ST - Mod3 - Chapter 9 - PathTesting - Part2
ST - Mod3 - Chapter 9 - PathTesting - Part2
STRUCTURAL TESTING
2
3
4
5
5
8 9
8 9
8/(9-1)=1
6
7
8
9
Test Coverage Metrics
• Test coverage metrics are a device to measure the extent
to which a set of test cases covers a program.
C0 Every Statement
C1 Every DD-Path
11
Cd C1 Coverage + every dependent pair of DD-Paths
12
Metric Based Testing –
Statement and Predicate Coverage Testing
• Statement coverage based testing aims to create test
cases that collectively exercise all statements in a
program.
13
DD-Path Testing
DD-Path Graph Edge Coverage C1
1 2
Here a T,T and F,F
combination will suffice
T P1 F
to have DD-Path Graph
edge coverage or
Predicate coverage C1
T P2 F
14
DD-Path Coverage Testing C1P
• This is the same as
the C1 but now we
must consider test P1
cases that exercise all T F
possible outcomes
of the choices for if-
else statement T,T, T P2 F
T,F, F,T, F,F for the
predicates P1, and P2
respectively, in the
DD-Path graph. For
CASE statements
each clause is covered.
15
Dependent DD-Path Pairs Coverage
Testing (Cd = C1+Dependent pairs )
• In simple C1 coverage criterion we are interested simply
to traverse all edges in the DD-Path graph.
16
C & H are such pairs, as are
DD paths D & H.
17
18
19
20
21
22
2
23
24
Multiple Condition Coverage Testing(CMCC)
• Look closely at the compound conditions in DD-Paths B and H.
26
Loop Coverage Testing
First
First First
A A
A
B
B B
C
C C
D
D D
Last
Last
Last
28