CS FundamentalsHardGATE CS · TCS NQT Prime · Product Company SDE

A function contains 9 binary decision points (if/while/for conditions), and no other branching. Using V(G) = (number of decision points) + 1, how many independent paths (and thus how many test cases for 100% branch coverage via basis-path testing) does it need?

  1. A. 11
  2. B. 10
  3. C. 8
  4. D. 9

Correct answer: B. 10

V(G) = 9 + 1 = 10; this is also the minimum number of test cases for full branch coverage by basis-path testing.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic