↓ Skip to main content

No Pull Request Has to Be Perfect: When Review Rounds Should End

·12 mins
Michael Hönnig
Author
Michael Hönnig
Until autumn 2027 only available for consulting engagements with a small number of hours – remote, in German and English.

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.

Meat Proxy Ping-Pong and Targeted ReviewOn the left, developer and reviewer merely pass the results of their coding and review agents back and forth, round after round. On the right, the agents run the rounds directly with each other, and at the merge gate all that counts is whether the code is substantially better and contains no irreversible errors and no security holes; whether a human reviews there depends on criticality and risk.Meat Proxy Ping-PongTargeted ReviewDeveloperforwardsReviewerforwardsfindings and repliesCodingAgentReviewAgentin the backgroundRound 1, 2, 3 … ∞humans tie up their time without reviewingCodingAgentReviewAgentrounds run automaticallyMerge Gate✓ code substantially better✓ no irreversible errors✓ no security holesnot perfect, but better
Instead of humans passing findings between two agents, the agents run the rounds themselves; at the merge gate, the pull request does not have to be perfect.

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].
Purposes of ReviewsSeven purposes of reviews in four groups: functionality with verification (errors and rule violations) and validation (gaps and misunderstandings), team with sharing knowledge and creating awareness across the team, code with improving maintainability and finding alternatives, accountability with the four-eyes principle. Highlighted are validation, knowledge, awareness and four eyes: they need human judgment or learning, and that is where scarce human review time belongs. Agents can largely take over verification, maintainability and alternatives.FunctionalityTeamCodeAccountabilityVerificationerrors andrule violationsValidationgaps andmisunderstandingsKnowledgesharingAwarenessacross the teamMaintainabilityimprovingAlternativesfindingFour Eyesapproval withaccountabilityneeds human judgment or learningagents can largely take overHuman review time belongs to the highlighted purposes
Purposes of reviews: highlighted are those for which humans must judge or learn themselves; that is where scarce human review time belongs.

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.

One-Way Doors and Two-Way DoorsOn the left, a one-way door: the change is irreversible, such as a data migration with no way back or a published interface; it deserves a thorough review in which a human reviews depending on criticality and risk. On the right, a two-way door: the change is reversible, defects can be fixed with the next pull request; the pull request does not have to be perfect, but better.One-Way DoorTwo-Way Doorirreversible: no way backe.g. a data migration with no way back,a published interfacereversible: most changesdefects can be fixed withthe next pull requestThorough Reviewhuman review by criticality and riskNormal Reviewnot perfect, but better
Irreversible changes are one-way doors and deserve a thorough review; most changes are two-way doors whose defects the next pull request fixes.

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.

Yield per Review Round (Schematic)Schematic bars for five review rounds. In rounds 1 and 2, many findings are implemented, some of them critical; the yield drops from round to round. From round 3 on, only proven findings block the merge; the rest are notes that do not block the merge.implemented findingsof which criticalproven findings: blocknotes: do not blockfrom round 3: only proof blocksRound 1Round 2Round 3Round 4Round 5
Schematic: the yield of implemented and critical findings drops from round to round. From the set round on, only proven findings block; everything else is a note.

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?

PRRoundFindingUseful?Automatable?
#4121Rounding deviates from the business ruleyes, criticalno
#4121Possible null dereferenceyesyes, nullness checker
#4122Error case without a testyespartly, test coverage
#4123Variable name could be clearerbarelyno
#4151Log message contains personal datayespartly, log scanner
#4151Imports not sortednoyes, linter
#4152Method could be split in twonopartly, complexity metric
#4153Comment repeats the codenopartly
#4154Loop could be written differentlynono
……………
Rate of useful findings44 %
(4 of 9)
Rate of automatable findings22 % 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
#

  1. European Commission (2024): Commission Delegated Regulation (EU) 2024/1774 (regulatory technical standards on ICT risk management under DORA), Article 17(1)(b). EUR-Lex. ↩
  2. Bacchelli, A.; Bird, C. (2013): Expectations, Outcomes, and Challenges of Modern Code Review. ICSE 2013, freely available on Zenodo. ↩
  3. 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). ↩
  4. 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. ↩
  5. Bezos, J. (2016): 2015 Letter to Shareholders. Amazon.com, Inc. ↩

Discuss on X · Discuss on Mastodon (in German)

This article was translated from German with AI assistance.