Contents
What is the purpose of code review?
Code review helps give a fresh set of eyes to identify bugs and simple coding errors before your product gets to the next step, making the process for getting the software to the customer more efficient. Simply reviewing someone’s code and identifying errors is great.
How do I improve my code review?
10 tips to guide you toward effective peer code review
- Review fewer than 400 lines of code at a time.
- Take your time.
- Do not review for more than 60 minutes at a time.
- Set goals and capture metrics.
- Authors should annotate source code before the review.
- Use checklists.
- Establish a process for fixing defects found.
Where can I do a good code review?
Nearly any healthy programming workflow will involve code review at some point in the process. This may be a Pull Request on GitHub, a Differential Revision on Phabricator, a Crucible Review on Atlassian, or any number of other review tools. But however you do it, not all code reviews are created equal.
What should be included in a code review checklist?
Code review checklists are not only something for the code reviewers. Instead, as the author of the code change, follow the code review best practice and be your own reviewer first! So, before sending out the code for review, make sure that:
What’s the purpose of commenting in a code review?
The purpose here is to test the code outside of the automatic unit tests; in short, you’re testing what the CI cannot test. If this doesn’t apply, and there is truly nothing to manually test, don’t waste your time. Commenting matters.
How many lines of code can you review at a time?
If you try to review too many lines of code at once, you’re less likely to find defects. Try to keep each review session to 400 lines or less. Setting a line-of-code (LOC) limit is important for the same reasons as setting a time limit. It ensures you are at your best when reviewing the code.