Black-Box Testing Techniques I
Black-Box Testing Techniques I
Black-box testing concerns techniques for designing tests; it is not a level of testing.
Black-box techniques apply to all levels of testing (e.g., unit, component, product, and system).
Partition Testing
Also known as input space partitioning and equivalence partitioning. Can be thought of as exhaustive testing Las Vegas style... Idea is to partition the programs input space based on a (small) number of equivalence classes such that, according to the specification, every element of a given partition is handled (e.g., mapped to an output) in the same manner.
In most multi-input cases, classes for individual inputs must be combined in some manner to partition the input space. (E.g., see City Tax Specification below.)
An ordered pair of numbers, (x, y), are input and a message is output stating whether they are in ascending order, descending order, or equal. If the input is other than an ordered pair of numbers, an error message is output.
x<y
x>y
TEST CASES
1 V 2 3 4
V
V I
For HOURS 20, output Low; for HOURS > 20, output HIGH."
If the specification suggests that values in a class may be handled differently, divide the class accordingly. { HOURS [0,40] } (V) becomes: { HOURS [0,20]} (V), { HOURS (20,40] } (V)
{ yes } (V)
{ no } (V) { other } (I)
Note that program behaviors associated with invalid inputs are not specified!
Res?
1% 1%
5% 1%
15% 1%
If we partition the space comprised of these classes based solely on the specified outputs, what would the result be?
Res?
1%
5%
15%
Would you be comfortable with the degree of coverage afforded by choosing ONE test case from each of these 3 partitions? Why or why not?
Res?
1%
5%
15%
Would you be comfortable with the degree of coverage afforded by choosing ONE test case from each of these 3 partitions? Why or why not?
Res?
1%
5%
15%
(Weak Equivalence Class Testing) Would you be comfortable with the degree of coverage afforded by choosing ONE test case from each of these 3 partitions? Why or why not?
Res?
1% 1%
5% 1%
15% 1%
Gross_Pay
(30K, 50K] > 50K
Res?
1% 1%
5% 1% Gross_Pay
15% 1%
Weak:
30K yes no
(30K, 50K]
> 50K
Res?
1% 1%
5% 1%
15% 1%
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
1%
5%
15%
no
1%
1%
1%
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
1%
5%
15%
no
1%
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
1%
5%
15%
no
1%
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
1%
5%
15%
no
1%
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
1%
5%
15%
no
1%
If gross pay is more than $50,000, the tax is 1% for nonresidents and 15% for residents.
Gross_Pay
30K yes (30K, 50K] > 50K
1%
5%
15%
Res?
no
1%
1%
1%
If gross pay is more than $50,000, the tax is 1% for nonresidents and 15% for residents.
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
no
1%
5%
15%
1%
1%
If gross pay is more than $50,000, the tax is 1% for nonresidents and 15% for residents.
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
no
1%
5%
15%
1%
1%
If gross pay is more than $50,000, the tax is 1% for nonresidents and 15% for residents.
Gross_Pay
30K (30K, 50K] > 50K yes
Res?
no
1%
5%
15%
1%
1%
Some conclusions
In general, the connection between partition testing and exhaustive testing is tenuous, at best. Partitioning a complex, multi-dimensional input space based solely on differences in specified output behavior can be risky.
Coming Up Next
The combinatorial approach considered next, Cause-Effect Analysis, allows for the systematic (and with appropriate tool support, automatic) partitioning of a multidimensional input space for different levels of coverage.