When is a pull request good enough to merge? And when should a review end if a review agent still keeps finding something? This article shows how review ping-pong wastes scarce human review time, especially when humans merely pass the findings of their coding and review agents back and forth, how to measure the value of review rounds, and which principle ends the ping-pong.
Review Time Is the Bottleneck#
Coding agents now produce changes faster than humans can review them. In the article Verification and Validation as the New Bottlenecks I used Goldratt’s Theory of Constraints to show that the bottleneck of software development thereby shifts from programming to verification and validation. Step 2 of the Theory of Constraints is: exploit the constraint. So the scarce human review time must not be wasted on work that does not require human review.
Meat Proxies: Ping-Pong Without a Contribution of One’s Own#
The following pattern shows how step 2 can be missed: A software developer has a coding agent write a change, a reviewer hands it to a review agent for review, and both merely pass the results of their agents back and forth. The humans thus become meat proxies, human relay stations between two agents. I call this back and forth meat proxy ping-pong. It consumes exactly the scarce human time that is the bottleneck, and adds nothing to the review. The agents can run such rounds directly with each other; human attention belongs where only humans can or should judge.
That does not mean a reviewer may not use AI; of course they may. But then they have to contribute something of their own: check the agent’s findings, understand the change, hold it against the requirements. If they do not, the human should be taken out at this point entirely, and review and approval automated.
The left side of the diagram shows this ping-pong. On the right side, the agents run the rounds themselves, and at the merge gate only three questions count.
What Reviews Are For#
Whether a finding is relevant depends on what the review is for. Reviews serve several purposes:
- Finding errors and rule violations: This is verification; the change is checked against the specification, coding guidelines and architecture rules.
- Finding gaps and misunderstandings: This is validation; it works especially well when the users of the change review it, such as internal customers of a new API.
- Sharing knowledge: Whoever reviews the code knows it at least roughly afterwards.
- Creating awareness across the team: The team learns what is changing where.
- Improving maintainability: Code becomes easier to understand and easier to change for human and artificial intelligence.
- Finding alternative solutions: Reviews often bring up better approaches to the same problem.
- Taking accountability: Under the four-eyes principle, someone vouches for the change with their approval; in regulated environments this is often mandatory, for example in the financial sector through the EU regulation DORA: whoever approves a change must be independent of whoever requests and implements it[1].
Studies of human code reviews confirm this variety. Reviews find fewer defects than expected, but foster knowledge transfer, team awareness and the understanding of code and changes[2]. Three quarters of the defects found do not affect visible functionality, but maintainability[3].
Meat proxies serve these purposes only incidentally. Whoever passes findings on does learn something about the code, but does not judge for themselves. The agents could do the passing on without them. They should spend their review time where their own judgment matters, for example in validation or approval.
Measuring Whether Review Rounds Pay Off#
Whether review rounds pay off can be measured: Were the reported findings relevant? Were they critical enough to justify another round? And could the problems have been found in another way, for example by automated checks? If the answers are mostly “no”, the ping-pong ties up review time without noticeably improving quality.
All it takes is to record a few attributes for each finding: in which round it came up, whether it was implemented, how serious it was, and whether a test, a linter or a static analysis could have found it just as well. From this, each round shows how many findings were implemented and how many of them were critical. If this yield drops markedly from a certain round on, that is the round at which the review should end or change. Findings that an automated check could have found belong in the pipeline, not in the next review; that elevates the constraint instead of burdening it.
An evaluation at Microsoft shows how revealing such measurements are: only about 15 % of review comments pointed to a possible defect, and without prior knowledge of the code, only a third of a reviewer’s comments were considered useful[4]. With review agents, measuring becomes even easier, because their findings are available in structured form.
An evaluation in one of my projects adds to the picture: of 74 review findings, about 70 % were correct in substance, and 62 % led to a correction. But only 7 of them should have stopped the merge, just under 10 %; the rest could just as well have been fixed in a later pull request. Six of these seven findings came from AI reviews that a reviewer had forwarded. So a fully automated review would have found them as well, without the detour through a human.
I am exploring the possibilities and problems of agentic reviews with my Werkrevisor. It turns out to be a balancing act to make reviews fast enough and not too expensive (token costs) without their results losing value. That is why I am currently reworking Werkrevisor from the ground up.
No Pull Request Has to Be Perfect#
Behind all this is my principle for reviews:
No pull request has to be perfect.
It should:
- make the code substantially better,
- introduce no irreversible errors,
- open no security holes.
It may be incomplete and imperfect, otherwise the work gets stuck in review.
Irreversible errors correspond to what Jeff Bezos calls one-way doors[5]: doors with no way back, such as a data migration without a way back or a published interface that others already rely on. Such changes deserve a thorough review. Most changes, by contrast, are two-way doors: a defect can be fixed with the next pull request.
From a Set Round On, Only Proven Findings Count#
From a set review round on, the third for example, at the latest, only findings whose validity has been proven should count, for example by a failing test or a reproducible example. Vague suspicions may then only be notes that do not block the merge. Otherwise, experience shows, an AI review never ends: a review agent always finds something.
Proof reverses the burden of proof: it is not the software developer who has to refute a suspicion, but the review agent who has to substantiate it. A failing test has a double value here: it proves the finding and stays in the code as a regression test after the fix. The notes are not lost; they can be recorded as an issue for a later change.
Deriving the Limit From the Latest Reviews#
Which round is the limit need not be guessed; it follows from the measurement above. A simple table of the findings from the latest reviews is enough, say the last 20 pull requests. Each finding gets two ratings: How useful was it, and would an automated check have found it just as well?
| PR | Round | Finding | Useful? | Automatable? |
|---|---|---|---|---|
| #412 | 1 | Rounding deviates from the business rule | yes, critical | no |
| #412 | 1 | Possible null dereference | yes | yes, nullness checker |
| #412 | 2 | Error case without a test | yes | partly, test coverage |
| #412 | 3 | Variable name could be clearer | barely | no |
| #415 | 1 | Log message contains personal data | yes | partly, log scanner |
| #415 | 1 | Imports not sorted | no | yes, linter |
| #415 | 2 | Method could be split in two | no | partly, complexity metric |
| #415 | 3 | Comment repeats the code | no | partly |
| #415 | 4 | Loop could be written differently | no | no |
| … | … | … | … | … |
| Rate of useful findings | 44 % (4 of 9) | |||
| Rate of automatable findings | 22 % fully, another 44 % partly |
Sketch with made-up sample data, shown as an excerpt only; the rates refer to the excerpt.
The two rates show at a glance how much the reviews deliver at all and how much of that an automated check could do more cheaply.
The evaluation is per round: How many useful findings came up there that no automated check would have found? In the example, rounds 1 and 2 deliver all useful findings; from round 3 on, only matters of style remain. So the limit is round 3: from there on, only proven findings block. Whatever was automatable moves as a rule into linters, tests or static analysis. Because models, prompts and code change, it pays to update the table regularly and to adjust the limit.
The Human at the Merge Gate, Depending on Criticality#
At the merge gate, only the three questions that follow from the principle count, not perfection.
Whether a human reviews there depends on the criticality of the software module or repository and on the risk of the specific change. I describe this static criticality and dynamic risk in more detail in the article Quality and Autonomy in an AI Software Factory. If criticality and risk are low, the gate can decide automatically when all evidence is green. Otherwise, a human reviews, but not by passing findings on, but by answering exactly these three questions and taking accountability for the answer.
A review by those who use the change themselves is particularly useful, for example a team that consumes an API provided in the pull request. It checks not only whether the change is implemented correctly, but at the same time validates whether the API does the right thing for its use case. Such a review combines verification and validation and is therefore well-spent human review time.
Conclusion: Better Instead of Perfect#
Reviewers may and should use AI themselves; merely forwarding its findings, however, burdens the bottleneck without a contribution of their own. The agents can run the rounds themselves, and whether the rounds pay off can be measured. From a set round on at the latest, only proven findings count, so that the review ends. At the merge gate, the principle applies: no pull request has to be perfect.
Sources and Further Reading#
- European Commission (2024): Commission Delegated Regulation (EU) 2024/1774 (regulatory technical standards on ICT risk management under DORA), Article 17(1)(b). EUR-Lex. ↩
- Bacchelli, A.; Bird, C. (2013): Expectations, Outcomes, and Challenges of Modern Code Review. ICSE 2013, freely available on Zenodo. ↩
- Mäntylä, M. V.; Lassenius, C. (2009): What Types of Defects Are Really Discovered in Code Reviews?. IEEE Transactions on Software Engineering, 35(3); freely available preprint in Mäntylä’s dissertation (Aaltodoc). ↩
- Czerwonka, J.; Greiler, M.; Tilford, J. (2015): Code Reviews Do Not Find Bugs: How the Current Code Review Best Practice Slows Us Down. ICSE 2015, freely available from Microsoft Research. ↩
- Bezos, J. (2016): 2015 Letter to Shareholders. Amazon.com, Inc. ↩
