# State Transition Test Design Technique

Using state transition testing, we pick test cases from an application where we need to test different system transitions. We can apply this when an application gives a different output for the same input, depending on what has happened in the earlier state.

Some examples are Vending Machine, Traffic Lights.

Vending machine dispenses products when the proper combination of coins is deposited.

Traffic Lights will change sequence when cars are moving / waiting

#### Example on State Transition Test Case Design Technique:

Take an example of login page of an application which locks the user name after three wrong attempts of password.

A finite state system is often shown as a state diagram

![](/files/-Lj0Oe3zVu-Nkp6Xs18A)

It works like a truth table. First determine the states, input data and output data.

![](/files/-Lj0OkYFF1iGg6l2eZU3)

Entering correct password in the first attempt or second attempt or third attempt, user will be redirected to the home page (i.e., State – S4).

Entering incorrect correct password in the first attempt, a message will be displayed as try again and user will be redirected to state S2 for the second attempt.

Entering incorrect correct password in the second attempt, a message will be displayed as try again and user will be redirected to state S3 for the third attempt.

Entering incorrect correct password in the third attempt, user will be redirected to state S5 and a message will be displayed as “Account locked. Consult Administrator”.

Likewise, let’s see another example.

Withdrawal of money from ATM. ‘User A’ wants to withdraw 30,000 from ATM. Imagine he could take 10,000 per transaction and total balance available in the account is 25,000. In the first two attempts, he could withdraw money. Whereas in the third attempt, ATM shows a message as “Insufficient balance, contact Bank”. Same Action but due to change in the state, he couldn’t withdraw the money in the third transaction.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://testplace.gitbook.io/tutorials/manual-testing/manual-testing-tutorial/state-transition-test-design-technique.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
