In 1976, software engineer Michael Fagan at IBM published a paper introducing what he called "software inspections": structured, formal examinations of code by groups of engineers before it was tested or deployed.[2]

Fagan's data showed that inspections found more defects per hour of effort than testing did and caught a category of errors (design problems, logic flaws and incorrect assumptions) that testing most often missed.

Today, as a standard practice across almost every professional software organization for half a century, code review takes the form Fagan would recognize. Before it goes into the shared codebase, at least one other person reviews the code of one developer.

Pull requests on GitHub have replaced printed listings as the tool. What has not changed is the finding. Code review continues to be one of the most effective ways for software teams to detect defects and share knowledge.

This article explains what code review is, what the research says about its effectiveness, what good reviews look like, what common antipatterns undermine them, and when alternatives like pair programming may be more appropriate.

What Code Review Is and What It Accomplishes

The Basic Process

Code review is the practice of having at least one engineer, other than the author, examine source code changes before those changes are merged into the shared codebase. The reviewer is looking for:

  • Correctness: Does the code do what it is supposed to do? Are there edge cases it fails to handle?
  • Logic errors. Might the reasoning be flawed in ways that do not produce test failures right away but will cause problems later?
  • Security vulnerabilities: Are there injection risks, authentication flaws, exposed credentials, insecure data handling?
  • Performance: Are there obvious inefficiencies - N+1 queries, unnecessary allocations, blocking operations?
  • Readability: Is the code clear enough that a future maintainer (who may be the author themselves six months hence) can understand it without the context that exists in the author's head today?
  • Design and architecture. Is this the right approach or is there one that is simpler or more robust?
  • Standards compliance. The code follows the team's set conventions, naming patterns and test rules.

Reviews most often come out as approval and merge, approval with minor non-blocking suggestions or a request for changes before merging.

What Makes Code Review Different from Testing

Automated testing and code review go together as complements, they do not compete. Tests show that the code meets defined assertions by working as expected. Code review looks more widely at whether the code is correct in its design and assumptions and at whether the logic that is readable is what was intended.

Tests catch bugs that break what the test expects, whereas code review catches bugs the author never thought to test. Defect types split differently in practice too: testing is better at catching regressions and boundary conditions while review is better at catching logic flaws, security holes and design problems.

A widely used figure says that combining code review and testing snags more than 95 percent of defects before release.[3] That is compared with about 75 to 85 percent for either method by itself.

Jones's analysis across hundreds of software projects (Jones, 2008, "Applied Software Measurement") found that teams using both practices had post-release defect rates approximately six times lower than teams relying on testing alone.[3]

What Research Says About Code Review Effectiveness

Google's Findings

Google has published extensively on its engineering practices, including code review. In its 2020 book Software Engineering at Google (Winters, Manshreck, and Wright), the company reports that code review is required for all changes to its codebase before submission, with few exceptions.[4]

More than 900 engineers answered an internal Google survey that collected data showing code review has purposes going beyond defect detection.

  • 83 percent of respondents cited reviewing for "correctness" as a primary motivation
  • 73 percent cited improving code readability
  • 59 percent cited knowledge transfer to other team members
  • 58 percent cited ensuring code maintainability

The multi-purpose nature of this framing matters. Code review is not just a way to find defects. It is also a way to share ownership and distribute knowledge.

Reviewing code helps engineers get familiar with parts of the codebase they did not write, cutting down the single points of failure that happen when only one person understands a component.

Google's approach also includes a strong norm around code ownership: any engineer can approve a change that meets the style guide and design principles, but a separate "owner" approval is required for changes to certain sensitive areas.

This two-level system distributes review load while maintaining quality gates for critical paths.

Microsoft Research

Microsoft Research has produced a large body of code review research. Bacchelli and Bird's 2013 study titled "Expectations, Outcomes and Challenges of Modern Code Review" surveyed 165 developers across several Microsoft teams and examined 450 code reviews.

Their key finding: developers' primary goal in code review is not defect finding (as Fagan's formal inspection model assumed) but understanding the change: ensuring that reviewers comprehend what the code does and why, which serves knowledge transfer as much as quality assurance.

In a 2015 Microsoft study pulling together data from several companies, Rigby and Bird found that changes checked by more than one reviewer have much lower post-commit defect rates than single-reviewer changes, with returns leveling off past two reviewers.

Over 200,000 code reviews from both open-source and commercial projects were examined by the study. It found that the best review team size is two to three reviewers. That gives enough diversity of perspective without the coordination overhead that makes quality worse as groups get larger.

Sadowski et al. (2018), in a landmark Google case study published at ICSE, found that review quality degrades significantly for changes over 400 lines of code.

Their analysis of over 13,000 code reviews found that as change size increased, both reviewer thoroughness and defect detection rate fell nonlinearly - a 600-line change was not 50 percent harder to review than a 400-line change; it was disproportionately harder.

IBM and the Original Inspection Data

Formal inspections set up by Fagan's 1976 IBM data and later replications showed that they could get rid of 60 to 80 percent of defects before testing.

Boehm and Basili later did studies at NASA that showed fixing a defect in code review costs about 1/10 what it costs to fix it after release. That gives the classic economic argument for finding defects early.

The "cost of defects by phase" curve (where defects found in production cost 100x more to fix than defects found during design) has been cited in software quality literature for decades.

While the exact multipliers vary by study and context, the directional finding is robust: defects found early are dramatically cheaper to fix than defects found late.

Projects that used structured inspection processes had 25 to 40 percent fewer post-release defects even once project complexity and team experience were controlled for. Barry Boehm's analysis at TRW in 1981 and follow-up work at NASA's Goddard Space Flight Center came to that finding.

What follows is that an hour put into code review usually saves far more than an hour of later debugging, rework and incident response. That payoff compounds because review also stops cascading defects where a bad assumption in a core abstraction spreads into every system built on top of it.

SmartBear's Large-Scale Analysis

One of the largest empirical studies of code review effectiveness came from SmartBear Software (now part of the Tricentis group), which analyzed data from 2,500 reviews done by 50 teams (Cohen, 2006). The study gave several concrete benchmarks that have since become widely referenced.

  • Maintaining effectiveness calls for reviewers to look at no more than 200-400 lines of code per hour. Reviews that go faster bring in much lower defect detection rates.
  • Inspection rate matters more than inspection time: a reviewer spending 60 minutes on 600 lines detects fewer defects per line than one spending 60 minutes on 200 lines
  • Optimal review session length is 60 to 90 minutes. Once reviewers get fatigued past 90 minutes, the defect detection rate falls sharply.
  • Teams that conducted code reviews found approximately 85 percent of defects before software was released, compared to 50 percent for teams relying only on testing

What Good Code Review Looks Like

The Scope Problem: Not Too Big, Not Too Small

Of all factors, the size of the change being reviewed is what most determines code review quality. Sadowski et al. (2018) did research at Google that showed review quality drops markedly for changes over 400 lines. Reviewers become less thorough, approval takes longer and defect detection becomes less effective.

Practically speaking, large changes that sweep through an entire system should be broken down into smaller units that can be reviewed. That takes more discipline from authors and more overhead for managing the workflow but it brings substantially better results.

The same finding implies a preference for frequent small reviews over infrequent large ones. Teams that merge changes multiple times per day with small, reviewable diffs outperform teams that accumulate large changes for periodic review, both in quality and in cycle time.

Author Behavior

Before requesting review, the author should:

Write a clear, informative description. What the change does, why it is needed and any non-obvious implementation choices should all be covered in the review description. When a reviewer grasps the intent, that person can give better feedback than one who has to work it out from the code.

Review your own code first. Authors who go through their own diff before asking for an outside review catch a large share of their own bugs. Reading the code inside the review UI instead of the editor often turns up problems that were easy to miss while writing it.

Annotate complex sections. Where a particular implementation is inescapably complex or makes a subtle tradeoff, a quick comment that explains it in the review request cuts down on reviewer confusion as well as defensiveness.

Scope changes tightly. Leave out unrelated cleanup, refactoring or style tweaks when opening a pull request for a feature or bug fix. Mixing purposes makes the review harder and hides the reason for each change in the commit history.

Reviewer Behavior

Good review feedback is:

Specific and actionable. When a person says "I found it difficult to follow the control flow here. Would extracting the retry logic into a helper function make it clearer?" that is more useful than saying "This function is confusing."

Explaining reasoning. A suggestion without rationale comes across as arbitrary. "Use a Set here instead of a List and lookup will be O(1) rather than O(n). That matters when the collection is large" gives the author what they need to decide if the suggestion fits.

Distinguishing blocking from non-blocking concerns. Not every suggestion should block the review. Teams benefit from conventions (a "nit:" prefix for style suggestions, a "blocker:" prefix for required changes) that communicate the reviewer's intent clearly.

Focused on the code, not the person. Use "We should add error handling here" instead of "you forgot error handling." Code is a shared artifact and the review is about making it better.

"The goal of code review is not to catch every imperfection but to ensure the code is better after the review than before.

Treating review as an examination the author must pass rather than a collaboration to improve the code produces adversarial dynamics that harm both quality and team culture."

Common framing in engineering culture literature, notably reflected in Winters, Manshreck, and Wright (2020), Software Engineering at Google

What to Look For: A Practical Checklist

CategoryKey Questions
CorrectnessDoes it handle null/empty inputs? Are off-by-one errors possible? Are all code paths covered?
Error handlingAre errors caught and handled appropriately? Do failures degrade gracefully?
SecurityIs user input sanitized? Are credentials or secrets hardcoded? Are permissions checked?
TestsDo tests cover the new behavior? Do they test the right things? Are they brittle?
ReadabilityCan a new team member understand this in 10 minutes? Are names descriptive?
PerformanceAre there obvious bottlenecks? Are database queries efficient?
ArchitectureDoes this fit the existing design? Does it introduce technical debt?
DependenciesAre new dependencies necessary? Are they maintained? Are their licenses compatible?
DocumentationAre public APIs documented? Are non-obvious decisions explained in comments?

Common Antipatterns

Rubber Stamping

Rubber stamping means giving approval to code without genuinely reviewing it. Time pressure on the reviewers, lack of familiarity with the relevant part of the codebase, social discomfort at challenging colleagues or working in a culture that values speed over quality can all bring about rubber stamping.

Rubber stamping is worse than no review in one specific sense: it provides the organizational comfort of having conducted code review while allowing the defects that review was meant to catch to pass through. It is the process theater of engineering quality.

Signs of rubber stamping: reviews completed in under two minutes for substantial changes; consistently no comments; approval immediately following a "LGTM" (looks good to me) with no specifics.

Rigby and Bird's research from 2013 showed that reviews without any comments had a statistically higher defect rate after a merge than reviews with at least one comment. That gives proof that it is the lack of engagement and not the lack of problems that causes rubber stamping.[5]

Nitpicking

At the other extreme is nitpicking. That is spending review time on cosmetic issues such as inconsistent indentation, naming style preferences and punctuation in comments but giving insufficient attention to correctness and design.

Nitpicking wears authors down, above all newer engineers who get notes that feel arbitrary and stylistic rather than substantive and it pulls reviewer focus away from the problems that count.

Automation fixes this. Linters and formatters like ESLint, Prettier, Black and gofmt enforced in the build pipeline take style and formatting debates out of human code review altogether and free reviewers to focus on real questions.

Asynchronous Review as a Delay Mechanism

When reviewers do not reply quickly and authors have to wait days or weeks for feedback, code review can become a bottleneck in some organizations. Google's internal data show that reviews taking longer than 24 hours go with much lower developer satisfaction as well as slower delivery of features.

Service level expectations that teams can set let reviewers give initial feedback within four or eight business hours and most review issues get resolved quickly. Only complex ones need more time to consider.

Getting some engagement with the prompt, even just saying "I'll look at this more carefully tomorrow", stops the demoralizing silence that weakens review culture.

Review wait time came out as one of the top contributors to low code review satisfaction in the 2022 State of DevOps Report by DORA (DevOps Research and Assessment). Teams that waited more than 24 hours for initial feedback reported 47 percent lower satisfaction with how their whole development workflow was going.

Author Defensiveness

When authors read review feedback as personal attack instead of as improvement suggestions, reviews turn conflict-prone and reviewers learn to tone down or drop feedback to prevent friction. That dynamic weakens review quality without anyone setting out to do that.

When engineering cultures that treat code as a shared organizational asset instead of personal property of the author get built, this friction reduces. Mob/ensemble programming and other practices in which code is written collaboratively from the beginning bring about a comparable shift in how ownership is framed.

Amy Edmondson's research at Harvard Business School (1999, 2019) on psychological safety in teams, the belief that one can speak up without punishment, directly applies to code review culture.[6]

Reviews have higher defect detection rates where teams have high psychological safety. That is because reviewers feel safe to raise concerns and authors feel safe to receive them.

Synchronous vs. Asynchronous Review

Most teams use asynchronous code review as their main model through pull requests or merge requests. The author sends in the code and reviewers look at it on their own schedule, add comments and the author replies.

That model scales easily because reviewers and authors do not have to line up their schedules and written comments leave a clear record of design decisions.

Synchronous code review. When reviewer and author sit together (or are on a call) and go through code in real time, complex discussions move faster but the method calls for coordination overhead. It is used most often for changes that are especially complex or sensitive or for onboarding situations where real-time explanation helps.

Pair programming, two engineers working on the same code simultaneously, is a form of continuous review that avoids the async model's batch-and-wait cycle entirely. One engineer writes (the "driver") while the other observes, questions, and suggests (the "navigator"), switching roles periodically.

Studies of pair programming (Cockburn and Williams, 2001) show that pairing brings in code with about 15 percent fewer defects and takes about 15 percent more time. That makes pair programming approximately quality-neutral on direct measures of productivity but gives a long-term gain once the cost of preventing defects is counted.

It also produces more consistent knowledge distribution than serial code review.

Pair programming is particularly effective for:

  • Novel or complex problems where two perspectives reduce design errors
  • Onboarding situations where knowledge transfer is the primary goal
  • High-stakes changes where the cost of defects is elevated

Routine tasks, geographically distributed teams as well as individual work styles that get exhausted by real-time collaboration all make it less practical for this approach.

The Metrics Trap: What Not to Measure

Newly committed teams that set out to improve code review often turn to metrics. That makes sense but needs care because the wrong metrics actually make review quality worse.

Metrics that commonly backfire:

  • Time to approval: Optimizing for speed incentivizes rubber stamping. A reviewer who approves within 10 minutes of every submission is likely not reading code.
  • Number of comments left: Incentivizes nitpicking and verbose but low-value feedback.
  • Review coverage per engineer. This puts pressure to cover code without really engaging with it.

More useful signals:

  • Post-merge defect rate for reviewed vs. unreviewed changes (requires tracking bugs to originating commits)
  • Author survey satisfaction with feedback quality
  • Reviewer response time (measured separately from approval time)
  • Change size distribution (tracking whether teams are breaking work into reviewable units)

The goal of measuring code review is to understand whether it is working (whether it is catching defects, distributing knowledge, and maintaining standards), not to create accountability theater around the activity of reviewing.

Building a Code Review Culture

Technical process alone does not produce good code review. The cultural and structural environment matters as much as the mechanics.

Psychological safety is foundational. Engineers who fear that critical feedback will damage their reputation or standing will not provide honest reviews, and engineers who receive honest feedback in an unsupportive environment will find code review demoralizing rather than helpful.

Amy Edmondson's research on psychological safety applies directly: teams where it is safe to say "I don't understand this" or "I think this is wrong" have more useful reviews.

Seniority dynamics require deliberate management. Junior engineers often hold back from questioning a senior engineer's code even when their concerns are spot on.

Explicit norms that treat code review as egalitarian (any engineer can question any other's code, and junior engineers are expected to ask questions they don't understand) produce better reviews and accelerate learning.

Rotation and cross-team review prevents the formation of review silos where only the author's immediate teammates ever see their code. Occasional cross-team or cross-functional reviews spread knowledge and surface assumptions that teams develop collectively over time.

Calibration reviews, where the same code is reviewed independently by multiple reviewers and results are compared, can surface divergence in review standards and calibrate the team around consistent expectations.

Drawing from formal inspection methods, this technique gets used rarely in modern teams yet it can be very effective when code review quality has stopped being consistent.

One of the most valuable engineering practices around is code review done well. Defects get caught cheaply, knowledge gets distributed and shared standards get maintained. The cultural artifacts that let codebases stay comprehensible over time documented design decisions, visible technical debates and accessible history get created as well.

When done poorly (rubber-stamped, nitpicky or delayed), it wastes time and gives the illusion of quality without having its substance. The difference lies less in the tooling than in the culture and habits around it.

AI-Assisted Code Review

New dimensions have been added to the code review world by AI code review tools that have emerged (GitHub Copilot, Amazon CodeGuru, DeepCode/Snyk and others). Machine learning lets these tools spot common bug patterns, security holes and style problems automatically ahead of human review starting.

AI-assisted review tools are most effective at:

  • Security vulnerability detection. Detecting common vulnerability classes including SQL injection, insecure dependencies and exposed credentials that can be pattern-matched against known vulnerability signatures.
  • Style and convention enforcement: Supplementing or replacing manual style review for teams without comprehensive automated linting
  • Obvious bug patterns. These are off-by-one errors, null dereferences and resource leak patterns that appear frequently in training data.

They are weakest at:

  • Design and architecture review: Whether this approach is the right one for the problem requires understanding context that AI tools lack
  • Requirements correctness. Understanding the requirements is what it takes to know whether the code gets the intended behavior right.
  • Team-specific conventions and standards. Information on this specific codebase, the team's history and the organizational limits.

GitHub reported in 2023 that Copilot pull request summaries - automated descriptions of what a pull request changes - reduced the time human reviewers spent understanding change context by an average of 40 percent in their internal studies, allowing reviewers to focus more quickly on substantive feedback.

Summarizing context that reduces human overhead in this way may turn out to be AI's most valuable contribution to code review workflow instead of directly replacing human judgment on design and correctness.

Practically speaking, treat AI code review tools as a first pass that takes automatable checks off human reviewers' plates rather than a stand-in for human judgment on design, correctness and knowledge sharing.

The most valuable aspects of code review (the judgment, the questions, the knowledge sharing) remain human work.

Code Review and the Broader Development Lifecycle

Code review does not stand alone. It works best when it sits inside a wider set of engineering habits:

Continuous integration: Automated builds and tests that run on every pull request eliminate an entire class of review feedback ("does this build?") and ensure reviewers are looking at code that works at the mechanical level.

Over 10 million tests run daily through Google's internal CI system. Basic correctness is verified by the time a change gets to human review.

Static analysis: Tools like SonarQube, Semgrep, and language-specific analyzers catch categories of defects that are tedious for human reviewers to check consistently. When static analysis is integrated into the pull request workflow, reviewers can trust that certain checks have already been performed.

Feature flags and gradual rollouts. With the ability to roll back or limit exposure reducing what it costs for a defect to get into production, pre-merge review can be made as intense as needed.

When production risk is managed differently, teams that have a mature rollout infrastructure can take a somewhat higher defect rate in review.

In a multi-layer quality system, review is one layer and the best code review culture sees it that way. It is not the only check but an essential one that catches what other layers miss.

Sources and Further Reading

  1. Bacchelli, A., & Bird, C. (2013). Expectations, outcomes, and challenges of modern code review. 2013 35th International Conference on Software Engineering (ICSE), 712-721. View source
  2. Fagan, M. E. (1976). Design and code inspections to reduce errors in program development. IBM Systems Journal, 15(3), 182-211. View source
  3. Capers Jones (2008). Applied Software Measurement. View source
  4. Titus Winters, Tom Manshreck and Hyrum Wright (2020). Software Engineering at Google. View source
  5. Rigby, P. C., & Bird, C. (2013). Convergent contemporary software peer review practices. Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, 202-212. View source
  6. Edmondson, A. (1999). Psychological Safety and Learning Behavior in Work Teams. Administrative Science Quarterly, 44(2), 350-383. View source