How should you review tests generated by an AI coding assistant?
Answer
Review them as untrusted code. Trace every assertion to a requirement or risk, check that setup reaches the intended state, reject invented APIs and tautological expectations, and run the test against both correct and deliberately broken behavior. Inspect isolation, cleanup, secrets, dependencies and maintainability, then keep human ownership for the final oracle and merge decision.
Strong answer includes
- validates that the test can fail for the intended defect
- checks invented assumptions and security risks
- keeps human ownership of the oracle
Practical example
An AI-generated test for a discount calculator asserts result is not null, which passes even after someone injects a bug that returns the wrong discount amount; mutating the discount logic locally and confirming the test actually turns red is what exposes that the assertion was never checking the real value.