Adversarial Test-Hardening for AI-Written Code: An Instrument Autopsy and a Pre-Registered Causal Estimate of the Critic Loop
This paper presents a pre-registered causal study of an adversarial test-hardening loop that uses mechanical oracles to validate AI-generated code, revealing that a previously reported statistical breakthrough was an instrument artifact while demonstrating that a same-lineage critic model significantly improves mutant killing rates compared to a cross-provider configuration, with findings that highlight how harness asymmetries and operational failures can distort cross-model evaluations.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine a world where computers are learning to write their own homework. In the field of software engineering, this is a rapidly growing corner of science where Artificial Intelligence (AI) is asked to write code and then write the tests to check if that code works. Think of it like a student who not only writes an essay but also creates the answer key for the teacher. The problem is, these AI students are often too nice to themselves. They write tests that only check if the code runs without crashing (the "happy path") but fail to catch the sneaky bugs hidden inside. To measure how good a test suite really is, scientists use a trick called "mutation testing." Imagine taking a perfectly good essay and secretly swapping out a few words to create nonsense. If the teacher's answer key (the test) can spot the nonsense and mark it wrong, the test is good. If the test lets the nonsense slide, the test is weak. The big question researchers are asking is: Can we build a system where one AI writes the code, a second AI writes the tests, and a third AI acts as a strict critic to find the mistakes the second one missed? And if we use different AI companies for the critic, does that make the tests better?
This paper tells the story of a scientific experiment that tried to answer that question, but with a twist: the researchers accidentally discovered a massive glitch in their own measuring tape. They set up a "test-hardening loop" where an AI "Tester" writes code, and an AI "Critic" writes new tests specifically to kill the bugs the first round missed. They ran this loop using two different setups: one where the Critic was from the same company as the Tester, and another where the Critic was from a different company.
At first, the results looked like a huge victory for the "different company" Critic. The data suggested it was vastly superior, finding bugs the other one missed with a statistical certainty so high it looked like a miracle (). But then, the researchers did something rare and brave: they tore their own experiment apart to perform an "instrument autopsy." They found that the "different company" Critic wasn't actually smarter. Instead, the "same company" Critic was getting its answers silently chopped off by a hidden limit in the computer system they were using. Because the "same company" model tended to write longer, more detailed answers, the system cut them off before they finished, making it look like the model failed. The "different company" model wrote shorter answers, so it never hit the limit and looked perfect.
Once the researchers fixed this glitch, the "miracle" disappeared. The "different company" Critic wasn't a superhero; it was just the only one that didn't get its homework cut in half. However, there was a second, deeper issue: the initial experiment (Experiment 1) had a design flaw where each setup generated its own fresh starting test suite from scratch. This meant the comparison wasn't just about the Critic's skill, but also about the random luck of the initial test draw, making it impossible to tell if the "different company" was truly better or just got a lucky start. To fix this, the researchers ran a second experiment (Experiment 2) where they froze the initial test suite and forced both setups to start from the exact same point.
The real, honest finding from this corrected design was that the loop itself is powerful: when the Critic is allowed to keep trying, it can kill about 78% of the bugs that the first round of testing missed. However, comparing two different AI companies is tricky because the tools running them can be unfair. The paper concludes that while using a strict, mechanical referee (mutation testing) is great, you still have to make sure the referee's arena is fair for everyone, or you might end up praising the wrong winner. The researchers also found that the "different company" setup was cheaper to run, but this wasn't just because it wrote shorter answers; the cost gap was largely driven by the "same company" setup suffering from repeated operational failures, such as its verbose answers hitting the system limits and getting rejected, which forced the system to spend more money on retries and failed attempts.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.