Testcover.com Testcover.com
Tutorial - Thermostat Example -
tempSet Integrated 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 integrated transition model, in which states of other regions are included as test factors. 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

These tempSet state transitions define the partitions for this integrated transition design as well as for the previous, stand-alone transition design. The difference is that the integrated transition design contains 2 additional test factors for the tempControl and fanControl states.

There are 7 test factors with values as follows.

Test FactorNumber of ValuesTest Factor Values
1. roomTemp4 49 70 78 100
2. heatTemp4 50 51 98 99
3. coolTemp4 50 51 98 99
4. tempSet state3 idleWait heatKeyWait coolKeyWait
5. tempControl state5 heatOffWait heatOnWait coolOffWait coolOnWait tempControlOff
6. fanControl state3 autoOffWait autoOnWait fanOn
7. 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 7-11 of the design procedure. The relationship between the blocks of the tempSet stand-alone transition design and those of the integrated transition design is presented in the tempSet mapping table. Generally each block of the tempSet stand-alone transition design is mapped to 2 blocks in the integrated transition model, to test persistent combinations of states when the furnace or air conditioner is either on or off. Usually the roomTemp, heatTemp, and coolTemp values can be selected so that a single block contains either on or off values for both the furnace and air conditioner. However, the blocks for testing the heatTemp and coolTemp limits in partitions 5 and 7 require a mapping to 3 blocks each for consistent program variable values. For example, P5B2 in the stand-alone transition design is mapped to P5B3 (off), P5B4 (furnace on), and P5B6 (air conditioner on) in the integrated transition design.

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 integrated transition design
roomTemp
heatTemp
coolTemp
tempSet state
tempControl state
fanControl state
event
#TS:II idleWait to idleWait
+ idleWait to idleWait (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50 51
98 99
idleWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
IDLE_TIMEOUT
+ idleWait to idleWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
98 99
50 51
idleWait
heatOnWait coolOnWait
autoOnWait fanOn
IDLE_TIMEOUT
#TS:HI heatKeyWait to idleWait
+ heatKeyWait to idleWait (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50 51
98 99
heatKeyWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
H_KEY_TIMEOUT
+ heatKeyWait to idleWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
98 99
50 51
heatKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
H_KEY_TIMEOUT
#TS:CI coolKeyWait to idleWait
+ coolKeyWait to idleWait (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50 51
98 99
coolKeyWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
C_KEY_TIMEOUT SET
+ coolKeyWait to idleWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
98 99
50 51
coolKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
C_KEY_TIMEOUT SET
#TS:IH idleWait to heatKeyWait
+ idleWait to heatKeyWait (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50 51
98 99
idleWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
SET
+ idleWait to heatKeyWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
98 99
50 51
idleWait
heatOnWait coolOnWait
autoOnWait fanOn
SET
#TS:HH heatKeyWait to heatKeyWait
+ heatKeyWait to heatKeyWait (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
51
98
heatKeyWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
UP[heatTemp<maxTemp] DOWN[heatTemp>minTemp]
+ heatKeyWait to heatKeyWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
98
51
heatKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
UP[heatTemp<maxTemp] DOWN[heatTemp>minTemp]
+ internal transition down (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50
99
heatKeyWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
DOWN[heatTemp<=minTemp]
+ internal transition down heatOnWait x (autoOnWait fanOn)
49
50
50
heatKeyWait
heatOnWait
autoOnWait fanOn
DOWN[heatTemp<=minTemp]
+ internal transition down coolOnWait x (autoOnWait fanOn)
70 78
50
50
heatKeyWait
coolOnWait
autoOnWait fanOn
DOWN[heatTemp<=minTemp]
+ internal transition up heatOffWait x (autoOffWait fanOn)
100
99
99
heatKeyWait
heatOffWait
autoOffWait fanOn
UP[heatTemp>=maxTemp]
+ internal transition up (coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
99
99
heatKeyWait
coolOffWait tempControlOff
autoOffWait fanOn
UP[heatTemp>=maxTemp]
+ internal transition up (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
99
50
heatKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
UP[heatTemp>=maxTemp]
#TS:HC heatKeyWait to coolKeyWait
+ heatKeyWait to coolKeyWait (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50 51
98 99
heatKeyWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
SET
+ heatKeyWait to coolKeyWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
98 99
50 51
heatKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
SET
#TS:CC coolKeyWait to coolKeyWait
+ coolKeyWait to coolKeyWait (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
51
98
coolKeyWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
UP[coolTemp<maxTemp] DOWN[coolTemp>minTemp]
+ coolKeyWait to coolKeyWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
98
51
coolKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
UP[coolTemp<maxTemp] DOWN[coolTemp>minTemp]
+ internal transition down (heatOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50
50
coolKeyWait
heatOffWait tempControlOff
autoOffWait fanOn
DOWN[coolTemp<=minTemp]
+ internal transition down coolOffWait x (autoOffWait fanOn)
49
50
50
coolKeyWait
coolOffWait
autoOffWait fanOn
DOWN[coolTemp<=minTemp]
+ internal transition down (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
99
50
coolKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
DOWN[coolTemp<=minTemp]
+ internal transition up (heatOffWait coolOffWait tempControlOff) x (autoOffWait fanOn)
70 78
50
99
coolKeyWait
heatOffWait coolOffWait tempControlOff
autoOffWait fanOn
UP[coolTemp>=maxTemp]
+ internal transition up heatOnWait x (autoOnWait fanOn)
70 78
99
99
coolKeyWait
heatOnWait
autoOnWait fanOn
UP[coolTemp>=maxTemp]
+ internal transition up coolOnWait x (autoOnWait fanOn)
100
99
99
coolKeyWait
coolOnWait
autoOnWait fanOn
UP[coolTemp>=maxTemp]

The tempSet region has 105 test cases in 7 partitions in the integrated transition design. The results tables follow.

#1. idleWait to idleWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values4 Values4 Values1 Value5 Values3 Values1 Value164
TS:II1705199idleWaittempControlOfffanOnIDLE_TIMEOUT143
TS:II2789951idleWaitheatOnWaitautoOnWaitIDLE_TIMEOUT123
TS:II3785098idleWaittempControlOffautoOffWaitIDLE_TIMEOUT107
TS:II4789850idleWaitcoolOnWaitfanOnIDLE_TIMEOUT91
TS:II5785199idleWaitcoolOffWaitautoOffWaitIDLE_TIMEOUT81
TS:II6705099idleWaitheatOffWaitautoOffWaitIDLE_TIMEOUT72
TS:II7709850idleWaitheatOnWaitautoOnWaitIDLE_TIMEOUT64
TS:II8705098idleWaitcoolOffWaitfanOnIDLE_TIMEOUT57
TS:II9785198idleWaitheatOffWaitfanOnIDLE_TIMEOUT52
TS:II10709950idleWaitcoolOnWaitautoOnWaitIDLE_TIMEOUT47
TS:II11709851idleWaitheatOnWaitfanOnIDLE_TIMEOUT43
TS:II12789951idleWaitcoolOnWaitfanOnIDLE_TIMEOUT41

The test cases in partition 1 test the timeout transition from the idleWait state with all persistent pairs of tempControl and fanControl states. 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 UP or DOWN button is pressed as needed to set the heatTemp to 51. Next the SET button is pressed to take the tempSet state to coolKeyWait, and the UP button is pressed repeatedly to set the coolTemp to 99. The SET button is pressed again to take the tempSet state to idleWait. The mode switch is set to OFF, and the fan switch is set to ON. The temperature sensor simulator is set to 70.

#2. heatKeyWait to idleWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values4 Values4 Values1 Value5 Values3 Values1 Value164
TS:HI1705199heatKeyWaittempControlOfffanOnH_KEY_TIMEOUT143
TS:HI2789951heatKeyWaitheatOnWaitautoOnWaitH_KEY_TIMEOUT123
TS:HI3785098heatKeyWaittempControlOffautoOffWaitH_KEY_TIMEOUT107
TS:HI4789850heatKeyWaitcoolOnWaitfanOnH_KEY_TIMEOUT91
TS:HI5785199heatKeyWaitcoolOffWaitautoOffWaitH_KEY_TIMEOUT81
TS:HI6705099heatKeyWaitheatOffWaitautoOffWaitH_KEY_TIMEOUT72
TS:HI7709850heatKeyWaitheatOnWaitautoOnWaitH_KEY_TIMEOUT64
TS:HI8705098heatKeyWaitcoolOffWaitfanOnH_KEY_TIMEOUT57
TS:HI9785198heatKeyWaitheatOffWaitfanOnH_KEY_TIMEOUT52
TS:HI10709950heatKeyWaitcoolOnWaitautoOnWaitH_KEY_TIMEOUT47
TS:HI11709851heatKeyWaitheatOnWaitfanOnH_KEY_TIMEOUT43
TS:HI12789951heatKeyWaitcoolOnWaitfanOnH_KEY_TIMEOUT41

The test cases in partition 2 test the timeout transition from the heatKeyWait state with all persistent pairs of tempControl and fanControl states.

#3. coolKeyWait to idleWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values4 Values4 Values1 Value5 Values3 Values2 Values183
TS:CI1705099coolKeyWaittempControlOffautoOffWaitC_KEY_TIMEOUT162
TS:CI2789951coolKeyWaitcoolOnWaitfanOnSET141
TS:CI3709850coolKeyWaitheatOnWaitautoOnWaitC_KEY_TIMEOUT123
TS:CI4705198coolKeyWaitcoolOffWaitautoOffWaitSET106
TS:CI5785098coolKeyWaitcoolOffWaitfanOnC_KEY_TIMEOUT94
TS:CI6705099coolKeyWaitheatOffWaitfanOnSET84
TS:CI7785198coolKeyWaitheatOffWaitautoOffWaitC_KEY_TIMEOUT76
TS:CI8789951coolKeyWaitheatOnWaitautoOnWaitC_KEY_TIMEOUT68
TS:CI9789850coolKeyWaitcoolOnWaitfanOnC_KEY_TIMEOUT61
TS:CI10785198coolKeyWaittempControlOfffanOnSET55
TS:CI11709950coolKeyWaitcoolOnWaitautoOnWaitSET49
TS:CI12709851coolKeyWaitheatOnWaitfanOnSET44
TS:CI13785199coolKeyWaitcoolOffWaitfanOnC_KEY_TIMEOUT41

The test cases in partition 3 test the timeout and SET transitions from the coolKeyWait state with all persistent pairs of tempControl and fanControl states. Each event value is paired with each of the tempControl and fanControl states. 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 UP or DOWN button is pressed as needed to set the coolTemp to 51. The temperature sensor simulator is set to 78. The mode switch is set to COOL, and the fan switch is set to ON. The SET button is pressed again before the coolKeyWait timeout occurs.

#4. idleWait to heatKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values4 Values4 Values1 Value5 Values3 Values1 Value164
TS:IH1705199idleWaittempControlOfffanOnSET143
TS:IH2789951idleWaitheatOnWaitautoOnWaitSET123
TS:IH3785098idleWaittempControlOffautoOffWaitSET107
TS:IH4789850idleWaitcoolOnWaitfanOnSET91
TS:IH5785199idleWaitcoolOffWaitautoOffWaitSET81
TS:IH6705099idleWaitheatOffWaitautoOffWaitSET72
TS:IH7709850idleWaitheatOnWaitautoOnWaitSET64
TS:IH8705098idleWaitcoolOffWaitfanOnSET57
TS:IH9785198idleWaitheatOffWaitfanOnSET52
TS:IH10709950idleWaitcoolOnWaitautoOnWaitSET47
TS:IH11709851idleWaitheatOnWaitfanOnSET43
TS:IH12789951idleWaitcoolOnWaitfanOnSET41

The test cases in partition 4 test the SET transition from the idleWait state with all persistent pairs of tempControl and fanControl states.

#5. heatKeyWait to heatKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
4 Values4 Values4 Values1 Value5 Values3 Values4 Values263
TS:HH1705198heatKeyWaittempControlOfffanOnDOWN[heatTemp>minTemp]242
TS:HH2785099heatKeyWaitcoolOffWaitautoOffWaitDOWN[heatTemp<=minTemp]221
TS:HH3709851heatKeyWaitheatOnWaitautoOnWaitUP[heatTemp<maxTemp]201
TS:HH41009999heatKeyWaitheatOffWaitfanOnUP[heatTemp>=maxTemp]182
TS:HH5495050heatKeyWaitheatOnWaitfanOnDOWN[heatTemp<=minTemp]166
TS:HH6789950heatKeyWaitcoolOnWaitautoOnWaitUP[heatTemp>=maxTemp]151
TS:HH7785198heatKeyWaittempControlOffautoOffWaitUP[heatTemp<maxTemp]140
TS:HH8789851heatKeyWaitcoolOnWaitfanOnUP[heatTemp<maxTemp]130
TS:HH9709999heatKeyWaitcoolOffWaitautoOffWaitUP[heatTemp>=maxTemp]121
TS:HH10705050heatKeyWaitcoolOnWaitautoOnWaitDOWN[heatTemp<=minTemp]113
TS:HH11705198heatKeyWaitheatOffWaitautoOffWaitDOWN[heatTemp>minTemp]107
TS:HH12785198heatKeyWaitcoolOffWaitfanOnDOWN[heatTemp>minTemp]102
TS:HH13789851heatKeyWaitcoolOnWaitautoOnWaitDOWN[heatTemp>minTemp]98
TS:HH14785099heatKeyWaitheatOffWaitfanOnDOWN[heatTemp<=minTemp]95
TS:HH15705099heatKeyWaittempControlOfffanOnDOWN[heatTemp<=minTemp]92
TS:HH16789950heatKeyWaitheatOnWaitfanOnUP[heatTemp>=maxTemp]89
TS:HH17789999heatKeyWaittempControlOffautoOffWaitUP[heatTemp>=maxTemp]87
TS:HH18705198heatKeyWaitcoolOffWaitautoOffWaitUP[heatTemp<maxTemp]86
TS:HH19785198heatKeyWaitheatOffWaitfanOnUP[heatTemp<maxTemp]85
TS:HH20789851heatKeyWaitheatOnWaitfanOnDOWN[heatTemp>minTemp]84
TS:HH21495050heatKeyWaitheatOnWaitautoOnWaitDOWN[heatTemp<=minTemp]83
TS:HH221009999heatKeyWaitheatOffWaitautoOffWaitUP[heatTemp>=maxTemp]82

In partition 5, 5 test cases lower the heatTemp setting, and 5 test cases raise the heatTemp setting. 6 cases test the lower heatTemp limit, and 6 test the upper limit. All persistent pairs of tempControl and fanControl states are included, and each event value is paired with each of the tempControl and fanControl states.

#6. heatKeyWait to coolKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values4 Values4 Values1 Value5 Values3 Values1 Value164
TS:HC1705199heatKeyWaittempControlOfffanOnSET143
TS:HC2789951heatKeyWaitheatOnWaitautoOnWaitSET123
TS:HC3785098heatKeyWaittempControlOffautoOffWaitSET107
TS:HC4789850heatKeyWaitcoolOnWaitfanOnSET91
TS:HC5785199heatKeyWaitcoolOffWaitautoOffWaitSET81
TS:HC6705099heatKeyWaitheatOffWaitautoOffWaitSET72
TS:HC7709850heatKeyWaitheatOnWaitautoOnWaitSET64
TS:HC8705098heatKeyWaitcoolOffWaitfanOnSET57
TS:HC9785198heatKeyWaitheatOffWaitfanOnSET52
TS:HC10709950heatKeyWaitcoolOnWaitautoOnWaitSET47
TS:HC11709851heatKeyWaitheatOnWaitfanOnSET43
TS:HC12789951heatKeyWaitcoolOnWaitfanOnSET41

The test cases in partition 6 test the SET transition from the heatKeyWait state with all persistent pairs of tempControl and fanControl states.

#7. coolKeyWait to coolKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
4 Values4 Values4 Values1 Value5 Values3 Values4 Values263
TS:CC1705198coolKeyWaittempControlOfffanOnDOWN[coolTemp>minTemp]242
TS:CC2495050coolKeyWaitcoolOffWaitautoOffWaitDOWN[coolTemp<=minTemp]221
TS:CC3789999coolKeyWaitheatOnWaitautoOnWaitUP[coolTemp>=maxTemp]200
TS:CC4789851coolKeyWaitcoolOnWaitfanOnUP[coolTemp<maxTemp]181
TS:CC5705099coolKeyWaitheatOffWaitautoOffWaitUP[coolTemp>=maxTemp]167
TS:CC6709950coolKeyWaitcoolOnWaitfanOnDOWN[coolTemp<=minTemp]155
TS:CC7785198coolKeyWaittempControlOffautoOffWaitUP[coolTemp<maxTemp]144
TS:CC8709851coolKeyWaitheatOnWaitautoOnWaitUP[coolTemp<maxTemp]133
TS:CC91009999coolKeyWaitcoolOnWaitfanOnUP[coolTemp>=maxTemp]123
TS:CC10785050coolKeyWaitheatOffWaitfanOnDOWN[coolTemp<=minTemp]115
TS:CC11785198coolKeyWaitcoolOffWaitfanOnDOWN[coolTemp>minTemp]109
TS:CC12789851coolKeyWaitcoolOnWaitautoOnWaitDOWN[coolTemp>minTemp]104
TS:CC13705198coolKeyWaitheatOffWaitautoOffWaitDOWN[coolTemp>minTemp]100
TS:CC14709950coolKeyWaitheatOnWaitautoOnWaitDOWN[coolTemp<=minTemp]96
TS:CC15785050coolKeyWaittempControlOffautoOffWaitDOWN[coolTemp<=minTemp]93
TS:CC16705099coolKeyWaitcoolOffWaitfanOnUP[coolTemp>=maxTemp]90
TS:CC17789851coolKeyWaitheatOnWaitfanOnDOWN[coolTemp>minTemp]88
TS:CC18705099coolKeyWaittempControlOfffanOnUP[coolTemp>=maxTemp]86
TS:CC19705198coolKeyWaitcoolOffWaitautoOffWaitUP[coolTemp<maxTemp]85
TS:CC20785198coolKeyWaitheatOffWaitfanOnUP[coolTemp<maxTemp]84
TS:CC21495050coolKeyWaitcoolOffWaitfanOnDOWN[coolTemp<=minTemp]83
TS:CC221009999coolKeyWaitcoolOnWaitautoOnWaitUP[coolTemp>=maxTemp]82

In partition 7, 5 test cases lower the coolTemp setting, and 5 test cases raise the coolTemp setting. 6 cases test the lower coolTemp limit, and 6 test the upper limit. All persistent pairs of tempControl and fanControl states are included, and each event value is paired with each of the tempControl and fanControl states.

<tempSet Stand-alone Transition tempSet Integrated Target State>

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