Professional Documents
Culture Documents
Software Testing
Lecture 5
Cause-Effect Analysis
Л
Causes Effects
V
C-E Analysis Process Steps
Causes: Effects:
(1) Non-Resident (11) 1% tax
(2) Resident (12) 5% tax
(3) $0 Gross Pay $30K (13) 15% tax
(4) $30K Gross Pay $50K
(5) Gross Pay $50K
Constraints deducible from spec,
problem domain knowledge, etc.
A. [(1) Л ¬(2)] V [¬(1) Л (2)] (i.e., one, and only one
of (1) and (2) must be true.)
Non-Res (1)
V (11) 1% tax
[0,30K] (3)
O
(30K,50K] (4)
O
Л (12) 5% tax
O
Res (2)
Л (13) 15% tax
>50K (5)
Cause/Effect Constraints
Exclusive Inclusive
A
O “one and only one” A => B
B
Illustration of Step 3 (Identify Test Case
Selection Strategy)
• Simple (but extreme) strategies:
– “All Feasible Combinations of Cause
Values” (AFCCV)
– “All Effects covered with the
Minimum number of test Cases”
(AEMC)
• For the relationships depicted in our graph,
how many test cases would be required to
achieve AFCCV coverage? AEMC coverage?
AFCCV and AEMC Coverage
Non-Res (1)
V (11) 1% tax
[0,30K] (3)
O
(30K,50K] (4)
O
Л (12) 5% tax
O
Res (2)
Л (13) 15% tax
>50K (5)
AFCCV and AEMC Coverage (cont’d)
• AFCCV:
– There are 25 = 32 possible value
combinations for all 5 Causes.
– For Causes (1) and (2), there are 2
feasible value combination pairs (due
to the “one and only one” constraint):
TF and FT.
(cont.)
AFCCV and AEMC Coverage (cont’d)
• AFCCV: (cont’d)
– Similarly, for Causes (3), (4), and (5),
there are 3 feasible value combination
triples: TFF, FTF, and FFT.
– Thus, there are 2 X 3 = 6 feasible
combinations of values for all 5
Causes, requiring a total of 6 test
cases.
AFCCV and AEMC Coverage (cont’d)
• AEMC:
– There are 3 mutually exclusive Effects.
– Thus, a different combination of Cause
values is required for each Effect to
evaluate to True.
– Therefore, 3 test cases are required.
(cont.)
AFCCV and AEMC Coverage (cont’d)
• AEMC: (cont’d)
– In general, when there are N Effects,
N or fewer test cases are required
for AEMC Coverage.
– When the N Effects are mutually
exclusive, all N test cases are
required.
AFCCV and AEMC Coverage (cont’d)
REPEAT
Select the next (initially, the first) Effect.
Tracing back through the graph (right to left), find
all feasible combinations of connected Cause
values that result in the Effect being True.
For each new such combination found:
Determine values of all other Effects, and
Enter values for each Cause and Effect in a
new column of the test case coverage matrix.
UNTIL each Effect has been selected.
What Should We Call this Strategy?
Non-Res (1)
V (11) 1% tax
[0,30K] (3)
O
(30K,50K] (4)
O
Л (12) 5% tax
O
Res (2)
Л (13) 15% tax
>50K (5)
Applying Strategy #3
Non-Res (1)
V (11) 1% tax
[0,30K] (3)
O
(30K,50K] (4)
O
Л (12) 5% tax
O
Res (2)
Л (13) 15% tax
>50K (5)
Applying Strategy #3
Non-Res (1)
V (11) 1% tax
[0,30K] (3)
O
(30K,50K] (4)
O
Л (12) 5% tax
O
Res (2)
Л (13) 15% tax
>50K (5)
Applying Strategy #3