Path Testing
Path Testing
Generally,
Generally,
Responsibility Software Developers,
Independent Software Testers
Technically sound Testers
1. a=5; Sequence 1 2
2. b=a*2-1;
1
1. If(a>b) 3
Selection 2
2. C=3
3. Else c=5 4
4. C=c*c
CFG (Example 2)
1. While(a>b){ 1
2. b=b-1;
Iteration
3. b=b*a;} 2
4. C=a+b; 3
4
CFG(Example: 3)
1
1. While(x!=y){
2. If(x>y)then
2
3. X=x-y;
4
4. Else y=y-x; 3
5. }
5
6. Return x;
6
Example : 7
Next
Quadratic Equation
11 F
21,25,29
17 F
30,33,36
2
5 1
4
3
Independent (basis) paths
• Independent path is a path through a DD-path graph
of the program which cannot be reproduced from
other paths
• At least one node or edge is new .
• Minimum Number of path (edge).
• Condition Coverage
Independent Path
Example 8
Consider a program for the classification of a triangle . Its
input is a triple of positive integers say (a, b, c) from the
interval (1,100). The output may be
Scalene
Isosceles
Equilateral
Not a triangle
Draw the flow graph and DD path graph . Also find the
independent paths from DD path graph.
10 F
1 Source
2-4 A
5 B
6 C
7 D
8 E
… …
19 Sink
CFG to DD-Path