Boundary Value Analysis Flashcards
What is the rationale behind Boundary Value Analysis?
Boundary Value Analysis is used to test loop conditions that often test for < instead of =< and vice versa, as well as to catch off-by-one errors.
Where do the boundaries for Boundary Value Analysis come from?
The boundaries for Boundary Value Analysis often come from the application itself, such as array size or physical limitations like the load capacity of an elevator.
What is the first step in Boundary Value Analysis?
The first step in Boundary Value Analysis is to define the minimum, just above minimum, normal value, just below maximum, and maximum for each input variable. These are denoted as “min,” “min+,” “nom,” “max-,” and “max,” respectively. The normal value can be any value as long as it is different from the other ones.
What is the second step in Boundary Value Analysis?
The second step in Boundary Value Analysis is to generate test cases by taking the following input values:
Keep all but one variable at their normal values
Let that variable range over all the values
For example, if we have two input variables A and B, and their values are defined as follows:
A: min, min+, nom, max-, max
B: min, min+, nom, max-, max
Then, we would generate test cases by selecting one variable and letting it range over all values while keeping the other variable at its normal value. This would result in the following test cases:
A=min+, B=nom
A=nom, B=min+
A=nom, B=max-
A=max-, B=nom
For two input variables, this approach would result in 9 test cases (5 for A, 5 for B, and 1 for both at their normal values). For n input variables, the formula for generating test cases is 4n + 1.
How many test cases are generated for 2 input variables in Boundary Value Analysis?
9 test cases.
How many test cases are generated for n input variables in Boundary Value Analysis?
For n input variables, 4n + 1 test cases are generated.