Menu

When "Tests Passed" Is Not Enough

When "Tests Passed" Is Not Enough: Measuring an AI Agent's Checks With Mutation Testing

Notes · CheckingNovember 25, 20263 min readSenova Systems Research

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

WorkWhat it didReported result
MuTAP (2023)Fed surviving mutants back to a language model to write better testsCaught "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 code9,095 mutants and 571 tests across 10,795 classes; engineers "accepted 73% of its tests"
MutGen (2025)Mutation-guided test generation with a language modelShowed 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:

  1. Start from a known-good solution for each task, and a hidden set of strong tests that pass on it.
  2. Make single-point mutants of the solution's source files (never of the tests), with a fixed seed.
  3. Use the hidden tests as truth. A mutant is really broken if they fail. Set aside the ones they pass.
  4. Run exactly the checks the agent would run, with the same commands, tools and environment.
  5. 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

  1. 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

  2. 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

  3. 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

  4. Stroebl, Kapoor and Narayanan 2024, The Limits of Inference Scaling Through Resampling
    What we used

    Imperfect verifiers cap accuracy; opened 2026-11-25

More in beyond the model

Is Compute the Limit on AIIf a system got far more out of each unit of compute, would compute stop being the bottleneck? The evidence says no: algorithms halve the compute needed about every eight months, yet frontier running costs keep rising because every gain is spent on more capability. Here is what efficiency does change, and the other limits that remain.4 minWhat Would Make an AI System More Than a Language Model"More than an LLM" is said often and defined rarely. We set a testable definition: with the same model inside, a system must do more per unit of compute, get better after it ships without forgetting, and have its work checked by something other than the model. Here is the evidence for each part and five signs you can measure.4 minOnly Compute What ChangedNeuromorphic chips save energy by doing nothing until something changes. Software can do the same: delta networks, prompt caching, precomputing in quiet time and updating only what changed. We collect what each was measured to save, note that nobody has yet measured event-driven against timer-driven AI agents, and say how to measure it.3 minWhy Long AI Chats Get ExpensiveServing systems can reuse the work of processing a prompt, but only for an identical start. Chat apps that drop the oldest message every turn change that start every turn, so long conversations are processed again from scratch. Here is how prefix caching works, the habits that defeat it, the trade-off of trimming in larger steps, and a free way to measure your own prompts.4 minComputing Beyond the GPUNew kinds of computer promise to make AI far cheaper. We read the papers and separated measured results from claims: what each has run, at what size, and what it cost in energy. Most energy goes into moving weights, software has cut cost per answer faster than hardware, and the new chips need models built for them.3 min