50 Shades of Code Review
“Hey Bob, welcome to the team! Can you take a look at this code review?”
While it may seem like a harsh introduction to your new software engineering role, it’s not uncommon for an experienced engineer to be handed a code review shortly after joining a company. But what exactly is expected in a code review? The answer varies between teams and organizations.
Level 1: The Quick Pass
At the most basic level, a code review is a quick scan for obvious issues. The reviewer isn’t necessarily expected to have a deep functional understanding of the code or the broader technical landscape. Instead, the focus is on the immediate vicinity of the changes — looking for bugs, style violations, or evident problems with the logic.
In a well-structured organization, automated CI tools should catch linting errors and enforce code standards. But in case they don’t, this is still an area the reviewer can flag. Additionally, the reviewer checks for consistency with the existing codebase, adherence to language idioms, correct naming, appropriate commenting, and reasonable extensibility.
Level 2: The Technical Dive
At this level, the reviewer goes beyond surface-level checks and develops a full mental model of the presented code. Now, the review covers aspects like:
- Comprehensive testing to ensure reliability and ease of future refactoring.
- Bug-free, crash-resistant behavior.
- Security against potential malicious usage.
- Performance, including handling expected loads.
The reviewer may also pull the branch locally and manually test the code to verify its behavior.
Level 3: The Functional Overview
In the final stage, the reviewer gains a complete understanding of the feature from a functional standpoint. This involves reading the relevant specs, tickets, and taking into account any meetings that shaped the feature. The goal here is to ensure the feature passes QA, meets user expectations, and delivers the intended value. Additionally, the reviewer confirms that the user-facing documentation is up-to-date.
As you can see, the scope of a code review can range dramatically depending on the team or organizational culture. It’s always worth checking in with your colleagues to understand what’s expected of you as a new member of the team.
By Thomas Martin
Follow me or comment