Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The system for discount calculation takes as the input two values: NumberofTransactions representing the total number of transactions for a given client TotalAmount Spent representing
The system for discount calculation takes as the input two values: NumberofTransactions representing the total number of transactions for a given client TotalAmount Spent representing the total amount spent by this client during these transactions Assume that each test case input is a pair (NumberOfTransactions, TotalAmount Spent). Consider the code shown in Figure 3 describing the business rules for this system. 1. IF NumberOfTransactions > 10 THEN 2. IF TotalAmount Spent > RM500 THEN 3. discount != 5% ELSE 4. discount := 2% ELSE 5. discount := 0% (a) Design a test case that should result in admitting the 5% discount. Propose a suitable test data for the test case. (b) What is the statement coverage for the following test suite: (9, RM600), (10, RM200)? (c) What is the decision coverage for the following test suite: (15, RM50), (20, RM750)? (d) Design the set of test cases that achieves the 100% statement coverage. (e) Based on your answer in (d), determine if additional test cases are needed to achieve the 100% decision coverage. [4 marks [2 marks] [2 marks] [6 marks) [1 mark] Paragraph B. 1 Answer for (a)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started