This technique should be used when you have any workflow in place, and should consider positive test cases (transitions that can happen), as well as negative test cases (transitions that are not allowed).
Any rule that can be described, thinked, scratched as a state transition diagram, workflow, lifecycle can have their test cases designed using this technique.
This technique can be also works to find completeness problems inside worflows and diagrams during documentation analysis.
HOT TIP
If a state transition like rule is provided as a series of statements instead of a table or graphic diagram, you can proceed as following:
This is a way common situation we face on daily basis, and this practice can be handful to gain confidence on what is being developed and how it should be tested
The rule
An order lifecycle at any e-commerce follows roughly the workflow:
How to apply the technique
From the diagram we see that it has the following allowed (positive) transitions:
And all the other unmentioned transitions should be treated as invalid (negative) transtitions
From New to Shipped (negative)
From New to Delivered (negative)
From Approved to New (negative)
From Approved to Delivered (negative)
From Shipped to New (negative)
From Shipped to Approved (negative)
From Shipped to Cancelled (negative)
From Delivered to New (negative)
From Delivered to Approved (negative)
From Delivered to Shipped (negative)
From Delivered to Cancelled (negative)
From Cancelled to New (negative)
From Cancelled to Approved (negative)
From Cancelled to Shipped (negative)
From Cancelled to Delivered (negative)
The rule
A ticket system have their valid transitions documented in the following table, where O represents allowed and X represents not allowed.
From \ To | Reported | Open | In Progress | In Review | Delivered | Rejected | Reopen |
---|---|---|---|---|---|---|---|
Reported | - | O | X | X | X | O | X |
Open | X | - | O | X | X | O | X |
In Progress | X | X | - | O | X | O | X |
In Review | X | O | O | - | O | O | X |
Delivered | X | X | X | X | - | X | O |
Rejected | X | X | X | X | X | - | X |
Reopen | X | X | O | X | X | X | - |
How to apply technique
There is no much secret applying this technique to design test cases.
For this case we have 7 states (n = 7). So we will have 42 test cases, as follows: