State transition testing derives test cases from valid transitions between the states of a modeled system. Where test cases have specified termination conditions, transition sequences must be divided into separate executable paths that respect those conditions.
The ATM diagram contains nine valid transitions. Assuming test cases can establish the Menu state as a starting precondition, the following five test cases achieve complete valid transition coverage.
Test case
Transition sequence
TC1
Login → Login (invalid credentials) → Menu (valid credentials)
TC2
Menu → Withdraw → Menu
TC3
Menu → Deposit → Menu
TC4
Menu → Get Balance → Menu
TC5
Menu → Logout
TC1 covers both unsuccessful and successful authentication transitions. TC2, TC3 and TC4 exercise the three available transaction paths and their corresponding return transitions. TC5 covers termination of the authenticated session.
The total number of transitions covered is: 2 + 2 + 2 + 2 + 1 = 9.
All nine valid transitions are therefore exercised.
Because the test must stop upon reaching Menu or Logout, the three transaction paths and logout path require separate test cases. The authentication path requires another test.
Consequently, five test cases are sufficient and minimal under the stated termination rule and starting-state assumption.
[Reference: CTAL-TA v4.0, Section 3.2.2 — State Transition Testing, page 33., Technical clarification: If every test were required to start at Login and terminate immediately upon reaching Menu, the transaction states would be unreachable within those tests. Option A requires Menu to be permitted as an initial test precondition.]