Testcover.com Testcover.com
Tutorial - Shopping Cart Example -
Transition Design - Functionally Dependent Form

Home
Existing User Login
Brochure
Sign up for Risk-Free Trial
About Testcover.com
Frequently Asked Questions
Tutorial with Examples
->Equivalence Partitioning
--->Shopping Cart Example
----->Seq. Unit Replay Design
->UML State Machines
--->Shopping Cart Example
--->Test Models, 1 Region
--->Design Procedure
--->Transition Designs
----->Functionally Dependent
----->Fixed Values
--->Target State Designs
----->Functionally Dependent
----->Fixed Values
--->Thermostat Example
->Definitions of Terms
Performance
WSDL Interface
Background
Partners
Registrations
Contact Information
The shopping cart example illustrates pairwise testing using a Unified Modeling Language (UML) state machine diagram. This test design is based on the shopping cart diagram. The design illustrates the transition model, in which each state transition has one partition. Some of the factor values are functionally dependent on the values of other factors. In this design they are expressed in functionally dependent form. The design is converted to fixed values form (below) using the fixed values conversion procedure.

In the shopping cart example there are four leaf states: emptyCart, nonemptyCart, shopping, checkout. There are eight state transitions corresponding to partitions:

# shopping to emptyCart
# nonemptyCart to emptyCart
# shopping to nonemptyCart
# nonemptyCart to nonemptyCart
# checkout to nonemptyCart
# emptyCart to shopping
# nonemptyCart to shopping
# nonemptyCart to checkout

There are 18 test factors with values as follows.

Test FactorNumber of ValuesTest Factor Values
1.newItem4 unset itemA itemB itemC
2.n5 unset 0 1 2 3
3.delChk[0]3 n/a 0 1
4.item[0]4 n/a itemA itemB itemC
5.qty[0]4 n/a 1 2 10
6.newQ[0]6 n/a 0 1 2 10 qty[0]
7.delChk[1]3 n/a 0 1
8.item[1]3 n/a itemB itemC
9.qty[1]4 n/a 1 2 10
10.newQ[1]6 n/a 0 1 2 10 qty[1]
11.delChk[2]3 n/a 0 1
12.item[2]2 n/a itemC
13.qty[2]4 n/a 1 2 10
14.newQ[2]6 n/a 0 1 2 10 qty[2]
15.i4 n/a 0 1 2
16.q5 n/a 0 1 2 10
17.state4 shopping emptyCart nonemptyCart checkout
18.event6 SHOP CART CHECK(i)[0<=i&&i<n]
QTY(i,q)[0<=i&&i<n] UPDATE CHECKOUT

The first 16 factors are program variables. Factor 17 is the current state, and factor 18 is the event triggering the expected transition. The newItem value indicates an item to place in the cart; n is the number of items in the cart (up to 3 in this test design). The first 3 items in the cart are indexed by 0, 1 and 2, so factors 3-6 are for the item in position 0, 7-10 for position 1, etc. For each cart position i, delChk[i] indicates whether the delete box is checked; item[i] identifies the item; qty[i] is the quantity of the item; newQ[i] shows a new quantity entered. Factors 15 and 16 give the values for i and q in the CHECK(i) and the QTY(i,q) events; these events are functionally dependent. The value n/a indicates that a factor is not applicable to the transition test case.

The items are placed in the cart starting at position 0. They are constrained to be different, to appear in separate cart positions. Otherwise, the item already in the cart would have its quantity incremented; a new cart position would not be filled. For example, when there are two different items, the test design constrains position 0 to have itemA or itemB; position 1 is constrained to have itemC.

In the shopping-nonemptyCart and checkout-nonemptyCart transitions, qty[0] is used as a value for newQ[0]. This indicates that the value shown for the new quantity is the same as the current quantity. Then newQ[0] is functionally dependent on qty[0]. (If qty[0] is 10, then so is newQ[0].) Factors newQ[1] and newQ[2] have similar dependencies on values of qty[1] and qty[2].

Constraints are used in the nonemptyCart-emptyCart and nonemptyCart-nonemptyCart UPDATE transitions, to insure the factor values are consistent with expected results: an empty cart in one partition and a nonempty cart in the other. To limit its length the request in this example contains only a subset of the possible combinations consistent with each of these results. However including all of them is straightforward; details are provided with the shopping cart mapping table.

The test design is constructed following steps 1-6 of the design procedure.

The test case generator request is given below. The partition prefix, e.g. SE, indicates the transition (shopping to emptyCart) for each test case.

Shopping Cart Example - transition design - functionally dependent form
newItem
n
delChk[0]
item[0]
qty[0]
newQ[0]
delChk[1]
item[1]
qty[1]
newQ[1]
delChk[2]
item[2]
qty[2]
newQ[2]
i
q
state
event
#SE shopping to emptyCart
+ shopping to emptyCart
unset
unset 0
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
shopping
CART
#NE nonemptyCart to emptyCart
+ nonemptyCart to emptyCart; n=1; delChk[0]=1
unset
1
1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
UPDATE
+ nonemptyCart to emptyCart; n=1; newQ[0]=0
unset
1
0 1
itemA itemB itemC
1 2 10
0
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
UPDATE
+ nonemptyCart to emptyCart; n=2; delChk[0]=1; newQ[1]=0
unset
2
1
itemA itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
UPDATE
+ nonemptyCart to emptyCart; n=3; delChk[0]=1; delChk[1]=1; newQ[2]=0
unset
3
1
itemA
1 2 10
0 1 2 10
1
itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0
n/a
n/a
nonemptyCart
UPDATE
#SN shopping to nonemptyCart
+ shopping to nonemptyCart; no items yet
itemA itemB itemC
unset 0
n/a
n/a
n/a
qty[0]
n/a
n/a
n/a
qty[1]
n/a
n/a
n/a
qty[2]
n/a
n/a
shopping
CART
+ shopping to nonemptyCart; n=1
itemA itemB itemC
1
0
itemA itemB itemC
1 2 10
qty[0]
n/a
n/a
n/a
qty[1]
n/a
n/a
n/a
qty[2]
n/a
n/a
shopping
CART
+ shopping to nonemptyCart; n=2
itemA itemB itemC
2
0
itemA itemB
1 2 10
qty[0]
0
itemC
1 2 10
qty[1]
n/a
n/a
n/a
qty[2]
n/a
n/a
shopping
CART
+ shopping to nonemptyCart; n=3
itemA itemB itemC
3
0
itemA
1 2 10
qty[0]
0
itemB
1 2 10
qty[1]
0
itemC
1 2 10
qty[2]
n/a
n/a
shopping
CART
#NN nonemptyCart to nonemptyCart
+ nonemptyCart to nonemptyCart; n=1; CHECK
unset
1
0 1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
0
n/a
nonemptyCart
CHECK(i)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=2; CHECK
unset
2
0 1
itemA itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
0 1
n/a
nonemptyCart
CHECK(i)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=3; CHECK
unset
3
0 1
itemA
1 2 10
0 1 2 10
0 1
itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
0 1 2
n/a
nonemptyCart
CHECK(i)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=1; QTY
unset
1
0 1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
0
0 1 2 10
nonemptyCart
QTY(i,q)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=2; QTY
unset
2
0 1
itemA itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
0 1
0 1 2 10
nonemptyCart
QTY(i,q)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=3; QTY
unset
3
0 1
itemA
1 2 10
0 1 2 10
0 1
itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
0 1 2
0 1 2 10
nonemptyCart
QTY(i,q)[0<=i&&i<n]
+ nonemptyCart to nonemptyCart; n=1; UPDATE
unset
1
0
itemA itemB itemC
1 2 10
1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
UPDATE
+ nonemptyCart to nonemptyCart; n=2; UPDATE
unset
2
0 1
itemA itemB
1 2 10
0 1 2 10
0
itemC
1 2 10
1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
UPDATE
+ nonemptyCart to nonemptyCart; n=3; UPDATE
unset
3
0 1
itemA
1 2 10
0 1 2 10
0 1
itemB
1 2 10
0 1 2 10
0
itemC
1 2 10
1 2 10
n/a
n/a
nonemptyCart
UPDATE
#CN checkout to nonemptyCart
+ checkout to nonemptyCart; n=1
unset
1
0
itemA itemB itemC
1 2 10
qty[0]
n/a
n/a
n/a
qty[1]
n/a
n/a
n/a
qty[2]
n/a
n/a
checkout
CART
+ checkout to nonemptyCart; n=2
unset
2
0
itemA itemB
1 2 10
qty[0]
0
itemC
1 2 10
qty[1]
n/a
n/a
n/a
qty[2]
n/a
n/a
checkout
CART
+ checkout to nonemptyCart; n=3
unset
3
0
itemA
1 2 10
qty[0]
0
itemB
1 2 10
qty[1]
0
itemC
1 2 10
qty[2]
n/a
n/a
checkout
CART
#ES emptyCart to shopping
+ emptyCart to shopping
unset
0
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
emptyCart
SHOP
#NS nonemptyCart to shopping
+ nonemptyCart to shopping; n=1
unset
1
0 1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
SHOP
+ nonemptyCart to shopping; n=2
unset
2
0 1
itemA itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
SHOP
+ nonemptyCart to shopping; n=3
unset
3
0 1
itemA
1 2 10
0 1 2 10
0 1
itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
n/a
n/a
nonemptyCart
SHOP
#NC nonemptyCart to checkout
+ nonemptyCart to checkout; n=1
unset
1
0 1
itemA itemB itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
CHECKOUT
+ nonemptyCart to checkout; n=2
unset
2
0 1
itemA itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
n/a
n/a
n/a
n/a
n/a
n/a
nonemptyCart
CHECKOUT
+ nonemptyCart to checkout; n=3
unset
3
0 1
itemA
1 2 10
0 1 2 10
0 1
itemB
1 2 10
0 1 2 10
0 1
itemC
1 2 10
0 1 2 10
n/a
n/a
nonemptyCart
CHECKOUT

The shopping cart transition design has 187 test cases in 8 partitions in functionally dependent form. Partitions 3, 4 and 5 contain functionally dependent factors; the other partitions use fixed values only. All test cases start with an empty cart. The results tables follow.

#1. shopping to emptyCart
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
1 Value2 Values1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value170
SE1unsetunsetn/an/an/an/an/an/an/an/an/an/an/an/an/an/ashoppingCART17
SE2unset0n/an/an/an/an/an/an/an/an/an/an/an/an/an/ashoppingCART0

The test cases in partition 1 test the CART transition from the shopping state to the emptyCart state.

#2. nonemptyCart to emptyCart
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
1 Value3 Values2 Values3 Values3 Values4 Values3 Values3 Values4 Values5 Values3 Values2 Values4 Values2 Values1 Value1 Value1 Value1 Value986
NE1unset11itemA10n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE833
NE2unset31itemA10101itemB201itemC100n/an/anonemptyCartUPDATE701
NE3unset21itemA210itemC100n/an/an/an/an/an/anonemptyCartUPDATE610
NE4unset31itemA121itemB210itemC20n/an/anonemptyCartUPDATE542
NE5unset31itemA101itemB10101itemC10n/an/anonemptyCartUPDATE494
NE6unset21itemB1011itemC10n/an/an/an/an/an/anonemptyCartUPDATE447
NE7unset10itemC100n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE408
NE8unset31itemA221itemB1020itemC100n/an/anonemptyCartUPDATE378
NE9unset31itemA111itemB1101itemC100n/an/anonemptyCartUPDATE359
NE10unset21itemA1020itemC20n/an/an/an/an/an/anonemptyCartUPDATE342
NE11unset11itemB21n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE326
NE12unset21itemA1100itemC10n/an/an/an/an/an/anonemptyCartUPDATE312
NE13unset31itemA2101itemB110itemC10n/an/anonemptyCartUPDATE300
NE14unset31itemA1001itemB121itemC20n/an/anonemptyCartUPDATE290
NE15unset31itemA1011itemB220itemC10n/an/anonemptyCartUPDATE281
NE16unset11itemC110n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE273
NE17unset21itemB201itemC20n/an/an/an/an/an/anonemptyCartUPDATE265
NE18unset31itemA2101itemB10100itemC20n/an/anonemptyCartUPDATE257
NE19unset11itemB12n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE250
NE20unset31itemA1011itemB1011itemC100n/an/anonemptyCartUPDATE244
NE21unset31itemA1021itemB2101itemC10n/an/anonemptyCartUPDATE239
NE22unset31itemA211itemB1001itemC20n/an/anonemptyCartUPDATE236
NE23unset31itemA101itemB100itemC10n/an/anonemptyCartUPDATE233
NE24unset10itemA20n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE231
NE25unset10itemB10n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE229
NE26unset21itemB10101itemC100n/an/an/an/an/an/anonemptyCartUPDATE227
NE27unset31itemA201itemB211itemC100n/an/anonemptyCartUPDATE225
NE28unset31itemA1101itemB1021itemC20n/an/anonemptyCartUPDATE223
NE29unset11itemC102n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE222
NE30unset11itemC11n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE221
NE31unset11itemC20n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE220
NE32unset21itemA100itemC10n/an/an/an/an/an/anonemptyCartUPDATE219
NE33unset21itemB110itemC20n/an/an/an/an/an/anonemptyCartUPDATE218
NE34unset21itemA220itemC10n/an/an/an/an/an/anonemptyCartUPDATE217

The test cases in partition 2 test the UPDATE transitions from the nonemptyCart state to the emptyCart state with all allowed pairs of factor values. Test case NE3 is set up as illustrated below.

The items already in the cart are constrained to be different, to appear in separate cart positions, and the UPDATE events are constrained to yield an empty cart.

NE3 is set up by placing itemA and itemC in the cart from the shopping page. New quantities of 2 for itemA and 10 for itemC are entered, and the update button is clicked. The delete box is checked for itemA, and a new quantity 1 is entered. A new quantity 0 is entered for itemC. The update button is clicked to trigger the transition to emptyCart.

#3. shopping to nonemptyCart
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
3 Values5 Values2 Values4 Values4 Values1 Value2 Values3 Values4 Values1 Value2 Values2 Values4 Values1 Value1 Value1 Value1 Value1 Value817
SN1itemAunsetn/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART664
SN2itemB30itemA1qty[0]0itemB2qty[1]0itemC10qty[2]n/an/ashoppingCART532
SN3itemB20itemB10qty[0]0itemC1qty[1]n/an/an/aqty[2]n/an/ashoppingCART448
SN4itemC10itemA2qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART391
SN5itemB30itemA2qty[0]0itemB10qty[1]0itemC1qty[2]n/an/ashoppingCART352
SN6itemB10itemC1qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART324
SN7itemA30itemA2qty[0]0itemB2qty[1]0itemC2qty[2]n/an/ashoppingCART297
SN8itemB0n/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART277
SN9itemC20itemB1qty[0]0itemC10qty[1]n/an/an/aqty[2]n/an/ashoppingCART261
SN10itemC30itemA10qty[0]0itemB2qty[1]0itemC1qty[2]n/an/ashoppingCART246
SN11itemA20itemB2qty[0]0itemC2qty[1]n/an/an/aqty[2]n/an/ashoppingCART234
SN12itemA30itemA1qty[0]0itemB1qty[1]0itemC1qty[2]n/an/ashoppingCART223
SN13itemA10itemB10qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART213
SN14itemA30itemA10qty[0]0itemB10qty[1]0itemC10qty[2]n/an/ashoppingCART208
SN15itemC30itemA2qty[0]0itemB1qty[1]0itemC10qty[2]n/an/ashoppingCART203
SN16itemCunsetn/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART199
SN17itemB30itemA10qty[0]0itemB1qty[1]0itemC2qty[2]n/an/ashoppingCART196
SN18itemC30itemA1qty[0]0itemB10qty[1]0itemC2qty[2]n/an/ashoppingCART193
SN19itemC10itemC10qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART191
SN20itemA10itemC2qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART189
SN21itemA20itemA1qty[0]0itemC1qty[1]n/an/an/aqty[2]n/an/ashoppingCART187
SN22itemBunsetn/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART186
SN23itemA0n/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART185
SN24itemC0n/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART184

The test cases in partition 3 test the CART transitions from the shopping state to the nonemptyCart state with all allowed pairs of factor values. Test case SN2 is set up as illustrated below.

The items already in the cart are constrained to be different, to appear in separate cart positions. In addition the values for newQ[0], newQ[1] and newQ[2] are functionally dependent on those of qty[0], qty[1] and qty[2] respectively. This is because the exit action of the cart state sets newQ[i] equal to qty[i]. (Any new quantity entered is abandoned if the cart is not updated.) So the value for newQ[i] is constrained to be the same as qty[i] before the transition back to nonemptyCart. Each of the newQ[i] factors is one function of one determinant factor because it always equals qty[i] in this partition. In this case the functionally dependent form is equivalent to the fixed values form: Both forms yield test cases covering the same values and pairs.

SN2 is set up by placing itemA, itemB and itemC in the cart from the shopping page. New quantities of 2 for itemB and 10 for itemC are entered, and the update button is clicked. The shop button is clicked to return to the shopping page, and itemB is placed in the cart (again) to trigger the transition to nonemptyCart.

#4. nonemptyCart to nonemptyCart
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
1 Value3 Values2 Values3 Values3 Values4 Values3 Values3 Values4 Values5 Values3 Values2 Values4 Values5 Values4 Values5 Values1 Value3 Values1576
NN1unset10itemA10n/an/an/an/an/an/an/an/a0n/anonemptyCartCHECK(i)[0<=i&&i<n]1423
NN2unset31itemA211itemB211itemC2111nonemptyCartQTY(i,q)[0<=i&&i<n]1273
NN3unset31itemA1000itemB1020itemC102n/an/anonemptyCartUPDATE1148
NN4unset20itemB1021itemC20n/an/an/an/a12nonemptyCartQTY(i,q)[0<=i&&i<n]1032
NN5unset30itemA1100itemB1100itemC110010nonemptyCartQTY(i,q)[0<=i&&i<n]926
NN6unset21itemB2100itemC101n/an/an/an/an/an/anonemptyCartUPDATE850
NN7unset31itemA1001itemB1001itemC10020nonemptyCartQTY(i,q)[0<=i&&i<n]783
NN8unset11itemC101n/an/an/an/an/an/an/an/a01nonemptyCartQTY(i,q)[0<=i&&i<n]727
NN9unset31itemA121itemB121itemC1202nonemptyCartQTY(i,q)[0<=i&&i<n]678
NN10unset31itemA10101itemB2101itemC2101n/anonemptyCartCHECK(i)[0<=i&&i<n]637
NN11unset21itemB110itemC22n/an/an/an/a110nonemptyCartQTY(i,q)[0<=i&&i<n]603
NN12unset10itemB22n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE571
NN13unset31itemA210itemB1010itemC1012n/anonemptyCartCHECK(i)[0<=i&&i<n]542
NN14unset20itemA100itemC10n/an/an/an/a00nonemptyCartQTY(i,q)[0<=i&&i<n]514
NN15unset31itemA10101itemB100itemC11n/an/anonemptyCartUPDATE490
NN16unset30itemA101itemB10101itemC2122nonemptyCartQTY(i,q)[0<=i&&i<n]467
NN17unset21itemB120itemC1010n/an/an/an/a11nonemptyCartQTY(i,q)[0<=i&&i<n]448
NN18unset30itemA101itemB211itemC102210nonemptyCartQTY(i,q)[0<=i&&i<n]429
NN19unset31itemA210itemB101itemC101022nonemptyCartQTY(i,q)[0<=i&&i<n]412
NN20unset11itemC210n/an/an/an/an/an/an/an/a00nonemptyCartQTY(i,q)[0<=i&&i<n]396
NN21unset31itemA10101itemB210itemC1022nonemptyCartQTY(i,q)[0<=i&&i<n]381
NN22unset30itemA1011itemB2100itemC210n/an/anonemptyCartUPDATE368
NN23unset31itemA221itemB10101itemC1000n/anonemptyCartCHECK(i)[0<=i&&i<n]356
NN24unset30itemA101itemB1021itemC101011nonemptyCartQTY(i,q)[0<=i&&i<n]345
NN25unset31itemA1020itemB101itemC21210nonemptyCartQTY(i,q)[0<=i&&i<n]334
NN26unset31itemA211itemB1020itemC10210nonemptyCartQTY(i,q)[0<=i&&i<n]324
NN27unset31itemA1021itemB211itemC101000nonemptyCartQTY(i,q)[0<=i&&i<n]315
NN28unset31itemA10100itemB101itemC10211nonemptyCartQTY(i,q)[0<=i&&i<n]306
NN29unset30itemA100itemB100itemC100n/anonemptyCartCHECK(i)[0<=i&&i<n]298
NN30unset11itemC10n/an/an/an/an/an/an/an/a02nonemptyCartQTY(i,q)[0<=i&&i<n]290
NN31unset10itemC22n/an/an/an/an/an/an/an/a010nonemptyCartQTY(i,q)[0<=i&&i<n]282
NN32unset31itemA10101itemB1021itemC2100nonemptyCartQTY(i,q)[0<=i&&i<n]274
NN33unset31itemA1021itemB10100itemC1011nonemptyCartQTY(i,q)[0<=i&&i<n]267
NN34unset31itemA211itemB10101itemC10200nonemptyCartQTY(i,q)[0<=i&&i<n]261
NN35unset21itemB201itemC21n/an/an/an/a1n/anonemptyCartCHECK(i)[0<=i&&i<n]256
NN36unset10itemC12n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE251
NN37unset31itemA1000itemB111itemC222n/anonemptyCartCHECK(i)[0<=i&&i<n]248
NN38unset21itemB101itemC10n/an/an/an/a10nonemptyCartQTY(i,q)[0<=i&&i<n]245
NN39unset30itemA100itemB100itemC1000nonemptyCartQTY(i,q)[0<=i&&i<n]243
NN40unset11itemB20n/an/an/an/an/an/an/an/a0n/anonemptyCartCHECK(i)[0<=i&&i<n]242
NN41unset10itemC100n/an/an/an/an/an/an/an/a0n/anonemptyCartCHECK(i)[0<=i&&i<n]241
NN42unset20itemB1000itemC102n/an/an/an/a1n/anonemptyCartCHECK(i)[0<=i&&i<n]240
NN43unset31itemA10101itemB1011itemC200n/anonemptyCartCHECK(i)[0<=i&&i<n]239
NN44unset30itemA1010itemB1010itemC10121nonemptyCartQTY(i,q)[0<=i&&i<n]238

The test cases in partition 4 test the CHECK(i), QTY(i,q) and UPDATE transitions from the nonemptyCart state to the nonemptyCart state. Test cases NN6, NN10 and NN11 are set up as illustrated below.

The items already in the cart are constrained to be different, to appear in separate cart positions, and blocks with the UPDATE event are constrained not to yield an empty cart. In addition the event value CHECK(i) is functionally dependent on i, and QTY(i,q) is functionally dependent on i and q.

In functionally dependent form the CHECK(i) function is treated as one value for test case generation. However, in each test case, it is determined by i, so all allowed pairs of i and CHECK(i) are covered. Moreover, all allowed pairs of i and the nondeterminant factor values are covered. Each nondeterminant factor value is paired with at least one value of CHECK(i) and with the only fixed value of the event factor (UPDATE). To insure that all pairs of CHECK(i) and the nondeterminant factors are covered, the fixed values procedure should be used to convert the partition to fixed values form.

QTY(i,q) also is treated as one value for test case generation, so each nondeterminant factor value is paired with at least one value of QTY(i,q). All pairs of the determinant factors (i and q) and nondeterminant factor values are covered. To insure that all values of QTY(i,q) are covered, and that all pairs of QTY(i,q) and the nondeterminant factors are covered, the fixed values procedure should be used to convert the partition to fixed values form.

NN6 is set up by placing itemB and itemC in the cart from the shopping page. New quantities of 2 for itemB and 10 for itemC are entered, and the update button is clicked. The delete box is checked for itemB, and a new quantity 10 is entered. A new quantity 1 is entered for itemC. The update button is clicked to trigger the transition to nonemptyCart.

NN10 is set up by placing itemA, itemB and itemC in the cart from the shopping page. New quantities of 10 for itemA, 2 for itemB and 2 for itemC are entered; the update button is clicked. The delete boxes are checked for itemA, itemB and itemC. New quantities of 10 for itemB and 10 for itemC are entered. The delete box is unchecked for itemB to trigger the transition to nonemptyCart.

NN11 is set up by placing itemB and itemC in the cart from the shopping page. A new quantity of 2 for itemC is entered, and the update button is clicked. A new quantity of 10 is entered for itemC to trigger the transition to nonemptyCart.

#5. checkout to nonemptyCart
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
1 Value3 Values1 Value3 Values3 Values1 Value2 Values3 Values4 Values1 Value2 Values2 Values4 Values1 Value1 Value1 Value1 Value1 Value568
CN1unset10itemC10qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/acheckoutCART415
CN2unset30itemA1qty[0]0itemB1qty[1]0itemC1qty[2]n/an/acheckoutCART298
CN3unset20itemB2qty[0]0itemC2qty[1]n/an/an/aqty[2]n/an/acheckoutCART220
CN4unset30itemA10qty[0]0itemB10qty[1]0itemC10qty[2]n/an/acheckoutCART181
CN5unset30itemA2qty[0]0itemB2qty[1]0itemC2qty[2]n/an/acheckoutCART154
CN6unset10itemA1qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/acheckoutCART140
CN7unset20itemB10qty[0]0itemC1qty[1]n/an/an/aqty[2]n/an/acheckoutCART130
CN8unset20itemB1qty[0]0itemC10qty[1]n/an/an/aqty[2]n/an/acheckoutCART120
CN9unset10itemB2qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/acheckoutCART112
CN10unset20itemA1qty[0]0itemC2qty[1]n/an/an/aqty[2]n/an/acheckoutCART109
CN11unset30itemA2qty[0]0itemB10qty[1]0itemC1qty[2]n/an/acheckoutCART106
CN12unset30itemA2qty[0]0itemB1qty[1]0itemC10qty[2]n/an/acheckoutCART103
CN13unset30itemA10qty[0]0itemB2qty[1]0itemC1qty[2]n/an/acheckoutCART100
CN14unset30itemA1qty[0]0itemB2qty[1]0itemC10qty[2]n/an/acheckoutCART98
CN15unset30itemA10qty[0]0itemB1qty[1]0itemC2qty[2]n/an/acheckoutCART96
CN16unset30itemA1qty[0]0itemB10qty[1]0itemC2qty[2]n/an/acheckoutCART94
CN17unset10itemC1qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/acheckoutCART93
CN18unset10itemC2qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/acheckoutCART92

The test cases in partition 5 test the CART transitions from the checkout state to the nonemptyCart state with all allowed pairs of factor values. Test case CN3 is set up as illustrated below.

The items already in the cart are constrained to be different, to appear in separate cart positions. In addition the values for newQ[0], newQ[1] and newQ[2] are functionally dependent on those of qty[0], qty[1] and qty[2] respectively. This is because the exit action of the cart state sets newQ[i] equal to qty[i]. (Any new quantity entered is abandoned if the cart is not updated.) So the value for newQ[i] is constrained to be the same as qty[i] before the transition back to nonemptyCart. Each of the newQ[i] factors is one function of one determinant factor because it always equals qty[i] in this partition. In this case the functionally dependent form is equivalent to the fixed values form: Both forms yield test cases covering the same values and pairs.

CN3 is set up by placing itemB and itemC in the cart from the shopping page. New quantities of 2 for itemB and 2 for itemC are entered, and the update button is clicked. The checkout button is clicked, and then the cart button is clicked to trigger the transition to nonemptyCart.

#6. emptyCart to shopping
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value1 Value153
ES1unset0n/an/an/an/an/an/an/an/an/an/an/an/an/an/aemptyCartSHOP0

The test case in partition 6 tests the SHOP transition from the emptyCart state to the shopping state with all allowed pairs of factor values.

#7. nonemptyCart to shopping
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
1 Value3 Values2 Values3 Values3 Values4 Values3 Values3 Values4 Values5 Values3 Values2 Values4 Values5 Values1 Value1 Value1 Value1 Value1118
NS1unset10itemA10n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP965
NS2unset31itemA1011itemB1000itemC101n/an/anonemptyCartSHOP827
NS3unset31itemA220itemB221itemC20n/an/anonemptyCartSHOP719
NS4unset21itemB10101itemC11n/an/an/an/an/an/anonemptyCartSHOP620
NS5unset30itemA1101itemB111itemC12n/an/anonemptyCartSHOP555
NS6unset20itemA1010itemC210n/an/an/an/an/an/anonemptyCartSHOP508
NS7unset30itemA101itemB2101itemC1010n/an/anonemptyCartSHOP470
NS8unset10itemC22n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP433
NS9unset20itemB1000itemC102n/an/an/an/an/an/anonemptyCartSHOP405
NS10unset30itemA100itemB100itemC10n/an/anonemptyCartSHOP381
NS11unset11itemC1010n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP363
NS12unset30itemA1100itemB1020itemC21n/an/anonemptyCartSHOP345
NS13unset31itemA211itemB1011itemC10n/an/anonemptyCartSHOP329
NS14unset31itemA1021itemB101itemC22n/an/anonemptyCartSHOP314
NS15unset30itemA1020itemB1010itemC1010n/an/anonemptyCartSHOP300
NS16unset21itemB221itemC110n/an/an/an/an/an/anonemptyCartSHOP288
NS17unset31itemA111itemB121itemC110n/an/anonemptyCartSHOP276
NS18unset10itemB101n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP265
NS19unset31itemA201itemB211itemC21n/an/anonemptyCartSHOP254
NS20unset30itemA210itemB2100itemC22n/an/anonemptyCartSHOP243
NS21unset20itemA10100itemC20n/an/an/an/an/an/anonemptyCartSHOP234
NS22unset31itemA121itemB1101itemC11n/an/anonemptyCartSHOP227
NS23unset31itemA10101itemB10101itemC100n/an/anonemptyCartSHOP220
NS24unset31itemA2101itemB201itemC210n/an/anonemptyCartSHOP214
NS25unset31itemA1001itemB1021itemC102n/an/anonemptyCartSHOP209
NS26unset21itemB110itemC101n/an/an/an/an/an/anonemptyCartSHOP206
NS27unset11itemC11n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP204
NS28unset31itemA2100itemB101itemC100n/an/anonemptyCartSHOP202
NS29unset31itemA10101itemB210itemC11n/an/anonemptyCartSHOP200
NS30unset10itemC100n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP199
NS31unset21itemB201itemC21n/an/an/an/an/an/anonemptyCartSHOP198
NS32unset21itemB1021itemC100n/an/an/an/an/an/anonemptyCartSHOP197

The test cases in partition 7 test the SHOP transitions from the nonemptyCart state to the shopping state with all allowed pairs of factor values. Test case NS1 is set up as illustrated below.

The items already in the cart are constrained to be different, to appear in separate cart positions.

NS1 is set up by placing itemA in the cart from the shopping page. A new quantity 0 is entered for itemA. The shop button is clicked to trigger the transition to shopping.

#8. nonemptyCart to checkout
Test
Case ID
newItem n delChk[0] item[0] qty[0] newQ[0] delChk[1] item[1] qty[1] newQ[1] delChk[2] item[2] qty[2] newQ[2] i q state event Combo
Countdown
1 Value3 Values2 Values3 Values3 Values4 Values3 Values3 Values4 Values5 Values3 Values2 Values4 Values5 Values1 Value1 Value1 Value1 Value1118
NC1unset10itemA10n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT965
NC2unset31itemA1011itemB1000itemC101n/an/anonemptyCartCHECKOUT827
NC3unset31itemA220itemB221itemC20n/an/anonemptyCartCHECKOUT719
NC4unset21itemB10101itemC11n/an/an/an/an/an/anonemptyCartCHECKOUT620
NC5unset30itemA1101itemB111itemC12n/an/anonemptyCartCHECKOUT555
NC6unset20itemA1010itemC210n/an/an/an/an/an/anonemptyCartCHECKOUT508
NC7unset30itemA101itemB2101itemC1010n/an/anonemptyCartCHECKOUT470
NC8unset10itemC22n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT433
NC9unset20itemB1000itemC102n/an/an/an/an/an/anonemptyCartCHECKOUT405
NC10unset30itemA100itemB100itemC10n/an/anonemptyCartCHECKOUT381
NC11unset11itemC1010n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT363
NC12unset30itemA1100itemB1020itemC21n/an/anonemptyCartCHECKOUT345
NC13unset31itemA211itemB1011itemC10n/an/anonemptyCartCHECKOUT329
NC14unset31itemA1021itemB101itemC22n/an/anonemptyCartCHECKOUT314
NC15unset30itemA1020itemB1010itemC1010n/an/anonemptyCartCHECKOUT300
NC16unset21itemB221itemC110n/an/an/an/an/an/anonemptyCartCHECKOUT288
NC17unset31itemA111itemB121itemC110n/an/anonemptyCartCHECKOUT276
NC18unset10itemB101n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT265
NC19unset31itemA201itemB211itemC21n/an/anonemptyCartCHECKOUT254
NC20unset30itemA210itemB2100itemC22n/an/anonemptyCartCHECKOUT243
NC21unset20itemA10100itemC20n/an/an/an/an/an/anonemptyCartCHECKOUT234
NC22unset31itemA121itemB1101itemC11n/an/anonemptyCartCHECKOUT227
NC23unset31itemA10101itemB10101itemC100n/an/anonemptyCartCHECKOUT220
NC24unset31itemA2101itemB201itemC210n/an/anonemptyCartCHECKOUT214
NC25unset31itemA1001itemB1021itemC102n/an/anonemptyCartCHECKOUT209
NC26unset21itemB110itemC101n/an/an/an/an/an/anonemptyCartCHECKOUT206
NC27unset11itemC11n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT204
NC28unset31itemA2100itemB101itemC100n/an/anonemptyCartCHECKOUT202
NC29unset31itemA10101itemB210itemC11n/an/anonemptyCartCHECKOUT200
NC30unset10itemC100n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT199
NC31unset21itemB201itemC21n/an/an/an/an/an/anonemptyCartCHECKOUT198
NC32unset21itemB1021itemC100n/an/an/an/an/an/anonemptyCartCHECKOUT197

The test cases in partition 8 test the CHECKOUT transitions from the nonemptyCart state to the checkout state with all allowed pairs of factor values. Test case NC4 is set up as illustrated below.

The items already in the cart are constrained to be different, to appear in separate cart positions.

NC4 is set up by placing itemB and itemC in the cart from the shopping page. A new quantity 10 is entered for itemB, and the update button is clicked. The delete boxes are checked for itemB and for itemC. The checkout button is clicked to trigger the transition to checkout.

<Shopping Cart Test Models Transition - Fixed Values>

Copyright © 2003-2018 Testcover.com, LLC. All rights reserved.