Testcover.com Testcover.com
Tutorial - Thermostat Example -
tempSet Stand-alone Transition Design

Home
Existing User Login
Brochure
Sign up for Risk-Free Trial
About Testcover.com
Frequently Asked Questions
Tutorial with Examples
->Equivalence Partitioning
->UML State Machines
--->Shopping Cart Example
--->Thermostat Example
--->Test Models, 3 Regions
--->Design Procedure
--->tempSet Designs
----->Stand-alone Transition
----->Integrated Transition
----->Integrated Target State
----->Integrated Propagation
--->tempControl Designs
--->fanControl Designs
->Definitions of Terms
Performance
WSDL Interface
Background
Partners
Registrations
Contact Information
The thermostat example illustrates pairwise testing using a Unified Modeling Language (UML) state machine diagram. This test design is for the tempSet region, which allows the user to set the heating and cooling temperatures. It illustrates the stand-alone transition model, in which the region is considered isolated from the rest of the system. Each state transition in this region has one partition.

Requirements summary. Normally the thermostat displays the current room temperature. By pressing the SET button the user can select a state to display and set the temperature for heating or cooling. In these temperature setting states, the user can raise or lower the temperature setting by pressing the UP or DOWN button. Each UP/DOWN press changes the temperature setting by one degree, within operational limits. The thermostat returns to its current temperature display state after a timeout period. Details of the temperature setting operation are defined in the tempSet region of the UML state machine diagram.

Test model. In the tempSet region there are 3 leaf states: idleWait, heatKeyWait, and coolKeyWait. There are 7 state transitions corresponding to partitions:

# idleWait to idleWait
# heatKeyWait to idleWait
# coolKeyWait to idleWait
# idleWait to heatKeyWait
# heatKeyWait to heatKeyWait
# heatKeyWait to coolKeyWait
# coolKeyWait to coolKeyWait

There are 5 test factors with values as follows.

Test FactorNumber of ValuesTest Factor Values
1. roomTemp5 49 50 74 99 100
2. heatTemp5 50 51 74 98 99
3. coolTemp5 50 51 74 98 99
4. tempSet state3 idleWait heatKeyWait coolKeyWait
5. event12 IDLE_TIMEOUT H_KEY_TIMEOUT C_KEY_TIMEOUT
SET UP[heatTemp<maxTemp] UP[heatTemp>=maxTemp]
DOWN[heatTemp>minTemp] DOWN[heatTemp<=minTemp]
UP[coolTemp<maxTemp] UP[coolTemp>=maxTemp]
DOWN[coolTemp>minTemp] DOWN[coolTemp<=minTemp]

The test design is constructed following steps 1-6 of the design procedure. Note that partition 5 (P5, heatKeyWait to heatKeyWait) and partition 7 (P7, coolKeyWait to coolKeyWait) are split into three blocks each (P5B1-P5B3 and P7B1-P7B3). P5B1 and P7B1 test the normal raising and lowering of the heatTemp and coolTemp settings. P5B2 and P7B2 test the lower limit for setting heatTemp and coolTemp, while P5B3 and P7B3 test the upper limit.

The test case generator request is given below. The partition prefix TS:II indicates the region, tempSet (TS), and the transition, e.g. idleWait to idleWait (II), for each test case.
Thermostat Example - tempSet stand-alone transition design
roomTemp
heatTemp
coolTemp
tempSet state
event
#TS:II idleWait to idleWait
49 50 74 99 100
50 99
50 99
idleWait
IDLE_TIMEOUT
#TS:HI heatKeyWait to idleWait
50 99
50 51 74 98 99
50 99
heatKeyWait
H_KEY_TIMEOUT
#TS:CI coolKeyWait to idleWait
50 99
50 99
50 51 74 98 99
coolKeyWait
C_KEY_TIMEOUT SET
#TS:IH idleWait to heatKeyWait
50 99
50 51 74 98 99
50 99
idleWait
SET
#TS:HH heatKeyWait to heatKeyWait
50 99
51 74 98
50 99
heatKeyWait
UP[heatTemp<maxTemp] DOWN[heatTemp>minTemp]
+ internal transition down
49
50
99
heatKeyWait
DOWN[heatTemp<=minTemp]
+ internal transition up
100
99
50
heatKeyWait
UP[heatTemp>=maxTemp]
#TS:HC heatKeyWait to coolKeyWait
50 99
50 51 99
50 98 99
heatKeyWait
SET
#TS:CC coolKeyWait to coolKeyWait
50 99
50 99
51 74 98
coolKeyWait
UP[coolTemp<maxTemp] DOWN[coolTemp>minTemp]
+ internal transition down
49
99
50
coolKeyWait
DOWN[coolTemp<=minTemp]
+ internal transition up
100
50
99
coolKeyWait
UP[coolTemp>=maxTemp]

The tempSet region has 65 test cases in 7 partitions in the stand-alone transition design. The results tables follow.

#1. idleWait to idleWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state event Combo
Countdown
5 Values2 Values2 Values1 Value1 Value43
TS:II1495050idleWaitIDLE_TIMEOUT33
TS:II2999999idleWaitIDLE_TIMEOUT24
TS:II3509950idleWaitIDLE_TIMEOUT19
TS:II4745099idleWaitIDLE_TIMEOUT14
TS:II51005099idleWaitIDLE_TIMEOUT10
TS:II6505099idleWaitIDLE_TIMEOUT8
TS:II7499999idleWaitIDLE_TIMEOUT6
TS:II8749950idleWaitIDLE_TIMEOUT4
TS:II9995050idleWaitIDLE_TIMEOUT2
TS:II101009950idleWaitIDLE_TIMEOUT0

The test cases in partition 1 test the timeout of the idleWait state with various temperature variable values. Set-up for test case TS:II1 is described below.

TS:II1 is set up starting in the idleWait state. The SET button is pressed to take the tempSet state to heatKeyWait, and the DOWN button is pressed repeatedly to set the heatTemp to 50. Next the SET button is pressed to take the tempSet state to coolKeyWait, and the DOWN button is pressed repeatedly to set the coolTemp to 50. The SET button is pressed again to take the tempSet state to idleWait, and the temperature sensor simulator is set to 49.

#2. heatKeyWait to idleWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state event Combo
Countdown
2 Values5 Values2 Values1 Value1 Value43
TS:HI1505050heatKeyWaitH_KEY_TIMEOUT33
TS:HI2999899heatKeyWaitH_KEY_TIMEOUT24
TS:HI3995150heatKeyWaitH_KEY_TIMEOUT19
TS:HI4507499heatKeyWaitH_KEY_TIMEOUT14
TS:HI5509999heatKeyWaitH_KEY_TIMEOUT10
TS:HI6505199heatKeyWaitH_KEY_TIMEOUT8
TS:HI7995099heatKeyWaitH_KEY_TIMEOUT6
TS:HI8997450heatKeyWaitH_KEY_TIMEOUT4
TS:HI9509850heatKeyWaitH_KEY_TIMEOUT2
TS:HI10999950heatKeyWaitH_KEY_TIMEOUT0

The test cases in partition 2 test the timeout of the heatKeyWait state with various temperature variable values.

#3. coolKeyWait to idleWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state event Combo
Countdown
2 Values2 Values5 Values1 Value2 Values53
TS:CI1995099coolKeyWaitC_KEY_TIMEOUT43
TS:CI2509950coolKeyWaitSET33
TS:CI3509951coolKeyWaitC_KEY_TIMEOUT27
TS:CI4505098coolKeyWaitSET21
TS:CI5995074coolKeyWaitSET16
TS:CI6999998coolKeyWaitC_KEY_TIMEOUT12
TS:CI7509974coolKeyWaitC_KEY_TIMEOUT9
TS:CI8995051coolKeyWaitSET6
TS:CI9509999coolKeyWaitSET3
TS:CI10995050coolKeyWaitC_KEY_TIMEOUT0

The test cases in partition 3 test the timeout and SET transitions from the coolKeyWait state with various temperature variable values. Set-up for test case TS:CI2 is described below.

TS:CI2 is set up starting in the idleWait state. The SET button is pressed to take the tempSet state to heatKeyWait, and the UP button is pressed repeatedly to set the heatTemp to 99. Next the SET button is pressed to take the tempSet state to coolKeyWait, and the DOWN button is pressed repeatedly to set the coolTemp to 50. The temperature sensor simulator is set to 50, and the SET button is pressed again before the coolKeyWait timeout occurs.

#4. idleWait to heatKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state event Combo
Countdown
2 Values5 Values2 Values1 Value1 Value43
TS:IH1505050idleWaitSET33
TS:IH2999899idleWaitSET24
TS:IH3995150idleWaitSET19
TS:IH4507499idleWaitSET14
TS:IH5509999idleWaitSET10
TS:IH6505199idleWaitSET8
TS:IH7995099idleWaitSET6
TS:IH8997450idleWaitSET4
TS:IH9509850idleWaitSET2
TS:IH10999950idleWaitSET0

The test cases in partition 4 test the SET transition from the idleWait state with various temperature variable values.

#5. heatKeyWait to heatKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state event Combo
Countdown
4 Values5 Values2 Values1 Value4 Values97
TS:HH1509899heatKeyWaitDOWN[heatTemp>minTemp]87
TS:HH21009950heatKeyWaitUP[heatTemp>=maxTemp]77
TS:HH3995199heatKeyWaitUP[heatTemp<maxTemp]68
TS:HH4495099heatKeyWaitDOWN[heatTemp<=minTemp]59
TS:HH5507450heatKeyWaitUP[heatTemp<maxTemp]52
TS:HH6997499heatKeyWaitDOWN[heatTemp>minTemp]48
TS:HH7505150heatKeyWaitDOWN[heatTemp>minTemp]44
TS:HH8999850heatKeyWaitUP[heatTemp<maxTemp]40

Test cases TS:HH1, TS:HH6, and TS:HH7 lower the heatTemp setting. Test cases TS:HH3, TS:HH5, and TS:HH8 raise the heatTemp setting. Test cases TS:HH2 and TS:HH4 test the upper and lower heatTemp limits respectively.

#6. heatKeyWait to coolKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state event Combo
Countdown
2 Values3 Values3 Values1 Value1 Value38
TS:HC1509999heatKeyWaitSET28
TS:HC2995198heatKeyWaitSET19
TS:HC3995050heatKeyWaitSET12
TS:HC4505098heatKeyWaitSET9
TS:HC5505150heatKeyWaitSET6
TS:HC6999950heatKeyWaitSET4
TS:HC7995099heatKeyWaitSET2
TS:HC8505199heatKeyWaitSET1
TS:HC9509998heatKeyWaitSET0

The test cases in partition 6 test the SET transition from the heatKeyWait state with various temperature variable values.

#7. coolKeyWait to coolKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state event Combo
Countdown
4 Values2 Values5 Values1 Value4 Values97
TS:CC1509998coolKeyWaitDOWN[coolTemp>minTemp]87
TS:CC21005099coolKeyWaitUP[coolTemp>=maxTemp]77
TS:CC3999951coolKeyWaitUP[coolTemp<maxTemp]68
TS:CC4499950coolKeyWaitDOWN[coolTemp<=minTemp]59
TS:CC5505074coolKeyWaitUP[coolTemp<maxTemp]52
TS:CC6999974coolKeyWaitDOWN[coolTemp>minTemp]48
TS:CC7505051coolKeyWaitDOWN[coolTemp>minTemp]44
TS:CC8995098coolKeyWaitUP[coolTemp<maxTemp]40

Test cases TS:CC1, TS:CC6, and TS:CC7 lower the coolTemp setting. Test cases TS:CC3, TS:CC5, and TS:CC8 raise the coolTemp setting. Test cases TS:CC2 and TS:CC4 test the upper and lower coolTemp limits respectively.

<Design Procedure tempSet Integrated Transition>

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