Testcover.com Testcover.com
Tutorial - Shopping Cart Example -
Target State 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 target state model, in which each partition includes all the transitions leading to a particular target state. 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 which are grouped into four partitions according to their target states:

# all states to emptyCart
# all states to nonemptyCart
# all states to shopping
# all states 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 target state test design is constructed from the shopping cart transition design (functionally dependent form) by following steps 12-13 of the design procedure. The relationship between the blocks of the shopping cart transition design and those of the target state design is presented in the shopping cart mapping table. All the partitions with transitions leading to a particular target state are combined into one partition. So the eight transition design partitions are combined into four target state partitions in this design.

The test case generator request is given below. The partition prefix, e.g. E, indicates the target state (emptyCart) for each test case.

Shopping Cart Example - target state 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
#E states 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
+ 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
#N states 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
+ 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
+ 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
#S states 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
+ 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
#C states 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 target state design has 172 test cases in 4 partitions in functionally dependent form. Partition 2 contains functionally dependent factors; the other partitions use fixed values only. All test cases start with an empty cart. The results tables follow.

#1. states 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 Value5 Values3 Values4 Values4 Values5 Values3 Values3 Values4 Values5 Values3 Values2 Values4 Values2 Values1 Value1 Value2 Values2 Values1361
E1unsetunsetn/an/an/an/an/an/an/an/an/an/an/an/an/an/ashoppingCART1208
E2unset31itemA111itemB1101itemC100n/an/anonemptyCartUPDATE1058
E3unset21itemB201itemC20n/an/an/an/an/an/anonemptyCartUPDATE944
E4unset11itemC102n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE870
E5unset31itemA2101itemB110itemC10n/an/anonemptyCartUPDATE802
E6unset31itemA1101itemB1021itemC20n/an/anonemptyCartUPDATE752
E7unset21itemA1100itemC10n/an/an/an/an/an/anonemptyCartUPDATE707
E8unset10itemB10n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE673
E9unset31itemA1021itemB2101itemC10n/an/anonemptyCartUPDATE643
E10unset21itemA210itemC100n/an/an/an/an/an/anonemptyCartUPDATE623
E11unset0n/an/an/an/an/an/an/an/an/an/an/an/an/an/ashoppingCART606
E12unset31itemA101itemB100itemC10n/an/anonemptyCartUPDATE590
E13unset11itemA210n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE575
E14unset31itemA221itemB1020itemC100n/an/anonemptyCartUPDATE563
E15unset31itemA121itemB210itemC20n/an/anonemptyCartUPDATE553
E16unset21itemA1020itemC20n/an/an/an/an/an/anonemptyCartUPDATE544
E17unset31itemA1001itemB121itemC20n/an/anonemptyCartUPDATE535
E18unset31itemA1011itemB220itemC10n/an/anonemptyCartUPDATE527
E19unset11itemC11n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE520
E20unset31itemA10101itemB201itemC100n/an/anonemptyCartUPDATE513
E21unset31itemA1011itemB1011itemC100n/an/anonemptyCartUPDATE507
E22unset31itemA2101itemB10100itemC20n/an/anonemptyCartUPDATE501
E23unset10itemC20n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE497
E24unset21itemB1011itemC10n/an/an/an/an/an/anonemptyCartUPDATE494
E25unset31itemA211itemB1001itemC20n/an/anonemptyCartUPDATE491
E26unset31itemA101itemB10101itemC10n/an/anonemptyCartUPDATE488
E27unset21itemB121itemC100n/an/an/an/an/an/anonemptyCartUPDATE486
E28unset31itemA201itemB211itemC100n/an/anonemptyCartUPDATE484
E29unset11itemB1010n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE483
E30unset11itemC110n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE482
E31unset10itemC100n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE481
E32unset10itemA20n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE480
E33unset21itemA100itemC10n/an/an/an/an/an/anonemptyCartUPDATE479
E34unset21itemB110itemC20n/an/an/an/an/an/anonemptyCartUPDATE478
E35unset21itemA220itemC10n/an/an/an/an/an/anonemptyCartUPDATE477

The test cases in partition 1 test the allowed transitions from all states to the emptyCart state with all allowed pairs of factor values. Test case E7 is 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 to yield an empty cart.

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

#2. states 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
4 Values5 Values3 Values4 Values4 Values5 Values3 Values3 Values4 Values6 Values3 Values2 Values4 Values6 Values4 Values5 Values3 Values4 Values2438
N1itemAunsetn/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART2285
N2unset30itemA100itemB100itemC100n/anonemptyCartCHECK(i)[0<=i&&i<n]2132
N3unset21itemB201itemC21n/an/an/an/a11nonemptyCartQTY(i,q)[0<=i&&i<n]1985
N4unset31itemA1021itemB1021itemC10222nonemptyCartQTY(i,q)[0<=i&&i<n]1856
N5unset10itemC1010n/an/an/an/an/an/an/an/an/an/anonemptyCartUPDATE1750
N6unset30itemA2qty[0]0itemB2qty[1]0itemC2qty[2]n/an/acheckoutCART1653
N7itemC20itemB1qty[0]0itemC10qty[1]n/an/an/aqty[2]n/an/ashoppingCART1576
N8unset31itemA2101itemB2101itemC210110nonemptyCartQTY(i,q)[0<=i&&i<n]1503
N9unset31itemA111itemB111itemC1101nonemptyCartQTY(i,q)[0<=i&&i<n]1436
N10unset10itemB12n/an/an/an/an/an/an/an/a00nonemptyCartQTY(i,q)[0<=i&&i<n]1379
N11unset21itemB1011itemC12n/an/an/an/a1n/anonemptyCartCHECK(i)[0<=i&&i<n]1329
N12unset31itemA210itemB100itemC1010n/an/anonemptyCartUPDATE1287
N13unset20itemA1000itemC1010n/an/an/an/a010nonemptyCartQTY(i,q)[0<=i&&i<n]1247
N14itemB30itemA10qty[0]0itemB1qty[1]0itemC2qty[2]n/an/ashoppingCART1211
N15unset30itemA111itemB2101itemC1022n/anonemptyCartCHECK(i)[0<=i&&i<n]1180
N16unset31itemA1001itemB1001itemC10020nonemptyCartQTY(i,q)[0<=i&&i<n]1149
N17unset30itemA221itemB1020itemC21n/an/anonemptyCartUPDATE1119
N18unset10itemC21n/an/an/an/an/an/an/an/a02nonemptyCartQTY(i,q)[0<=i&&i<n]1090
N19itemB0n/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART1064
N20unset20itemB1021itemC20n/an/an/an/a12nonemptyCartQTY(i,q)[0<=i&&i<n]1042
N21unset30itemA1010itemB1010itemC10121nonemptyCartQTY(i,q)[0<=i&&i<n]1020
N22unset30itemA220itemB1100itemC12n/an/anonemptyCartUPDATE1001
N23unset10itemC1qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/acheckoutCART983
N24unset11itemA11n/an/an/an/an/an/an/an/a010nonemptyCartQTY(i,q)[0<=i&&i<n]966
N25itemC30itemA10qty[0]0itemB2qty[1]0itemC1qty[2]n/an/ashoppingCART950
N26unset30itemA121itemB1011itemC2102n/anonemptyCartCHECK(i)[0<=i&&i<n]934
N27itemA30itemA10qty[0]0itemB10qty[1]0itemC10qty[2]n/an/ashoppingCART919
N28unset21itemB1100itemC101n/an/an/an/a12nonemptyCartQTY(i,q)[0<=i&&i<n]905
N29unset10itemC100n/an/an/an/an/an/an/an/a0n/anonemptyCartCHECK(i)[0<=i&&i<n]893
N30unset31itemA211itemB1020itemC10210nonemptyCartQTY(i,q)[0<=i&&i<n]881
N31unset31itemA10100itemB101itemC10211nonemptyCartQTY(i,q)[0<=i&&i<n]870
N32unset31itemA10101itemB1021itemC2100nonemptyCartQTY(i,q)[0<=i&&i<n]861
N33unset31itemA10101itemB210itemC1022nonemptyCartQTY(i,q)[0<=i&&i<n]852
N34unset20itemB200itemC22n/an/an/an/an/an/anonemptyCartUPDATE843
N35unset31itemA1021itemB10100itemC1011nonemptyCartQTY(i,q)[0<=i&&i<n]835
N36itemCunsetn/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART828
N37unset11itemC101n/an/an/an/an/an/an/an/a01nonemptyCartQTY(i,q)[0<=i&&i<n]821
N38unset31itemA1020itemB101itemC21210nonemptyCartQTY(i,q)[0<=i&&i<n]814
N39unset31itemA1021itemB211itemC101000nonemptyCartQTY(i,q)[0<=i&&i<n]807
N40unset30itemA101itemB10101itemC2122nonemptyCartQTY(i,q)[0<=i&&i<n]800
N41itemA10itemC2qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART794
N42itemB20itemB1qty[0]0itemC2qty[1]n/an/an/aqty[2]n/an/ashoppingCART789
N43unset31itemA211itemB211itemC211n/anonemptyCartCHECK(i)[0<=i&&i<n]784
N44unset30itemA101itemB211itemC102210nonemptyCartQTY(i,q)[0<=i&&i<n]779
N45unset30itemA101itemB1021itemC101011nonemptyCartQTY(i,q)[0<=i&&i<n]774
N46unset31itemA211itemB10101itemC10200nonemptyCartQTY(i,q)[0<=i&&i<n]769
N47unset20itemB10qty[0]0itemC1qty[1]n/an/an/aqty[2]n/an/acheckoutCART764
N48itemA20itemA1qty[0]0itemC1qty[1]n/an/an/aqty[2]n/an/ashoppingCART760
N49unset20itemA100itemC10n/an/an/an/a00nonemptyCartQTY(i,q)[0<=i&&i<n]756
N50itemB30itemA2qty[0]0itemB10qty[1]0itemC1qty[2]n/an/ashoppingCART753
N51itemC30itemA2qty[0]0itemB1qty[1]0itemC10qty[2]n/an/ashoppingCART750
N52unset20itemA100itemC11n/an/an/an/an/an/anonemptyCartUPDATE747
N53itemC10itemC10qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART745
N54itemB10itemC1qty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART743
N55itemA20itemB2qty[0]0itemC2qty[1]n/an/an/aqty[2]n/an/ashoppingCART741
N56unset21itemB1101itemC1010n/an/an/an/a1n/anonemptyCartCHECK(i)[0<=i&&i<n]739
N57unset10itemC22n/an/an/an/an/an/an/an/a010nonemptyCartQTY(i,q)[0<=i&&i<n]737
N58unset30itemA100itemB100itemC1000nonemptyCartQTY(i,q)[0<=i&&i<n]735
N59unset31itemA210itemB101itemC101022nonemptyCartQTY(i,q)[0<=i&&i<n]733
N60unset31itemA201itemB201itemC2010nonemptyCartQTY(i,q)[0<=i&&i<n]731
N61unset30itemA10qty[0]0itemB10qty[1]0itemC10qty[2]n/an/acheckoutCART729
N62itemBunsetn/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART728
N63itemA0n/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART727
N64itemC0n/an/an/aqty[0]n/an/an/aqty[1]n/an/an/aqty[2]n/an/ashoppingCART726
N65itemA30itemA1qty[0]0itemB1qty[1]0itemC1qty[2]n/an/ashoppingCART725
N66itemA30itemA2qty[0]0itemB2qty[1]0itemC2qty[2]n/an/ashoppingCART724
N67itemB30itemA1qty[0]0itemB2qty[1]0itemC10qty[2]n/an/ashoppingCART723
N68itemC30itemA1qty[0]0itemB10qty[1]0itemC2qty[2]n/an/ashoppingCART722
N69unset31itemA1000itemB111itemC222n/anonemptyCartCHECK(i)[0<=i&&i<n]721
N70unset31itemA1011itemB200itemC1102n/anonemptyCartCHECK(i)[0<=i&&i<n]720
N71unset11itemC210n/an/an/an/an/an/an/an/a00nonemptyCartQTY(i,q)[0<=i&&i<n]719
N72unset11itemB1010n/an/an/an/an/an/an/an/a010nonemptyCartQTY(i,q)[0<=i&&i<n]718
N73unset31itemA211itemB211itemC2111nonemptyCartQTY(i,q)[0<=i&&i<n]717
N74unset30itemA1qty[0]0itemB1qty[1]0itemC1qty[2]n/an/acheckoutCART716

The test cases in partition 2 test the allowed transitions from all states to the nonemptyCart state with all allowed pairs of factor values. Test cases N2, N4, N6, N7 and N22 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 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.

In the shopping cart transition design the newQ[0] factor is one function of one determinant factor because it always equals qty[0] in its partition. However, in the target state design the newQ[0] factor has fixed values also, so newQ[0] is not one function of one determinant factor. To insure that all pairs of newQ[0] and the nondeterminant factors are covered, the fixed values procedure should be used to convert the partition to fixed values form. Similar reasoning holds for newQ[1] and newQ[2].

The event value CHECK(i) is functionally dependent on i, and QTY(i,q) is functionally dependent on i and q. The event factor is not one function of one factor in this partition. To insure that all values of CHECK(i) and QTY(i,q) are paired with their nondeterminant factors, the fixed values procedure should be used to convert the partition to fixed values form.

N2 is set up by placing itemA, itemB and itemC in the cart from the shopping page. New quantities of 0 for itemA, 0 for itemB and 0 for itemC are entered. The delete box is checked for itemA to trigger the transition to nonemptyCart.

N4 is set up by placing itemA, itemB and itemC in the cart from the shopping page. New quantities of 10 for itemA, 10 for itemB and 10 for itemC are entered; the update button is clicked. The delete boxes are checked for itemA, itemB and itemC. New quantities of 2 for itemA, 2 for itemB and 2 for itemC are entered. A new quantity of 2 is entered for itemC (again) to trigger the transition to nonemptyCart.

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

N7 is set up by placing itemB and itemC in the cart from the shopping page. A new quantity of 10 for itemC is entered, and the update button is clicked. The shop button is clicked, and then another itemC is placed in the cart from the shopping page to trigger the transition to nonemptyCart.

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

#3. states 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 Value4 Values3 Values4 Values4 Values5 Values3 Values3 Values4 Values5 Values3 Values2 Values4 Values5 Values1 Value1 Value2 Values1 Value1411
S1unset0n/an/an/an/an/an/an/an/an/an/an/an/an/an/aemptyCartSHOP1258
S2unset30itemA100itemB100itemC10n/an/anonemptyCartSHOP1111
S3unset21itemB201itemC21n/an/an/an/an/an/anonemptyCartSHOP995
S4unset31itemA10101itemB10101itemC100n/an/anonemptyCartSHOP898
S5unset30itemA210itemB2100itemC22n/an/anonemptyCartSHOP831
S6unset10itemC22n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP767
S7unset20itemA2100itemC102n/an/an/an/an/an/anonemptyCartSHOP718
S8unset30itemA1020itemB1010itemC1010n/an/anonemptyCartSHOP674
S9unset31itemA121itemB1101itemC11n/an/anonemptyCartSHOP638
S10unset21itemB1011itemC12n/an/an/an/an/an/anonemptyCartSHOP606
S11unset11itemC11n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP583
S12unset31itemA2101itemB201itemC210n/an/anonemptyCartSHOP561
S13unset31itemA1001itemB1021itemC102n/an/anonemptyCartSHOP543
S14unset30itemA1101itemB111itemC12n/an/anonemptyCartSHOP528
S15unset21itemB1021itemC100n/an/an/an/an/an/anonemptyCartSHOP514
S16unset30itemA1100itemB1020itemC21n/an/anonemptyCartSHOP500
S17unset10itemC100n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP488
S18unset11itemB210n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP477
S19unset31itemA220itemB221itemC20n/an/anonemptyCartSHOP466
S20unset21itemB1101itemC1010n/an/an/an/an/an/anonemptyCartSHOP456
S21unset31itemA1011itemB1000itemC101n/an/anonemptyCartSHOP446
S22unset31itemA111itemB121itemC110n/an/anonemptyCartSHOP438
S23unset31itemA201itemB211itemC21n/an/anonemptyCartSHOP432
S24unset30itemA101itemB2101itemC1010n/an/anonemptyCartSHOP426
S25unset10itemA10n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP421
S26unset31itemA211itemB1011itemC10n/an/anonemptyCartSHOP416
S27unset31itemA1021itemB101itemC22n/an/anonemptyCartSHOP412
S28unset31itemA2100itemB101itemC100n/an/anonemptyCartSHOP409
S29unset31itemA10101itemB210itemC11n/an/anonemptyCartSHOP406
S30unset20itemB1000itemC102n/an/an/an/an/an/anonemptyCartSHOP404
S31unset11itemC1010n/an/an/an/an/an/an/an/an/an/anonemptyCartSHOP403

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

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

S3 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 delete boxes are checked for itemB and itemC. New quantities of 0 for itemB and 1 for itemC are entered. The shop button is clicked to trigger the transition to shopping.

#4. states 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
C1unset10itemA10n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT965
C2unset31itemA1011itemB1000itemC101n/an/anonemptyCartCHECKOUT827
C3unset31itemA220itemB221itemC20n/an/anonemptyCartCHECKOUT719
C4unset21itemB10101itemC11n/an/an/an/an/an/anonemptyCartCHECKOUT620
C5unset30itemA1101itemB111itemC12n/an/anonemptyCartCHECKOUT555
C6unset20itemA1010itemC210n/an/an/an/an/an/anonemptyCartCHECKOUT508
C7unset30itemA101itemB2101itemC1010n/an/anonemptyCartCHECKOUT470
C8unset10itemC22n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT433
C9unset20itemB1000itemC102n/an/an/an/an/an/anonemptyCartCHECKOUT405
C10unset30itemA100itemB100itemC10n/an/anonemptyCartCHECKOUT381
C11unset11itemC1010n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT363
C12unset30itemA1100itemB1020itemC21n/an/anonemptyCartCHECKOUT345
C13unset31itemA211itemB1011itemC10n/an/anonemptyCartCHECKOUT329
C14unset31itemA1021itemB101itemC22n/an/anonemptyCartCHECKOUT314
C15unset30itemA1020itemB1010itemC1010n/an/anonemptyCartCHECKOUT300
C16unset21itemB221itemC110n/an/an/an/an/an/anonemptyCartCHECKOUT288
C17unset31itemA111itemB121itemC110n/an/anonemptyCartCHECKOUT276
C18unset10itemB101n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT265
C19unset31itemA201itemB211itemC21n/an/anonemptyCartCHECKOUT254
C20unset30itemA210itemB2100itemC22n/an/anonemptyCartCHECKOUT243
C21unset20itemA10100itemC20n/an/an/an/an/an/anonemptyCartCHECKOUT234
C22unset31itemA121itemB1101itemC11n/an/anonemptyCartCHECKOUT227
C23unset31itemA10101itemB10101itemC100n/an/anonemptyCartCHECKOUT220
C24unset31itemA2101itemB201itemC210n/an/anonemptyCartCHECKOUT214
C25unset31itemA1001itemB1021itemC102n/an/anonemptyCartCHECKOUT209
C26unset21itemB110itemC101n/an/an/an/an/an/anonemptyCartCHECKOUT206
C27unset11itemC11n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT204
C28unset31itemA2100itemB101itemC100n/an/anonemptyCartCHECKOUT202
C29unset31itemA10101itemB210itemC11n/an/anonemptyCartCHECKOUT200
C30unset10itemC100n/an/an/an/an/an/an/an/an/an/anonemptyCartCHECKOUT199
C31unset21itemB201itemC21n/an/an/an/an/an/anonemptyCartCHECKOUT198
C32unset21itemB1021itemC100n/an/an/an/an/an/anonemptyCartCHECKOUT197

The test cases in partition 4 test the allowed transitions from all states to the checkout state with all allowed pairs of factor values. Test case C4 is set up as illustrated below.

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

This partition from the target state design is the same as its counterpart (partition 8) in the transition design because there is only one transition to the shopping cart in this example.

C4 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.

<Transition - Fixed Values Target State - Fixed Values>

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