Why code review?

Source: Internet
Author: User
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:

  1. 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?
  2. Consistency)
    Whether the code logic complies with the design document
    Are the formats, symbols, structures, and other styles used in the Code consistent?
  3. 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.
  4. 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)
  5. 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?
  6. 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)
  7. Structuredness)
    Does each function of a program exist as a recognizable code block?
    Does a loop have only one entry?
  8. 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?
  9. 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
  10. Verifiability)
    Is the Implementation Technology in the code easy to test?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.