A developer has finished a new feature. The tests are green and it is ready to ship. But only the person who wrote the code has looked at it. A missed condition, a misunderstood business rule or a shortcut nobody will understand next year usually surfaces only when a customer complains. Code review reduces that risk before release, at the cheapest possible point: before a change is merged, one or more teammates read the code, ask questions and approve it.
This guide explains why code review is done, which formats teams use, what to look for, how change size affects review quality, how to calculate team capacity, how to write review comments, which metrics to track and how to set the practice up in six steps. All example figures and assumptions are illustrative; they are not industry averages or measured statistics.
What Is Code Review?
Code review is the practice of having another developer read and evaluate a change before it joins the main codebase. The reviewer looks at whether the code works correctly, whether it is understandable, whether it has tests and whether it could harm the rest of the system. The outcome is usually one of three decisions: approve, request changes, or raise a question that needs discussion.
Code review does not replace testing; it catches what testing cannot. A test answers "does the code produce the expected output for the expected input?" A review answers "are we solving the right problem, will someone be able to understand this in six months, did we misread the rule?" We covered testing itself in our software testing guide.
We recommend reading: What is the software development life cycle (SDLC)?
Why Is Code Review Done?
It has three core purposes: catching defects early, spreading knowledge across the team and keeping the code consistent.
- Catching defects early: A logic error, a missing validation or a misread business rule takes minutes to fix at review time and can take days in production. We work out the cost logic below.
- Knowledge sharing: If only one person knows a piece of code, the team is blind when that person is on leave or leaves. Review makes sure every module is familiar to at least two people, and new developers learn the team's style here.
- Consistency: Decisions about naming, error handling and folder layout are aligned during review. Inconsistent code turns into technical debt over time; review slows that buildup at its source.
What Are the Code Review Formats?
There is no single right format; teams choose by team size, change risk and time zones. Most teams make the first one their baseline and add the others when needed.
| Format | How it works | Strength | Weakness | Best for |
|---|---|---|---|---|
| Change-request review | The author shares the change; the reviewer reads it in their own time and leaves comments | Leaves a record, works across time zones | Waiting time can grow | Everyday standard work |
| Pair programming | Two people write the same code at the same time; one types, the other reads | Instant feedback, fast knowledge transfer | Uses two people's time at once | Hard or unfamiliar areas |
| Meeting-based review | The author walks the team through the code and the team discusses it together | Shared understanding of design decisions | Takes time, wasteful for small changes | Large or risky changes |
What Should You Look for in a Code Review?
The biggest risk for a reviewer is "reading and moving on" without knowing where to look. A six-area checklist prevents that. Not every change gets the same depth in every area; the riskiest area comes first.
| Area | Questions to ask |
|---|---|
| Correctness | Does the code do what was asked? Are edge cases (empty values, zero, very large values) considered? |
| Readability | Are the names meaningful? Would someone reading this in six months understand the intent? |
| Tests | Is there a test for the new behavior? For a bug fix, is there a test that catches the bug? |
| Security | Is input validated? Is authorization checked? Is a secret key written into the code? |
| Performance | Is there a database query inside a loop? Is there a spot that will slow down on large data? |
| Backward compatibility | Does it break existing data, interfaces or other systems? Is there a way to roll back? |
The security row is the one most often skipped. The checks in our guides on role-based access control and API security can be added straight to a review checklist. For changes that involve architecture decisions, the service-boundary principles in the microservices architecture article give the discussion a starting point.
How Does Change Size Affect Review Quality?
As a change grows, the review gets shallower. Attention is limited; on a 100-line change the reviewer thinks about every line, while on a 1,000-line change they skim most of it and say "looks fine". The model below is an illustrative assumption, not a research finding or an industry average. We assume 2 defects per 100 lines and catch rates of 70%, 50% and 30% depending on size.
| Change size | Total defects | Catch rate | Caught | Escaped |
|---|---|---|---|---|
| 100 lines | 2 | 70% | 1.4 | 0.6 |
| 400 lines | 8 | 50% | 4.0 | 4.0 |
| 1,000 lines | 20 | 30% | 6.0 | 14.0 |
| 1,000 lines, split into 10 parts | 20 | 70% | 14.0 | 6.0 |
Reviewed as one piece, the same 1,000 lines yield 20 × 30% = 6 caught defects and 14 escapes. Split into 10 parts, they yield 10 × (2 × 70%) = 14 caught defects and 6 escapes. Simply by splitting the work, 8 more defects are caught early. In practice, teams set a target such as "no change above 400 lines, ideally around 200", and each team should set its own limit from its own measurements. We covered how splitting work relates to delivery frequency in our CI/CD guide.
How Do You Set a Review Time Target and Calculate Team Capacity?
If review time is not planned, it always falls to the bottom of the queue. So a target is set both for waiting time and for total load. The calculation below is illustrative.
- Volume: 25 changes per week, each taking an average of 40 minutes to review.
- Total load: 25 × 40 min = 1,000 min ≈ 16.7 hours.
- In a team of 6, one reviewer per change: 16.7 ÷ 6 ≈ 2.8 hours; about 2 h 47 min per person per week, roughly 33 minutes a day.
- If every change gets two reviewers: 33.3 hours; 5.6 hours per person, about 14% of a 40-hour week.
Two conclusions follow. First, review is not "something to do when idle"; it is roughly 7% of planned work and belongs on the calendar. Second, a second reviewer doubles the load, so it is more sustainable to require one only for high-risk changes (payments, authorization, data migration). A simple rule works well for the time target: give a first response within 4 working hours, with reviewers checking the queue at two fixed times a day.
How Do You Write Good Review Comments?
The tone of the comments decides the quality of the review. The aim is to judge the code, not the person, to state the decision clearly and to keep the author from getting defensive.
- Talk about the code, not the person: Instead of "you did this wrong", write "this condition fails on an empty list".
- Ask, don't order: "This function seems to do two jobs; have you tried splitting it?" probes the author's context and finds the answer together.
- Give the reason: "Change this" is not enough; explain the risk you see in one sentence.
- Separate blocking from suggestions: The author should see clearly which comment blocks the merge and which is optional.
- Say what is good, too: Pointing out a clean solution strengthens team culture and learning.
| Label | Meaning | Example |
|---|---|---|
| Blocking | Cannot be merged until fixed | Blocking: Another customer's order can be read without checking the user's authorization. |
| Suggestion | Up to the author | Suggestion: Moving these three lines into a separate function could make testing easier. |
| Question | For understanding; the answer decides the outcome | Question: Is returning an empty list here a deliberate choice? |
Which Checks Should Be Left to Automation?
Human attention is scarce; if it is spent on indentation, spacing and naming arguments, nothing is left for logic. Handing format and style checks to automation points the reviewer at the valuable part.
- Automated: code format, style rules, simple error patterns, build, test runs, scanning dependencies for known vulnerabilities.
- Human: correctness of the business rule, design decisions, meaning of names, security assumptions, purpose of the code.
The rule is simple: if a machine can decide, humans do not debate it. How these automated checks run on every change ties into the pipeline logic in our CI/CD article; the pipeline should be green before review is requested.
Which Metrics Should You Track in Code Review?
Metrics show whether review has become a bottleneck; they are used to improve the process, not to measure individuals. The example values below are illustrative.
| Metric | Calculation | Example | Reading |
|---|---|---|---|
| First response time | From opening the change to the first comment | Median 3 h | Target under 4 working hours |
| On-time first response rate | Answered within 4 hours ÷ all | 21 ÷ 25 = 84% | A gap if the target is 90% |
| Review rounds | Total rounds ÷ number of changes | 55 ÷ 25 = 2.2 | Too high suggests an expectation or size problem |
| Wait-to-active ratio | Waiting ÷ active review | 6 h ÷ 40 min = 360 ÷ 40 = 9 | Time is spent waiting in the queue |
| Change size | Median line count | 180 lines | Under the 400 limit |
In the example, active review takes 40 minutes while waiting takes 6 hours; the wait is 9 times the work itself. The problem is not slow reviewers but an invisible queue: the fix is not to work harder but to set fixed review hours.
What Does an Early-Caught Defect Save?
The cost of fixing a defect grows with the stage where it is found. The multipliers below are an illustrative assumption; real ratios vary from team to team, so set your own from your records. We take 1 hour to fix at review, 4 hours at testing (4 times) and 15 hours in production (15 times); a developer hour costs ₺750 (₺6,000 daily rate ÷ 8). Of the defects that escape, 70% are found in testing and 30% in production.
The expected cost of one escaped defect: 0.7 × 4 + 0.3 × 15 = 2.8 + 4.5 = 7.3 hours. Now apply it to the 1,000-line change:
- One piece: 6 defects caught in review (6 × 1 = 6 h), 14 escape (14 × 7.3 = 102.2 h): total 108.2 hours.
- Split into 10 parts: 14 defects caught in review (14 h), 6 escape (6 × 7.3 = 43.8 h): total 57.8 hours.
- Difference: 108.2 − 57.8 = 50.4 hours × ₺750 = ₺37,800.
The figure covers only fix hours; the effect of a production defect on customer trust and sales is not included. Review time is assumed to be about the same in both cases. To grasp the logic, count the defects your team fixed in production over the last three months and estimate how many a review could have caught.
What Are the Common Code Review Mistakes?
- Sending a huge change: The reviewer tires and skims. Splitting is the author's responsibility.
- Opening a change with no description: A change that does not say what it does and why forces the reviewer to guess.
- Spending time on style debates: If formatting is not handed to automation, logic errors slip through.
- Making it personal: If the tone is harsh, the author meets comments with defensiveness and improvement stops.
- Rubber-stamp approvals: An approval given without reading turns review into false assurance.
- Leaving review in the queue: A review with no time target waits for days and delivery slows down.
How Do You Set Up Code Review in Six Steps?
If your team has no review or an ad hoc one, start with small steps in this order. Each step produces a written output.
- Write the policy: Purpose, scope (which code, which changes), how many approvals are needed and who can approve, on one page.
- Set a size limit: For example 400 lines; anything larger is split or sent to a meeting-based review.
- Turn on automated checks: Format, style, build and tests must be green before review is requested.
- Use the checklist: Put the six-area list into the change template; the author reads their own change first and ticks it off.
- Plan time and capacity: Put the first-response target and weekly review hours on the calendar; in the example, 2.8 hours per person.
- Track the metrics: Review first response time, rounds and the wait ratio with the team once a month; do not compare individuals.
We recommend reading: What is technical debt? The interest analogy, measurement and payoff plan
We recommend reading: What Is Version Control (Git)? Commits, Branches, Merging, Tags and Source Code Ownership Guide
We recommend reading: What Is Software Monitoring?
We recommend reading: What Is Test Automation?
We recommend reading: What Is Secure Software Development (Secure SDLC)?
We recommend reading: How to Do Performance Testing: Load, Stress and Soak Tests, Targets and Reading the Results
We recommend reading: What Is Penetration Testing? Types, Scope, Reports, Cost and How a Business Should Commission One
We recommend reading: What Is Static Code Analysis and Quality Gates? Complexity, Thresholds and Findings Management Guide
We recommend reading: What Is Scrum? How to Run Sprint Planning, Daily Standups, Sprint Reviews and Retrospectives
We recommend reading: How to Do a Software Technical Due Diligence: Code and Architecture Audit, Scorecard and Decision Guide
Custom Software Development with İnovabil
At İnovabil our focus is custom software built from scratch for your company: custom software, ERP, CRM, e-commerce, web, mobile and integration. Our process page records our development and testing steps; they aim at a project that moves forward in measurable, traceable pieces. Because the review method, team size and expectations differ from project to project, we suggest settling them in writing at the requirements stage, so the question "who will look at your code, and how?" is answered before the project starts.
We built CRM, purchasing and mobile for Avcılar İnşaat; a purchasing system for İZBAN; a prepaid cargo system for Kredili Kargo; logistics and shipment planning for Karyak; and warehouse management plus a complaint and support management system for Sleepy. Send us a short summary of the maintenance of your existing software or a new project, and let us write the expectations down together.
We recommend reading: Our software development process: from analysis to release, step by step
Frequently Asked Questions
What is code review and what is it for?
It is the practice of having another developer read and evaluate a change before it joins the main codebase. It catches defects early, spreads knowledge across the team and keeps the code consistent.
Does code review replace testing?
No. A test verifies the output for specific inputs; a review evaluates whether the business rule was understood correctly, how readable the code is and the design decisions. The two complement each other.
How many lines should a change be at most?
There is no universal number; most teams set an upper limit around 200 to 400 lines. In our illustrative model the catch rate is taken as 70% at 100 lines and 30% at 1,000 lines. Set your limit from your own measurements.
How long does code review take?
It depends on the size and risk of the change. In the example, 25 changes a week at 40 minutes each come to 16.7 hours; in a team of 6 that is about 2.8 hours per person per week. If every change gets two reviewers, the load doubles.
What should you watch for in review comments?
Criticize the code, not the person, ask questions, give the reason and separate blocking comments from optional suggestions. Leave style and format to automated checks.