Testcover.com Testcover.com
Tutorial - Thermostat Example -
tempSet Integrated Target State 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 target state model, in which states of other regions are included as test factors. The transitions to each target state in this region are combined into 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 which are grouped into 3 partitions according to their target states:

# all tempSet states to idleWait
# all tempSet states to heatKeyWait
# all tempSet states to coolKeyWait

The tempSet integrated target state design uses the same blocks and test factor values as in the previous, integrated transition design. The difference is that the integrated target state design contains fewer partitions and yields fewer test cases. Each pair of states from all regions is associated with each of this region's target 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 12-14 of the design procedure. The relationship between the blocks of the tempSet integrated transition design and those of the integrated target state design is presented in the tempSet mapping table. All the tempSet partitions with transitions leading to a particular target state are combined into one partition. The 7 previous partitions are combined into 3 partitions in this design.

The test case generator request is given below. The partition prefix TS:I indicates the region, tempSet (TS), and the target state, e.g. idleWait (I), for each test case.
Thermostat Example - tempSet integrated target state design
roomTemp
heatTemp
coolTemp
tempSet state
tempControl state
fanControl state
event
#TS:I tempSet states 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
+ 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
+ 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:H tempSet states 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
+ 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:C tempSet states 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
+ 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 76 test cases in 3 partitions in the integrated target state design. The results tables follow.

#1. tempSet states to idleWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values4 Values4 Values3 Values5 Values3 Values4 Values265
TS:I1705199idleWaittempControlOfffanOnIDLE_TIMEOUT244
TS:I2785098heatKeyWaittempControlOffautoOffWaitH_KEY_TIMEOUT223
TS:I3709850coolKeyWaitheatOnWaitautoOnWaitC_KEY_TIMEOUT202
TS:I4789951coolKeyWaitcoolOnWaitfanOnSET181
TS:I5705198coolKeyWaitcoolOffWaitautoOffWaitSET164
TS:I6789951idleWaitheatOnWaitautoOnWaitIDLE_TIMEOUT148
TS:I7709950heatKeyWaitcoolOnWaitautoOnWaitH_KEY_TIMEOUT133
TS:I8705099idleWaitheatOffWaitautoOffWaitIDLE_TIMEOUT120
TS:I9785198heatKeyWaitheatOffWaitfanOnH_KEY_TIMEOUT108
TS:I10789850idleWaitcoolOnWaitfanOnIDLE_TIMEOUT97
TS:I11785098coolKeyWaitcoolOffWaitfanOnC_KEY_TIMEOUT87
TS:I12709851heatKeyWaitheatOnWaitfanOnH_KEY_TIMEOUT78
TS:I13785199heatKeyWaitcoolOffWaitautoOffWaitH_KEY_TIMEOUT72
TS:I14705099coolKeyWaittempControlOffautoOffWaitC_KEY_TIMEOUT67
TS:I15705098idleWaitcoolOffWaitfanOnIDLE_TIMEOUT63
TS:I16705099coolKeyWaitheatOffWaitfanOnSET59
TS:I17785198coolKeyWaitheatOffWaitautoOffWaitC_KEY_TIMEOUT57
TS:I18789951coolKeyWaitheatOnWaitautoOnWaitC_KEY_TIMEOUT55
TS:I19709950coolKeyWaitcoolOnWaitautoOnWaitSET53
TS:I20709851coolKeyWaitheatOnWaitfanOnSET51
TS:I21785198coolKeyWaittempControlOfffanOnSET50
TS:I22789850coolKeyWaitcoolOnWaitfanOnC_KEY_TIMEOUT49

The test cases in partition 1 test the transitions from all the tempSet states to the idleWait state. All persistent pairs of current states leading to the idleWait state are included. Each event value is paired with each of the allowed current 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. tempSet states to heatKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
4 Values4 Values4 Values2 Values5 Values3 Values5 Values309
TS:H1705199idleWaittempControlOfffanOnSET288
TS:H2709851heatKeyWaitheatOnWaitautoOnWaitUP[heatTemp<maxTemp]267
TS:H3785099heatKeyWaitcoolOffWaitautoOffWaitDOWN[heatTemp<=minTemp]246
TS:H41009999heatKeyWaitheatOffWaitfanOnUP[heatTemp>=maxTemp]227
TS:H5789850idleWaitcoolOnWaitfanOnSET209
TS:H6705198heatKeyWaitheatOffWaitautoOffWaitDOWN[heatTemp>minTemp]192
TS:H7789951idleWaitheatOnWaitautoOnWaitSET177
TS:H8495050heatKeyWaitheatOnWaitautoOnWaitDOWN[heatTemp<=minTemp]162
TS:H9705098idleWaitcoolOffWaitfanOnSET149
TS:H10785198heatKeyWaittempControlOffautoOffWaitUP[heatTemp<maxTemp]138
TS:H11709950heatKeyWaitcoolOnWaitfanOnUP[heatTemp>=maxTemp]129
TS:H12789851heatKeyWaitcoolOnWaitautoOnWaitDOWN[heatTemp>minTemp]122
TS:H13705099idleWaitheatOffWaitautoOffWaitSET117
TS:H14789999heatKeyWaittempControlOffautoOffWaitUP[heatTemp>=maxTemp]112
TS:H15789851heatKeyWaitheatOnWaitfanOnDOWN[heatTemp>minTemp]108
TS:H16705099heatKeyWaittempControlOfffanOnDOWN[heatTemp<=minTemp]104
TS:H17785198heatKeyWaitheatOffWaitfanOnUP[heatTemp<maxTemp]101
TS:H18785198heatKeyWaitcoolOffWaitfanOnDOWN[heatTemp>minTemp]99
TS:H19705050heatKeyWaitcoolOnWaitautoOnWaitDOWN[heatTemp<=minTemp]97
TS:H20709999heatKeyWaitcoolOffWaitautoOffWaitUP[heatTemp>=maxTemp]95
TS:H21709950heatKeyWaitheatOnWaitautoOnWaitUP[heatTemp>=maxTemp]93
TS:H22705198heatKeyWaittempControlOfffanOnDOWN[heatTemp>minTemp]92
TS:H23705198heatKeyWaitcoolOffWaitautoOffWaitUP[heatTemp<maxTemp]91
TS:H24789851heatKeyWaitcoolOnWaitfanOnUP[heatTemp<maxTemp]90
TS:H25705099heatKeyWaitheatOffWaitautoOffWaitDOWN[heatTemp<=minTemp]89
TS:H26495050heatKeyWaitheatOnWaitfanOnDOWN[heatTemp<=minTemp]88
TS:H271009999heatKeyWaitheatOffWaitautoOffWaitUP[heatTemp>=maxTemp]87

The test cases in partition 2 test the transitions from all allowed tempSet states to the heatKeyWait state. (There is no transition from coolKeyWait to heatKeyWait.) All persistent pairs of current states leading to the heatKeyWait state are included. Each event value is paired with each of the allowed current states. Set-up for test case TS:H2 is described below.

TS:H2 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 98. 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 70. The mode switch is set to HEAT, and the fan switch is set to AUTO. After the tempControl and fanControl states are heatOnWait and autoOnWait, the SET button is pressed as needed to return to the heatKeyWait state. The UP button is pressed before the heatKeyWait timeout occurs.

#3. tempSet states to coolKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
4 Values4 Values4 Values2 Values5 Values3 Values5 Values309
TS:C1705199heatKeyWaittempControlOfffanOnSET288
TS:C2709851coolKeyWaitheatOnWaitautoOnWaitUP[coolTemp<maxTemp]267
TS:C3785050coolKeyWaittempControlOffautoOffWaitDOWN[coolTemp<=minTemp]246
TS:C41009999coolKeyWaitcoolOnWaitautoOnWaitUP[coolTemp>=maxTemp]226
TS:C5785198coolKeyWaitcoolOffWaitfanOnDOWN[coolTemp>minTemp]207
TS:C6789951heatKeyWaitcoolOnWaitfanOnSET191
TS:C7705099heatKeyWaitheatOffWaitautoOffWaitSET177
TS:C8709850heatKeyWaitheatOnWaitautoOnWaitSET165
TS:C9495050coolKeyWaitcoolOffWaitfanOnDOWN[coolTemp<=minTemp]153
TS:C10785198coolKeyWaitheatOffWaitfanOnUP[coolTemp<maxTemp]143
TS:C11789999coolKeyWaitheatOnWaitfanOnUP[coolTemp>=maxTemp]135
TS:C12705098heatKeyWaitcoolOffWaitfanOnSET128
TS:C13789851coolKeyWaitcoolOnWaitautoOnWaitDOWN[coolTemp>minTemp]121
TS:C14709950coolKeyWaitcoolOnWaitfanOnDOWN[coolTemp<=minTemp]114
TS:C15705198coolKeyWaitheatOffWaitautoOffWaitDOWN[coolTemp>minTemp]109
TS:C16785099coolKeyWaitcoolOffWaitautoOffWaitUP[coolTemp>=maxTemp]104
TS:C17785198coolKeyWaittempControlOffautoOffWaitUP[coolTemp<maxTemp]101
TS:C18789851coolKeyWaitcoolOnWaitfanOnUP[coolTemp<maxTemp]99
TS:C19705050coolKeyWaitheatOffWaitautoOffWaitDOWN[coolTemp<=minTemp]97
TS:C20709950coolKeyWaitheatOnWaitautoOnWaitDOWN[coolTemp<=minTemp]95
TS:C21705099coolKeyWaitheatOffWaitautoOffWaitUP[coolTemp>=maxTemp]93
TS:C22705198coolKeyWaittempControlOfffanOnDOWN[coolTemp>minTemp]92
TS:C23705198coolKeyWaitcoolOffWaitautoOffWaitUP[coolTemp<maxTemp]91
TS:C24789851coolKeyWaitheatOnWaitfanOnDOWN[coolTemp>minTemp]90
TS:C25495050coolKeyWaitcoolOffWaitautoOffWaitDOWN[coolTemp<=minTemp]89
TS:C26705099coolKeyWaittempControlOfffanOnUP[coolTemp>=maxTemp]88
TS:C271009999coolKeyWaitcoolOnWaitfanOnUP[coolTemp>=maxTemp]87

The test cases in partition 3 test the transitions from all allowed tempSet states to the coolKeyWait state. (There is no transition from idleWait to coolKeyWait.) All persistent pairs of current states leading to the coolKeyWait state are included. Each event value is paired with each of the allowed current states.

<tempSet Integrated Transition tempSet Integrated Propagation>

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