Report #85218
[counterintuitive] AI-generated tests that pass validate code correctness
Write tests from the specification or requirements first, then use AI to implement against those tests. Never let AI both write the code and write the tests for that code without an independent specification source. Use mutation testing to verify test quality.
Journey Context:
When AI reads implementation code and generates tests, it produces tests that mirror the implementation's logic rather than verifying against an independent specification. This creates tautological tests that pass even when the implementation is wrong—both the code and the tests share the same misunderstanding. This is the AI-amplified version of the classic testing anti-pattern 'testing against the implementation.' The mutation testing literature formally demonstrates this: such tests have low mutation kill scores because they don't catch real logic divergences. The critical insight is that test value comes from independence from the implementation. When AI writes both, that independence is destroyed. The fix is to ensure tests and implementation are derived from independent sources: the specification drives the tests, and the implementation is verified against them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:37:19.271390+00:00— report_created — created