Tutorial-8: To Generate Equivalence Class Test Cases-For the Salesman Commission Calculation Program
“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:
To apply the four techniques of equivalence class partitioning one by one & generate appropriate test cases?The valid classes of the input variables are as follows
F1 = {fans: 1 ≤ fans ≤ 70}
F2 = {fans = -1}
P1 = {pumps : 1 ≤ pumps ≤ 80}
B1 = {bodies : 1 ≤ bodies ≤ 90}
The corresponding invalid classes of the input variables are as follows:
F3 = {fans : fans = 0 or fans < -1}
F4 = {fans : fans > 70}
P2 = {pumps : pumps < 1}
P3 = {pumps :pumps > 80}
B2 = {bodies : bodies < 1}
B3 = {bodies : bodies > 90}
1) & 2) Weak Normal & Strong Normal Equivalence Class: Since the number of valid classes is equal to the number of independent variables, so we have exactly one weak normal equivalence class test case and again, it is identical to the strong normal equivalence class test case.
Test Case ID | Fans | Pumps | Bodies | Expected Output for sales |
WN1, SN1 | 35 | 40 | 45 | 3900 |
3) Weak Robust Equivalence Class: Test Cases falling under this category are as under
Test Case ID | Fans | Pumps | Bodies | Expected Output for sales |
WR1 | 35 | 40 | 45 | 3900 |
WR2 | 0 | 40 | 45 | Invalid Input |
WR3 | 71 | 40 | 45 | Invalid Input |
WR4 | 35 | 0 | 45 | Invalid Input |
WR5 | 35 | 81 | 45 | Invalid Input |
WR6 | 35 | 40 | 0 | Invalid Input |
WR7 | 35 | 40 | 91 | Invalid Input |
4) Strong Robust Equivalence Class: Test Cases falling under this category are
Test Case ID | Fans | Pumps | Bodies | Expected Output for sales |
SR1 | -1 | 40 | 45 | Value of Fans not in range 1 – 70 |
SR2 | 35 | -1 | 45 | Value of Pumps not in range 1 – 80 |
SR3 | 35 | 40 | -1 | Value of Bodies not in range 1 – 90 |
SR4 | -1 | -1 | 45 | Value of Fans & Pumps are not in their ranges |
SR5 | -1 | 40 | -1 | Value of Fans & Bodies are not in their ranges |
SR6 | 35 | -1 | -1 | Value of Pumps & Bodies are not in their ranges |
SR7 | -1 | -1 | -1 | Value of Fans, Pumps & Bodies are not in their ranges |
Many More Articles & Tutorials on Black Box Testing
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.