White Box Testing
White Box Testing
1
Basis Path Testing
2
Control Flow Graph
• Node
• Edges or Links
• Decision Node
• Junction Node
• Regions
3
Control Flow Graph
4
Software Testing
Path Testing Myths
Terminology
• Path
• Segment
• Path Segment
• Length of a Path
• Independent Path
5
Path Testing Terminology
Cyclomatic Complexity
• V(G) = e-n+2P
• V(G) = d + P
6
Example
7
Example
8
Decision to Decision Path
Graph
9
Example
• Cyclomatic Complexity
V(G) = e – n + 2 * P
= 10 – 8 +2
= 4
V(G) = Number of predicate nodes + 1
= 3 (Nodes B,C and F) + 1
= 4
10
Example
Independent Paths
• A-B-F-H
• A-B-F-G-H
• A-B-C-E-B-F-G-H
• A-B-C-D-F-H
11