CS FundamentalsHardAccenture · Tech Mahindra pattern

A program's control flow graph has 8 edges, 6 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. 8
  2. B. 4
  3. C. 5
  4. D. 3

Correct answer: B. 4

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

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic