QuestionQ83

VerifiedWhite-Box Test Techniques

How many test cases must be designed to achieve 100% decision coverage for the following pseudo-code that applies discount rates to hotel room bookings?

Question Image

Explanation

Full decision coverage requires each decision to evaluate both true and false at least once. Three cases are needed for room prices above 200 to cover Platinum, Gold, and neither loyalty outcome; two cases are needed for prices from 151 through 200 to cover both Platinum outcomes; and one case at 150 or below covers the false outcome of the final Discount_factor < 100% decision. This requires six test cases.

Community Discussion

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