Tutorial-4: To Generate BVA Test Cases-For the Salesman Commision Calculation Program
Before we generate the test cases for the sales commission calculation program, firstly we need to define the problem domain as described below.
Problem Domain: “A desert cooler sales person sold cooler fans, pumps and bodies that were made by a cooler maker. Fans cost $45, pumps cost $30 and bodies cost $25.
The salesperson had to sell at least one complete cooler per month, and the production limits were such that the most the sales person could sell in a month was 70 fans, 80 pumps and 90 bodies. The sales person used to send the details of sold items to the cooler maker. The cooler maker then computed the sales person’s commission as follows:
1) 10% on sales upto and including $1000.
2) 15% of the next $800.
3) And 20% on any sales in excess of $1800.
The commission program produced a monthly sales report that gave the total number of fans, pumps and bodies sold, the sales person’s total dollar sales and finally, the commission.”
Objective of this Tutorial: How to Generate BVA Test Cases for this problem?
Here we have three inputs for the program, hence n = 3.
Since BVA yields (4n + 1) test cases according to single fault assumption theory, hence we can say that the total number of test cases will be (4*3+1)=12+1=13.
The boundary value test cases are
We can see that the monthly sales are limited by the following consideration:
1 ≤ fans ≤ 70
1 ≤ pumps ≤ 80
1 ≤ bodies ≤ 90
|Test Case ID||Fans||Pumps||Bodies||Expected Output of Sales|
Here we can see that out of 15 test cases, two are redundent. Hence 13 test cases are sufficient to test this program.