Question 1
Given the following state model of sales order software:
PLACED -> IN PRODUCTION
IN PRODUCTION -> CANCELLED
IN PRODUCTION -> SHIPPED
SHIPPED -> INVOICED
INVOICED -> CANCELLED
CANCELLED -> PLACED
Which of the following sequences of transitions provides the highest level of transition coverage for the model (assuming you can start in any state)?
State transition testing is a black-box testing technique where test cases are designed to cover states and transitions of a state machine.
Given the state model with the following transitions:
PLACED -> IN PRODUCTION
IN PRODUCTION -> CANCELLED
IN PRODUCTION -> SHIPPED
SHIPPED -> INVOICED
INVOICED -> CANCELLED
CANCELLED -> PLACED
To cover all transitions at least once, we need to create a sequence that covers all six transitions.
Option A: IN PRODUCTION -> CANCELLED -> PLACED -> IN PRODUCTION -> CANCELLED -> PLACED - Misses SHIPPED -> INVOICED and INVOICED -> CANCELLED transitions.
Option B: IN PRODUCTION -> SHIPPED -> INVOICED -> CANCELLED -> PLACED -> IN PRODUCTION - Covers all transitions.
Option D: PLACED -> CANCELLED -> PLACED -> CANCELLED -> PLACED -> IN PRODUCTION -> CANCELLED - Misses SHIPPED -> INVOICED and INVOICED -> CANCELLED transitions.
Given these, Option B covers all the transitions6source9source.