Path Testing: Csci 565 Spring 2007

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 19

Path Testing

Csci 565
Spring 2007
Objectives
Decision-to-decision path (DD-Paths)
Test Coverage Metrics
Basis Path Testing
Observation on McCabe Basis Path Method
Essential Complexity
t
f
t
f
f
f
f
Test Selection Criteria (white box)
Test Selection Criteria
Help us to measure the adequacy of a test suite
E.g. if we use statement coverage to test 40% of the
code, it means 60 percent of code was never executed
Help us to decide when to stop testing
E.g., use other criteria to cover 85%
Overview of the families of test
selection criteria
Families of test selection criteria include
Structural model coverage criteria
All statements (AS),
All Decisions (AD),
All paths (AP)
APAD AS
Condition coverage (CC)
A test set achieves CC when each condition in the program is tested with a
true result and false results
Decision/CC (D/CC)
A test set achieves D/CC when it achieves both AD and CC
Multiple condition coverage (MCC)
A test set achieves MCC if it exercises all possible combinations of condition
outcomes in each decision
For N conditions, it requires 2
N
tests
Basis Path Testing
Ex1=p2+p3-p1
Ex2=2p2-p1
Ex1= p2+p3-p1
Ex1= (1,0,1,2,0,0,0,0,1,0) +(1,0,0,0,1,0,0,1,0,1)-(1,0,0,1,0,0,0,0,1,0)
Ex1 = (1,0,1,1,1,0,0,1,0,1)



McCabes Algorithmic Procedure
McCables Algorithmic Procedure can be used to
identify a set of basis paths
Select a path with highest number of decision nodes
Retrace each decision in baseline path
Flip each decision to create a new path
E.g.
A,B,C,B,E,F,G
A,D,E,F,G
A,D,F,G
A,B,E,F,G
A,B,C,G



Observations on McCabes Basis
Path
Is testing Basis
path enough?
Infeasible paths
Essential Complexity
V(G)=1wellStr(P)
V(G) >=10 requires
substantial testing
Use the characteristics
of code to select
appropriate criteria

You might also like