QuestionQ39

VerifiedWhite-Box Test Techniques

Consider this specification:

Question Image

When flying with an economy ticket, you may be upgraded to business class, particularly if you have a gold card in the airline’s frequent-flier program. If you do not have a gold card, you may be bumped off the flight when it is full and you check in late.

This is represented in the control-flow graph below. Each box (that is, statement or decision) is numbered.

Three tests have been run:

  • Test 1: A gold-card holder who is upgraded to business class
  • Test 2: A non-gold-card holder who remains in economy
  • Test 3: A person who is bumped from the flight

What level of decision coverage is achieved by these three tests?

Explanation

There are four two-outcome decisions, for eight decision outcomes in total. The tests exercise both outcomes of the gold-card decision and the economy-full decision, but only one outcome of each business-full decision. Therefore, six of the eight decision outcomes are covered, which is 75%.

Community Discussion

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