Which test levels would you use for these checkout failures?
Instruction: Choose the most useful first test level for each defect, state the assertion, and explain where a broader test adds value.
In a fictional checkout, three defects were found: (A) a pure total-calculation function returns $22.00 for two $10.00 items with a 10% discount, although tax and shipping are both zero; (B) the order service sends the payment adapter an amount in dollars while the adapter contract expects integer cents; (C) a customer completes an approved sandbox payment, but the browser never displays the created order. Unit tests exercise isolated code, integration tests exercise collaborating components or boundaries, and system tests exercise the assembled application. No real payments may be made.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
For A, I would start with a unit test of the calculation function: quantity two times $10.00 gives $20.00, and a 10% discount gives $18.00. That is a fast, precise check of a local rule. I'd include zero discount and rounding examples according to the agreed money contract...
Related Questions
-
easy
-
easy
-
easy
-
easy
-
easy
-
easy