Boundary value Analysis: the so-called boundary condition refers to those states in the input and output equivalence classes that happen to be at or above the boundary, or below the boundary. The important difference between the boundary value analysis method and the equivalence partition is that the boundary value analysis is in the state of equivalence dividing boundary or near the boundary, and one of the weaknesses of boundary value analysis and equivalence partitioning is that the combination of input conditions is not analyzed. They are different in two ways:
- Unlike selecting any element from an equivalence class as a delegate, boundary value analysis requires selecting one or more elements so that each boundary of an equivalence class is tested once.
- Instead of focusing on input conditions (input space), you also need to consider designing test cases from the result space (output equivalence class).
A general guide for designing test cases with the boundary value analysis method:
- If the input criteria specify a range of input values, the test case should be designed for the bounds of the scope, and invalid input test cases should be designed for cases that have just crossed out. Example: If the valid range of input values is -1.0~+1.0, then the test case should be designed for 1.0, +1.0,-1.001, +1.001;
- If the input criteria specify the number of input values, then the test case should be designed for the minimum number of input values, the maximum number of input values, and one less than the minimum quantity, which is more than the maximum number. For example, if an input file can hold 1~255 records, the test case should be designed according to 0, 1, 255, 256 records;
- Apply Guide 1 to each output condition to check the bounds of the result space. Because the bounds of the input range do not always represent the bounds of the output range (as in the case of trigonometric sin). Similarly, it is unlikely that the results will always produce more than the output range, but this possibility should be considered in any case;
- For each output condition, apply Guide 2, if an information retrieval system displays a summary of the most relevant information based on the input request, and the number of summaries never exceeds 4, the test case should be written to show 0, 1, and 4 summaries, and the test case should be designed to cause the program to display 5 summaries incorrectly;
- If the input or output of a program is an ordered sequence (for example, sequential files, linear lists, or tables), special attention should be paid to the first and last elements of the sequence;
- Also, play with intelligence to find other boundary conditions.
The Art of software Testing: Boundary value analysis