Software Engineering - Software Testing Methods

Software testing is the final review of software requirements analysis, design specifications and coding before the software is put into productive operation, and is a key step in software quality control.

The software development process is a top-down and gradually refined process, while the testing process is a bottom-up and gradually integrated process arranged in the opposite order.

1. White box testing and black box testing

Black box testing: Knowing the functional design specifications of the product, it can be tested to prove whether each implemented function meets the requirements.

White box testing: Knowing the internal working process of the product, it can be tested to prove whether each internal operation meets the design specification requirements and whether all internal components have been checked.

Software testing has a fatal flaw, that is, incomplete and incomplete testing.

2. Test case design for white box testing

Logic coverage is a technique for designing test cases based on the internal logical structure of the program, which belongs to white box testing

Logic coverage can be further divided into: statement coverage decision coverage decision-condition coverage condition combination coverage path coverage

Program segment example

Statement coverage is to design several test cases and run the program under test so that each executable statement is executed at least once. Statement coverage is the weakest logic coverage criterion.

Decision coverage is to design several test cases and run the program under test so that the true and false branches of each judgment in the program are experienced at least once. Decision coverage is also called branch coverage.

Condition coverage is to design several test cases and run the program under test so that the possible values ​​of each condition in each judgment in the program are executed at least once.

Decision-condition coverage is to design enough test cases so that all possible values ​​of each condition in the judgment are executed at least once, and all possible judgment results of each judgment itself are executed at least once

Condition combination coverage is to design enough test cases and run the program under test so that all possible condition value combinations of each judgment are executed at least once.

Path testing is to design enough test cases to cover all possible paths in the program. If we still take the original diagram as an example, we can choose a group of test cases as follows to cover all the paths of the program segment.

The basic path test is based on the program control flow graph, by analyzing the complexity of the loop of the control structure, and deriving the basic executable path set, so as to design the test case method

3. Test case design for black box testing

Equivalence class division is a typical black-box testing method, and it is also a very practical and important testing method. It is used to solve how to select an appropriate subset to find as many errors as possible.

The so-called equivalence class refers to a subset of an input domain. In this subset, the individual input data are equivalent for uncovering errors in the program, and it is reasonable to assume that testing a representative value of some equivalence class is equivalent to testing other values ​​of this class.

There are two different cases of division of equivalence classes:  

(1) Effective equivalence class: refers to the set of input data that is reasonable and meaningful for the specification of the program. Using it, you can check whether the program implements the functions and performances specified in the specification.

(2) Invalid equivalence class: It refers to a collection of input data that is unreasonable and meaningless for the specification of the program. Programmers mainly use this type of test cases to check whether the implementation of functions and performance in the program does not meet the requirements of the specification. When designing test cases, consider both the design of valid equivalence classes and the design of invalid equivalence classes.

Boundary value analysis is also a black-box testing method, which is a supplement to the equivalence class partitioning method. People know from long-term testing work experience that a large number of errors occur on the boundaries of input or output ranges, rather than inside the input range. The boundary mentioned here refers to some specific situations that are slightly higher than the boundary value and slightly lower than the boundary value of the input equivalence class and the output equivalence class.

Guess you like

Origin blog.csdn.net/TAO1031/article/details/128180280