Discussion
Cyclometric complexity of a flow graph G with n vertices and e edges is
Answer: B
The cyclomatic complexity of a flow graph G with e edges and n vertices is V(G) = e - n + 2, option (B). It equals the number of linearly independent paths through the program and is the minimum number of test cases needed to cover every independent path. For example, a single decision gives a graph with 4 nodes and 4 edges, so 4 - 4 + 2 = 2 paths. The general formula for a graph with p connected components is e - n + 2p, and a single procedure has p = 1. The forms e+n-2, e+n+2 and e-n-2 give wrong values, for instance e+n-2 would give 6 for the one decision graph, which is more than its 2 paths.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development