Member-only story
3 Best Practices for Excellent Code Review
What Makes a Pull Request Review Effective
This article explains how to do a code review, so that a high number of code defects is uncovered during review process. Then you don’t need to fix so many bugs in production 🥳
Background
Recommendations in this article are based on the largest case study on code review process ever done.
The study took place at Cisco, where they analyzed 2500 code reviews consisting of 3.2 million lines of code written by 50 developers.
Findings of the study are interesting and very practical because the reviewed code was written for commercially-available software at Cisco, not just some hello-world apps in laboratory conditions.
What Makes a Code Review Effective
TL;DR
For the most effective code review:
- Pull requests should have less than 400 changes, ideally less than 250.
- You should not review more than 500 changes at a time, ideally less than 300.
- Pull requests should be annotated by authors before they’re reviewed.