This example is reproduced from http://www.csc.calpoly.edu/~jdalbey/205/Resources/grocerystore.html.
A Grocery Store
Consider a software module that is intended to accept the name of a grocery item and a list of the different sizes the item comes in, specified in ounces. The specifications state that the item name is to be alphabetic characters 2 to 15 characters in length. Each size may be a value in the range of 1 to 48, whole numbers only. The sizes are to be entered in ascending order (smaller sizes first). A maximum of five sizes may be entered for each item. The item name is to be entered first, followed by a comma, then followed by a list of sizes. A comma will be used to separate each size. Spaces (blanks) are to be ignored anywhere in the input.
Derived Equivalence Classes
Black Box Test Cases for the Grocery Item Example based on the Equivalence Classes Above.
# | Test Data | Expected Outcome | Classes Covered |
---|---|---|---|
1 | xy,1 | T | 1,4,7,9,11,13,16,18,20,22 |
2 | AbcDefghijklmno,1,2,3 ,4,48 | T | 1,4,7,9,11,13,16,18,20,23 |
3 | a2x,1 | F | 2 |
4 | A,1 | F | 3 |
5 | abcdefghijklmnop | F | 5 |
6 | Xy,0 | F | 6 |
7 | XY,49 | F | 8 |
8 | Xy,2.5 | F | 10 |
9 | xy,2,1,3,4,5 | F | 14 |
10 | Xy | F | 15 |
11 | XY,1,2,3,4,5,6 | F | 17 |
12 | 1,Xy,2,3,4,5 | F | 19 |
13 | XY2,3,4,5,6 | F | 21 |
14 | AB,2#7 | F | 12 |