State Transition Path Generator
Describe your states and the transitions between them, and this walks random valid paths through the machine. Useful for finding the sequences nobody thought to test — the ones that go back and forth before reaching the end.
What this generator does
Explores sequences rather than combinations. The test matrix generator answers which configurations to test; this answers which *journeys* to test, which is a different question — a bug that only appears when a document goes draft, review, draft, review, published will never show up in a matrix of settings.
How to use this tool
- List your states, one per line, as `from -> to, to`.
- A line with no arrow is a terminal state.
- Set how many steps a walk may take.
- Press Generate a path, and again for a different one.
Understanding the controls
- States and transitions
- One line per state, as `from -> to, to`. The first state named is the start. A line with no arrow declares a terminal state, which is what lets a walk finish rather than running to the step limit.
- Maximum steps
- A safety limit. A machine with a cycle in it can walk forever, so the walk stops here and says so rather than looping.
- Seed
- Reproduces the same path, so a walk that found something interesting can be turned into a regression test that always follows it.
Worked examples
- A publishing workflow
- draft → review → draft → review → published → archived
- A machine with a cycle
- Walks stop at the step limit rather than looping, and the result says which happened.
- An unreachable state
- Listed under "never reached" — walk a few times, and a state that never appears is worth investigating.
Common use cases
- Finding untested paths through an order or approval workflow
- Generating test scenarios for a document or content lifecycle
- Checking a state machine has no unreachable states
- Producing example sequences for documentation
- Exploring what a user could actually do before you write the tests
How this generator works
From the current state, one of its declared transitions is chosen at random and followed; the walk continues until it reaches a state with no exits or hits the step limit. Any state named only as a target is treated as terminal, so you do not have to declare an end state explicitly. The states never visited on a given walk are listed afterwards, which is the quickest way to notice one that is unreachable altogether.
Randomness and fairness
Each step is a uniform choice among the transitions available from the current state, drawn from the browser's cryptographic randomness. A seed switches to a generator that is deterministic, not cryptographic, so a path can be reproduced exactly — which is what turns an interesting walk into a repeatable test.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Transitions are unweighted, so every option from a state is equally likely. Real systems are not like that, and a rare-but-important transition will need many walks to appear.
- There are no guards or conditions. A transition that can only happen when a value is set cannot be expressed, so some generated paths may be impossible in practice.
- Random walking is not exhaustive. It finds paths, but it cannot prove a state is unreachable — only that these particular walks did not reach it.
- The notation is deliberately simple and does not cover hierarchical or parallel states.
Common mistakes
- Forgetting to declare a terminal state
- Without one, every walk runs to the step limit. Add a line naming the end state with no arrow — the tool warns when none exists.
- Assuming one walk covers the machine
- A single path visits a handful of states. Walk repeatedly and watch the never-reached list shrink.
Practical tips
- Walk ten times and note which states never appear — that is usually where the missing transition or the dead state is.
- Seed any path that finds a bug, and paste the seed into the regression test so it always follows the same route.
Privacy and your data
The machine you describe is processed in your browser and never uploaded — worth knowing, since an internal workflow is often the sort of thing an organisation would rather not paste into a remote service. Nothing is stored between visits or written into the page address. Analytics records the step count only.
Frequently asked questions
- How do I write the machine?
- One state per line, as `from -> to, to`. The first state named is the start, and a line with no arrow is terminal.
- Why does my walk never finish?
- Because no state is terminal, so it runs to the step limit. Add a state with no outgoing transitions.
- Can it prove a state is unreachable?
- No. Random walking finds paths but cannot prove their absence — treat a never-reached state as a prompt to check, not a proof.
Related generators
- Retry Backoff Schedule GeneratorWork out what a retry policy actually does — every delay, the running total, and where a cap or jitter changes it.
- Pagination Test Case GeneratorWork out every page boundary for a list, and the specific totals where pagination bugs actually live.
- Test Matrix GeneratorTurn parameters and their values into a test matrix — full factorial, a random sample, or all-pairs coverage in a fraction of the cases.