The Art of Software Testing - Study Notes

Software testing is the process of executing a program to find bugs

Black Box Testing: Exhaustive Input Testing
White Box Testing : Exhaustive Path Testing

Important principles of software testing:
Checking if a program "doesn't do what it's supposed to do" is only half of testing, the other half of testing is to check if a program "does what it shouldn't do"

Principle 1: A required part of the test case is the definition of the expected output or result. The
test case includes:
1. A description of the input data of the program 2. An accurate description
of the correct output result of the program under the above input data . Principle 5: Test cases should be written based not only on valid and expected input, but also on invalid and unexpected input. Main manual testing methods: code inspections, walkthroughs, and usability testing



Summary of code inspection error list (you can refer to the usual code review)

data reference error

1. Are any referenced variables unassigned or uninitialized?
2. Is the value of the subscript within the range?
3. Are there non-integer subscripts?
4. Are there virtual calls? (Is the memory unit referenced by either a pointer or a reference variable allocated)
5. Do the attributes of the record and structure match?
6. Is there a "just one difference" error for indexing or subscripting? (The array starts from 0)
7. Are all inherited functions defined?


Operation error

1. Are there operations between non-arithmetic variables?
2. Is there a mixed-mode operation? (int/float)
3. Are there operations between variables of different word lengths?
4. Is the size of the target variable smaller than the assignment size? (It always refers to the length or range of values, int and long)
5. Does the intermediate result overflow (up and down)?
6. Is there a division by 0?
7. Does the value of the variable exceed a meaningful range? (The number of int types is greater than 32)
8. Is the precedence order of operators correctly understood? (2*i/2==i? If i is odd? If division is performed first?)
9. Is integer division correct?


data declaration error

1. Are all variables declared? (int a)
2. Is the default property understood correctly? (in java)
3. Is the initialization of arrays and strings correct?
4. Are the variables assigned the correct length, type and storage class?
5. Is the initialization consistent with the storage class?
6. Are there similar variable names? (usually warning)


comparison error

1. Are there comparisons between variables of different types?
2. Is there a mixed-mode comparison operation?
3. Are the comparison operators correct? (At most, least...)
4. Is the boolean expression correct? (AND-OR is not correctly expressed in C++, && ||!)
5. Is the operand of a boolean operator a boolean type? Are comparison operators and Boolean operators wrongly mixed? (2>x>1 => x<2 &&x>1)
6. For expressions that contain more than one Boolean operator, is the assignment order and operator precedence order? correct?
7.! ! Does the way the compiler evaluates boolean expressions has any effect on the program? (if((x==0 && (x/y)>z) may cause a division by 0 error!!)


control flow error

1. Are all loops terminated eventually?
2. Does the program, module, or subroutine eventually terminate?
3. Is it possible that the loop body has never been executed because the actual situation does not satisfy the entry condition of the loop? (Is there any omission here?)
4. If the loop is controlled by both the iteration variable and the boolean condition, if the loop is out of bounds??
5. Is there an error that is only one difference, off-by-one?
6.! Are there inexhaustible judgments?


interface error

1. Is the amount of formal parameters received by the called module equal to the amount of actual parameters sent by the calling module? Is the order correct?
2. Do the properties of the actual parameter (type and size) match those of the corresponding formal parameter?
3. If the built-in function is called, is the number, attributes, and order of the actual parameters correct?
4. Does a subroutine change a formal parameter that was only an input value?
5. If there are global variables, are their definitions and properties the same in all modules that reference them?


input/output error

1. If the file is explicitly declared, are its attributes correct?
2. Are the settings of the attributes in the statement to open the file correct?
3. Does the format specification match the information in the I/O statement? (attribute)
4. Is there enough free memory space to hold the file that the program will read?
5. Are all files opened before use?
6. Are all files closed after use?
7. Whether to judge the condition of the end of the file and handle it correctly? (EOF)
8. How to correctly handle the I/O error situation?
9. Does the program handle errors like "File Not Found" correctly?


other checks

1. Is the program or module robust enough? (legality of input)
2. Does the program miss a function?
3. If the program is compiled and passed, but the computer provides one or more "warning" or "prompt" information, it should be carefully checked one by one. "Warning" messages indicate that the compiler doubts the correctness of certain operations in the program; "hint" messages may list variables that are not declared, or usages that are not conducive to code optimization.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326315834&siteId=291194637