The fourth chapter of software engineering

Source: Internet
Author: User
1. Code Writing Specification:

(1) The code should not only be efficient enough to reduce redundancy, but also be easy for the collaborators to read in order to work more efficiently in the process of cooperation. And the name should try to avoid the ambiguity;

(2) in the process of writing, should develop the habit of writing blank {}, pay attention to the branch;

(3) Underscores are generally used for scopes and variables;

(4) Use Pascal and Camel form to name, distinguish function and variable;

(5) Note should be placed in the function head, try to use only ASCII characters;

2. Code Design Specifications:

(1) function to do one thing;

(2) The program logic is clear and understandable;

(3) Use Assert assert to determine the correct response of the program, if (), else if () to handle possible errors, else for the error test to continue after the operation of the program;

(4) for the simple data type, as far as possible without the class transfer, the application pointer pass;

(5) Public/protected/private members are described in order (do not mix together);

(6) Only if it is necessary to customize the operator, only use type inheritance;

3. Code review:

(1) The most basic method of review in software engineering is peer review. For the critical code, we have to ask more than one person to do the code review.

(2) Review to find errors: coding errors, logic errors, algorithmic errors, potential errors, and regression errors.

Review can also find areas for improvement, familiarity with code, learning knowledge

(3) Code review steps:

"1" by compiling;

"2" Programmer tested the code, you can add OutputDebugString monitoring program flow;

"3" programmers provide the latest code, and file diff analysis Tools (git should now be able to do);

"4" When facing the review, the reviewers actively put forward their views;

"5" to get a satisfactory response to all questions;

"6" Code to consider future updates, maintenance leave room;

After the "7" code review: Correct the obvious error, record the error that cannot be corrected temporarily;

(4) Establish a verification form for code review;

4. Pair Programming:

(1) Pairing programming pay attention to role assignment, role exchange, recording forecast and actual time;

Summarize

In fact, this article is a very good writing standard.

The fourth chapter of software engineering

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.