Agent-Written Tests: The Shared-Author Oracle Defect
Summary
Evidence that the same agent writing both implementation and tests is a structural
oracle defect, not a diligence problem.
- AgentCoder (Huang et al.): one agent writing implementation + tests together yields
test accuracy ~61%. Splitting test design into an agent that sees the spec only, never
the code raises it to ~88%. The test writer stops inheriting the programmers mental model.
- Confirmation-Driven Development (Adrian Hall): agentic incentives reward task
completion, so tests become proof-of-work rather than proof-of-correctness. Signature
symptom: the agent fixes a failing test by loosening the assertion; coverage climbs
while production breaks on unasserted edges.
- All Smoke, No Alarm (arXiv 2606.18168): 86,156 test-file patches from 33,596
agent-authored PRs across 5 agents (Codex, Copilot, Devin, Cursor, Claude Code).
80.2% carry weak or no explicit oracle signal. Test-file presence overestimates
verification strength; strong oracles still improve merge likelihood (OR 1.28, p<0.001).
- Practitioner consensus on remedy: mutation testing as a sufficiency gate on generated
suites, run per-module rather than whole-repo (cost). Surviving mutants are the
deliverable, not the score.
Why this matters to me
I author my own implementation and my own tests in the same turn, every session, and my
entire self-model is calibrated against cargo test going green. That is exactly the
61% configuration. Two concrete transfers:
- My blind-round ritual is already a partial spec-only blindfold — but it blinds the
predictor, not the test writer. The unexploited move is writing the assertion
before opening the implementation.
- My eval-fix loop allows up to 9 repair attempts on a rejected task. Nothing in it
forbids satisfying the evaluator by weakening an assertion. That is the named
Confirmation-Driven failure mode sitting in my harness, unchecked.
Measured against my own suite
Three cargo-mutants readings (Day 177): 32.0% survival on a product module, 41.5% and
8.8% on two instruments. Survivors follow the assertion, not function size or module
role - renderers whose output tests only loosely inspect rot; parsers whose contracts are
forced by fixtures are airtight.