The Linus’ Law principle — “given enough eyeballs, all bugs are shallow” — underlying all of these efforts has proven effective in catching defects1 prior to QA or production releases. It is also an efficient way to promote knowledge sharing on development teams, which increases consistency and decreases overall ramp-up time for development team members. A recent study indicated that peer review led to knowledge sharing increases from 66-150%2.
Peer Code Review may focus on:
- Functional Correctness - A peer review is the first opportunity for another individual to validate that the acceptance criteria of a user story has been met. In particular, there are often easily overlooked edge cases that can be caught during a review.
- Coding Standards - When an organization has coding standards such as formatting style, naming conventions, etc., a peer review can present an opportunity to ensure consistency with established patterns.
- Architecture/Organization - A code review may uncover departures from established coding patterns that should be corrected, which leads to suggestions for better code reuse or prompt refactoring activities as a code base evolves with changing business functionality and requirements. Regular reviews across team members builds a shared understanding of what “fits” the code base.
- Unit Tests - While unit tests should be run prior to a code review by the developer whose code is going to be reviewed, the review may lead to suggestions for improving/updating existing unit tests or adding new ones, which contribute to overall stability and confidence in regular releases.
An ongoing peer review process should enhance the knowledge and mutual trust of each participating team while improving the quality of code delivered to QA.