Testcover.com Testcover.com
Tutorial - Thermostat Example -
tempControl Integrated Propagation 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 propagation model, in which the effects of this region's transitions on other regions are tested.

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 state2 autoOffWait autoOnWait
7. event7 H_ON_TIMEOUT[roomTemp>heatTemp+dT]
HEAT[roomTemp<heatTemp] H_OFF_TIMEOUT[roomTemp<heatTemp]
C_ON_TIMEOUT[roomTemp<coolTemp-dT]
COOL[roomTemp>coolTemp] C_OFF_TIMEOUT[roomTemp>coolTemp]
OFF

The test design is constructed following steps 15-18 of the design procedure. The relationship between the blocks of the tempControl integrated target state design and those of the integrated propagation design is presented in the tempControl mapping table.

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 propagation design
roomTemp
heatTemp
coolTemp
tempSet state
tempControl state
fanControl state
event
#TC:h tempControl states to heatOffWait
+ heatOnWait to heatOffWait
70 100
50 69
50 69
idleWait heatKeyWait coolKeyWait
heatOnWait
autoOnWait
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
HEAT[roomTemp<heatTemp]
+ heatOffWait to heatOnWait
49 78
79 99
50 69
idleWait heatKeyWait coolKeyWait
heatOffWait
autoOffWait
H_OFF_TIMEOUT[roomTemp<heatTemp]
#TC:c tempControl states to coolOffWait
+ coolOnWait to coolOffWait
49 78
79 99
79 99
idleWait heatKeyWait coolKeyWait
coolOnWait
autoOnWait
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
COOL[roomTemp>coolTemp]
+ coolOffWait to coolOnWait
70 100
79 99
50 69
idleWait heatKeyWait coolKeyWait
coolOffWait
autoOffWait
C_OFF_TIMEOUT[roomTemp>coolTemp]
#TC:t tempControl states to tempControlOff
+ heatOnWait to tempControlOff
49 78
79 99
79 99
idleWait heatKeyWait coolKeyWait
heatOnWait
autoOnWait
OFF
+ coolOnWait to tempControlOff
70 100
50 69
50 69
idleWait heatKeyWait coolKeyWait
coolOnWait
autoOnWait
OFF

The tempControl region has 40 test cases in 5 partitions in the integrated propagation 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 Values1 Value1 Value1 Value60
TC:h1706969coolKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]39
TC:h2705050heatKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]24
TC:h31006950idleWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]12
TC:h41006969heatKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]8
TC:h5705069idleWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]4
TC:h61005050coolKeyWaitheatOnWaitautoOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]0

The test cases in partition 1 involve transitions from the heatOnWait state to the heatOffWait state following an increase in the roomTemp value or a decrease in the heatTemp value. The tempControl state change then leads to a fanControl state change. In the tempControl region tempControlOff and heatOffWait are omitted as current states because they do not lead to observable changes in other regions. The fanOn state also is omitted because it precludes observable changes in other regions. (The autoOffWait state was excluded from this transition earlier due to testability issues. However, autoOffWait as a current state also would preclude observable changes in other regions and is omitted from the design for this reason as well.) Set-up and expected results for TC:h2 are described below.

TC:h2 is set up by setting the temperature sensor simulator to 49, heatTemp to 50, 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 twice to put the tempSet region into the coolKeyWait state. The temperature sensor simulator is set to 70, and the SET button is pressed twice again, to put the tempSet region into the heatKeyWait state before the heatOnWait timeout occurs. The expected results include the tempControl state going to heatOffWait, the furnace turning off, the fanControl state going to autoOffWait, and the fan turning off.

#2. tempControl states to heatOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values2 Values2 Values3 Values2 Values1 Value2 Values83
TC:H1499969coolKeyWaittempControlOffautoOffWaitHEAT[roomTemp<heatTemp]62
TC:H2497950heatKeyWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]42
TC:H3789950idleWaittempControlOffautoOffWaitHEAT[roomTemp<heatTemp]28
TC:H4789969heatKeyWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]18
TC:H5497969idleWaittempControlOffautoOffWaitHEAT[roomTemp<heatTemp]12
TC:H6787950coolKeyWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]6
TC:H7789969heatKeyWaittempControlOffautoOffWaitHEAT[roomTemp<heatTemp]4
TC:H8497969idleWaitheatOffWaitautoOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]2

The test cases in partition 2 involve transitions to the heatOnWait state either from the tempControlOff state via the mode switch, or from the heatOffWait state following a decrease in the roomTemp value or an increase in the heatTemp value. The tempControl state change then leads to a fanControl state change. In the tempControl region heatOnWait is omitted as a current state because it does not lead to observable changes in other regions. The autoOnWait and fanOn states also are omitted because they preclude observable changes in other regions. Set-up and expected results for TC:H1 and TC:H2 are described below.

TC:H1 is set up by setting the temperature sensor simulator to 49, heatTemp to 99, 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 twice to put the tempSet region into the coolKeyWait state. The mode switch is then set to HEAT. The expected results include the tempControl state going to heatOnWait, the furnace turning on, the fanControl state going to autoOnWait, and the fan turning on.

TC:H2 is set up by setting the temperature sensor simulator to 100, 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, heatOffWait, and autoOffWait, the SET button is pressed twice to put the tempSet region into the coolKeyWait state. The temperature sensor simulator is set to 49, and the SET button is pressed twice again, to put the tempSet region into the heatKeyWait state before the heatOffWait timeout occurs. The expected results include the tempControl state going to heatOnWait, the furnace turning on, the fanControl state going to autoOnWait, and the fan turning on.

#3. tempControl states to coolOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values2 Values2 Values3 Values1 Value1 Value1 Value60
TC:c1499999coolKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]39
TC:c2497979heatKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]24
TC:c3789979idleWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]12
TC:c4789999heatKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]8
TC:c5497999idleWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]4
TC:c6787979coolKeyWaitcoolOnWaitautoOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]0

The test cases in partition 3 involve transitions from the coolOnWait state to the coolOffWait state following a decrease in the roomTemp value or an increase in the coolTemp value. The tempControl state change then leads to a fanControl state change. In the tempControl region tempControlOff and coolOffWait are omitted as current states because they do not lead to observable changes in other regions. The fanOn state also is omitted because it precludes observable changes in other regions. Set-up and expected results for TC:c2 are described below.

TC:c2 is set up by setting the temperature sensor simulator to 100, heatTemp to 79, and coolTemp to 79. 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 twice to put the tempSet region into the coolKeyWait state. The temperature sensor simulator is set to 49, and the SET button is pressed twice again, to put the tempSet region into the heatKeyWait state before the coolOnWait timeout occurs. The expected results include the tempControl state going to coolOffWait, the air conditioner turning off, the fanControl state going to autoOffWait, and the fan turning off.

#4. tempControl states to coolOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
2 Values2 Values2 Values3 Values2 Values1 Value2 Values83
TC:C1709969coolKeyWaittempControlOffautoOffWaitCOOL[roomTemp>coolTemp]62
TC:C2707950heatKeyWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]42
TC:C31009950idleWaittempControlOffautoOffWaitCOOL[roomTemp>coolTemp]28
TC:C41009969heatKeyWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]18
TC:C5707969idleWaittempControlOffautoOffWaitCOOL[roomTemp>coolTemp]12
TC:C61007950coolKeyWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]6
TC:C71009969heatKeyWaittempControlOffautoOffWaitCOOL[roomTemp>coolTemp]4
TC:C8707969idleWaitcoolOffWaitautoOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]2

The test cases in partition 4 involve transitions to the coolOnWait state either from the tempControlOff state via the mode switch, or from the coolOffWait state following an increase in the roomTemp value or a decrease in the coolTemp value. The tempControl state change then leads to a fanControl state change. In the tempControl region coolOnWait is omitted as a current state because it does not lead to observable changes in other regions. The autoOnWait and fanOn states also are omitted because they preclude observable changes in other regions. Set-up and expected results for TC:C1 and TC:C2 are described below.

TC:C1 is set up by setting the temperature sensor simulator to 70, heatTemp to 99, 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 twice to put the tempSet region into the coolKeyWait state. The mode switch is then set to COOL. The expected results include the tempControl state going to coolOnWait, the air conditioner turning on, the fanControl state going to autoOnWait, and the fan turning on.

TC:C2 is set up by setting the temperature sensor simulator to 49, 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, coolOffWait, and autoOffWait, the SET button is pressed twice to put the tempSet region into the coolKeyWait state. The temperature sensor simulator is set to 70, and the SET button is pressed twice again, to put the tempSet region into the heatKeyWait state before the coolOffWait timeout occurs. The expected results include the tempControl state going to coolOnWait, the air conditioner turning on, the fanControl state going to autoOnWait, and the fan turning on.

#5. tempControl states to tempControlOff
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
4 Values4 Values4 Values3 Values2 Values1 Value1 Value149
TC:t1499999coolKeyWaitheatOnWaitautoOnWaitOFF128
TC:t21006969heatKeyWaitcoolOnWaitautoOnWaitOFF108
TC:t3787979coolKeyWaitheatOnWaitautoOnWaitOFF93
TC:t4705069idleWaitcoolOnWaitautoOnWaitOFF78
TC:t51005050coolKeyWaitcoolOnWaitautoOnWaitOFF68
TC:t6789999heatKeyWaitheatOnWaitautoOnWaitOFF62
TC:t7497999idleWaitheatOnWaitautoOnWaitOFF56
TC:t8497979heatKeyWaitheatOnWaitautoOnWaitOFF52
TC:t9789979idleWaitheatOnWaitautoOnWaitOFF48
TC:t10706969coolKeyWaitcoolOnWaitautoOnWaitOFF44
TC:t11705050heatKeyWaitcoolOnWaitautoOnWaitOFF40
TC:t121006950idleWaitcoolOnWaitautoOnWaitOFF36

The test cases in partition 5 involve transitions to the tempControlOff state from the heatOnWait or coolOnWait state via the mode switch. The tempControl state change then leads to a fanControl state change. In the tempControl region heatOffWait and coolOffWait are omitted as current states because they do not lead to observable changes in other regions. The autoOffWait and fanOn states also are omitted because they preclude observable changes in other regions. Set-up and expected results for TC:t1 are described below.

TC:t1 is set up by setting the temperature sensor simulator to 49, heatTemp to 99, and coolTemp to 99. 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 twice to put the tempSet region into the coolKeyWait state. The mode switch is then set to OFF. The expected results include the tempControl state going to tempControlOff, the furnace turning off, the fanControl state going to autoOffWait, and the fan turning off.

<tempControl Integrated Target State fanControl Stand-alone Transition>

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