Skip to content
Technology transformation expertise firm · ARDIANE Group Innovate, secure, succeed

Engineering

Code review: organising it so that it finds what no tool can see

In brief

Code review is the reading of a change by someone other than its author, before it is merged into the shared code base. It looks for what automated checks cannot see (intent, design, readability, edge cases): Management Square explains here how to organise it and how to split the work between the tool and the reviewer.

Page contents

“Our merge requests wait for days, reviewers approve without comment and defects still reach production: should we keep code review?” Behind this observation lies a budget question: how much engineering time does reviewing deserve?

Yes, on one condition: that the review takes care of what it alone can see. Code review consists of having each change read by someone other than its author before it is merged into the shared code base, most often through a change request (a pull request or merge request). It detects logic and design defects, keeps code that the whole team can read and spreads knowledge of the system. Everything a machine checks better (formatting, style rules, known vulnerabilities, non-regression) is taken away from it. A slow, ineffective review most often signals changes that are too large and a poor split between the tool and the reviewer.

What a code review looks for

The reviewer answers a series of questions that no automated check asks:

  • does the change do what the request describes, no less and no more?
  • is it placed in the right spot, without duplicating logic that exists elsewhere or creating one more dependency?
  • what happens at the limits: missing value, empty list, failing call, concurrent execution?
  • will someone who discovers this code in a year understand the names, the breakdown and the choices?
  • do the added tests verify the expected behaviour, or do they merely execute the code?
  • is access control respected, and does no sensitive data end up in the logs?
  • can the change be deployed and rolled back safely: data migration, configuration, compatibility with the version in service?

The review has two effects that have nothing to do with detecting defects. It prevents any part of the system from being known to only one person. It leaves a written record of the choices, useful when your organisation has to demonstrate that a change was seen by two people before its production release.

It does not provide proof that the code works. That proof belongs to tests, organised according to the strategy described on our software quality and testing page.

Organising the review: size, turnaround time, roles

The size of changes is the first setting. A short change, pursuing a single intent, can be read in full. A large change receives an approval in principle, because nobody can review it seriously. Two habits are often enough: breaking a development into mergeable steps, and separating a refactoring of the code from a change in behaviour.

Next comes preparation. The author rereads their own change before submitting it. Its description says what changes, why, how they verified it and what they left aside. They do not call on anyone until the automated checks have passed.

The time to first review is the subject of a team agreement. A pending change has a cost: its author has moved on to another subject, the shared code base has moved, conflicts accumulate. Reviewing a colleague’s work therefore comes before starting a new piece of work.

The reviewer is someone who knows the area being changed, and a rotation prevents reviewing from always falling on the same people. Sensitive modules have designated owners, whose approval is required.

Comments follow a convention. Each remark announces its weight: blocking point, suggestion or simple question. It addresses the code and gives its reason. When a written exchange gets bogged down, a face-to-face conversation concludes it, then the decision is recorded.

A design disagreement is settled according to a known rule: the module owner, or the lead architect. For a structural change, the design is discussed before the code is written. Discovering in review that it should have been done differently costs a rewrite.

What belongs to the tool, what belongs to the reviewer

Subject of the check What the tool does What remains for the reviewer
Formatting and style A formatter and a linter, such as ESLint, apply the conventions Nothing: the subject leaves the discussion
Common programming defects Static analysis, with a tool such as SonarQube, flags them across all the code Dismissing false alarms, with a written justification
Vulnerabilities Dependency analysis, secret detection, security analysis of the code Logic errors: access control, a business rule that can be bypassed
Non-regression Automated tests run on every change The relevance of the added tests
Design and readability Complexity measures, to be read as a signal Judgement: is this the simplest solution that meets the need?
Fit with the need No check Examination by the reviewer, with the product owner in case of doubt

A practical rule follows from this table: a human comment on a point that a tool could have raised calls for a new rule in the tool, so that the remark does not come back. These checks run in the integration pipeline, whose construction is described on our DevOps and platform engineering page.

Review assistants based on generative AI sit on the tool side. They comment quickly, including on logic, and spot omissions. They know neither the need nor the history of the system, and are sometimes wrong with confidence. Their remarks are suggestions: approval is still given by a named person.

The drifts of a poorly tuned review

The rubber-stamp approval is the most widespread. The reviewer approves without reading, for lack of time or because the change is too big. The review exists in the tool and no longer checks anything.

The toll gate is the opposite: a single person has to approve everything. Changes pile up in front of them, and the team learns to wait rather than to review.

The style debate fills the comments when the tool has not settled it. It wears people out and diverts attention from design.

A review used to judge people closes down discussion. An author who fears comments breaks work down less, explains less and submits later.

Measuring the review without distorting behaviour

A few measures, tracked at team level, show whether the review is working:

  • the time between submission and the first review;
  • the size of the changes submitted;
  • the share of changes approved without any comment;
  • the number of round trips before merging;
  • defects discovered in production in code that had nevertheless been reviewed.

None of them is read on its own. A very short turnaround combined with a high share of approvals without comment describes a review for show. A number of comments per reviewer, turned into a target, produces noise. These measures are never used to assess an individual.

The review is also the moment when a team knowingly accepts a shortcut that it will have to go back over. Recording it at that moment is the simplest way to track technical debt.

One decision remains, and it belongs to the team and its technical management: which changes require a review before merging, which can be reviewed afterwards, and who settles a disagreement. Written on one page and revised at regular intervals, this rule sets what the review costs and what you can expect from it.

FAQ

Frequently asked questions

Another question? Ask us

What is a code review for?

A code review is used to have a change examined by someone who did not write it, before it joins the shared code base. It detects logic and design defects that tests do not reveal, keeps code that the whole team can read and spreads knowledge of the system. It does not prove that the code works: that proof belongs to automated tests.

How many reviewers does a code review need?

There is no universal number. One reviewer who knows the area being changed is enough for most changes. A second pair of eyes is justified on sensitive parts: security, regulated calculations, interfaces shared between teams. Multiplying reviewers dilutes responsibility, each assuming the other has read carefully, and lengthens the time to merge.

Can static analysis replace code review?

No, the two checks do not cover the same things. Static analysis applies known rules to all the code, without tiring: style, common programming defects, catalogued vulnerabilities. It knows nothing of the intent of the change, the business need or the history of the system. The review deals with what requires judgement, and improves in quality when the tool relieves it of the rest.

Should code produced by an AI assistant be reviewed?

Yes, with the same rigour as for hand-written code. The author of the change remains responsible for what they submit, however the code was produced, and must be able to explain it. Generated code is often plausible and well presented, which encourages a quick read: the reviewer first checks that it meets the need and that it fits with the rest of the system.

Code review or pair programming: which should you choose?

The two practices pursue the same goal by different routes. Pair programming is a continuous review: two people build the solution together, which suits difficult subjects or welcoming a newcomer. Code review leaves a written record and adapts to remote work or staggered hours. Many teams combine the two and lighten the review of changes written in pairs.

A project to bring to completion?

A first conversation is enough to understand your challenge, identify the right people and tell you frankly what we can bring.