EDUCBA

EDUCBA

MENUMENU
  • Explore
    • Lifetime Membership
    • All in One Bundles
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Login
Home Software Development Software Development Tutorials Software Testing Tutorial State Transition Testing

State Transition Testing

Priya Pedamkar
Article byPriya Pedamkar

Updated July 1, 2023

State Transition Testing

What is State Transition Testing?

Software Testing Principles are defined and followed for ensuring the successful Testing process, find and fix the defects, and to not miss any requirements provided by the customer. The seven principles of Software Testing that are essentially to be followed for all the types of software testing encircle ‘Early testing’, ‘Testing shows presence of defects’, ‘Defect clustering’, ‘Pesticide paradox’, ‘Testing is context dependent’, ‘Exhaustive testing is not possible’, ‘Absence of errors fallacy’.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

When to Use State Transition Testing?

  • State Transition testing is used when so ever the tester is testing an application considering the finite set of the input values.
  • It can also be used whenever tester is testing the sequence of events which take place in an application under test, that is, this would make the tester test application behaviour for the sequence of the input values.

Also, it can be used whenever a system that is under test has got the dependency on the events or values in past.

State Transition Diagram

State transition diagram demonstrates the states in the form of texts that are boxed and the transition is demonstrated through the arrows. State transition diagram is also referred to as the State Chart or also Graph. It is as well quite useful in the identification of the valid transitions.

How to Perform State Transition Testing (Include Examples)

Let us discuss how to perform state transition testing with the help of examples.

Example 1:

Let us assume the functionality of the ATM system wherein in case the user enters an invalid password for three consecutive times account will get locked.

However, in the same system in case the user enters a valid password in any of consecutive three attempts the user would get logged in successfully. However, in case the user enters an invalid password for a first or second time the user is asked to re-enter the password. And at last, in case the user enters the incorrect password for the 3rd time his account will get locked.

When so ever user enters right PIN he is logged in with the state that is Access granted and in case the keys in the wrong password he is given the next try and if he repeats his action for the 3rd time the blocked state of account is reached.

State Transition Table

Correct PIN Incorrect PIN
D1) Start D5 D2
D2) 1st try D5 D3
D3) 2nd try D5 D4
D4) 3rd try D5 D6
D5) Access Granted – –
D6) Account blocked – –

As provided in the above table whenever user keys in the right PIN, the state is moved to D5 which is called Access granted state. But in case user keys in the wrong pin he is transitioned to the next state. However, in case he does the same for the 3rd attempt as well, he will be in the state where his account gets blocked.

Example 2:

In the reservation login screen of flights assume that you need to enter the correct agent name as well as password in order to get inside flight reservation application.

It would give us access to the application with the right password and user name, but do you know what would happen in case you entered the wrong password.

This application too permits only three attempts, and in case the users enter the wrong password in the 4th attempt system the application would close automatically.

State Graphs is useful for determination of the valid transitions that needs testing. For this case, testing along with the right pin as well as with a wrong pin is mandatory.

We can also use the State Table for determination of system transitions that are invalid.

state transition testing

For the State Table, each and every valid state are provided on the left-hand side of the table, also events that make them occur are on above.

All of the cells denotes the system of state would eventually move to whenever the corresponding event takes place.

Let us take an example. When you are in the D1 state, then you enter the correct password, then you are moved to D6 state which is Access Granted State. In case we have keyed in the wrong password in the first try then you would be moved to  D3 state or given a 2nd Try.

In a similar manner, we can predict the remaining states.

We have highlighted two of the states that are invalid with the help of this method. Assume that we are in the state S6, meaning, we are logged in into the application already, and afterwards we open the other instance of the reservation of flight, then input either right or wrong passwords for that same agent only. The response of the system for such condition has to get testing done.

Advantages

Few advantages are as given.

  • This black box testing technique provides either pictorial/tabular representation of the system behaviour that will allow a tester to complete as well as understanding the system behaviour in an effective manner.
  • By using this testing, The technique tester is able to verify that all of the conditions are covered by using this particular testing. In addition, the results are as well captured.

Disadvantages

Following are the disadvantages given.

  • The most basic disadvantage of state transition testing technique is we cannot ever depend or rely on this procedure every other time. Let us take an example. In case the system infinite system, that is, it is not in a sequential order then we cannot use this technique.
  • Second disadvantage of state transition testing is that we need to mention every possible state of the system. Although it is correct for all the smaller ones, it, however, comes down to larger ones since there exists exponential progression when it comes to how many states exist.

Recommended Articles

This has been a Guide to State Transition Testing. Here we discuss basic concepts, examples, advantages and disadvantages of State Transition Testing in detail. You may also look at the following article to learn more –

  1. Functional Testing vs Non-Functional Testing
  2. System Integration Testing
  3. Penetration Testing Tools
  4. Penetration Testing Services
ADVERTISEMENT
All in One Excel VBA Bundle
500+ Hours of HD Videos
15 Learning Paths
120+ Courses
Verifiable Certificate of Completion
Lifetime Access
ADVERTISEMENT
Financial Analyst Masters Training Program
2000+ Hours of HD Videos
43 Learning Paths
550+ Courses
Verifiable Certificate of Completion
Lifetime Access
ADVERTISEMENT
All in One Data Science Bundle
2000+ Hour of HD Videos
80 Learning Paths
400+ Courses
Verifiable Certificate of Completion
Lifetime Access
ADVERTISEMENT
All in One Software Development Bundle
5000+ Hours of HD Videos
149 Learning Paths
1050+ Courses
Verifiable Certificate of Completion
Lifetime Access
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

🚀 Extended Cyber Monday Price Drop! All in One Universal Bundle (3700+ Courses) @ 🎁 90% OFF - Ends in ENROLL NOW