Testcover.com Testcover.com
Tutorial - Thermostat Example -
UML State Machine Diagram

Home
Existing User Login
Brochure
Sign up for Risk-Free Trial
About Testcover.com
Frequently Asked Questions
Tutorial with Examples
->UML State Machine
--->Thermostat
--->Test Models
--->Design Procedure
--->tempSet Designs
--->tempControl Designs
--->fanControl Designs
Performance
WSDL Interface
Background
Partners
Registrations
Contact Information


The Thermostat Example illustrates pairwise testing using a Unified Modeling Language (UML) state machine diagram. UML is a standard software engineering modeling language created and managed by the Object Management Group. This example gives a procedure for developing pairwise test designs from UML state machine diagrams, which may have multiple orthogonal regions. The example describes and compares designs using 4 different test models for the 3 regions of the thermostat state machine diagram.

UML state machines can differ from traditional finite state machines in important ways. A finite state machine can be in only one state at a time, but a UML state machine allows for multiple regions operating concurrently. Thus each region of a UML state machine has its own state, and the overall operation depends on the states of all the regions. UML state machines also can have hierarchically nested states and actions associated with the entry and exit of the states. A crash course in UML state machines provides more detail about these concepts.

The state machine diagram describes a thermostat, simplified for the purpose of the example. It has 3 regions:

• tempSet allows the user to set the heating and cooling temperatures.
• tempControl controls the heating and cooling according to the operating mode selected by the user.
• fanControl controls the operation of the fan circulating the air.

Four pairwise test models are used to design tests of a region's behavior and its interactions with other regions:

• Stand-alone transition model --The region is considered isolated from the rest of the system; each state transition in this region has one partition.
• Integrated transition model --States of other regions are included as factors for testing this region; each state transition in this region has one partition.
• Integrated target state model --States of other regions are included as factors for testing this region; the transitions to each target state in this region are combined into one partition.
• Integrated propagation model --States of other regions are included as test factors; the effects of this region's transitions on other regions are tested.

The test design procedure describes the steps to develop test designs according to these models, using the UML state machine diagram. In the following pages test designs for the 3 regions illustrate the design procedure, as well as the characteristics of the different models.

The numbers of test cases resulting from the different designs are tabulated below.

Thermostat Example Pairwise Test Designs
Orthogonal
Region
Stand-alone
Transition Model
Integrated
Transition Model
Integrated
Target State Model
Integrated
Propagation Model
tempSet 65 test cases in
7 partitions
105 test cases in
7 partitions
76 test cases in
3 partitions
34 test cases in
3 partitions
tempControl 64 test cases in
16 partitions
120 test cases in
16 partitions
66 test cases in
5 partitions
40 test cases in
5 partitions
fanControl 15 test cases in
8 partitions
96 test cases in
8 partitions
52 test cases in
3 partitions

It is important to note that for each of the 3 regions the same test factor values (i.e. the same blocks) are used for the integrated transition model design as for the integrated target state model design. Thus the differences in numbers of test cases are due to differences between the models, and not different choices of test values.

<Start Command - 2 States Thermostat>

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