State Transition
Testing Tool
Map the states and events in a system, then get a diagram, a state table and the tests to cover every transition, valid and invalid.
Picture logging in to your bank. You type the wrong password and get an error. You try again and get another. On the third attempt your account locks, and now even the right password won't let you in. Typing a password is the same action every time, but the result depends on what's already happened.
That's what state transition testing covers. Software often behaves differently depending on the state it's in, and defects tend to hide in the moves between states, or in moves that shouldn't be possible at all. This tool turns a list of transitions into a diagram, a state table and a full set of tests.
Go to the state transition testing tool ↓
What Is State Transition Testing?
State transition testing checks how software moves from one state to another when something happens. It's a black box technique, so it works from how the system should behave, not from the code. It suits anything with a sequence or a status, such as logins, orders, bookings, payments, media players and devices.
States, Events And Transitions
A state is a situation the system can be in, such as Logged out, Locked or Logged in. An event is something that happens, such as entering the wrong password. A transition is the move from one state to another when an event happens. Some transitions also trigger an action, such as showing a message or sending an email.
In the login example, entering the wrong password on the second failed attempt is a transition from 2 failed attempts to Locked. Its action is showing an account locked message.
Valid And Invalid Transitions
Valid transitions are the moves the system should make. Invalid transitions are events that shouldn't change anything in a particular state. Entering the correct password while the account is locked is a good example. The account should stay locked, and if the system lets the person in, that's a serious defect.
Testers often focus on the valid paths and miss the invalid ones, yet some of the most damaging defects sit there. This tool lists both.
Who Is It For?
- Students and anyone new to software testing can see how a system's behaviour turns into a diagram, a table and a clear set of tests.
- Working testers get tests for every valid and invalid transition, with the steps to reach each starting state, ready to download as a CSV file.
- Developers and business analysts can spot missing transitions and states that can't be reached before any code is written.
How To Use The State Transition Testing Tool
- Choose one of the examples, or start from scratch.
- Add each transition on its own row: the state it starts from, the event, the state it moves to and any action.
- Choose the start state, which is the state the system is in when it first starts.
- Tick "Include invalid transitions" to add a test for every event that shouldn't change the state.
- Check the diagram and the state table, and look at anything listed under "Worth checking".
- Use the test list on the page, or download it as a CSV file.
Build Your State Transition Tests
List the transitions, then get the diagram, the state table and every test.
The highlighted state is the start. Dashed states can't be reached from the start.
Each cell shows the state the event moves to. A dash (–) marks an invalid transition, where that event shouldn't change the state.
Things to know
- Every test starts from the start state. The "Get to the starting state" column lists the events to send first, using the shortest route.
- Invalid transitions are expected to be rejected or ignored, leaving the state unchanged. Check the requirements for exactly what should happen, such as which error message appears.
- These tests check each transition once on its own. Defects that only appear after a particular sequence, such as two failed logins followed by a password reset, need longer tests.
Understanding The Results
The diagram shows each state as a box and each transition as an arrow, labelled with the event. The state table shows the same information as a grid, with a state on each row and an event in each column. A dash (–) marks an invalid transition, where that event shouldn't change the state.
In the test list, get to the starting state shows the shortest sequence of events from the start state to the state the test needs. The expected result shows where the system should end up and any action it should take. Worth checking lists states that can't be reached and events that lead to two different states, which are both signs of a gap in the requirements.
Key Points
- State transition testing checks how software moves between states when events happen.
- A state table shows every combination of state and event, including the invalid ones.
- Valid transition tests check each move the system should make at least once.
- Invalid transition tests check that an event doesn't change the state when it shouldn't.
- States that can't be reached, or events with two possible outcomes, usually point to gaps in the requirements.
Frequently Asked Questions
It's another name for testing every valid transition at least once, which is what the valid tests in this tool do. 1-switch coverage tests every pair of transitions in a row, such as a failed login followed by a successful one. It catches more defects but needs many more tests.
Because the system should stay where it is, and sometimes it doesn't. A locked account that accepts the right password, or a delivered order that can still be cancelled, are both defects that only invalid transition tests would catch.
Either a transition is missing from the list, or the requirements describe a state the system never actually gets into. Both are worth raising before testing starts.
A decision table looks at combinations of conditions at one moment. State transition testing looks at what happens over time, where the order of events matters. Many systems need both, such as a login that checks several conditions and also locks after repeated failures.
No. The states and events come from the requirements, or from how the system behaves when you use it.
