Measure AI Code Reviewers With Planted Defects Before Trusting Their Approvals
Use realistic planted bugs to measure what an AI reviewer catches, where it misses, and whether it should approve changes without a person.

AI code reviewers can comment on every pull request, suggest fixes and approve some changes with little human input. Their usefulness, though, depends on a question many teams can’t answer: how often do they miss a real defect? Comment counts and developer acceptance rates don’t tell you. A planted-defect drill can show what the reviewer actually catches and where a person still needs to look.
The same measurement problem can affect AI testing: dashboards may look healthy even when checks have stopped catching the failures they were meant to find. Green AI testing dashboards can obscure that gap. Code review needs a way to test detection, too.
Measure what gets through
Common review metrics count activity: comments per pull request, the share of suggestions developers accept, or review time saved. These figures can be useful, but they don’t show whether the tool catches important defects.
Imagine a reviewer that leaves forty comments about names, formatting, documentation and possible refactoring. Developers accept many of them because they’re easy to address. Meanwhile, the reviewer overlooks an inverted condition in billing code. By activity measures, it may look productive. For the team, the missed defect matters more than a high volume of minor suggestions.
Activity measures can also reward excess commentary. A tool that comments frequently may seem more valuable, even when its observations bury the one that warrants attention. And silence on a clean change can look like failure, although it may be the right result. To measure detection, give the reviewer defects whose locations and causes you already know.
Create a realistic test set
This approach adapts mutation testing, which checks whether a test suite detects a deliberately introduced bug. Here, the AI reviewer is the system being evaluated.
Take a small group of real pull requests from your codebase that were reviewed and merged without incident. Make a copy of each and introduce one defect relevant to your work. Examples include removing a null or bounds check, changing a condition to be inverted or off by one, deleting an authorization check, or swallowing an error without reporting it.
Also consider a test change that weakens what the test asserts. This resembles the false-heal problem in AI test automation: a test may pass after a repair while no longer checking the behavior it was meant to cover.
Make each planted defect plausible. A syntax error that immediately breaks a build won’t tell you much about whether the reviewer can spot a subtle mistake. A change that resembles an ordinary slip is a better test. The suggested starting point is two or three dozen planted pull requests spread across the code paths that matter most to your team.
Keep a record of each planted defect and its location. That answer key gives you a consistent basis for scoring the reviewer’s comments.
Score catches and noise
Run the planted changes through the reviewer as it operates in production, using the same configuration, prompt and context. Then compare its comments with the answer key.
Set a strict rule for what counts as a catch before scoring. A comment somewhere in the same file isn’t enough. The reviewer should identify the defect, or point close enough to it that a developer could find and fix the problem. A vague suggestion to add validation might deserve credit in some cases, but teams should decide that in advance and apply the rule consistently.
Track two figures: the share of planted defects the reviewer flags, and the number of unrelated comments it leaves on those same changes. A tool that identifies a defect but buries it among thirty style comments may not help a developer notice it. The amount of noise affects whether a correct observation leads to action.
Review every miss, not just the overall catch rate. The pattern can reveal a specific weakness. A reviewer might notice removed null checks but miss deleted authorization checks. That gap gives the team a concrete reason to add human review for changes involving permissions, or to adjust the reviewer and measure it again.
Research on self-healing web locators has framed AI repair as assisted triage rather than an automatic fix. The same idea applies to code review: the reviewer can help direct attention, while missed cases show where people still need to examine a change. Work on self-healing web locators offers that framing.
Retest after changes
Keep the planted set as a regression suite for the reviewer. Models, prompts, rules and input context can change, and each change may affect what the tool catches. Re-run the drill after changes to those elements, and on a regular schedule even when the setup appears stable.
If the catch rate falls, investigate before allowing the new setup to handle changes. The response might be to undo a prompt change, add a rule or limit which changes the reviewer can approve without a person. The results can also support a fairer comparison between tools: run each candidate against the same planted set. An exit test for an AI agent makes a similar case for testing behavior rather than relying on a feature list.
Set approval limits by risk
Use the findings to set boundaries around automated approval. A reviewer that performs well on configuration and documentation changes but misses half the planted defects in authorization code shouldn’t approve authorization changes on its own. Its record should determine where it can act independently and where a person must review the work.
AI reviewers can catch real problems and save time, but teams need evidence to judge where they can rely on them. Test the reviewer with known defects, track both misses and noise, and repeat the drill as the tool changes. Those results give administrators a practical basis for deciding what it may approve and which changes still need human attention.