Image for post
Image for post

How to Become a Code Review Ninja

Code reviews are a vital part of the modern software development life-cycle. Tools like Github, Gitlab, and others have made the code review process easier to facilitate than ever before. Online static analysis tools like Codacy, LGTM, and others can provide additional feedback right in a pull request with just some configuration. Many companies — including where I currently work, Bandwidth — even require a minimum number of reviewers to approve before merging to the mainline.

Learn to LOVE Reading Code

I don’t know about you, but I love reading code. I’m not kidding or exaggerating — sometimes I wish I was. When I get an email to review another pull request, I get super excited to spend an hour or so reading someone else’s changes.

👉 Code Style

I’ve seen more time wasted on code style in a PR than any other. Get together and pick a style (they are plenty out there already to use as starts), add a linter, and move on.

👉 Naming Conventions

This could be rolled up into Code Style as well, but I’ve always seen these two ideas as separate. Either way, agree on the naming for your classes, variables, methods, etc. Especially pay attention to things like acronyms or abbreviations (for example, whether to use Id, ID or id).

👉 Testing Requirements

Make sure everyone understands the level of testing expected for your project. It’s a terrible feeling to spend time working really hard on a story, submit a PR, and be told you need to add tests before you can move forward (which should happen b.t.w). If your team is doing TDD, this should really be a non-issue.

User Story Requirements

Make sure your team agreed upon the requirements before it was even picked up. This should go without saying, but its a crucial and overlooked step. As a reviewer, make sure to re-read the story before reviewing code instead of making assumptions. As I get into in the section below, code reviews are about understanding. That also means you need to understand what the story is doing vs what the story is requiring it to do.

Code Reviews Aren’t About Finding Bugs

There are articles and articles that show that code reviews are effective means to detect and triage bugs before release. However, I would argue that isn’t the point of a code review. Instead, I believe that finding bugs in someone’s code is really a side-effect of a good code review; not that other way around.

Jesus follower | husband | IJM advocate | software engineer. I share tips and tools for building great software as a team.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store