WEEK2 Code Review

Source: Internet
Author: User

Code review

http://blog.fogcreek.com/increase-defect-detection-with-our-code-review-checklist-example/

This blog describes the "code Review Checklist" approach, which allows software developers to efficiently review code.

The following is an enumeration of typical review indicators:

Code Review Checklist

General (generic indicator)

    • Does the code work correctly? Whether the expected function can be achieved, the logic is correct, and so on.
    • Are all the codes easy to understand?
    • Does it conform to your code specifications? Usually includes the position of parentheses, the names of variables and functions, the length of each line, the format, and the comment.
    • Are there some redundant or duplicated code?
    • Is it as modular as possible?
    • Can global variables be overridden?
    • Is there some code that is commented out?
    • Is the length of the loop structured? Does the loop have the correct termination conditions?
    • Is there any code that can be replaced by a library function?
    • Can I delete any log records or debug code?

Security (Secure)

    • Are all input data checked (checked for correct format, length, type, range, etc.) and encoded?
    • Where are the third-party programs used, and are all the returned error messages captured?
    • Does the output value pass the test and encode correctly?
    • is invalid parameter value processed?

Documentation (document)

    • Is there a document to interpret the code?
    • Do all the functions have a plus spec?
    • Do you describe unusual behavior or the handling of boundary conditions?
    • Is there a record of the use of third-party functions?
    • Are the data structures and units of measure explained?
    • Is there an incomplete code? If so, should it be a suitable tag such as "To do" for deletion or tagging?

Testing (TEST)

    • Is the code testable? That is, whether to add too many hidden dependencies, whether the object can be initialized, the test framework can use methods, etc.
    • Does the test exist? And does it do a full coverage?
    • Does the unit test test to see if the code can achieve the expected functionality?
    • Does the array check for cross-border conditions?
    • What test code can be replaced with an existing API?

The checklist of code review needs to be set by the development team according to the specific needs of the project, and it needs to be adjusted more often, so that the consistency of the code review can be ensured, thus improving the quality of the code. Also note that code review can improve the programmer's code quality in the psychological level, and it is very important for team development.

WEEK2 Code Review

Related Article

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.