Basis Path Testing
Basis Path Testing
TESTING
HOA LE
Agenda
Introduction
Cyclomatic complexity
Basic path testing approach
Conclusion
Introduction
1: IF A = 100
2: THEN IF B > C
3: THEN A = B
4: ELSEA= C
5: ENDIF
6: ENDIF
7: Print A
Determine Cyclomatic complexity
Cyclomatic
complexity =
8-7+ 2*1= 3.
Determine Cyclomatic complexity
Cyclomatic complexity = edges - nodes
+ 2p
Cyclomatic complexity
= 7-8+ 2*2= 3.
Determine Cyclomatic complexity
Cyclomatic complexity
= 2+1= 3.
Determine Cyclomatic complexity
Cyclomatic complexity =number of regions in
the control flow graph
Cyclomatic complexity
=3
Find a basis set of paths
Path 1: 1, 2, 3, 5, 6, 7.
Path 2: 1, 2, 4, 5, 6, 7.
Path 3: 1, 6, 7.
Generate test cases for each path