Code Review

What is Code Review?

Code review is the practice of having other developers examine a change to source code before it is merged, to find defects, keep code maintainable and share knowledge across the team.

Updated November 2026 · 4 min read


Code review is the practice of having one or more developers examine a change to source code before it is merged into the shared codebase. Reviewers look for defects, unclear or unmaintainable code, security problems and departures from the team's standards, and they ask questions or suggest improvements. In most teams today it happens through a pull request or merge request in a tool such as GitHub or GitLab: the author proposes a change, reviewers comment, the author revises, and the change is merged once it is approved.

Formal review has a long history. In 1976 Michael Fagan of IBM published a method for structured code inspections, with defined roles, checklists and meetings, and showed that inspections found many defects before testing. Modern code review is far lighter: asynchronous, tool-based and applied to small changes, usually every change. Google, for example, requires every change to its main codebase to be reviewed.

What Code Review Is For

Finding bugs is the reason most people give, but research shows it is only part of the value. A 2013 study of code review at Microsoft by Alberto Bacchelli and Christian Bird found that while developers ranked finding defects as their main motivation, reviews actually produced more comments about code quality and maintainability, and that much of their value came from knowledge transfer, team awareness of changes and finding better approaches. Code review does several jobs at once:

  • Catching defects and edge cases the author missed, before they reach users.
  • Keeping code maintainable, so it stays readable and consistent for the next person who changes it.
  • Spreading knowledge, so more than one person understands each part of the system.
  • Mentoring, in both directions, as reviewers and authors learn from each other.
  • Security and compliance, by ensuring a second person has seen every change. Many regulated organizations rely on review as a control, a form of segregation of duties.

What Reviewers Look For

AreaTypical questions
CorrectnessDoes it do what it is meant to? Are edge cases, errors and concurrency handled?
DesignDoes the change fit the system's architecture? Is it more complex than it needs to be?
ReadabilityAre names clear? Would another developer understand it in six months?
TestsAre there tests, and do they check behavior rather than implementation details?
SecurityIs input validated? Are secrets, permissions and personal data handled safely?
PerformanceAre there obvious inefficiencies, such as queries in loops?

Formatting and style should mostly be enforced by automated linters and formatters, and simple issues by static analysis, so that human reviewers can spend their attention on design and logic.

Code Review Guidelines

Most teams write down a short set of guidelines so that reviews are consistent, quick and respectful. Common elements, many of them drawn from Google's published engineering practices, include:

  • Keep changes small. A widely cited study of code review at Cisco, published by SmartBear, found that reviewers' ability to find defects fell sharply beyond 200 to 400 lines of code and after 60 to 90 minutes of reviewing. Small changes get faster, better reviews.
  • Explain the change. Authors write a clear description of what changed and why, and point reviewers to the risky parts.
  • Respond quickly. Slow reviews stall work and encourage large batches. Google's guidance treats one business day as the maximum time to respond.
  • Approve when the change improves the code. Google's standard is to approve once a change definitely improves the overall health of the codebase, even if it is not perfect, rather than holding out for perfection.
  • Label comment severity. Prefixes such as "nit:" for minor preferences and "blocking:" for must-fix issues tell the author what really matters.
  • Critique the code, not the person, and explain the reasoning behind requests.
  • Automate what can be automated, including style checks, tests and security scans in the CI/CD pipeline.

Code Review and Delivery Speed

Review is often the biggest source of waiting time in software delivery. A change that takes two hours to write can wait two days for review, which inflates lead time and encourages developers to batch work into larger changes that are even harder to review. Teams that review quickly tend to keep changes small and merge often, which fits trunk-based development and supports better DORA metrics. Some teams replace or supplement asynchronous review with pair programming, where code is reviewed continuously as it is written.

An Example

Consider a hypothetical team whose pull requests average 600 lines and wait a median of 26 hours for a first review. Its cycle time is about six days. The team agrees three guidelines: changes under 300 lines where possible, first response within four working hours, and style left to an automated formatter. Two months later, pull requests average 220 lines, the median wait for first review is three hours, and cycle time is down to about two and a half days. Reviewers also report leaving more comments on design and fewer on formatting.

Common Pitfalls

  • Rubber-stamping: approving large changes without reading them, which gives a false sense of safety.
  • Nitpicking: blocking changes over personal style preferences.
  • Review queues: one or two senior developers who must approve everything, creating a bottleneck.
  • Late design feedback: raising fundamental objections after the work is done, when an early conversation would have saved it.
  • Using review metrics to judge individuals, which encourages gaming.

Code review sits alongside automated testing and code coverage as part of an engineering team's quality system, and its speed is a large factor in developer experience.