Manual Testing · Test Design

State Transition Testing

Some features behave differently depending on what happened before. State transition testing checks those flows.

Beginner 5 min Lesson 11 of 24
Before you start:Decision Table Testing
0/24 in Manual Testing
On this page · 5 min · Beginner

Learning objectives#

  • Draw a state transition diagram
  • Build a state table
  • Test valid and invalid transitions
  • Apply it to workflows

Explanation#

A state is a condition the system is in (Pending, Paid, Shipped). An event triggers a transition to another state.

Test every valid transition, and also invalid ones — the system should refuse them gracefully.

Typical uses: order workflows, account lockouts, approval processes, subscription status.

Code example: Order status workflow#

TextOrder status workflow Illustrative
            pay              ship              deliver
Pending ─────────► Paid ─────────► Shipped ─────────► Delivered
   │ cancel           │ cancel (refund)
   ▼                  ▼
Cancelled ◄───────────┘


Valid transitions to test: Pending→Paid, Paid→Shipped, Shipped→Delivered,
                            Pending→Cancelled, Paid→Cancelled (refund issued)
Invalid transitions to test: Delivered→Cancelled, Cancelled→Shipped, Pending→Shipped
Expected output
Five valid and three invalid transition tests cover the workflow’s rules.

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. Identify states and events from the requirements.
  2. Draw transitions between states.
  3. Test every valid transition.
  4. Attempt invalid ones and expect a clear refusal.

Real-world use case#

An e-commerce admin should never be able to ship a cancelled order — a state transition test proves it.

Common mistakes#

Testing only the main path

Cancellations and invalid moves often have the bugs.

Ignoring side effects

Check refunds, emails and stock updates on each transition.

Best practices#

  • Draw the diagram first
  • Cover every transition at least once
  • Test invalid transitions
  • Verify side effects

Remember this#

State + event → new state.

Valid and invalid transitions.

Check side effects.

Practice exercise#

Your task: An ATM card is blocked after 3 wrong PINs. List the states.

Show solution
Text Illustrative
Start → 1st wrong → 2nd wrong → Blocked; a correct PIN from any non-blocked state → Access granted.

Mini quiz#

State Transition Testing quizMultiple choice Question 1 of 1

Which is an invalid transition in the order workflow above?

Score so far: 0/0

Want more? Practise all Manual Testing MCQs · Manual Testing interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.