Report #24574
[counterintuitive] AI writing tautological tests that mock the implementation instead of asserting business logic
Instruct the agent to write state-based or integration tests rather than interaction-based \(mock-heavy\) tests. If mocks are necessary, explicitly define the expected final state, not just the mock call verifications.
Journey Context:
AI finds it easy to generate Mockito setups because the syntax is rigid and well-represented in training data. However, it struggles to synthesize the overarching business invariant. Humans catch this because they ask 'does this prove the feature works?', while AI asks 'does this test pass?'. AI tests often just assert that the code does what it does.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:39:29.240033+00:00— report_created — created