QuestionQ61

VerifiedTest Analysis and Test Design

Consider the following state diagram for a simple ATM.

Question Image

The decision has been made to add the following capabilities:

  1. Allow the customer to move from Get Balance to Deposit, Withdrawal, or Menu.
  2. Allow the customer to move from Deposit to Withdrawal, Get Balance, or Menu.
  3. From Withdrawal, the customer will still be able to go only to Menu.

How many test cases are required to achieve 100% 0-switch coverage of both the new and existing capabilities?

Explanation

0-switch coverage means testing every single transition (state-to-state edge) in the state model exactly once. The base diagram contains 9 transitions: the Login self-loop on invalid credentials, Login-to-Menu on valid login, Menu-to-Withdraw and Withdraw-to-Menu, Menu-to-Deposit and Deposit-to-Menu, Menu-to-Logout, and Menu-to-GetBalance and GetBalance-to-Menu. The new requirements add four transitions that did not previously exist: Get Balance to Deposit, Get Balance to Withdrawal, Deposit to Withdrawal, and Deposit to Get Balance (the Menu-return paths from both states already existed). Adding these 4 new transitions to the original 9 gives a total of 13 distinct transitions, requiring 13 test cases to achieve full 0-switch (single transition) coverage.

Community Discussion

No comments yet. Be the first to start the discussion!