You may make a copy of a worksheet and complete this activity, or simply type your answers in any text editor.
You may work alone or with at most two other students in this course. (max size = 3)
Consider a small web app, convert.php (source code), that allows users to convert measurements.
Design IDM(s) for the app, write tests that satisfy Base Choice Coverage, and then automate your tests. Note: Try to keep your partitioning simple and choose a small number of partitions and blocks.
14 textboxes: F, C, cm, in, ft, m, ... 2 buttons: Convert and Clear Form Many browser features: back, forward, reload, entering URL directly, bookmark, ...
One possible solution would be
* characteristic 1, input is a number or not
(all textbox inputs share common characteristics)
* characteristic 2, number compare to 0
* characteristic 3, form button is clicked
* characteristic 4, browser feature is clicked
* characteristic 1, input is a number or not: [number, not number]
* characteristic 2, number compare to 0: [neg, 0, pos]
* characteristic 3, form button is clicked: [Convert, Clear Form]
// Focusing on functionality of the app, we are interested in how the app
// behaves in response to clicking the "Convert" button or the "Clear Form" button.
// Note: not clicking the form button won't trigger the functionality of the app
// (doesn't help us test the app).
// Thus, "not click" is not considered as a block nor an input value here.
* characteristic 4, browser feature is clicked: [click, not click]
// Alternatively, we may consider characteristic 4 in terms of
// which browser feature is clicked.
// Assume the input space includes back, forward, and reload;
// thus, the partition may be [none, back, forward, reload].
// For simplicity (for this exercise),
// let's omit URL rewriting, bookmark, and other browser features.
// Note: clicking the back button has been shown to be a major source of web failures
// and many professional web developers and test engineers overlooked such interaction.
// For this activity, let's assume that characteristic 4 targets the back button.
// In practice, all browser features must be taken into account when testing web apps.
Satisfy both properties
* characteristics 1, [1, a] * characteristics 2, [-1, 0, 1] * characteristics 3, [Convert, Clear Form] * characteristics 4, [click Back, not click]
First, let's decide the base choices
* characteristics 1, input is a number or not: [number, not number], (base: number)
* characteristics 2, number compare to 0: [neg, 0, pos], (base: pos)
* characteristics 3, form button is clicked: [Convert, Clear Form], (base: convert)
* characteristics 4, browser feature is clicked: [click Back, not click], (base: not click)
Thus, our base test requirement (tr) is
tr 1: [number, pos, convert, not click]
Then, apply Base Choice Coverage (BCC) to derive the remaining test requirements (trs)
tr 2: [number, pos, Convert, click Back]
tr 3: [number, pos, Clear Form, not click]
tr 4: [number, neg, Convert, not click]
tr 5: [number, 0, Convert, not click]
tr 6: [not number, pos, Convert, not click]
Identify any infeasible test requirement(s)
tr 2 If we interpret the test in the way that clicking the Convert button and
clicking the Back button happen simultaneously, this test requirement is infeasible.
If we interpret the test in the way that clicking the Convert button and
clicking the Back button happen in sequence, this test requirement is feasible.
(assume we want to enter the inputs in sequence and keep this test requirement)
tr 6 (block 2 of characteristic 1 and block 3 of characteristic 2 cannot be combined)
Thus, this test requirement is infeasible.
To deal with infeasible test requirement(s), there are two options
option 1: discard it, or
option 2: fix it
Typically, testers try to fix the infeasible test requirement(s).
Assume we want to fix the infeasible test requirement tr 6.
One way to fix this tr is to consider which aspect (between "not number" and "pos")
is more important and then drop the less important.
Since other tests cover "number" and "pos," a reasonable option in this case is
to cover "not number" aspect.
The fixed tr 6 would be [not number, convert, not click]
tr 1: [number, pos, convert, not click]
test case 1: 1,1,1,1,1,1,1,1,1,1,1,1,1,1, Convert (base)
Expected output (Post-state): results include
1.0 Fº = -17.22 Cº 1.0 Cº = 33.80 Fº 1.0 in = 2.54 cm 1.0 cm = 0.39 in
1.0 ft = 0.30 m 1.0 m = 3.28 ft 1.0 mi = 1.61 km 1.0 km = 0.62 mi
1.0 gal = 3.79 L 1.0 L = 0.26 gal 1.0 oz = 28.35 g 1.0 g = 0.04 oz
1.0 lb = 0.45 kg 1.0 kg = 2.21 lb
tr 2: [number, pos, Convert, click Back]
test case 2: 1,1,1,1,1,1,1,1,1,1,1,1,1,1, Convert, click Back
Expected output (Post-state): depend on business logic,
for example,
(i) clicking the browser back button should reset all previously entered data, or
(ii) data entries previously entered should remain, ...
tr 3: [number, pos, Clear Form, not click]
test case 3: 1,1,1,1,1,1,1,1,1,1,1,1,1,1, Clear Form
Expected output (Post-state): all text fields are clear
tr 4: [number, neg, Convert, not click]
test case 4: -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, Convert
Expected output (Post-state): results include
-1.0 Fº = -18.33 Cº -1.0 Cº = 30.20 Fº -1.0 in = -2.54 cm -1.0 cm = -0.39 in
-1.0 ft = -0.30 m -1.0 m = -3.28 ft -1.0 mi = -1.61 km -1.0 km = -0.62 mi
-1.0 gal = -3.78 L -1.0 L = -0.26 gal -1.0 oz = -28.35 g -1.0 g = -0.04 oz
-1.0 lb = -0.45 kg -1.0 kg = -2.21 lb
tr 5: [number, 0, Convert, not click]
test case 5: 0,0,0,0,0,0,0,0,0,0,0,0,0,0 Convert
Expected output (Post-state): results include
0.0 Fº = -17.78 Cº 0.0 Cº = 32.0 Fº 0.0 in = 0.0 cm 0.0 cm = 0.0 in
0.0 ft = 0.0 m 0.0 m = 0.0 ft 0.0 mi = 0.0 km 0.0 km = 0.0 mi
0.0 gal = 0.0 L 0.0 L = 0.0 gal 0.0 oz = 0.0 g 0.0 g = 0.0 oz
0.0 lb = 0.0 kg 0.0 kg = 0.0 lb
tr 6: [not number, --, Convert, not click]
test case 6: a,a,a,a,a,a,a,a,a,a,a,a,a,a Convert
Expected output (Post-state):
Data entry is not numeric
Note: depend on the implementation
HTTP 500 Error is returned (for the Java servlet version of convert,
but not the php version)
sample solution in Canvas > Files
CC-BY-NC-SA 4.0 license.