LAB TASK
TOPIC: White Box Testing Techniques
Program:
Flow Chart:
Question: Find the Statement Coverage, Branch Coverage, Path Coverage
by
Using the above program and flow graph?
1. Statement coverage:
If we traverse through path 1A-2C-3D-E-4G-5H all
the nodes are covered. And by traveling through only one path all the nodes
12345 are covered, so the Statement coverage in this case is 1.
2. Branch coverage:
In the first case traversing through "Yes "decision, the path is 1A-2C-3D-E-
4G-5H, and the number of covered edges is A, C, D, E,G,H and but edges B
and F is not covered in this path. To cover B and F edges, we have to
traverse through "No" decision. In the case of "No" decision the path is 1A-
2B-E-4F, and the number of covered edge is B . So by traveling through these
two paths, all branches have covered.
Hence,
Path 1= 1A-2C-3D-E-4G-5H
Path 2= 1A-2B-E-4F
Branch Coverage= No of Paths= 2
Case Covered Path Branch
Branches coverage
yes A-C-D-E-G-H 1A-2C-3D-E-4G- 2
5H
No A-B-E-F 1A-2B-E-4F
3. Path Coverage:
Path Coverage ensures covering of all the paths from start to end.
All possible paths are
i. 1A-2B-E-4F
ii. 1A-2B-E-4G-5H
iii. 1A-2C-3D-E-4G-5H
iv. 1A-2C-3D-E-4F
So path coverage is 4.