Reading Contents

Go to top

State transition

The paper

Pay attention to the state changes of the object under test, whether there are unreachable and illegal states in the requirements specification, and whether there are illegal state transitions

State, that is, the response form maintained by the object under test under certain input conditions

 

process

(1) State nodes are defined according to requirements

(2) Draw the state migration diagram

(3) Draw the state transfer tree

(4) Extract test cases

 

case

Airline ticketing system

(1) The customer calls the airline to book the ticket, and the ticket information is in the “booked” state;

(2) After the customer pays the ticket fee, the ticket information becomes “paid” state;

(3) After arriving at the airport on the day of the trip and getting the ticket, the ticket information changes to “issued” state;

(4) After check-in, the ticket information changes to “used” state;

(5) You can cancel your booking information at any time before boarding the plane. If you have paid for the ticket, you can get a refund. After the cancellation, your booking information will be in the “cancelled” state.

 

State nodes and state migration diagrams

 

State transition tree

 

Extract test cases

Extract a test case from the start node to the leaf node

Scheduled -> Cancelled

Scheduled -> Paid -> Cancelled

Reserved -> Paid -> tickets issued -> Cancelled

Reserved -> Paid -> Ticketed -> Used