[Individual Software Process] Defect Management - C ++ Code Review Guide and Checklist

zhaozj2021-02-16  47

Chapter 4 Defect Management

u What is a defect?

u Defect Find Technology

u code review

u Defect prediction

4.3 Code Review Table 4.4 C Code Review Guide and Checklist

purpose

Guide you to conduct a valid code review

#

#

#

#

Grand total

Grand total%

General description

After completing each review step, record the number of a type of defect found in the right is recorded. If this step does not find a defect, you will have a fork number (×) indicating the correct check in the column on the right. Before starting the next program, follow the checkpoints to check the programs, classes, objects, or methods.

Integrity

All functions of the verification design have been encoded.

Includes

Verify that the include statement is complete.

initialization

Check the initialization of variables and parameters:

¨ The beginning of the program;

¨ The beginning of each cycle;

¨ In the entrance of the function / process.

transfer

Check the format of the function call:

¨ pointer;

¨ ¨;

usage of.

first name

Check the spelling and use of the name:

¨ Do you agree?

¨ Is it within the scope of the description?

¨ Whether the reference to the variable in the structure is used ".".

String

Check all strings:

¨用 Use the pointer to represent;

¨ is the end of NULL.

pointer

Check all pointers:

¨ is initialized to NULL;

¨ Is there after New (new) before delete;

¨ 要 Be deleted after New and use it.

Output format

Check the output format:

¨ Will the wrap are appropriate;

¨ Is the interval is appropriate.

{}Correct

Ensure check {} is appropriate and

Logical operator

Verify ==, =, || logical operator is used properly;

Checking () for each logic function is appropriate.

Progressive examination

Check each line of code:

¨ Is the syntax of the instruction correct?

Is the punctuation correct?

Is the symbol correct?

standard

Ensure that all codes meet the coding standard.

Opening and close file

Verify all files:

¨ is the right statement;

¨ is the right opening;

¨ is a suitable close.

Comprehensive inspection

A comprehensive examination of the entire program has been discovered system problems and non-desired issues.

total

Regularly update the checklist. Over time, check the table naturally becomes large. However, the main role of checklists is to help you focus on key aspects. After too big, you will lose your focus. So to review the defect data regularly, delete the entries that cannot find the problem.

From a personal checkpoint method, you can realize that each engineer has its own characteristics, and an engineer's practical experience is not necessarily applicable to others. Therefore, it is necessary to design a checkpoint suitable for you, and check it regularly to ensure that the checkpoint is more efficient. As long as you miss the shortcomings in the code review, you must constantly find ways to improve checklists.

转载请注明原文地址:https://www.9cbs.com/read-24612.html

New Post(0)