Do the tests your coding agent writes actually catch bugs? I planted 599 validated defects and ran 32 suites at them. The interesting number is not the one I went looking for.
Mutation testing: change one thing in the code so it behaves differently, run the suite, see whether it fails. The share of planted changes a suite catches is its mutation score. Unlike coverage, you cannot satisfy it by executing a line without checking what the line did.
The published numbers are all for single-shot generation — one prompt, one answer, no tools. A comparative study puts LLM-written suites at a peak of 0.546 against 0.690 for human-written ones. A 2026 empirical study of tests written by coding agents measured assertion density and coverage, found both healthy, and said explicitly that mutation testing is what would settle whether that translates into fault detection. Nobody had run it.
Four arms, each adding one capability, on Haiku:
| arm | mutation score | cost per run |
|---|---|---|
| one prompt, no tools | 0.9712 | $0.0053 |
| agent, may run pytest | 0.9843 | $0.0239 |
| agent + coverage target | 0.9933 | $0.0250 |
| agent + surviving mutants fed back | 1.0000 | $0.1494 |
Monotone, unsurprising, and much higher than the published single-shot figures. Mutation-guided iteration reached 1.000 in every case, for about eight times the first round's cost.
Three of the 32 first-round suites failed against the unmodified module — they do not pass on correct code. All three came from the same arm: the one with no tools, which cannot run what it writes. Every arm that could execute produced a working suite, 29 times out of 29.
All three broken suites scored a mutation score of 1.000.
Of course they did. A suite that fails on correct code fails against every mutant too, and a mutation score that does not check validity first counts each of those failures as a kill. One of the three was not valid Python at all. It still scored 1.000.
So the thing an executing agent buys you is not sharper tests. It is tests that exist. If you take one thing from this: run the suite against the unmodified code before you believe any number computed from it.
Every arm reached 100% statement coverage and 100% decision coverage, in every valid run, on every module. The mutation scores over those same runs range from 0.96 to 1.00 — one suite leaves five planted defects alive, another leaves none.
If coverage were the measure, these suites would be identical. It is not a measure of whether anything was checked.
Half the runs used modules whose docstrings state the behaviour — the inclusive boundary, the rounding direction, which end of the range is excluded. The other half used byte-identical code with every docstring cut to one line. One-shot went 0.9712 with them and 0.9841 without; the agent 0.9843 against 0.9747. Both differences are smaller than the spread between modules and one has the wrong sign.
The reason matters more than the result. The model has the code in front of it, and for a mutation score the code is the specification: a test written from the implementation pins what the implementation does, a mutant changes what it does, so the test fails. Documentation is irrelevant to that loop.
A mutation score is regression-detection power. It is not correctness.
A suite written from an implementation ratifies that implementation, bug and all. If a function rounds the wrong way, tests generated from it assert the wrong rounding, score beautifully against every mutant, and will defend the bug against whoever later fixes it. Nothing here measures that. The experiment that would — plant a defect where the code contradicts its own docstring, and see which one the generated suite asserts — is the obvious next one, and I have not run it.
A mutation score is only as honest as its mutants. The standard way it gets inflated is the equivalent mutant: an edit no input can reveal, which survives every possible suite and is counted against it anyway. So every mutant here was kept only if some input tells it apart from the original, with the witness recorded. 43 of 642 were discarded that way.
The inputs you validate with turn out to decide the answer. Mine come in two kinds: edge cases written by hand from the docstrings, and a few hundred seeded random draws per function. Only 18 of 599 kept mutants need a random draw to be distinguishable at all — and they behave completely differently:
| mutants | killed by a careful hand-written suite |
|---|---|
| distinguishable by a hand-picked edge case | 276 of 282 (97.9%) |
| distinguishable only by a random draw | 1 of 8 (12.5%) |
On one module the two sets score the same unchanged suite at 0.9832 and 0.9512: a 3.2-point difference produced by four mutants. A human picks edge cases out of the documentation and then writes tests against those same edges, so a mutant set validated on hand-picked inputs is quietly selected for being catchable.
Any mutation score built on hand-validated mutants, or on mutants that were never validated at all, is optimistic by roughly that much.
I wrote two careful suites by hand, from the docstrings, without looking at the mutant list: 0.9512 and 0.9581, both at 100% coverage. Against a published human baseline of 0.690 on real-world benchmarks, that says plainly that 27 small pure functions are an easier target than the code those studies used. Read every number above with that in mind.
Each of these made the answer look better than it was, which is the direction that does not announce itself.
test_*.py, so a saved answer collected nothing, exited 5, and every mutant counted as killed because the exit code was non-zero.--tools without --allowedTools. The first agent trial wrote no file and logged a permission denial: the first flag decides which schemas are sent, the second which calls are allowed.Corpus, oracle, seven mutation operators with validation, a dependency-free coverage tracer, the grader, the eight-arm runner, the figure pipeline and an offline test suite that needs no network and no API — plus every recorded run as raw CSV, including the rows thrown away.
Point it at your own modules, write the oracle for them, and you get your own figure instead of mine. Every number on this page is in the report, and the method is above if you would rather build it yourself.