State Transition Testing
What is State Transition Testing?
State Transition testing, a black box testing technique, in which outputs are triggered by changes to the input conditions or changes to 'state' of the system. In other words, tests are designed to execute valid and invalid state transitions.
When to use?
When we have sequence of events that occur and associated conditions that apply to those events
When the proper handling of a particular event depends on the events and conditions that have occurred in the past
It is used for real time systems with various states and transitions involved
Deriving Test cases:
Understand the various state and transition and mark each valid and invalid state
Defining a sequence of an event that leads to an allowed test ending state
Each one of those visited state and traversed transition should be noted down
Steps 2 and 3 should be repeated until all states have been visited and all transitions traversed
For test cases to have a good coverage, actual input values and the actual output values have to be generated
Allows testers to familiarise with the software design and enables them to design tests effectively.
It also enables testers to cover the unplanned or invalid states.
A System's transition is represented as shown in the below diagram:
The tests are derived from the above state and transition and below are the possible scenarios that need to be tested.
|Tests||Test 1||Test 2||Test 3|
|Input||Switch ON||Switch Off||Switch off|
|Output||Light ON||Light Off||Fault|