Code Review Best Practices
Code Review Best Practices
Everyone
Document and standardize theTIP Right-click
code on a topic to mark it as done. Learn more.
review process.
Provide adequate time for code reviews and ensure that it is a priority.
Recognition and rewards for those with track record of quality feedback.
Hold regular code review sessions to discuss broader trends or issues that arise during the review process.
Encourage authors to seek feedback during development before submitting a formal code review.
Take notes on any questions or concerns about the change to discuss them during the review.
Author
Review your code before submitting for review.
Ensure that the changes are complete and ready for review, including all necessary tests and documentation.
Verify that the code change has been properly tested in a development environment.
Double-check that the code adheres to the project's coding standards and best practices.
Identify any potential performance, security, or scalability concerns and note them for discussion during the review.
Make sure to add proper title, description, any screenshots, relevant links, configuration changes etc in the PR.
Approach the review process with an open mind, and be willing to learn from and collaborate with other team members.
Understand the requirements and the context in which change was made. Reviewer
Based on the requirements, prepare a list of items that should have been covered in the changes.
Ensure that you understand the codebase and its architecture.
Approach the process with an open mind; be willing to provide constructive feedback and collaborate to improve code quality
Consider the overall quality of the code, including readability, maintainability, and scalability.
Determine the appropriate level of review needed based on the scope and impact of the code change.
Be willing to collaborate with the author to resolve any issues or concerns that arise during the review process.
Reviewer
Be respectful and professional in your feedback, avoiding personal attacks or derogatory comments.
Provide clear and actionable feedback, including specific suggestions for improvement and explanations of any concerns.
Identify any potential performance, security, or scalability concerns, and discuss them with the author.
Team wide styleguide is the absolute authority styling. Verify changes against those instead of personal preferences
Leave comments to suggest improvements, but prefix it with "Nit" if it's not critical to meeting the standards
Provide positive feedback in addition to constructive criticism, to reinforce good practices and boost team morale.
Address all the feedback received, including any concerns or questions raised.
Author
Implement the suggested changes and provide explanations where needed.
Run the tests and ensure that they all pass after making changes
Seek feedback from other team members if you are unsure about the changes.
Reviewer
Resolve conflicting opinions in a timely manner; don't let a PR sit around due to disagreement.
Verify that all the feedback has been addressed by the author.
Review the updated code and ensure that the suggested changes have been implemented as expected.
Run the tests again and ensure that they all pass.
Monitor the performance and functionality of the code change and address any issues that arise.
Celebrate the successful completion of the code change!
Keep Shipping
Community
roadmap.sh is the 6th most starred project on GitHub and is visited by
hundreds of thousands of developers every month.
roadmap.sh by @kamrify
Community created roadmaps, articles, resources The leading DevOps resource for Kubernetes,
and journeys to help you choose your path and cloud-native computing, and the latest in at-scale
grow in your career. development, deployment, and management.