CS FundamentalsHardIBM · Deloitte pattern

A program's control flow graph has 6 edges, 5 nodes and 1 connected component. According to McCabe's basis path method, what is the minimum number of test cases needed to execute every independent path at least once?

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

Correct answer: C. 3

The size of the basis set of independent paths equals the cyclomatic complexity: V(G) = E − N + 2P = 6 − 5 + 2(1) = 3. That many test cases form a minimal basis set.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic