Skip to content
Independent guides for QA & test automationRSSEditorial policy
QA Vibes

Practice · Test design

State transition testing questions and answers

Exam-style state transitions questions, generated fresh each time, with answers computed to the ISTQB Foundation Level v4.0 definitions (section 4.2.4). Every wrong answer tells you which mistake leads to it.

No answers yet

State transitions

The life cycle of an online order starts in Placed and has these valid transitions:

  • Placed → Paid on "pay"
  • Paid → Shipped on "ship"
  • Shipped → Delivered on "deliver"
  • Shipped → Lost on "lose"
  • Lost → Refunded on "refund"
  • Delivered → Returned on "return"
  • Returned → Refunded on "refund"
How many coverage items does all transitions coverage identify?

What the syllabus asks for

A state transition diagram shows the states a system can be in and the events that move it between them. The same model as a state table has a row per state and a column per event, and every cell is either a valid transition or an invalid one.

The syllabus names three coverage criteria. All states coverage visits every state. Valid transitions coverage (also called 0-switch coverage) exercises every valid transition. All transitions coverage exercises every valid transition and attempts every invalid one, so its coverage items are all the cells of the state table.

Worked examples

Example 1

The life cycle of a support ticket starts in New and has these valid transitions:

  • New → Open on "assign"
  • Open → Waiting on "ask customer"
  • Waiting → Open on "customer replies"
  • Open → Resolved on "resolve"
  • Resolved → Open on "reopen"
  • Resolved → Closed on "close"
  • New → Closed on "close"

One test starts in New and triggers: "assign", "resolve", "reopen", "ask customer", "customer replies", "resolve". What valid transitions coverage does it achieve?

  • A. 80%
  • B. 17%
  • C. 71%
  • D. 86%
Show the answer

Answer: 71%. The test exercises 5 different valid transitions out of 7: 5 / 7 = 71%.

  • 80%: That is all states coverage: the share of states the test visits, not transitions.
  • 17%: That divides by every cell of the state table. Valid transitions coverage divides by the valid transitions only.
  • 86%: That counts a transition each time it is taken. Coverage counts each transition once, however often it is exercised.

Try this one in the quiz: open example 1.

Example 2

The life cycle of a support ticket starts in New and has these valid transitions:

  • New → Open on "assign"
  • Open → Waiting on "ask customer"
  • Waiting → Open on "customer replies"
  • Open → Resolved on "resolve"
  • Resolved → Open on "reopen"
  • Resolved → Closed on "close"

How many coverage items does valid transitions coverage (0-switch) identify?

  • A. 30
  • B. 24
  • C. 5
  • D. 6
Show the answer

Answer: 6. Each valid transition is a coverage item: there are 6 arrows in the diagram.

  • 30: That is every cell of the state table, the coverage items for all transitions coverage.
  • 24: That is the invalid transitions only. Valid transitions coverage counts the valid ones.
  • 5: That is the number of states, the coverage items for all states coverage.

Try this one in the quiz: open example 2.

Example 3

The life cycle of a document review starts in Draft and has these valid transitions:

  • Draft → In review on "submit"
  • In review → Approved on "approve"
  • In review → Draft on "reject"
  • Approved → Published on "publish"
  • Published → Draft on "withdraw"
  • Draft → Deleted on "delete"
  • Approved → Draft on "reject"

How many coverage items does all transitions coverage identify?

  • A. 23
  • B. 7
  • C. 12
  • D. 30
Show the answer

Answer: 30. The state table has a row for each of the 5 states and a column for each of the 6 events: 5 × 6 = 30 cells. 7 are valid transitions and 23 are invalid, and all transitions coverage exercises or attempts every one.

  • 23: That is the invalid transitions only. All transitions coverage counts the valid ones too.
  • 7: That is the valid transitions only. All transitions coverage also attempts every invalid one: every empty cell of the state table.
  • 12: That adds states and transitions. The coverage items are the cells of the state table: states × events.

Try this one in the quiz: open example 3.

What this is not

These are not questions from any ISTQB exam, and this site has no connection with ISTQB or any exam provider. Older question banks often use definitions from before version 4.0, so if an answer here disagrees with one you’ve seen elsewhere, check which syllabus it was written for. How the questions are made explains how every answer is checked.

To see the technique applied, read the state transition test generator.

Other techniques