In: Computer Science
Problem Descriptions: A membership wholesale store is launching its 10th anniversary celebration. New customer now has a welcome offer of a $20 gift card when pay the $45 annually membership fee, start from first year. Furthermore, all members (including new members) who spend more than $200 will see a $20 cash back on check list, and another $30 when spend $400 or more.Suppose we are to test a system which calculate the total amount of a random customer’s shopping cart, and assume all current customers choose not to pay the annual membership fee at this purchase. An input to the system contains two values, (N, Y). Y is a float >= 0 represents the total value of the customer’s shopping cart excluding the first membership fee. N is a boolean value only accept True or False which shows whether the customer is a new member or not. Output P is a float represents the total pay at cashier.Design test cases to cover all boundaries for this system. Some invalid test cases must also be designed. Note: a test case should contain both input and expected output, i.e., ((N, Y), P).
Partition of the variables:
The system contains two variables :
N is boolean : NewCustomer | ExistingCustomer
New -> 1
Existing -> 0
We can design the boundary testcases for the two customer types.
Y the cart value > 0 float
Partitions Invalid <= 0 | 1 - 200 | 200 - 400 | 400 and above
Boundary value analysis or BVA is picking the values at the boundaries
Sample cases:
(('1',150),130)
Invalid
(('1',-5),"Error Message") - This invalid test case intention is to check how the system responds when Y is < 0 or negative.
Boundary cases:
(('1',200),180)
(('1',400),350)
(('1',401),351)
(('0',200),200)
(('0',400),370)
(('0',401),350)
Adding robustness is to test beyond boundary for Min - and Max + values for the input parameters.
Hope this information helps.
If you have any doubts, feel free to ask
And kindly upvote if you like my answer
Stay safe.
Let me know if you have any doubts or if you need anything to change. If you are satisfied with the solution, please leave a +ve feedback : ) Let me know for any help with any other questions. Thank You! ===========================================================================