Testcover.com Testcover.com
Tutorial - Thermostat Example -
tempControl Stand-alone 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
--->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. The design illustrates the stand-alone transition model, in which the region is considered isolated from the rest of the system. Each state transition in this region has 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 corresponding to partitions:

# tempControlOff to heatOffWait
# heatOffWait to heatOffWait
# heatOnWait to heatOffWait
# tempControlOff to heatOnWait
# heatOffWait to heatOnWait
# heatOnWait to heatOnWait
# tempControlOff to coolOffWait
# coolOffWait to coolOffWait
# coolOnWait to coolOffWait
# tempControlOff to coolOnWait
# coolOffWait to coolOnWait
# coolOnWait to coolOnWait
# heatOffWait to tempControlOff
# heatOnWait to tempControlOff
# coolOffWait to tempControlOff
# coolOnWait to tempControlOff

There are 5 test factors with values as follows.

Test FactorNumber of ValuesTest Factor Values
1. roomTemp4 49 73 74 100
2. heatTemp4 50 73 74 99
3. coolTemp4 50 73 74 99
4. tempControl state5 heatOffWait heatOnWait coolOffWait coolOnWait tempControlOff
5. 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 1-6 of the design procedure.

The test case generator request is given below. The partition prefix TC:th indicates the region, tempControl (TC), and the transition, e.g. tempControlOff to heatOffWait (th), for each test case.
Thermostat Example - tempControl stand-alone transition design
roomTemp
heatTemp
coolTemp
tempControl state
event
#TC:th tempControlOff to heatOffWait
74 100
50 74
50 99
tempControlOff
HEAT[roomTemp>=heatTemp]
#TC:hh heatOffWait to heatOffWait
74 100
50 74
50 99
heatOffWait
H_OFF_TIMEOUT[roomTemp>=heatTemp]
#TC:Hh heatOnWait to heatOffWait
74 100
50 73
50 99
heatOnWait
H_ON_TIMEOUT[roomTemp>heatTemp+dT]
#TC:tH tempControlOff to heatOnWait
49 73
74 99
50 99
tempControlOff
HEAT[roomTemp<heatTemp]
#TC:hH heatOffWait to heatOnWait
49 73
74 99
50 99
heatOffWait
H_OFF_TIMEOUT[roomTemp<heatTemp]
#TC:HH heatOnWait to heatOnWait
49 74
74 99
50 99
heatOnWait
H_ON_TIMEOUT[roomTemp<=heatTemp+dT]
#TC:tc tempControlOff to coolOffWait
49 74
50 99
74 99
tempControlOff
COOL[roomTemp<=coolTemp]
#TC:cc coolOffWait to coolOffWait
49 74
50 99
74 99
coolOffWait
C_OFF_TIMEOUT[roomTemp<=coolTemp]
#TC:Cc coolOnWait to coolOffWait
49 73
50 99
74 99
coolOnWait
C_ON_TIMEOUT[roomTemp<coolTemp-dT]
#TC:tC tempControlOff to coolOnWait
74 100
50 99
50 73
tempControlOff
COOL[roomTemp>coolTemp]
#TC:cC coolOffWait to coolOnWait
74 100
50 99
50 73
coolOffWait
C_OFF_TIMEOUT[roomTemp>coolTemp]
#TC:CC coolOnWait to coolOnWait
74 100
50 99
50 74
coolOnWait
C_ON_TIMEOUT[roomTemp>=coolTemp-dT]
#TC:ht heatOffWait to tempControlOff
74 100
50 74
50 99
heatOffWait
OFF
#TC:Ht heatOnWait to tempControlOff
49 73
74 99
50 99
heatOnWait
OFF
#TC:ct coolOffWait to tempControlOff
49 74
50 99
74 99
coolOffWait
OFF
#TC:Ct coolOnWait to tempControlOff
74 100
50 99
50 73
coolOnWait
OFF

The tempControl region has 64 test cases in 16 partitions in the stand-alone transition design. The results tables follow.

#1. tempControlOff to heatOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:th1745050tempControlOffHEAT[roomTemp>=heatTemp]15
TC:th21007450tempControlOffHEAT[roomTemp>=heatTemp]8
TC:th31005099tempControlOffHEAT[roomTemp>=heatTemp]3
TC:th4747499tempControlOffHEAT[roomTemp>=heatTemp]0

The test cases in partition 1 test the HEAT transitions from the tempControlOff state with various temperature variable values for which roomTemp>=heatTemp. Test case TC:th1 is set up as illustrated below.

TC:th1 is set up by setting the temperature sensor simulator to 74, heatTemp to 50, and coolTemp to 50. The mode switch is set to OFF. After the tempSet and tempControl states are idleWait and tempControlOff, the mode switch is moved from OFF to HEAT to trigger the transition to heatOffWait.

#2. heatOffWait to heatOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:hh1745050heatOffWaitH_OFF_TIMEOUT[roomTemp>=heatTemp]15
TC:hh21007450heatOffWaitH_OFF_TIMEOUT[roomTemp>=heatTemp]8
TC:hh31005099heatOffWaitH_OFF_TIMEOUT[roomTemp>=heatTemp]3
TC:hh4747499heatOffWaitH_OFF_TIMEOUT[roomTemp>=heatTemp]0

The test cases in partition 2 test the timeout transitions from the heatOffWait state with various temperature variable values for which roomTemp>=heatTemp.

#3. heatOnWait to heatOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:Hh1745050heatOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]15
TC:Hh21007350heatOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]8
TC:Hh31005099heatOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]3
TC:Hh4747399heatOnWaitH_ON_TIMEOUT[roomTemp>heatTemp+dT]0

The test cases in partition 3 test the timeout transitions from the heatOnWait state with various temperature variable values for which roomTemp>heatTemp+dT. Test case TC:Hh1 is set up as illustrated below.

TC:Hh1 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. After the tempSet and tempControl states are idleWait and heatOnWait, the temperature sensor simulator is set to 74, and the SET button is pressed three times to set the roomTemp value in the idleWait state before the heatOnWait timeout occurs.

#4. tempControlOff to heatOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:tH1497450tempControlOffHEAT[roomTemp<heatTemp]15
TC:tH2739950tempControlOffHEAT[roomTemp<heatTemp]8
TC:tH3737499tempControlOffHEAT[roomTemp<heatTemp]3
TC:tH4499999tempControlOffHEAT[roomTemp<heatTemp]0

The test cases in partition 4 test the HEAT transitions from the tempControlOff state with various temperature variable values for which roomTemp<heatTemp.

#5. heatOffWait to heatOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:hH1497450heatOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]15
TC:hH2739950heatOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]8
TC:hH3737499heatOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]3
TC:hH4499999heatOffWaitH_OFF_TIMEOUT[roomTemp<heatTemp]0

The test cases in partition 5 test the timeout transitions from the heatOffWait state with various temperature variable values for which roomTemp<heatTemp. Test case TC:hH1 is set up as illustrated below.

TC:hH1 is set up by setting the temperature sensor simulator to 99, heatTemp to 74, and coolTemp to 50. The mode switch is set to HEAT. After the tempSet and tempControl states are idleWait and heatOffWait, the temperature sensor simulator is set to 49, and the SET button is pressed three times to set the roomTemp value in the idleWait state before the heatOffWait timeout occurs.

#6. heatOnWait to heatOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:HH1497450heatOnWaitH_ON_TIMEOUT[roomTemp<=heatTemp+dT]15
TC:HH2749950heatOnWaitH_ON_TIMEOUT[roomTemp<=heatTemp+dT]8
TC:HH3747499heatOnWaitH_ON_TIMEOUT[roomTemp<=heatTemp+dT]3
TC:HH4499999heatOnWaitH_ON_TIMEOUT[roomTemp<=heatTemp+dT]0

The test cases in partition 6 test the timeout transitions from the heatOnWait state with various temperature variable values for which roomTemp<=heatTemp+dT.

#7. tempControlOff to coolOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:tc1495074tempControlOffCOOL[roomTemp<=coolTemp]15
TC:tc2749974tempControlOffCOOL[roomTemp<=coolTemp]8
TC:tc3745099tempControlOffCOOL[roomTemp<=coolTemp]3
TC:tc4499999tempControlOffCOOL[roomTemp<=coolTemp]0

The test cases in partition 7 test the COOL transitions from the tempControlOff state with various temperature variable values for which roomTemp<=coolTemp.

#8. coolOffWait to coolOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:cc1495074coolOffWaitC_OFF_TIMEOUT[roomTemp<=coolTemp]15
TC:cc2749974coolOffWaitC_OFF_TIMEOUT[roomTemp<=coolTemp]8
TC:cc3745099coolOffWaitC_OFF_TIMEOUT[roomTemp<=coolTemp]3
TC:cc4499999coolOffWaitC_OFF_TIMEOUT[roomTemp<=coolTemp]0

The test cases in partition 8 test the timeout transitions from the coolOffWait state with various temperature variable values for which roomTemp<=coolTemp.

#9. coolOnWait to coolOffWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:Cc1495074coolOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]15
TC:Cc2739974coolOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]8
TC:Cc3735099coolOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]3
TC:Cc4499999coolOnWaitC_ON_TIMEOUT[roomTemp<coolTemp-dT]0

The test cases in partition 9 test the timeout transitions from the coolOnWait state with various temperature variable values for which roomTemp<coolTemp-dT.

#10. tempControlOff to coolOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:tC1745050tempControlOffCOOL[roomTemp>coolTemp]15
TC:tC21009950tempControlOffCOOL[roomTemp>coolTemp]8
TC:tC31005073tempControlOffCOOL[roomTemp>coolTemp]3
TC:tC4749973tempControlOffCOOL[roomTemp>coolTemp]0

The test cases in partition 10 test the COOL transitions from the tempControlOff state with various temperature variable values for which roomTemp>coolTemp.

#11. coolOffWait to coolOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:cC1745050coolOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]15
TC:cC21009950coolOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]8
TC:cC31005073coolOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]3
TC:cC4749973coolOffWaitC_OFF_TIMEOUT[roomTemp>coolTemp]0

The test cases in partition 11 test the timeout transitions from the coolOffWait state with various temperature variable values for which roomTemp>coolTemp.

#12. coolOnWait to coolOnWait
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:CC1745050coolOnWaitC_ON_TIMEOUT[roomTemp>=coolTemp-dT]15
TC:CC21009950coolOnWaitC_ON_TIMEOUT[roomTemp>=coolTemp-dT]8
TC:CC31005074coolOnWaitC_ON_TIMEOUT[roomTemp>=coolTemp-dT]3
TC:CC4749974coolOnWaitC_ON_TIMEOUT[roomTemp>=coolTemp-dT]0

The test cases in partition 12 test the timeout transitions from the coolOnWait state with various temperature variable values for which roomTemp>=coolTemp-dT.

#13. heatOffWait to tempControlOff
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:ht1745050heatOffWaitOFF15
TC:ht21007450heatOffWaitOFF8
TC:ht31005099heatOffWaitOFF3
TC:ht4747499heatOffWaitOFF0

The test cases in partition 13 test the OFF transitions from the heatOffWait state with various temperature variable values for which roomTemp>=heatTemp.

#14. heatOnWait to tempControlOff
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:Ht1497450heatOnWaitOFF15
TC:Ht2739950heatOnWaitOFF8
TC:Ht3737499heatOnWaitOFF3
TC:Ht4499999heatOnWaitOFF0

The test cases in partition 14 test the OFF transitions from the heatOnWait state with various temperature variable values for which roomTemp<heatTemp.

#15. coolOffWait to tempControlOff
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:ct1495074coolOffWaitOFF15
TC:ct2749974coolOffWaitOFF8
TC:ct3745099coolOffWaitOFF3
TC:ct4499999coolOffWaitOFF0

The test cases in partition 15 test the OFF transitions from the coolOffWait state with various temperature variable values for which roomTemp<=coolTemp.

#16. coolOnWait to tempControlOff
Test
Case ID
roomTemp heatTemp coolTemp tempControl state event Combo
Countdown
2 Values2 Values2 Values1 Value1 Value25
TC:Ct1745050coolOnWaitOFF15
TC:Ct21009950coolOnWaitOFF8
TC:Ct31005073coolOnWaitOFF3
TC:Ct4749973coolOnWaitOFF0

The test cases in partition 16 test the OFF transitions from the coolOnWait state with various temperature variable values for which roomTemp>coolTemp.

<tempSet Integrated Propagation tempControl Integrated Transition>

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