C Language Programming Specification--------9 Quality Assurance

Source: Internet
Author: User

(1) Build software quality in software design process.

(2) Code Quality assurance Priority principle:

① correctness, refers to the program to achieve the design requirements of the function.

② stability, security, refers to the program stability, reliability, security.

③ testability, refers to the program to have a good testability.

④ specification/readability, refers to the program writing style, naming rules, etc. to conform to the norms.

(3) Only refer to their own storage space. If the module package is good, then the illegal reference to other people's space generally does not occur.

(3) Prevent references to memory space that has already been freed. In the actual programming process, a little careless will appear in a module to release a block of memory (such as the C language pointer), and another module at some point in the subsequent use of it. To prevent this from happening.

(4) The memory allocated in the procedure/function is disposed before the procedure/function exits, and the file handle requested in the procedure/function (for opening the file) is closed before the procedure/function exits. The allocated memory is not freed and the file handle is not closed, which is a more common error and may occur with little attention.

(5) Do not misuse the goto statement. A goto statement destroys the structure of a program, so it is best not to use a goto statement unless you really need it.

C Language Programming Specification--------9 Quality Assurance

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.