Sunday, January 18, 2009

Black Box - Boundary Value Analysis

2)Boundary Value Analysis (BVA)

Boundary Value Analysis (BVA) is a test data selection technique (Functional Testing technique) where the extreme values are chosen. Boundary values include maximum, minimum, just inside/outside boundaries, typical values, and error values. The hope is that, if a system works correctly for these special values then it will work correctly for all values in between.
§ Extends equivalence partitioning
§ Test both sides of each boundary
§ Look at output boundaries for test cases too
§ Test min, min-1, max, max+1, typical values
§ BVA focuses on the boundary of the input space to identify test cases
§ Rational is that errors tend to occur near the extreme values of an input variable


There are two ways to generalize the BVA techniques:

1. By the number of variables
o For n variables: BVA yields 4n + 1 test cases.

2. By the kinds of ranges
o Generalizing ranges depends on the nature or type of variables
§ NextDate has a variable Month and the range could be defined as {Jan, Feb, …Dec}
§ Min = Jan, Min +1 = Feb, etc.
§ Triangle had a declared range of {1, 20,000}
§ Boolean variables have extreme values True and False but there is no clear choice for the remaining three values

Explain Boundary value testing (BVA) & Equivalence testing with example.

Boundary value testing is a technique to find whether the application is accepting the expected range of values and rejecting the values, which falls out of range.
Ex. A user ID text box has to accept alphabet characters ( a-z ) with length of 4 to 10 characters.
BVA is done like this,
max value = 10 pass
max-1 = 9 pass
max+1 = 11 fail
min = 4 pass
min+1 = 5 pass
min-1 = 3 fail.
Like wise we check the corner values and come out with a details whether the application is accepting correct range of values.

Black-Box Test Case Selection: Boundary Value Analysis
Because exhaustive black-box testing is infeasible, black-box test cases must be chosen to maximize the chance of finding faults.
Experience has shown that values at or near equivalence class boundaries are more likely to detect faults. Boundary value analysis is choosing test cases at or near the boundaries of equivalence classes.

Examples of equivalence classes:
maximum negative, maximum positive, and 0 inputs or outputs;
input or output strings at size limits, 1 character beyond size limits, the empty string, and strings of 1 character; input or output numeric values at size limits and 1 beyond size limits;
empty input files and files with one character in them;

Boundary Value Analysis another Example
Consider the graphing package line weight equivalence class of choosing the standard weight when the current weight is an alternate weight.
Boundary value analysis suggests the following test cases:
the current weight is the lightest weight when the standard weight is chosen
the current weight is the heaviest weight when the standard weight is chosen

BVA guidelines:
1. If input condition specifies a range bounded by values a and b, test cases should include a and b, values just above and just below a and b
2. If an input condition specifies and number of values, test cases should be exercise the minimum and maximum numbers, as well as values just above and just below the minimum and maximum values
3. Apply guidelines 1 and 2 to output conditions, test cases should be designed to produce the minimum and maxim output reports

Advantages of Boundary Value Analysis

1. Robustness Testing - Boundary Value Analysis plus values that go beyond the limits
2. Min - 1, Min, Min +1, Nom, Max -1, Max, Max +1
3. Forces attention to exception handling
4. For strongly typed languages robust testing results in run-time errors that abort normal execution

Limitations of Boundary Value Analysis

BVA works best when the program is a function of several independent variables that represent bounded physical quantities
1. Independent Variables
o NextDate test cases derived from BVA would be inadequate: focusing on the boundary would not leave emphasis on February or leap years
o Dependencies exist with NextDate's Day, Month and Year
o Test cases derived without consideration of the function
2. Physical Quantities
o An example of physical variables being tested, telephone numbers - what faults might be revealed by numbers of 000-0000, 000-0001, 555-5555, 999-9998, 999-9999?

No comments:

Post a Comment