A program's control flow graph has 9 edges, 7 nodes and 1 connected component. What is its cyclomatic complexity?
Correct answer
D. 4
15 views
D. 4
15 views
McCabe's cyclomatic complexity V(G) = E − N + 2P = 9 − 7 + 2 = 4. It gives the number of independent paths, and so the minimum number of test cases for branch coverage.
Asked in: GATE CS, NTS, Technical Interviews
Not sure why the answer is D? Ask here and get an explanation.