Adversarial Test-Hardening for AI-Written Code: An Instrument Autopsy and a Pre-Registered Causal Estimate of the Critic Loop
Abstract
Large language models increasingly write both code and the tests meant to check it; coverage records what ran, not what was verified. We study an adversarial test-hardening loop under a mechanical oracle: a Tester model writes tests, mutation testing names surviving injected defects, and a Critic model writes tests to kill exactly those, with every verdict decided mechanically, so no model judges another's output. In Experiment 1, on five Python subjects (one same-lineage-loop cell could not be scored), the loop killed 105 mutants that one-shot generation missed and lost none, and the cross-lineage-Critic question returned a pre-declared null. The central finding was an autopsy: an earlier analysis reported a cross-lineage effect at p = 9.5e-66 that was an instrument artifact, an output cap silently truncating the verbose model, caught only by adversarial review of the completed analysis. Review then found a further confound, each arm resampling its own initial suite; Experiment 2 removes it. Under a pre-registered frozen-shared-round-0 design (five replicates on each of four subjects, seeds committed in advance), same-lineage Critic rounds killed 78% of the survivors the frozen initial suite left standing (mean incremental kill rate 0.783, 95% cluster-bootstrap interval [0.592, 0.935]), a within-replicate causal estimate; the cross-provider configuration showed a positive pilot difference (rate gap 0.178, 95% interval [0.039, 0.347]; magnitude dominated by a single replicate) at 5.5x lower arm cost. This compares two named model-provider-harness configurations, not an isolated lineage effect: part of the gap is one configuration's receipted operational failures, including truncation recurrences, now detected and scored rather than laundered. Cross-model comparisons can inherit the asymmetries of the harness that runs them. We release both protocols, all receipts, and the analysis code.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI
- Comments
- 26 pages. Two pre-registered experiments; protocols, all run receipts, and analysis code at https://github.com/Jott2121/crucible
Related papers
Generating Property-Based Regression Tests from Source Code Semantics
Shared title terminologycs.SEClemens Bauer, Johann Glock, Martin Pinzger
Think Before You Code: A Benchmark for Testing LLMs on Software Engineering Deliberation
Shared title terminologycs.SEAshman Mehra
Do Code Language Models Follow Tests? Paired Interventions on Program Behavior
Shared title terminologycs.SEYunhao Liang, Chengguang Gan, Ruixuan Ying et al.
Loop Engineering: Version-Bound, Evidence-Gated Coordination for Production Coding Agents
Shared title terminologycs.SEYupeng Pang, Meiling Chen, Yang Yang et al.
Evaluating and Mitigating the Misguidance Effect of Buggy Code in LLM-Generated Unit Tests
Shared title terminologycs.SEJunda Zhao, Shurui Zhou, Eldan Cohen
MineValiCoder: Reliable Code Generation with Test Case Quality Mining and Bipartite Graph-Based Mutual Validation
Shared title terminologycs.SEZhen Zhao, Qihang Yang, Feifei Dai et al.