Testcover.com Testcover.com
Tutorial - Thermostat Example -
tempControl 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
--->tempControl Designs
----->Stand-alone Transition
----->Integrated Transition
----->Integrated Target State
----->Integrated Propagation
--->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 tempControl region, which controls the heating and cooling according to the operating mode selected by the user. 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. The user selects the temperature control mode with a sliding switch that indicates the mode: OFF, HEAT or COOL. In the OFF mode there is no heating or cooling. In the HEAT mode, the thermostat turns the furnace on when the room temperature is less than the heat setting. It turns the furnace off when the room temperature exceeds the heat setting by a small increment. In the COOL mode, the thermostat turns the air conditioner on when the room temperature is greater than the cool setting. It turns the air conditioner off when the room temperature is less than the cool setting by a small increment. Details of the temperature control operation are defined in the tempControl region of the UML state machine diagram.

Test model. In the tempControl region there are 5 leaf states: heatOffWait, heatOnWait, coolOffWait, coolOnWait, tempControlOff. There are 16 state transitions which are grouped into 5 partitions according to their target states:

# all tempControl states to heatOffWait
# all tempControl states to heatOnWait
# all tempControl states to coolOffWait
# all tempControl states to coolOnWait
# all tempControl states to tempControlOff

There are 7 test factors with values as follows.

Test FactorNumber of ValuesTest Factor Values
1. roomTemp4 49 70 78 100
2. heatTemp4 50 69 79 99
3. coolTemp4 50 69 79 99
4. tempSet state3 idleWait heatKeyWait coolKeyWait
5. tempControl state5 heatOffWait heatOnWait coolOffWait coolOnWait tempControlOff
6. fanControl state3 autoOffWait autoOnWait fanOn
7. event13 HEAT[roomTemp>=heatTemp] H_OFF_TIMEOUT[roomTemp>=heatTemp]
H_ON_TIMEOUT[roomTemp>heatTemp+dT]
HEAT[roomTemp<heatTemp] H_OFF_TIMEOUT[roomTemp<heatTemp]
H_ON_TIMEOUT[roomTemp<=heatTemp+dT]
COOL[roomTemp<=coolTemp] C_OFF_TIMEOUT[roomTemp<=coolTemp]
C_ON_TIMEOUT[roomTemp<coolTemp-dT]
COOL[roomTemp>coolTemp] C_OFF_TIMEOUT[roomTemp>coolTemp]
C_ON_TIMEOUT[roomTemp>=coolTemp-dT] OFF

The test design is constructed following steps 12-14 of the design procedure. The relationship between the blocks of the tempControl integrated transition design and those of the integrated target state design is presented in the tempControl mapping table. All the tempControl partitions with transitions leading to a particular target state are combined into one partition. The 16 previous partitions are combined into 5 partitions in this design.

The test case generator request is given below. The partition prefix TC:h indicates the region, tempControl (TC), and the target state, e.g. heatOffWait (h), for each test case.
Thermostat Example - tempControl integrated target state design
roomTemp
heatTemp
coolTemp
tempSet state
tempControl state
fanControl state
event
#TC:h tempControl states to heatOffWait
+ tempControlOff to heatOffWait
70 100
50 69
50 69
idleWait heatKeyWait coolKeyWait
tempControlOff
autoOffWait autoOnWait fanOn
HEAT[roomTemp>=heatTemp]
+ heatOffWait to heatOffWait
70 100
50 69
50 69
idleWait heatKeyWait coolKeyWait
heatOffWait
autoOffWait fanOn
H_OFF_TIMEOUT[roomTemp>=heatTemp]
+ heatOnWait to heatOffWait
70 100
50 69
50 69
idleWait heatKeyWait coolKeyWait
heatOnWait
autoOnWait fanOn
H_ON_TIMEOUT[roomTemp>heatTemp+dT]
#TC:H tempControl states to heatOnWait
+ tempControlOff to heatOnWait
49 78
79 99
50 69
idleWait heatKeyWait coolKeyWait
tempControlOff
autoOffWait autoOnWait fanOn
HEAT[roomTemp<heatTemp]
+ heatOffWait to heatOnWait
49 78
79 99
50 69
idleWait heatKeyWait coolKeyWait
heatOffWait
autoOffWait fanOn
H_OFF_TIMEOUT[roomTemp<heatTemp]
+ heatOnWait to heatOnWait
49 78
79 99
50 69
idleWait heatKeyWait coolKeyWait
heatOnWait
autoOnWait fanOn
H_ON_TIMEOUT[roomTemp<=heatTemp+dT]
#TC:c tempControl states to coolOffWait
+ tempControlOff to coolOffWait
49 78
79 99
79 99
idleWait heatKeyWait coolKeyWait
tempControlOff
autoOffWait autoOnWait fanOn
COOL[roomTemp<=coolTemp]
+ coolOffWait to coolOffWait
49 78
79 99
79 99
idleWait heatKeyWait coolKeyWait
coolOffWait
autoOffWait fanOn
C_OFF_TIMEOUT[roomTemp<=coolTemp]
+ coolOnWait to coolOffWait
49 78
79 99
79 99
idleWait heatKeyWait coolKeyWait
coolOnWait
autoOnWait fanOn
C_ON_TIMEOUT[roomTemp<coolTemp-dT]
#TC:C tempControl states to coolOnWait
+ tempControlOff to coolOnWait
70 100
79 99
50 69
idleWait heatKeyWait coolKeyWait
tempControlOff
autoOffWait autoOnWait fanOn
COOL[roomTemp>coolTemp]
+ coolOffWait to coolOnWait
70 100
79 99
50 69
idleWait heatKeyWait coolKeyWait
coolOffWait
autoOffWait fanOn
C_OFF_TIMEOUT[roomTemp>coolTemp]
+ coolOnWait to coolOnWait
70 100
79 99
50 69
idleWait heatKeyWait coolKeyWait
coolOnWait
autoOnWait fanOn
C_ON_TIMEOUT[roomTemp>=coolTemp-dT]
#TC:t tempControl states to tempControlOff
+ heatOffWait to tempControlOff
70 100
50 69
50 69
idleWait heatKeyWait coolKeyWait
heatOffWait
autoOffWait autoOnWait fanOn
OFF
+ heatOnWait to tempControlOff
49 78
79 99
79 99
idleWait heatKeyWait coolKeyWait
heatOnWait
autoOffWait autoOnWait fanOn
OFF
+ coolOffWait to tempControlOff
49 78
79 99
79 99
idleWait heatKeyWait coolKeyWait
coolOffWait
autoOffWait autoOnWait fanOn
OFF
+ coolOnWait to tempControlOff
70 100
50 69
50 69
idleWait heatKeyWait coolKeyWait
coolOnWait
autoOffWait autoOnWait fanOn
OFF

The tempControl region has 66 test cases in 5 partitions in the integrated target state design. The results tables follow.

#1. tempControl states to heatOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values2 Values2 Values3 Values3 Values3 Values3 Values138
TC:h1706950coolKeyWaittempControlOfffanOnHEAT[roomTemp>=heatTemp]117
TC:h21006969heatKeyWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp>=heatTemp]96
TC:h3705069idleWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]75
TC:h41005050heatKeyWaittempControlOffautoOnWaitHEAT[roomTemp>=heatTemp]59
TC:h51006950idleWaitheatOnWaitfanOnH_ON_TIMEOUT[roomTemp>heatTemp+dT]46
TC:h6705050heatKeyWaitheatOffWaitfanOnH_OFF_TIMEOUT[roomTemp>=heatTemp]35
TC:h71006969coolKeyWaittempControlOffautoOffWaitHEAT[roomTemp>=heatTemp]28
TC:h81005050idleWaittempControlOffautoOffWaitHEAT[roomTemp>=heatTemp]23
TC:h91005050coolKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]19
TC:h10706969coolKeyWaitheatOffWaitfanOnH_OFF_TIMEOUT[roomTemp>=heatTemp]16
TC:h11705069idleWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp>=heatTemp]13
TC:h121006969heatKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]10

The test cases in partition 1 test the transitions from all allowed tempControl states to the heatOffWait state. (There are no transitions from coolOffWait or coolOnWait.) The constraints among the current states are the same as those in the tempControl integrated transition design. All allowed pairs of current states leading to the heatOffWait state are included. Each event value is paired with each of the allowed current states. Test case TC:h4 includes the transient pair of current states tempControlOff with autoOnWait. It is set up with tempControl in the coolOnWait state, as illustrated below.

TC:h4 is set up by setting the temperature sensor simulator to 100, heatTemp to 50, and coolTemp to 50. The mode switch is set to COOL, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, coolOnWait, and autoOnWait, the SET button is pressed to take the tempSet state to heatKeyWait. The mode switch is moved from COOL through OFF to HEAT before the heatKeyWait and autoOnWait timeouts occur.

#2. tempControl states to heatOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values2 Values2 Values3 Values3 Values3 Values3 Values138
TC:H1499950coolKeyWaittempControlOfffanOnHEAT[roomTemp<heatTemp]117
TC:H2789969heatKeyWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]96
TC:H3497969idleWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp<=heatTemp+dT]75
TC:H4787950heatKeyWaittempControlOffautoOnWaitHEAT[roomTemp<heatTemp]59
TC:H5789950idleWaitheatOnWaitfanOnH_ON_TIMEOUT[roomTemp<=heatTemp+dT]46
TC:H6497950heatKeyWaitheatOffWaitfanOnH_OFF_TIMEOUT[roomTemp<heatTemp]35
TC:H7789969coolKeyWaittempControlOffautoOffWaitHEAT[roomTemp<heatTemp]28
TC:H8787950idleWaittempControlOffautoOffWaitHEAT[roomTemp<heatTemp]23
TC:H9787950coolKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp<=heatTemp+dT]19
TC:H10499969coolKeyWaitheatOffWaitfanOnH_OFF_TIMEOUT[roomTemp<heatTemp]16
TC:H11497969idleWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]13
TC:H12789969heatKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp<=heatTemp+dT]10

The test cases in partition 2 test the transitions from all allowed tempControl states to the heatOnWait state. (There are no transitions from coolOffWait or coolOnWait.) The constraints among the current states are the same as those in the tempControl integrated transition design. All allowed pairs of current states leading to the heatOnWait state are included. Each event value is paired with each of the allowed current states. Test case TC:H4 includes the transient pair of current states tempControlOff with autoOnWait. It is set up with tempControl in the heatOnWait state, as illustrated below.

TC:H4 is set up by setting the temperature sensor simulator to 78, heatTemp to 79, and coolTemp to 50. The mode switch is set to HEAT, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, heatOnWait, and autoOnWait, the SET button is pressed to take the tempSet state to heatKeyWait. The mode switch is moved from HEAT to OFF and back to HEAT before the heatKeyWait and autoOnWait timeouts occur.

#3. tempControl states to coolOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values2 Values2 Values3 Values3 Values3 Values3 Values138
TC:c1499979coolKeyWaittempControlOfffanOnCOOL[roomTemp<=coolTemp]117
TC:c2789999heatKeyWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp<=coolTemp]96
TC:c3497999idleWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]75
TC:c4787979heatKeyWaittempControlOffautoOnWaitCOOL[roomTemp<=coolTemp]59
TC:c5789979idleWaitcoolOnWaitfanOnC_ON_TIMEOUT[roomTemp<coolTemp-dT]46
TC:c6497979heatKeyWaitcoolOffWaitfanOnC_OFF_TIMEOUT[roomTemp<=coolTemp]35
TC:c7789999coolKeyWaittempControlOffautoOffWaitCOOL[roomTemp<=coolTemp]28
TC:c8787979idleWaittempControlOffautoOffWaitCOOL[roomTemp<=coolTemp]23
TC:c9787979coolKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]19
TC:c10499999coolKeyWaitcoolOffWaitfanOnC_OFF_TIMEOUT[roomTemp<=coolTemp]16
TC:c11497999idleWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp<=coolTemp]13
TC:c12789999heatKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]10

The test cases in partition 3 test the transitions from all allowed tempControl states to the coolOffWait state. (There are no transitions from heatOffWait or heatOnWait.) The constraints among the current states are the same as those in the tempControl integrated transition design. All allowed pairs of current states leading to the coolOffWait state are included. Each event value is paired with each of the allowed current states. Test case TC:c4 includes the transient pair of current states tempControlOff with autoOnWait. It is set up with tempControl in the heatOnWait state, as illustrated below.

TC:c4 is set up by setting the temperature sensor simulator to 78, heatTemp to 79, and coolTemp to 79. The mode switch is set to HEAT, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, heatOnWait, and autoOnWait, the SET button is pressed to take the tempSet state to heatKeyWait. The mode switch is moved from HEAT through OFF to COOL before the heatKeyWait and autoOnWait timeouts occur.

#4. tempControl states to coolOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values2 Values2 Values3 Values3 Values3 Values3 Values138
TC:C1709950coolKeyWaittempControlOfffanOnCOOL[roomTemp>coolTemp]117
TC:C21009969heatKeyWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]96
TC:C3707969idleWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp>=coolTemp-dT]75
TC:C41007950heatKeyWaittempControlOffautoOnWaitCOOL[roomTemp>coolTemp]59
TC:C51009950idleWaitcoolOnWaitfanOnC_ON_TIMEOUT[roomTemp>=coolTemp-dT]46
TC:C6707950heatKeyWaitcoolOffWaitfanOnC_OFF_TIMEOUT[roomTemp>coolTemp]35
TC:C71009969coolKeyWaittempControlOffautoOffWaitCOOL[roomTemp>coolTemp]28
TC:C81007950idleWaittempControlOffautoOffWaitCOOL[roomTemp>coolTemp]23
TC:C91007950coolKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp>=coolTemp-dT]19
TC:C10709969coolKeyWaitcoolOffWaitfanOnC_OFF_TIMEOUT[roomTemp>coolTemp]16
TC:C11707969idleWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]13
TC:C121009969heatKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp>=coolTemp-dT]10

The test cases in partition 4 test the transitions from all allowed tempControl states to the coolOnWait state. (There are no transitions from heatOffWait or heatOnWait.) The constraints among the current states are the same as those in the tempControl integrated transition design. All allowed pairs of current states leading to the coolOnWait state are included. Each event value is paired with each of the allowed current states. Test case TC:C4 includes the transient pair of current states tempControlOff with autoOnWait. It is set up with tempControl in the coolOnWait state, as illustrated below.

TC:C4 is set up by setting the temperature sensor simulator to 100, heatTemp to 79, and coolTemp to 50. The mode switch is set to COOL, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, coolOnWait, and autoOnWait, the SET button is pressed to take the tempSet state to heatKeyWait. The mode switch is moved from COOL to OFF and back to COOL before the heatKeyWait and autoOnWait timeouts occur.

#5. tempControl states to tempControlOff
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
4 Values4 Values4 Values3 Values4 Values3 Values1 Value223
TC:t1706950coolKeyWaitheatOffWaitfanOnOFF202
TC:t2499999idleWaitheatOnWaitautoOnWaitOFF181
TC:t3787979heatKeyWaitcoolOffWaitautoOnWaitOFF161
TC:t41005069idleWaitcoolOnWaitfanOnOFF142
TC:t5789999coolKeyWaitcoolOffWaitautoOffWaitOFF128
TC:t6706969heatKeyWaitcoolOnWaitautoOffWaitOFF115
TC:t71005050heatKeyWaitheatOffWaitautoOnWaitOFF103
TC:t8497979heatKeyWaitheatOnWaitfanOnOFF92
TC:t9787979idleWaitheatOnWaitautoOffWaitOFF84
TC:t10705069coolKeyWaitcoolOnWaitautoOnWaitOFF76
TC:t111005050idleWaitheatOffWaitautoOffWaitOFF70
TC:t12499979coolKeyWaitcoolOffWaitfanOnOFF64
TC:t13706969idleWaitheatOffWaitautoOnWaitOFF60
TC:t14787999idleWaitcoolOffWaitfanOnOFF56
TC:t15499999heatKeyWaitheatOnWaitautoOffWaitOFF53
TC:t161006969coolKeyWaitheatOffWaitautoOffWaitOFF51
TC:t17497999coolKeyWaitheatOnWaitautoOnWaitOFF49
TC:t18706950coolKeyWaitcoolOnWaitfanOnOFF48

The test cases in partition 5 test the transitions from all allowed tempControl states to the tempControlOff state. (There is no transition from tempControlOff.) The constraints among the current states are the same as those in the tempControl integrated transition design. All allowed pairs of current states leading to the tempControlOff state are included. The event value (OFF) is paired with each of the allowed current states.

Six test cases include one of 4 transient pairs of current states:

TC:t3coolOffWait with autoOnWait
TC:t6coolOnWait with autoOffWait
TC:t7 TC:t13heatOffWait with autoOnWait
TC:t9 TC:t15heatOnWait with autoOffWait
These test cases are set up as illustrated below.

TC:t3 is set up by setting the temperature sensor simulator to 78, heatTemp to 79, and coolTemp to 79. The mode switch is set to HEAT, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, heatOnWait, and autoOnWait, the SET button is pressed to take the tempSet state to heatKeyWait. The mode switch is moved from HEAT through OFF to COOL and back to OFF before the heatKeyWait and autoOnWait timeouts occur.

TC:t6 is set up by setting the temperature sensor simulator to 70, heatTemp to 69, and coolTemp to 69. The mode switch is set to OFF, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, tempControlOff, and autoOffWait, the SET button is pressed to take the tempSet state to heatKeyWait. The mode switch is moved from OFF to COOL and back to OFF before the heatKeyWait and autoOffWait timeouts occur.

TC:t7 is set up by setting the temperature sensor simulator to 100, heatTemp to 50, and coolTemp to 50. The mode switch is set to COOL, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, coolOnWait, and autoOnWait, the SET button is pressed to take the tempSet state to heatKeyWait. The mode switch is moved from COOL through OFF to HEAT and back to OFF before the heatKeyWait and autoOnWait timeouts occur.

TC:t9 is set up by setting the temperature sensor simulator to 78, heatTemp to 79, and coolTemp to 79. The mode switch is set to OFF, and the fan switch is set to AUTO. After the tempSet, tempControl, and fanControl states are idleWait, tempControlOff, and autoOffWait, the mode switch is moved from OFF to HEAT and back to OFF before the autoOffWait timeout occurs.

<tempControl Integrated Transition tempControl Integrated Propagation>

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