QuestionQ35

VerifiedWhite-Box Test Techniques

Consider the pseudocode below:

Question Image

With the following tests, which additional test(s), if any, are needed to achieve 100% statement coverage using the fewest tests?

  • Test 1: A = 7, B = 7, Expected output: 7
  • Test 2: A = 7, B = 5, Expected output: 5
Explanation

The only uncovered executable statement is PRINT "Bingo!". It is reached when B > A and B = 2*A; A = 6, B = 12 meets both conditions. The existing tests already cover the other assignments and the final PRINT MN, so no further test is needed.

Community Discussion

No comments yet. Be the first to start the discussion!