ExamGecko
Question list
Search
Search

Related questions











Question 343 - CTFL-2018 discussion

Report
Export

A supermarket rewards its customers with discounts on certain products depending on how much the customer spends over a twelve-month period. The discounts are:

* 5% discount - once 500 has been spent.

* 10% discount - once a further 500 has been spent.

* 15% discount - once a further 1000 has been spent.

* 20% discount - once a further 2000 has been spent.

The following test cases have been written: TC1 -500 spent TC2 - 2000 spent

How many more test cases must be written to achieve 100% 2-pomt boundary value analysis for the discount scheme?

A.
4
Answers
A.
4
B.
6
Answers
B.
6
C.
7
Answers
C.
7
D.
8
Answers
D.
8
Suggested answer: C

Explanation:

2-point boundary value analysis is a technique that tests the boundary values of valid and invalid partitions with two values each: one at the boundary and one just outside the boundary. For example, if the valid range is 1 to 10, the 2-point boundary values are 1, 2, 9, 10 for the valid partition, and 0, 11 for the invalid partitions. The advantage of this technique is that it reduces the number of test cases compared to 3-point boundary value analysis, which tests one value inside the boundary as well. However, it may miss some defects that occur only with the values inside the boundary.

In this question, the valid partitions are the ranges of spending that correspond to different discounts, and the invalid partitions are the ranges of spending that are below or above the valid partitions. The boundaries are the values of spending that trigger a change in the discount rate. The 2-point boundary values for each partition are:

Invalid partition below 500: 0, 499

Valid partition for 5% discount: 500, 501

Valid partition for 10% discount: 1000, 1001

Valid partition for 15% discount: 2000, 2001

Valid partition for 20% discount: 4000, 4001

Invalid partition above 4000: 4001, 4002

The test cases TC1 and TC2 already cover two of the boundary values: 500 and 2000. Therefore, to achieve 100% 2-point boundary value analysis, we need to write seven more test cases to cover the remaining boundary values: 0, 499, 501, 1000, 1001, 4000, and 4002. Note that 4001 is a boundary value for both the valid and invalid partitions, so we only need to test it once.

asked 18/09/2024
Dennis Bruyn
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first