Code Review
What Is Code Review?
Code review is the practice of having one or more developers, other than the author, examine a code change before it is merged. Reviewers look for defects, design problems and unclear code. On Git platforms, code review happens in a pull request or merge request.
Why Code Review Matters
Code review is the last point where a person reads a change before it joins the main branch. A defect caught there costs a comment and a short fix. The same defect found in production costs an incident. It also spreads knowledge: after a review, at least two people understand the change, so the team is not dependent on its author.
How Code Review Works
The author pushes a branch and opens a pull request with a description of the change. Automated checks run first: build, tests, linting and static analysis. One or more reviewers then read the diff. They leave comments on specific lines, ask questions, and either request changes or approve. The author responds and pushes updates until the reviewers approve. Branch rules usually require a set number of approvals and passing checks before the merge.
Good reviews depend on small changes. A reviewer reads a 200-line pull request carefully and skims a 2,000-line one. Teams therefore pair review with limits on pull request size and with an expected response time.
Code review sits between coding and integration in the software delivery lifecycle.
How Oobeya Uses Code Review
Oobeya measures the review process from pull request data in GitHub, GitLab, Bitbucket, Azure DevOps and other Git integrations. The Pull Requests tab under Analytics > Coding, Review & Delivery shows cycle time, time to merge, pickup and review time, and pull request size. Four Symptoms on the team scorecard cover review problems: unreviewed pull requests, lightning pull requests that merge too fast to have been read, oversize pull requests, and high code review time. Each Symptom has a threshold that administrators can change.
Frequently Asked Questions
What is the difference between code review and a pull request?
A pull request is the mechanism: a proposal to merge one branch into another. Code review is the activity that takes place inside it.
How many reviewers should a pull request have?
One or two reviewers is the common practice. More reviewers add waiting time and each one tends to assume another has checked the details.
What do reviewers look for?
Reviewers check correctness, design, readability, test coverage and security. Formatting and style are best left to automated tools.
Related Terms
Related Pages
Move from definition to product context with the most relevant Oobeya pages for this term.