Once you implement a feature and before you commit the code to the source code system it is common to have the code reviewed by your teammates. The goal of the code review is to make sure that the code meets the expectations of functionality, design, test coverage, and style.
- On functionality, the reviewer should make sure that you implemented expected features that act in a way consistent with the overall design. This catches misunderstanding and prevents potential bugs.
- On design, the reviewer should verify that the code meets the design of the product or the module. The reviewer will mostly here focus on the API and how they meet the design specifications or fit with the existing or planned code.
- On test coverage, the reviewer will review the tests added or modified to cover the new code and that they properly exercise the new logic introduced.
- On style, the reviewer will make sure that you followed the agreed-upon coding style and best practices of the programming language used.
Require that every code change goes through a code review before commit to the source control system. Many software development tools provide automated flows for code reviews. Automating the code review process makes it easy to use and prevent issues from slipping. On a basic level, a code review system will:
- allow the reviewer to see the difference between the code before and after the change.
- allow the reviewer to enter comments on line or file bases and for the coder to respond to these comments.
- keep track of the different iterations of the change so the reviewer can quickly see if the developer addressed the comments.
Having code review as a requirement and relying on an automated process to perform it will give you all the benefits and make the process as efficient as possible.