State transition testing is used where some aspect of the system can be described is called a ‘finite state machine’. The state transition from one to other is based on the state of machine and depending upon the what happened before the output is varies for same inputs. In simple words it means that the system can be in a (finite) number of different states, and transitions from one state to another are determined by the rules of the ‘machine’. A system where we get a different output as an outcome for the same input, depending upon whatever has happened before, is called a finite system. A finite system is often represented as a state diagram. It enables testers to cover the unplanned or invalid states.
A state transition model has four basic parts:
- The states that the software may occupy (open or closed);
- The transitions form one state to another (not all transitions are allowed);
- The events that cause a transition (closing a file);
- The actions that results from a transition (an error message).
For example: In a Word processor, if a document is open, you have an option to close it. If no document is open, then ‘Close’ option is not available. After you choose ‘Close’ once, you cannot choose it again for the same document unless you open that document again. This shows that a document has two states: open and close.
State transition testing test the valid transitions from one state to another and also from one state to another and also the invalid transitions.
Example: A car has 4 states- Stopped, Accelerating, Constant Speed, and Decelerating
0 Comment(s)