Code review ensures that Code Quality is an important part. Its main work is:
1. Discover bugs in the Code;
2. Check the code quality from the perspective of code maintainability and scalability, and propose suggestions for modification.
1. bugs in the Code mainly appear in the following two places:
(1) bugs unrelated to business logic.
For example, the stream, file, and connection opened in the system are not closed in time, thread safe problems exist, or the performance is low, this type of problem is easy for experienced developers to find.
2. Bugs related to business logic.
This type of bug is very concealed. If someone unfamiliar with the product participates in the project development of the product, such bug may easily occur. To avoid such bugs, apart from providing detailed descriptions in use case and test case to guide developers correctly and discovering them in time during testing, code review is also an indispensable guarantee.
We hope that the Code reviewer will be very familiar with the product.
3. Who should take the code reviewer?
(1) familiar with related business logic.
(2) rich programming experience.
Both are indispensable.
4. Code review steps. These are my daily work experience and I am still working on this step.
(1) The code writer and the code reviewer sit together, and the code writer will explain the Code and related logic they are responsible for in sequence according to the UC, from the web layer to the DaO layer;
(2) code reviewers can raise their own questions at any time during this process, and actively discover hidden bugs. these bugs are recorded.
(3) After the code is explained, the Code reviewer arranges several hours for the code review.
The Code requires a line of calm. At the same time, the Code should be fully viewed to ensure excellent overall design of the Code.
(4) The Code reviewer prepares the "Code Review Report" based on the review results, and records the problems found in the "Review Report" and the modification suggestions, then, send the "Review Report" to relevant personnel.
(5) The code editor should modify the code according to the modification suggestions provided in the "Code Review Report". If the code is unclear, it can be actively submitted to the Code reviewer.
(6) Give feedback after the code writer fix the bug.
(7) The Code reviewer updates valuable issues found in the Code review to the "Code review specification" document, you can send a group email to all technical staff for particularly noteworthy issues.
5. Responsibilities:
Code writers and code reviewers are jointly responsible for the quality of the Code. In this way, we can ensure that the Code review is not a pass, where the code writer assumes the primary responsibility, and the code reviewer assumes the secondary responsibility.
6. documents required for code review:
Code review specification document: records the standards that the Code should follow. The Code reviewer codes the review code based on these standards, and constantly improves this document during the code review process.