Testing and review are where AI-written code is caught — and they are also places where AI itself can help.
Test generation
LLMs can propose unit tests, extend existing ones and suggest edge cases. The hard part is trusting generated tests: a test can pass while asserting the wrong behaviour. Good systems filter generated tests automatically — does it build, does it pass reliably, does it add coverage — before a human sees them.
Meta's TestGen-LLM is a well-documented example. It extends existing human-written tests and keeps only candidates that pass a set of filters. In Meta's evaluation, 75% of its test cases built correctly, 57% passed reliably and 25% increased coverage; in Instagram and Facebook test-a-thons it improved 11.5% of the classes it was applied to, and engineers accepted 73% of its recommendations for production.
Review assistance
AI can help in two ways:
- First-pass review: flag likely bugs, security issues, missing tests and style problems before a human looks.
- Resolving comments: propose the edit that addresses a reviewer's comment.
Google built the second into its internal review tool. Its research blog (May 2023) reported that the model addressed 52% of comments with a target precision of 50%, that 40–50% of previewed suggested edits were applied, and that Google expected it to save hundreds of thousands of hours of review time a year.
The review trap
If AI writes more code and AI also reviews it, human reviewers may start skimming. Keep a named human approver for every change, and decide which changes need deeper review: security-sensitive code, data migrations, public APIs, infrastructure. Track review time — if it climbs as AI adoption rises, review has become your bottleneck.