Testcover.com Testcover.com
Tutorial - UML State Machines

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
--->Test Models, 1 Region
--->Thermostat Example
--->Test Models, 3 Regions
--->Design Procedure
->Definitions of Terms
Performance
WSDL Interface
Background
Partners
Registrations
Contact Information





The next examples illustrate pairwise testing using Unified Modeling Language (UML) state machine diagrams. UML is a standard software engineering modeling language created and managed by the Object Management Group. 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 purpose of these test models is to include the program variables as well as the diagrammed states, so that the pairwise test design can address the extended state systematically. Test factors include program variables, the current system state(s) and an event triggering a transition whose action causes the expected results. Each test case is set up with the system in the specified state(s) and with the program variables set to their indicated values. The transition event is applied and the results observed.

The shopping cart from the earlier example is described here in terms of a UML state machine with one region. Two pairwise test models are used to design tests of the shopping cart's operation:

• Transition model -- Each state transition in the region has one partition.
• Target state model -- The transitions to each target state in the region are combined into one partition.

Shopping cart test designs in the following pages illustrate the design procedure and the characteristics of these models.

The thermostat example compares test designs for a state machine with multiple regions. The thermostat (simplified for this example) has three 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 operation 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. (This is the same as the transition model for one region above.)
• 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.

Thermostat test designs in the following pages illustrate the design procedure and the characteristics of these models.

<Sequence Unit Replay Shopping Cart Example (revisited)>

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