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

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 propagation design is based on the previous, integrated target state design. However, in the integrated propagation model, combinations of states, trigger events, and program variable values are selected to test the tempSet interactions with the other regions. Some blocks from the integrated target state model are not included in the integrated propagation model when they do not affect other regions according to the state machine diagram. Similarly, test factor values which do not cause observable interactions with other regions are excluded.

There are 7 test factors with values as follows.

Test FactorNumber of ValuesTest Factor Values
1. roomTemp6 50 51 70 78 98 99
2. heatTemp5 50 51 52 98 99
3. coolTemp5 50 51 97 98 99
4. tempSet state3 idleWait heatKeyWait coolKeyWait
5. tempControl state4 heatOffWait heatOnWait coolOffWait coolOnWait
6. fanControl state3 autoOffWait autoOnWait fanOn
7. event8 IDLE_TIMEOUT H_KEY_TIMEOUT C_KEY_TIMEOUT SET
UP[heatTemp<maxTemp] DOWN[heatTemp>minTemp]x2
UP[coolTemp<maxTemp]x2 DOWN[coolTemp>minTemp]

The event DOWN[heatTemp>minTemp]x2 or UP[coolTemp<maxTemp]x2 represents 2 presses of the corresponding button to turn off the furnace or air conditioner.

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

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 propagation design
roomTemp
heatTemp
coolTemp
tempSet state
tempControl state
fanControl state
event
#TS:I tempSet states to idleWait
+ idleWait to idleWait (heatOffWait coolOffWait) x (autoOffWait fanOn)
70 78
98 99
50 51
idleWait
heatOffWait coolOffWait
autoOffWait fanOn
IDLE_TIMEOUT
+ idleWait to idleWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
50 51
98 99
idleWait
heatOnWait coolOnWait
autoOnWait fanOn
IDLE_TIMEOUT
+ heatKeyWait to idleWait (heatOffWait coolOffWait) x (autoOffWait fanOn)
70 78
98 99
50 51
heatKeyWait
heatOffWait coolOffWait
autoOffWait fanOn
H_KEY_TIMEOUT
+ heatKeyWait to idleWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
50 51
98 99
heatKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
H_KEY_TIMEOUT
+ coolKeyWait to idleWait (heatOffWait coolOffWait) x (autoOffWait fanOn)
70 78
98 99
50 51
coolKeyWait
heatOffWait coolOffWait
autoOffWait fanOn
C_KEY_TIMEOUT SET
+ coolKeyWait to idleWait (heatOnWait coolOnWait) x (autoOnWait fanOn)
70 78
50 51
98 99
coolKeyWait
heatOnWait coolOnWait
autoOnWait fanOn
C_KEY_TIMEOUT SET
#TS:H tempSet states to heatKeyWait
+ heatKeyWait to heatKeyWait (heatOffWait) x (autoOffWait fanOn)
50
50
51
heatKeyWait
heatOffWait
autoOffWait fanOn
UP[heatTemp<maxTemp]
+ heatKeyWait to heatKeyWait (heatOffWait) x (autoOffWait fanOn)
98
98
99
heatKeyWait
heatOffWait
autoOffWait fanOn
UP[heatTemp<maxTemp]
+ heatKeyWait to heatKeyWait (heatOnWait) x (autoOnWait fanOn)
51
52
50
heatKeyWait
heatOnWait
autoOnWait fanOn
DOWN[heatTemp>minTemp]x2
+ heatKeyWait to heatKeyWait (heatOnWait) x (autoOnWait fanOn)
98
99
97
heatKeyWait
heatOnWait
autoOnWait fanOn
DOWN[heatTemp>minTemp]x2
#TS:C tempSet states to coolKeyWait
+ coolKeyWait to coolKeyWait (coolOffWait) x (autoOffWait fanOn)
51
50
51
coolKeyWait
coolOffWait
autoOffWait fanOn
DOWN[coolTemp>minTemp]
+ coolKeyWait to coolKeyWait (coolOffWait) x (autoOffWait fanOn)
99
98
99
coolKeyWait
coolOffWait
autoOffWait fanOn
DOWN[coolTemp>minTemp]
+ coolKeyWait to coolKeyWait (coolOnWait) x (autoOnWait fanOn)
51
52
50
coolKeyWait
coolOnWait
autoOnWait fanOn
UP[coolTemp<maxTemp]x2
+ coolKeyWait to coolKeyWait (coolOnWait) x (autoOnWait fanOn)
98
99
97
coolKeyWait
coolOnWait
autoOnWait fanOn
UP[coolTemp<maxTemp]x2

The tempSet region has 34 test cases in 3 partitions in the integrated propagation 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 Values4 Values3 Values4 Values245
TS:I1709850idleWaitheatOffWaitautoOffWaitIDLE_TIMEOUT224
TS:I2789951heatKeyWaitcoolOffWaitfanOnH_KEY_TIMEOUT203
TS:I3705098coolKeyWaitheatOnWaitautoOnWaitC_KEY_TIMEOUT182
TS:I4785199coolKeyWaitcoolOnWaitfanOnSET162
TS:I5785199idleWaitheatOnWaitautoOnWaitIDLE_TIMEOUT146
TS:I6705198heatKeyWaitcoolOnWaitautoOnWaitH_KEY_TIMEOUT131
TS:I7789951coolKeyWaitheatOffWaitautoOffWaitC_KEY_TIMEOUT116
TS:I8785098idleWaitcoolOnWaitfanOnIDLE_TIMEOUT103
TS:I9789850coolKeyWaitcoolOffWaitfanOnC_KEY_TIMEOUT90
TS:I10705099heatKeyWaitheatOnWaitfanOnH_KEY_TIMEOUT80
TS:I11709950coolKeyWaitcoolOffWaitautoOffWaitSET71
TS:I12709850heatKeyWaitheatOffWaitautoOffWaitH_KEY_TIMEOUT63
TS:I13789951idleWaitcoolOffWaitfanOnIDLE_TIMEOUT57
TS:I14709851coolKeyWaitheatOffWaitfanOnSET51
TS:I15785199coolKeyWaitheatOnWaitautoOnWaitC_KEY_TIMEOUT49
TS:I16705198coolKeyWaitcoolOnWaitautoOnWaitSET47
TS:I17705099coolKeyWaitheatOnWaitfanOnSET45
TS:I18785098coolKeyWaitcoolOnWaitfanOnC_KEY_TIMEOUT44

The test cases in partition 1 involve roomTemp changes associated with transitions to the idleWait state. The roomTemp changes lead to tempControl state changes, and possibly fanControl state changes. The tempControlOff state is omitted because it precludes observable changes in other regions. Set-up and expected results for two examples, TS:I1 and TS:I4, are described below.

TS:I1 is set up by setting the temperature sensor simulator to 100, heatTemp to 98, and coolTemp to 50. The mode switch is set to HEAT, and the fan switch is set to AUTO. After the current states of the regions are as given by the test case, the temperature sensor simulator is set to 70. The idleWaitState timeout, IDLE_TIMEOUT, is the trigger event. The expected results include the roomTemp being set to 70, the tempControl state going to heatOnWait, the furnace turning on, the fanControl state going to autoOnWait, and the fan turning on.

TS:I4 is set up by setting the temperature sensor simulator to 100, heatTemp to 51, and coolTemp to 99. The mode switch is set to COOL, and the fan switch is set to ON. After the tempSet, tempControl, and fanControl states are idleWait, CoolOnWait, and fanOn, the SET button is pressed twice to put the tempSet region into the coolKeyWait state. The temperature sensor simulator is set to 78, and the SET button is pressed again, before the coolKeyWait timeout occurs. The expected results include the roomTemp being set to 78, the tempControl state going to coolOffWait, the air conditioner turning off, and the fanControl state remaining in fanOn.

#2. tempSet states to heatKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
3 Values4 Values4 Values1 Value2 Values3 Values2 Values151
TS:H1505051heatKeyWaitheatOffWaitautoOffWaitUP[heatTemp<maxTemp]130
TS:H2515250heatKeyWaitheatOnWaitautoOnWaitDOWN[heatTemp>minTemp]x2109
TS:H3989899heatKeyWaitheatOffWaitfanOnUP[heatTemp<maxTemp]91
TS:H4989997heatKeyWaitheatOnWaitfanOnDOWN[heatTemp>minTemp]x276
TS:H5505051heatKeyWaitheatOffWaitfanOnUP[heatTemp<maxTemp]73
TS:H6989899heatKeyWaitheatOffWaitautoOffWaitUP[heatTemp<maxTemp]70
TS:H7515250heatKeyWaitheatOnWaitfanOnDOWN[heatTemp>minTemp]x267
TS:H8989997heatKeyWaitheatOnWaitautoOnWaitDOWN[heatTemp>minTemp]x264

The test cases in partition 2 involve heatTemp changes associated with transitions to the heatKeyWait state. The heatTemp changes lead to tempControl state changes, and possibly fanControl state changes. The current tempSet state must be heatKeyWait to change the heatTemp value. The tempControlOff, coolOffWait, and coolOnWait states are omitted because they preclude observable changes in other regions. Set-up and expected results for TS:H2 are described below.

TS:H2 is set up by setting the temperature sensor simulator to 51, heatTemp to 52, 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 event (actually 2 events) is 2 DOWN button presses. The expected results include the heatTemp being set to 50, the tempControl state going to heatOffWait, the furnace turning off, the fanControl state going to autoOffWait, and the fan turning off.

#3. tempSet states to coolKeyWait
Test
Case ID
roomTemp heatTemp coolTemp tempSet state tempControl state fanControl state event Combo
Countdown
3 Values4 Values4 Values1 Value2 Values3 Values2 Values151
TS:C1515051coolKeyWaitcoolOffWaitautoOffWaitDOWN[coolTemp>minTemp]130
TS:C2989997coolKeyWaitcoolOnWaitautoOnWaitUP[coolTemp<maxTemp]x2109
TS:C3999899coolKeyWaitcoolOffWaitfanOnDOWN[coolTemp>minTemp]91
TS:C4515250coolKeyWaitcoolOnWaitfanOnUP[coolTemp<maxTemp]x275
TS:C5999899coolKeyWaitcoolOffWaitautoOffWaitDOWN[coolTemp>minTemp]72
TS:C6515250coolKeyWaitcoolOnWaitautoOnWaitUP[coolTemp<maxTemp]x269
TS:C7989997coolKeyWaitcoolOnWaitfanOnUP[coolTemp<maxTemp]x266
TS:C8515051coolKeyWaitcoolOffWaitfanOnDOWN[coolTemp>minTemp]64

The test cases in partition 3 involve coolTemp changes associated with transitions to the coolKeyWait state. The coolTemp changes lead to tempControl state changes, and possibly fanControl state changes. The current tempSet state must be coolKeyWait to change the coolTemp value. The tempControlOff, heatOffWait, and heatOnWait states are omitted because they preclude observable changes in other regions.

<tempSet Integrated Target State tempControl Stand-alone Transition>

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