Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Common values of boundary value analysis method
Common values of boundary value analysis method
Reflections on boundary value analysis;

Long-term test experience tells us that a large number of errors occur on the boundary of input or output range, not within the input and output range. Therefore, designing test cases for various boundary conditions can find more errors.

When using boundary value analysis to design test cases, we must first determine the boundary conditions. Usually, the boundary between input and output equivalence classes is the boundary that should be tested emphatically. We should choose the value just equal to, just above or just below the boundary as the test data, instead of choosing the typical value or arbitrary value in the equivalence class as the test data.

1) For 16-bit integer, 32767 and -32768 are boundaries.

2) The cursor on the screen is located in the upper left corner and the lower right corner.

3) The first and last lines of the report

4) The first and last elements of the array

5) The 0 th, 1 th, 2 nd and last time of the cycle.

5. Boundary value analysis

1) Boundary value analysis uses the same partition method as the equivalence class partition method, except that the boundary value analysis assumes that errors exist more on the boundary of the partition, so the test cases are designed on the boundary and both sides of the equivalence class.

Example: Test a function that calculates the square root.

-input: real number

-output: real number

-Specification: When a number of 0 or more is entered, its positive square root is returned; When a number less than 0 is input, an error message that the square root is illegal will be displayed-if the input value is less than 0, 0 will be returned; The library function Print-Line can be used to output error messages.

2) equivalence class division:

First, the following divisions can be considered:

A. input (i)

B. output (a)>=0 and (b) error

Two. There are two test cases:

A. input 4, output 2. Corresponding to (2) and (1).

B, input-10, output 0 with an error prompt. Corresponding to (i) and (b).

3) Boundary value analysis:

The boundary of division (ii) is 0 and the largest positive real number; The boundary of division (i) is the smallest negative real number and 0. As a result, the following test cases were obtained:

A, input {minimum negative real number}

B. Input {greater than the minimum negative real number and close to the minimum value}

C, enter 0.

D. Input {less than the maximum positive real number and close to the maximum value}

E. Enter {Maximum Positive Real Number}

4) Generally speaking, there are several types of boundary checking involved in software testing: number, character, position, weight, size, speed, direction, size, space, etc.

5) Accordingly, the above-mentioned boundary values should be in the following situations: maximum/minimum, first/last, up/down, fastest/slowest, highest/lowest, shortest/longest, empty/full, etc.

The basic idea of boundary value analysis is to take the input variable values as min, min+, nom, max- and max, which are slightly higher than the minimum and normal values and slightly lower than the maximum and maximum values. Considering robustness testing, you can also add a value slightly higher than the maximum max+ and a value slightly lower than the minimum min-.

6) Use the boundary value as the test data.