QuestionQ73

VerifiedTest Analysis and Test Design

Examine the following state transition diagram for a simple ATM system.

Question Image

Assuming that a test case stops as soon as it reaches the Menu state or the Logout state, how many test cases are needed to achieve full coverage of this state transition diagram?

Explanation

Using the standard transition-tree approach for state-based testing, you build paths from the initial Login state and terminate each path the first time it revisits a state already seen in that path (i.e., returns to Menu) or reaches a terminal state (Logout). This yields five distinct paths: (1) invalid login looping back to Login then a valid login to Menu, (2) login to Menu, select Withdraw, then return to Menu, (3) login to Menu, select Deposit, then return to Menu, (4) login to Menu, select Balance, then return to Menu, and (5) login to Menu, then select Logout. Together these five test cases exercise every transition in the diagram exactly once (or more), so five test cases are the minimum required for full transition coverage under the stated stopping rule.

Community Discussion

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