CS FundamentalsHardProduct-company MCQ pattern

How many of the following statements about cyclomatic complexity are correct? 1. It equals the number of linearly independent paths through the control flow graph. 2. It gives an upper bound on the number of test cases needed for full branch coverage. 3. For a program with only binary decisions, it equals the number of predicate nodes plus one. 4. A function with cyclomatic complexity 1 contains no decision points.

  1. A. Only one
  2. B. Only two
  3. C. Only three
  4. D. All four

Correct answer: D. All four

All four are standard properties. Basis-path testing uses V(G) test cases, which is always enough for branch coverage (an upper bound), and V(G) = predicates + 1 for binary decisions; V(G) = 1 means straight-line code.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic