paint-brush
What to do When You're Tired of Slow Code Reviewsā€‚by@dawchihliou
604 reads
604 reads

What to do When You're Tired of Slow Code Reviews

by Daw-Chih LiouDecember 6th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

šŸŽ Learn how to accelerate the code review process to maximize your productivity šŸ”¬Ā Learn the best practices I came across for code reviewers āœļøĀ Learn the best practices I came across for pull request authors

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - What to do When You're Tired of Slow Code Reviews
Daw-Chih Liou HackerNoon profile picture


TL;DR

  • šŸŽ Learn how to accelerate the code review process to maximize your productivity
  • šŸ”¬Ā Learn the best practices I came across for code reviewers
  • āœļøĀ Learn the best practices I came across for pull request authors

Imagine this.


You just implemented a feature and wrote all the test cases. You felt great about the code so you opened a pull request and let your coworkers know. After days passing by, your pull request looked exactly the same as before. Seemingly untouched. No comment. No change request. You asked your coworkers again for code review and they agreed. Another week went by and nothing happened. You asked again and they told you that they needed more time because it wasn't a small PR and there was a lot to take into consideration.


Finally, you saw a notification about a change request and you jumped on it right away. After resolving merge conflicts and fixing the edge cases, you requested a review again, and waited. Another change request appeared after a few days and you repeated the process again. You got an approval after another revision and the PR was finally merged to the trunk.


After 4 weeks since you opened the PR.


If you can relate to it, you're not alone. Many teams experienced such a slow code review process. In fact, it'sĀ Ā in the development cycle. So I want to share with you the best practices of code review I learned to speed up the development and help you ship code faster.


Let's go.

For Pull Request Authors

The number one thing I've learned to boost code review productivity is to be thoughtful as an author. Other than producing clean code, there are many small things you can do to help your reviewers understand your pull requests proactively.

Be The Driver

You, the author, are the driver of the pace. Knowing that you rely on your coworkers during the code review process, you can clearly communicate theĀ whenĀ andĀ whatĀ upfront to align expectations.


TheĀ whenĀ is the most important to communicate because it tells your reviewers how urgent it is. The reviewers can plan their work accordingly. It's a great way to set aĀ Ā for the review process, and it's also a great way to show respect to your coworkers' time.


To communicate theĀ what, make sure you include a PR description that focuses on helping your reviewers understand the purpose and code design of your changes. Instead of listing functionalities, start with an opening paragraph explaining the background and why this PR is needed helps the reviewers to build theirĀ . Other descriptions I find very useful are:

  • Code design diagrams: aĀ Ā helps the reviewers toĀ Ā and react quickly to your pull request.
  • Acceptance Criteria: a list of simple sentences likeĀ Ā helps the reviews look for missing functionalities and test cases.

Keep It Concise

Small, laser-focused pull requests are the easiest to read. How small? Google Engineering Practices sayĀ .Ā Ā has shown that the code review quality decreases as the code change increases. The longer your reviewers review at a time, the less defects they catch. So it's important to keep your pull request small and focus on one thing. If the feature you're developing is too large, you can consider splitting it into multiple pull requests using theĀ Ā technique.

It replaces a large pull request with a sequence of small pull requests. It helps the reviewers to focus on one thing at the time and aligns brilliantly with the principal ofĀ .

For Code Reviewers

Be Mindful about Biases

AĀ Ā found that pull request authors faced different levels of pushback that varied depending on the authors' demographics. According to data, theyĀ Ā that


  • Women faced 21% higher odds of pushback than men
  • Black+ developers faced 54% higher odds than White+ developers
  • Latinx+ developers faced 15% higher odds than White+ developers
  • Asian+ developers faced 42% higher odds than White+ developers
  • Older developers faced higher odds of pushback than younger developers


We should be more mindful about the unintentional biases, especially in a diverse workplace. By being aware of it, we can avoid unnecessary pushback in code reviews and help accelerate the process.

It's A Great Place for Learning, Not Snob

Regardless of your level of experience, working as a developer is about constant learning. Pull request is an invaluable "marketplace" for developers to communicate and exchange feedback. So make sure it's a place of respect and alwaysĀ .

For me it has always been an amazing occasion to learn about domain knowledge. Take my PR inĀ , I learned so much aboutĀ Ā from aĀ Ā member. If he was to dismiss my requestĀ , the teaching moment would have never exist.

Inaction Is Bad

I read about a blog post titledĀ Ā by a tech lead at Instagram a year ago. He claimed that an effective code review consist of

  • decisive action ASAP
  • aiming to reduce the cost of mistakes
  • demanding small pull request and move fast


What I found refreshing in his approach is thatĀ not acting on a pull request is not an option. It minimizes the lead time to review and it has been very beneficial to me and my team. We are able to ship fast because we take proactive actions to code review. We don't let pending pull requests linger and we review with our business cases in mind.

Final Thoughts

To recap the best practices of pull request and code review to accelerate your development cycle
  • establish clear communication about theĀ whenĀ andĀ whatĀ of a pull request
  • create small and self-contained pull request that focus on one thing
  • be mindful about biases
  • be respectful to the author and fellow reviewers
  • take decisive review action as soon as possible

References

  • Ā - Emerson Murphy-Hill, Ciera Jaspan, Carolyn Egelman, Lan Cheng
  • Ā - Emerson Murphy-Hill, Research Scientist, Central Product Inclusion, Equity, and Accessibility
  • Ā - SMARTBEAR
  • Ā - Google
  • Ā - Dr. Michaela Greiler
  • Ā - Reddit
  • Ā - Reddit
  • Ā - Wikipedia
  • Ā - James Clear
  • Ā - GitHub
  • Ā - Google
  • Ā - Nathan Donaldson
  • Ā - Daw-Chih Liou
  • Ā - GitHub
  • Ā - Ecma International
  • Ā - GitHub
  • Ā - Reddit
  • Ā - Bobi
  • Ā - Caitlin Sadowski, Emma Sƶderberg, Luke Church, Michal Sipko. Google, Inc.

Also Published

Want to connect? This article was originally posted on .

ė°”ģ¹“ė¼ģ‚¬ģ“ķŠø ė°”ģ¹“ė¼ģ‚¬ģ“ķŠø ģ˜Øė¼ģøė°”ģ¹“ė¼