Report #88015
[counterintuitive] Using AI to generate unit tests to increase code coverage
Have AI generate property-based tests or test the public contract/interface, rather than implementation-specific unit tests. Manually define the invariants.
Journey Context:
The belief is that AI can easily write tests to boost coverage metrics. However, AI generates tests that are structurally valid but semantically vacuous. They assert the implementation's current \(possibly buggy\) behavior rather than the intended contract. This leads to high code coverage but low mutation testing scores, creating a false sense of security. AI lacks the intuition of the 'intent' of the code, which humans use to write tests that catch off-by-one or edge-case logic errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:19:08.186395+00:00— report_created — created