In the Software Development process, code review is one of the major processes. It plays a vital role in developing quality software and reducing human errors.
What is Code review?
Code review is also referred to as peer review. It is a part of the software quality assurance process which involves examining the source code to identify bugs at an early stage. A code review process is typically conducted before merging to the mainline branch.
The main purpose of the code review process is to maintain the code quality (Readable, Maintainable, and Extensible) and write bug-free software programs.
Who is involved in a code review?
In the code review process, at least two roles are always present in a team. A developer who writes code and creates Pull Request (PR) is referred as an “author” and the developer(s) who examines the quality of code is referred as “Reviewers”.
When code review should be done?
Actual code reviews should be done after all the automated checks are performed and Right before the working branch is merged with the main branch (Source code).
What Do Code Reviewers Look For?
According to Google’s Engineering Practices documentation, code reviews should look at the following things:
- Design: Is the code well-designed, appropriate, and efficient?
- Functionality: Does code meet the requirements and behave as the author likely intended?
- Complexity: code is easy to read, understand, and use? Could the code be made simpler?
- Tests: Does the code cover automated tests for each function?
- Name: Are names for variables, classes, methods, etc. clear and followed proper naming conventions?
- Comments: Are the comments clear, useful, and at a proper place?
- Style: Does the code follow proper coding standards or guidelines
- Documentation: Does have proper documentation for API?
What are the benefits of code review?
Code review provides a large number of benefits for a company dealing with code development as well as software developers. It’s advantages are extended beyond finding errors and fixing them. Let’s dive deep into the advantages of code review,
1. Knowledge Sharing
2. Train new Developers
3. Consistent Development Process
4. Team cohesion
5. Higher Quantity Code and cost reduction