![]() |
Testcover.com |
| ||
|
Tutorial - Start Command Example -
Hierarchical State Machine with 2 States | ||||
|
Home Existing User Login Brochure Sign up for Risk-Free Trial About Testcover.com Frequently Asked Questions Tutorial with Examples ->Finite State Machine --->Start Command: 3 States --->Start Command: 2 States Performance WSDL Interface Background Partners Registrations Contact Information |
Continuing with the Start Command Example, the test designer considers the differences
between the test application and the production application.
Test and production data differ, but generally the database schemas are the same or very similar.
Test and production network parameters differ, but the network services use identical facilities and configurations.
The test designer reasons that the test and production states can be considered equivalent
for the purposes of the start command testing.
If there are 2 states instead of 3,
there will be 2 2 = 4 transitions, i.e. 4 partitions rather than 9.
Fewer test cases may be expected.
Whether this simplification is justified may depend on a good understanding of the system under test,
the scope of the whole test program, risks and consequences of incomplete testing, and other considerations.
The point of this example is not to say whether the 3-state model or the 2-state model is the correct one.
Rather it is to demonstrate both techniques for appropriate use.
The 2-state model is similar to the 3-state model in that it has the same 6 test factors and values (below).
In fact the 2-state model uses the same request
blocks as the 3-state model.
Therefore the same pairs of factor values will be covered in both models.
The 2-state model is different from the 3-state model because the 9 blocks are grouped into 4 partitions rather than 9.
The 2-state model treats test and production as equivalent for transitions involving its idle and active states.
At the same time, the 2-state model retains the factor values and constraints defined by the blocks of the 3-state model.
For test factors 3, 4, 5 and 6, the value no stands for no or not prompted.
The request is composed of four partitions (P1, P2, P3, P4) corresponding to the four state transitions
between the idle and active states.
The request for this test model is shown below.
Partition prefixes (e.g. 2-II, 2-IA, etc.) are used to distinguish the test cases of different partitions.
The relationship between this 2-state model request and the 3-state request is summarized
here.
The four results tables follow.
#1. idle to idle
In each of the four partitions, all allowed pairs of factor values are covered.
The total number of test cases for this model is 35 (compared with 63 for the
3-state model).
As with the 3-state model, these 2-state model test cases can be ordered
to create a path through the test model states.
In a successful test run, each transition would set up the initial conditions for the following test case.
Here, the test cases are sorted by the 3 other state values to create 3 corresponding test runs.
In each run the transitions for this host are ordered
so that the resulting state of each test case sets up the initial state of the next.
Note that the 2-state model test cases are dependent on the test and production substates.
Run 1. Other state idle
Run 2. Other state test
Run 3. Other state production
Summary.
The Start Command Example illustrates pairwise testing using finite state machines.
In the 3-state model each state is considered a different initial condition and/or expected result.
Separate partitions are used to model transitions between states
to insure that all allowed pairs of factor values are tested.
This may lead to pairs being tested multiple times in different transitions.
In the 2-state model two states are considered equivalent,
and each transition to/from either of them is modeled with one partition.
Each allowed pair of values is covered in each partition,
but there is no attempt to associate each pair with both of the equivalent states.
Both test models can accommodate factor values with constraints and which depend on the current state or substate.
The final comparison between the test models examines test cases generated from two request blocks
used in both models.
In the 3-state model the blocks are in separate partitions
representing transitions from idle to test and from idle to production.
In the 2-state model the blocks are in the same partition
representing one transition from idle to active (test or production).
Consider the test cases with a database restoration from the other production dump.
There are 5 such test cases in the 3-state model and 3 test cases in the 2-state model.
The tables below show for each test model the
test cases from idle to test or production with database restoration from the other production dump.
3-state model: P2B1 and P3B1
2-state model: P2B1 and P2B2
3-IT3 and 3-IP4 are the 3-state model test cases for when the other state is idle.
They differ only by whether the test or production application is started.
2-IA8 is the only corresponding 2-state model test case.
It is identical to 3-IT3.
3-IT9 and 3-IP2 are the 3-state model test cases for when the other state is test.
They differ only by whether the test or production application is started.
2-IA5 is the only corresponding 2-state model test case.
It is identical to 3-IP2.
3-IT6 is the 3-state model test case for when the other state is production.
2-IA3 is the corresponding 2-state model test case,
and it is identical.
There are no test cases here for starting the production application on this host
because requirements prohibit that when the other state is production.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||