ASTQB State Transition Question
Question 28 of the ASTQB Foundation 2018 Sample Exam 1 reads:
You have been given the following requirement: A user must log in to the system with a valid username and password. If they fail to enter the correct combination three times, they will receive an error and will have to wait 10 minutes before trying again. The test terminates when the user successfully logs in. How many test cases are needed to provide 100% state transition coverage?
According to the answer table, the correct answer is B:
I'm wondering if someone could clarify for me why my thinking is wrong and why the answer of 2 is correct.
Demir last edited by
The key is in the phrase "state transition coverage" - the question is asking for the smallest number of tests that can cover each transition between states at least once.
Essentially the states you are transitioning between are:
- Login page (not logged in)
- Home page (logged in)
- Wait (too many invalid login attempts)
Since you will always start from the Login page, the Wait state is temporary, and you are testing invalid logins, your scenarios can only be:
- Start at the login page, make no more than 2 invalid attempts, then make a valid login attempt and end at the home page.
- Start at the login page, make 3 invalid attempts, wait, then make a valid login attempt and end at the home page.
Obviously you can have many more test cases, but this is the minimum to cover all the state transitions at least once.