Purpose:
The main purpose of code review is to view each otherCodeTo ensure the code quality, at least ensure that the code quality is relatively high when it is handed over to testers. This is only one of the main functions of code review. In fact, code review can also help beginners learn the code style and programming ideas of experts and quickly improve their programming capabilities.
Task:
In fact, code review mainly checks whether the Code has the following problems: code consistency, coding style, code security issues, code redundancy, correct design to meet requirements (performance, functions, and so on). The specific content is as follows:
- Completeness)
Whether the Code fully meets the functional requirements in the design document
Whether the code has been integrated and debugged according to the design document
Whether the Code has created the required database, including the correct initialization data
Is there any variable, constant, or data type that is not defined or referenced in the code?
-
- Consistency)
Whether the code logic complies with the design document
Are the formats, symbols, structures, and other styles used in the Code consistent?
-
- Correctness)
Whether the Code meets the standards
All variables are correctly defined and used.
All comments are accurate.
AllProgramThe call uses the correct number of parameters.
-
- Modifiability)
Whether the constants involved in the Code are easy to modify (such as using configurations, defining them as class constants, and using specialized constant classes)
Whether the Code contains a cross description or data dictionary to describe how the program accesses variables and constants.
Whether the Code has only one exit and one entry (except for serious exception handling)
- Predictability)
Does the development language used by the Code have well-defined syntax and semantics?
Whether the code avoids relying on the default features provided by the development language
Whether the code is accidentally in an endless loop
Does the code avoid infinite recursion?
-
- Robustness)
Does the Code take measures to avoid runtime errors (such as array boundary overflow, Division by zero, out-of-bounds value, stack overflow, etc)
-
- Structuredness)
Does each function of a program exist as a recognizable code block?
Does a loop have only one entry?
-
- Traceability)
Does the code uniquely identify each program?
Is there a cross-reference framework that can correspond to each other between code and development documents?
Indicates whether the Code contains a revision history. The changes and causes of the Code are recorded.
Are all security functions identified?
- Comprehension check (understandability)
Whether the annotation is clear enough to describe each subroutine
Whether to use ambiguous or unnecessary complex code and whether they are clearly annotated
Use unified formatting techniques (such as indentation and white space) to enhance the definition of code.
Whether the naming rules are easy to remember and reflect type
Each variable defines a valid value range.
In the codeAlgorithmWhether it meets the mathematical model described in the development document
-
- Verifiability)
Is the Implementation Technology in the code easy to test?