Writing
Code Review Doesn’t Start With a Pull Request. It Starts With the Plan.
What code review can establish about a pull request, and where requirements, customer validation and operational checks still matter.
By Ka Lun Chan · Cloud & AI · AI / Leadership / Delivery
What the review needs to establish
Every change has to answer three questions: was it built correctly, does it solve the right problem, and can the team operate it safely?
AI can draft code, tests and review findings. That makes it useful to decide which questions still need human review and when to ask them.
An automated review can flag likely defects. Confirm separately that the implementation does what the customer needs and addresses constraints known to the team.
When a team produces more changes than it can review, the bottleneck becomes the time and judgment needed to verify them.
| Question | How to check it | Can AI answer it? |
|---|---|---|
| Was it built correctly? | Code review, automated tests, static and security analysis | Mostly |
| Does it meet the need? | Requirements, acceptance criteria, usability, customer validation | It can help ask the questions |
| Is it safe to operate? | Deployment, monitoring, production verification, rollback | It can help watch, not decide |
Review the plan before the code
Reviewing an implementation plan is often worth more than reviewing hundreds of lines of code afterward. A wrong approach costs a conversation in planning. In a pull request, it costs a rewrite. After release, it can cost a migration.
Answer these questions before development starts:
- What problem does the customer need solved?
- What does success look like, and what are the acceptance criteria?
- Is this the simplest implementation that would work?
- What existing functionality could this affect?
- What are the security, performance and operational risks?
- What evidence will show that it works?
An assistant can challenge assumptions, compare options and surface unwritten requirements. The people responsible for the work decide which questions matter.
Not every change needs the same review
A typo fix in the docs shouldn’t get the same scrutiny as a change to authentication, billing or a production database. Yet many teams apply one rule to every pull request: two approvals, whatever it touches. The trivial change waits as long as the risky one, and the risky one gets the same quick skim as the trivial one.
Match review effort to risk:
| Change type | AI review | Human review | Testing |
|---|---|---|---|
| Documentation or copy | Automated | Optional | Basic validation |
| Small UI changes | Automated | Depends on risk | Visual and functional |
| Standard business logic | Automated | Targeted | Unit and integration |
| Authentication or permissions | Automated | Required | Security and negative paths |
| Database migrations | Automated | Required | Migration, rollback, data integrity |
| Critical business workflows | Automated | Required | End-to-end and regression |
| Infrastructure and deployment | Automated | Required for high-risk changes | Deployment and rollback |
Human review costs time. The cost of a missed defect depends on what the change touches, how many users it reaches and how easily it can be reversed.
What AI should review
Much of what reviewers traditionally comment on is repetitive, and AI handles it well:
- Coding standards and consistency with the rest of the codebase
- Common bugs and missing error handling
- Known security vulnerability patterns
- Unnecessary complexity and duplicate logic
- Performance concerns, like a query inside a loop
- Gaps in test coverage and likely regression risks
- Documentation that no longer matches the code
Letting AI take this first pass means people stop spending review time on formatting and naming.
AI reviewers can produce false positives and miss problems that require context from outside the diff. Evaluate findings against the actual behavior and requirements.
What people should still review
Save human attention for decisions that depend on context, accountability or judgment:
- Does the change solve the customer’s problem?
- Does the design introduce moving parts the problem does not require?
- What could go wrong? Think about operational failures, security boundaries, scale, data integrity and side effects in other parts of the system.
- Can the team maintain it, and will another engineer understand this six months from now?
- Who owns deployment risk and recovery if it fails?
A reviewer who spends their time on these, and leaves the routine comments to automation, adds far more than one who reads every line looking for style issues.
Is the change delivering the expected result?
A change can satisfy the ticket and still be unusable. Check the outcome under the conditions the customer actually faces.
A feature can pass every unit test and still confuse users, add steps nobody needed, break an existing workflow, handle only the happy path, show error messages nobody understands, or fall short on accessibility. Sometimes it simply doesn’t solve the original problem.
Here’s a hypothetical workflow from an app for federal contractors. A user creates an account and adds several companies. Each company can have more than one UEI, the unique entity ID that identifies a business in federal contracting. The user switches between companies and takes an action for whichever company is selected.
Every API endpoint behind that can work perfectly, with green unit and integration tests. An end-to-end test can click through the whole flow and pass. And there are still questions none of those tests answer:
- Does the user understand which company is active right now?
- Could they change another company’s data by accident?
- Does switching companies keep the right context everywhere, including open tabs and cached data?
- Are permissions enforced on every path, or only the ones the UI shows?
- Does any of it make sense to someone using it for the first time?
Unit tests tell you the parts behave. Integration tests tell you the parts talk to each other. End-to-end tests tell you the workflow runs. None of them tell you the workflow is useful. That takes code quality, security testing, end-to-end testing and someone actually walking through the product as a user, together.
So who on the team is responsible for checking that the feature delivers the intended outcome?
If the answer is “QA will catch it” or “the product owner will see it in the demo,” it probably gets checked late or not at all. Acceptance criteria, product validation and real customer workflows deserve the same attention as the source code.
Review continues after deployment
A merged pull request still needs a production check. That’s where the team can see whether the decision worked under real conditions.
- Verifying that the deployment produced the expected behavior
- Rolling out gradually behind a feature flag when the risk justifies it
- Watching error logs, performance metrics and alerts
- Looking at how people actually use the feature
- Reading customer feedback and support tickets
- Detecting regressions early and having a rollback ready
A review process for the AI era
A proposed review process:
- Plan review. The problem, acceptance criteria, design, dependencies and risks.
- Implementation review. AI does the first pass: code review, static analysis and test gaps. People review based on risk and complexity.
- Functional validation. The feature behaves the way the requirements say.
- End-to-end validation. The whole customer journey works, including edge cases and failures.
- Release review. Deployment risk, monitoring, rollback plan and readiness.
- Post-release validation. Confirm the agreed behavior in production.
For a low-risk change, most of these stages take minutes, and some are a single question. For a change to permissions or billing, each one deserves real time.
Too much review, or too little?
Teams can spend either too much or too little time on review.
With too much review, developers wait days for approval. Several engineers review a one-line change. Comments argue about style instead of outcomes. Review becomes the bottleneck and people lose momentum.
Too little review lets code through that nobody understands, with security or data-integrity risks still open.
Look at review turnaround and change failure together. DORA offers definitions for delivery metrics that help put changes in context.
Developers still need to understand the systems they build, whether a person or an AI wrote the code.
Short answers
Can AI replace human code review?
For routine checks, mostly yes: style, common bugs, missing error handling, known security patterns and test gaps. It can’t decide whether the team built the right thing, whether the design fits the business, or who owns the risk if the change fails. Those still need a person, and the amount of human review should depend on the risk of the change.
Does every pull request need a human reviewer?
Not at the same depth. A documentation or copy change can rely on automated checks. Changes to authentication, permissions, billing, database migrations, critical workflows and high-risk infrastructure should always get a human review. Team maturity and regulatory obligations can raise that bar.
When should code review start?
Before any code is written. Reviewing the problem, acceptance criteria, design and risks catches a wrong approach when it is cheap to change. Review then continues through testing, release and production, where you find out whether the change actually worked for users.
How do you measure whether a code review process works?
Look at review turnaround time, change failure rate, escaped defects and customer-reported issues together. Lines of code reviewed and the number of approvals measure activity, not quality.
Keep reviewing. Rethink what you review.
AI can speed up some code review. A person still has to establish whether the change solves the right problem and can be operated safely.