When "Tests Passed" Is Not Enough
When "Tests Passed" Is Not Enough: Measuring an AI Agent's Checks With Mutation Testing
An AI coding agent reporting that checks passed is only as good as the checks. Mutation testing, breaking working code on purpose and seeing whether the tests notice, measures that. Here is the method, why coverage isn't the same thing, how it is used on AI-written tests, and a protocol for measuring how often an agent's checks accept broken code.
The question
An AI coding agent finishes a task, runs the project's checks, and reports that they passed. How much is that worth? If the checks would also have passed broken code, "passed" tells you little, and paying for more attempts judged by those checks buys wrong code that looks finished.
There is a long-established way to measure this: mutation testing. This note explains it and how to apply it to an AI agent's checks. We report no results of our own here.
How to read this: each section gives the simple idea first, then The real detail. We opened every paper ourselves.
Break the code on purpose, then see if the tests notice
The simple idea
Take code that works. Make one small change that breaks it: flip a < to <=, swap + for -, turn true into false, return nothing. Each broken copy is called a mutant. Run the tests on each one. A test suite that is worth trusting fails on most of them; one that passes them is missing bugs.
The real detail
The share of mutants the tests catch is the mutation score, "the ratio of killed mutants out of all mutants" (Dakhel et al., MuTAP, 2023). Some mutants change nothing a user could see; these "equivalent mutants that no test can kill" (MutGen, 2025) are why a perfect score is rare and why they have to be set aside.
Coverage is not the same thing
The simple idea
"Our tests cover 100% of the code" means every line ran during testing. It doesn't mean the tests would notice if a line were wrong.
The real detail
The MutGen authors call coverage a weak indicator of fault-detection capability and report that "some test suites achieve 100% coverage but only 4% mutation score". Mutation testing measures what coverage can't: whether the tests check results, not just run code.
It is used on AI-written tests, at industrial scale
| Work | What it did | Reported result |
|---|---|---|
| MuTAP (2023) | Fed surviving mutants back to a language model to write better tests | Caught "up to 28% more faulty human-written code snippets"; mutation score of 93.57% on synthetic buggy code |
| Meta's ACH (2025) | Generated mutants and tests for privacy-relevant Kotlin code | 9,095 mutants and 571 tests across 10,795 classes; engineers "accepted 73% of its tests" |
| MutGen (2025) | Mutation-guided test generation with a language model | Showed that coverage alone overstates how good generated tests are |
Applying it to an AI agent's checks
The simple idea
For an agent, the question isn't "how good are these tests" in general. It is: when the agent says "checks passed", how often is the code actually wrong? That is a false-accept rate, and it can be measured with mutants and a stronger set of tests the agent never sees.
The real detail
A protocol that holds up:
- Start from a known-good solution for each task, and a hidden set of strong tests that pass on it.
- Make single-point mutants of the solution's source files (never of the tests), with a fixed seed.
- Use the hidden tests as truth. A mutant is really broken if they fail. Set aside the ones they pass.
- Run exactly the checks the agent would run, with the same commands, tools and environment.
- The false-accept rate is the share of really broken mutants those checks pass. Report it with a confidence interval, split by what actually ran.
Two sanity checks keep the number honest:
- the good solution passes the hidden tests;
- the agent's checks also pass the good solution. A checker that rejects everything would otherwise look perfect.
Three traps worth knowing:
- Test runners find test files anywhere. If the hidden tests sit in the same folder, the agent's "visible" check may run them too and look far better than it is.
- A check that can't start often counts as passed. If the tool it needs is missing, many systems skip the check rather than fail it. Make sure the check runs where the agent runs.
- Projects with no tests pass everything. Report them separately, and have the agent say plainly when nothing could be checked.
Why it matters before spending more compute
Retrying and picking the attempt that passes the checks only helps if passing means something. Research on resampling shows an imperfect checker sets a ceiling that more attempts can't lift (see our note on thinking longer versus building bigger). Measuring the checker first tells you whether the next dollar should go on more attempts or on better checks.
Sources
- Dakhel et al. 2023, Effective Test Generation Using Pre-trained Large Language Models and Mutation Testing (MuTAP)
What we used
Mutation score definition; up to 28% more faulty snippets caught; 93.57% mutation score on synthetic bugs; opened 2026-11-25
- Wang et al. 2025, MutGen: mutation-guided test generation with LLMs
What we used
Coverage a weak indicator; 100% coverage with 4% mutation score; equivalent mutants; opened 2026-11-25
- Foster et al. 2025, Mutation-Guided LLM-based Test Generation at Meta (ACH)
What we used
9,095 mutants, 571 tests, 10,795 classes; 73% of tests accepted; opened 2026-11-25
- Stroebl, Kapoor and Narayanan 2024, The Limits of Inference Scaling Through Resampling
What we used
Imperfect verifiers cap accuracy; opened 2026-11-25