CS FundamentalsVery hardProduct-company placement · ISTQB-style

An ATM state machine: inserting a card leads to '1st try'. A correct PIN in any try state leads to 'Access'; a wrong PIN moves 1st → 2nd → 3rd try, and a wrong PIN in the 3rd try leads to 'Locked'. Each test starts with card insertion and ends in Access or Locked. What is the minimum number of tests that covers every valid transition (0-switch coverage)?

  1. A. 3
  2. B. 7
  3. C. 6
  4. D. 4

Correct answer: D. 4

There are 7 transitions, but three of them go to Access (from each try) and one to Locked, and every test ends after reaching one of these. So at least 4 tests are needed, and these 4 suffice: right first time; wrong then right; wrong twice then right; wrong three times.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic