Arunkumar Khannur's Software Testing Knowledge Center

10.10. An Example on Creating State Graph and Designing Test Cases

State Graph describes the behaviour of a class over time through illustrations of the states and transitions of a single object progressing through its lifetime. State Graph, in object-oriented systems, is a notational representation of behaviour and also, response of an object to events, including internal and external stimuli. We consider an example of an ATM of the bank to demonstrate the steps on creating corresponding State Graph and then using that State Graph to design test cases.

ATM problem statement: “User inserts the ATM card and ATM reads it. If card is correct the system shall allow the user to Balance Enquiry or Print Mini Statement or Withdraw Amount provided sufficient balance is available. In each of these possible actions, there can be displaying or printing messages.” As a first step, we analyze the problem statement and try to understanding the system. When required we discuss with relevant stake holders to get clarifications on any points that may not be clear. By proceeding like this we develop an understanding of the problem. Following are the understanding of the problem after first round of analysis by involving stake holders:

As a second step, after analysis of the problem and developing an understanding, we Identify states, inputs and guards. Following that we create a state model of the application. For the given example, following is the State Graph

At the end, we have to generate sequences of test actions.

From this Table, we generate test scenarios as follows:
Khannur's Book
Arunkumar Khannur, Software Testing - Techniques and Applications, Published by Pearson Publications, 2011 (ISBN:978-81-317-5836-6; Pages:341 + xxii)
Follow Khannur
Khannur's Company
ISQT Process & Consulting Services Pvt. Ltd., Bangalore, INDIA
Khannur's Software Testing Forum
 Contact Khannur
ISQT Process & Consulting Services Pvt. Ltd.
#732, 1st Floor, 12th Main,
3rd Block, Rajajinagar,
Bangalore - 560010, INDIA
Phone: +91 80 23012511
Skype: arun.isqt