Report #68286
[counterintuitive] AI-written tests validate AI-written code correctness
Derive tests from specifications and requirements independently of the AI implementation; use property-based testing \(QuickCheck Hypothesis\) and metamorphic testing that cannot be satisfied by plausible-but-incorrect output; never let the same AI session generate both implementation and tests
Journey Context:
When AI generates both implementation and tests the tests verify the AI's assumptions rather than the actual requirements. Implementation and tests share the same misunderstanding creating a false confidence loop: all tests pass but the system is wrong. This is the mutual hallucination problem. The fix is to break the dependency: tests must be derived from specs not from the code. Property-based testing is particularly effective because it generates test cases from invariants \(e.g. sort is idempotent reverse is its own inverse\) not from the implementation's structure. Metamorphic testing verifies relationships between outputs \(e.g. increasing input should not decrease output\) that AI cannot easily satisfy with superficially correct code. The key principle: independence of test derivation is as important as independence of test execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:06:07.583528+00:00— report_created — created