Most developers have seen it happen.
A pull request gets opened. Someone checks the changed files, leaves a small comment about naming, perhaps suggests a cleaner approach, and eventually clicks Approve.
The PR is merged.
A few days later, something breaks. And when the team investigates, the uncomfortable question appears:
How did this get through code review?
The answer is often simpler than we want to admit: someone read the code, but nobody really reviewed the change.
## The difference between reading and reviewing
Reading code is relatively straightforward. You follow the logic, understand what a function does, and check whether the implementation looks reasonable.
Reviewing a change requires a different kind of thinking.
You need to understand what existed before, what the change is supposed to accomplish, and what might behave differently afterward.
A change can look perfectly reasonable in isolation while creating problems somewhere else.
For example:
- A function handles the new input correctly but breaks an older use case.
- A database query works with the development dataset but becomes expensive with real production data.
- An API response changes in a way that silently breaks another consumer.
- A new condition fixes one edge case but changes the behavior of several unrelated paths.
- An error is handled locally, but the calling code continues as if everything succeeded.
None of these problems necessarily makes the code look bad.
That's what makes them easy to miss.
## Why reviews become superficial
I don't think the problem is always a lack of technical skill.
Code reviews happen alongside everything else: meetings, deadlines, bug reports, feature work, and other people's pull requests.
A developer opens a PR with 35 changed files. The description says the feature is ready. Tests are green. The implementation looks familiar.
It's tempting to treat the green checks and a quick scan as sufficient evidence.
But automated tests only verify the scenarios they've been written to cover. And a reviewer who doesn't understand the intended behavior may not know which scenarios are missing.
The review gradually becomes a check that the code looks acceptable rather than an attempt to discover what could go wrong.
## What I try to look for beyond the changed lines
When reviewing a change, a few questions are often more valuable than debating formatting or naming:
1. What behavior is actually changing?
Not just which files were modified. What can users or other parts of the system do differently after this change?
2. What existing behavior could be affected?
A small change to shared logic can have a much larger impact than its diff suggests.
3. What happens when the expected input isn't available?
Missing values, duplicate requests, expired sessions, unexpected responses, and partial failures are worth considering.
4. Does the test prove the requirement or just the implementation?
A test can pass while confirming exactly the same assumption that caused the bug.
5. Can I explain the risk of this change?
If I cannot explain what might break, I probably haven't understood the change well enough to approve it confidently.
These questions don't guarantee a perfect review. They do help move the discussion away from whether the code looks clean and toward whether the change is safe.
## Smaller PRs help, but they aren't a complete solution
Keeping pull requests small makes reviews easier. That's good advice, and I still think it matters.
But a small PR can introduce a serious regression, while a large PR can be well understood and carefully reviewed.
The number of changed lines is not the same as the amount of risk.
A five-line change to authentication, permissions, or shared state might deserve more attention than a hundred lines of isolated UI work.
The important thing is to understand the consequences, not simply count the lines.
## Maybe the most important review question is different
Instead of asking:
"Does this code look good?"
Perhaps we should ask:
"What could become incorrect in the system if this change behaves exactly as written?"
That question changes the review.
It encourages us to think about callers, data, dependencies, failure paths, and behavior outside the pull request itself.
And it makes approval mean something more than having looked at the diff.
## A question for developers
What's the most common reason a bug slips through code review on your team?
Is it reviewers not having enough context, oversized pull requests, pressure to approve quickly, tests that miss important behavior, or something else?
I'm particularly interested in cases where the code looked perfectly reasonable during review, but the consequences only became visible after it reached production.
Top comments (0)