Method of writing test cases-boundary value analysis method (study notes)

Preface The
previous blog introduced a commonly used method of writing test cases-equivalence class division method. And the "boundary value analysis method" introduced today.

Defining the
boundary value analysis method is a black box test method for testing the boundary value of the input and output, which is a supplement to the equivalence class analysis method.

Experience has shown that test cases that consider boundary conditions have a more reliable test return rate than other test cases that do not consider boundary values. The so-called boundary conditions refer to those states in the input and output equivalence classes that are at or beyond the boundary, or below the boundary. -"The Art of Software Testing"

Although the boundary value analysis method is an equivalence class division method, there are differences between the two methods.

The equivalence class division method can select any data in the equivalence class range as a representative, while the boundary value analysis method requires each boundary value as a test condition.

The boundary value analysis method not only considers the input conditions, but also considers the test conditions generated by the output.

Application scenarios
As long as there is a data output scenario, the boundary value analysis method can be used. The general boundary value analysis method and the equivalence class division method are used together to form a set of complementary test programs.

How to use
Find the dividing point (maximum and minimum) between valid data and invalid data, and test the dividing point and the values ​​on both sides separately. 
Note: The boundary value essentially belongs to the category of equivalence, but it needs to be tested separately. This redundancy is necessary.

Optimization of test cases
1. Effective equivalence classes or boundary values ​​of different controls can be tested in the same test case as much as possible. Effective equivalence classes or boundary values ​​of different controls can be combined to reduce the number of tests. 
2. In a test case, only the invalid equivalence class or boundary value of one control is tested at the beginning, and invalid equivalence classes cannot be combined to avoid the occurrence of shielding. (After the previous error message appears, the following error message will not appear). Finally, consider the combination of invalid equivalence classes between different controls to test the stability of the system under extreme conditions.

Example The
example is a simple registration procedure as shown below: 

The requirements of the program are: 
1. Name: 1-20 characters, cannot contain numbers, and cannot be empty 
2. Age: an integer between 18 and 60, which cannot be empty 
3. If the information is correct, a prompt message will be given , And enter the corresponding registration information "xxx, age" in the "Registration Information" text box

According to the above requirements, the data analysis is as follows:

 

Guess you like

Origin blog.csdn.net/lwnicole_0102/article/details/87369553