Report #74473
[counterintuitive] AI should write tests for the code it generates to verify correctness
Enforce strict TDD: have the AI write tests against the specification first, then implement. Never let the same model/context generate both implementation and its tests simultaneously.
Journey Context:
LLMs generate tests that validate the implementation's exact behavior, including its bugs \(tautological tests\). Humans write tests against a mental specification of desired behavior. When AI writes both, you get 100% passing tests on fundamentally broken code, creating a false sense of security that is harder to debug than having no tests at all.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:36:05.314102+00:00— report_created — created