Definition

State transition testing

What is state transition testing?

State transition testing checks how a system responds to an event from a particular starting state. Each case names the starting state, the event, any condition that permits it and the expected outcome. It also checks what happens when the event is refused.

Why does the starting state matter?

The same action can mean different things over a record’s lifetime. Seeing a record in every possible state still leaves questions about the routes between them. For a refused action, check the stored state and any visible side effects as well as the message shown to the user.

Worked example

Cancelling a collection request

A customer may cancel a parcel collection while it is booked. Once the parcel has been collected, the same request should leave it marked collected and preserve its tracking history. These cases use one action and two starting states with different expected outcomes.

Try it on your pull request

Choose a change in your repository and tell Cue April what should happen. Review the proposed checks before they run.

Try Cue April on your repository