QuestionQ69

VerifiedWhite-Box Test Techniques

Consider the simplified logic below for crediting money to a bank account.

Receive money and the account number to be credited.

Question Image

What percentage of decision-testing coverage has been achieved by the following test suite?

  • Test Case A — Account number valid, account active, oldBalance = -100, balance now = +200, not a VIP customer
  • Test Case B — Account number valid, account active, oldBalance = -100, balance now = -50, is a VIP customer
Explanation

The logic contains five binary decisions, giving 10 decision outcomes. The two tests cover only the true outcomes for account validity, account activity, and whether the old balance is negative; they cover both outcomes for whether the new balance is non-negative and for VIP status. Therefore, 7 of 10 decision outcomes are covered, which is 70%.

Community Discussion

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