Chapter 15. State Transition Diagram Exercise

In this chapter, you’ll work through a series of exercises related to state testing. In this first exercise, you’ll create a state transition diagram for the Omninet kiosks, then build test cases to cover that diagram.

Kiosk States

The public Internet access kiosks can be in various states based on receipt of payment and active sessions. As you do the exercise, refer to the Marketing Requirements Document and the System Requirements Document for Omninet.

The exercise is three parts:

  1. Draw a state diagram for the kiosk.

  2. Create a state table to identify additional state/event combinations.

  3. Create test cases based on that diagram.

I suggest 60 minutes as a time limit. When you’re done, keep reading to see my solution.

My Solution and Comments

First, I drew the state transition diagram, as shown in Figure 15-1.[1] Notice that the model views the world from the kiosk’s point of view. The transitions in this diagram are defined in the Marketing Requirements Document and System Requirements Document.

Kiosk state transition diagram

Figure 15-1. Kiosk state transition diagram

In the course of drawing the diagram, I discovered the following issues in the Marketing Requirements Document and the System Requirements Document:

  • What happens if the system encounters a serious problem while running? Should it try to initialize itself? Should the current customer — if any — receive a refund?

  • What ...

Get Pragmatic Software Testing: Becoming an Effective and Efficient Test Professional now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.