CS FundamentalsVery hardGATE CS · product placement

How many of these statements about cyclomatic complexity are correct? 1. Adding a straight-line statement to a function never changes V(G). 2. Converting nested if-else chains into a lookup table can lower V(G) without changing behaviour. 3. V(G) gives the minimum number of tests for 100% statement coverage. 4. Two functions with the same V(G) can have very different numbers of feasible paths.

  1. A. 4
  2. B. 3
  3. C. 2
  4. D. 1

Correct answer: B. 3

1, 2 and 4 are correct. V(G) is an upper bound on the tests needed for branch coverage (and the size of a basis set), not the minimum for statement coverage, which is often much smaller.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic