State Transition Diagram with example in software engineering

What is State transition Diagram?

When we write our program in Object-oriented programming, then we need to make classes and objects. Objects change its states during different functions/actions performed on objects.

In state transition diagram we represent that what actions are leads to change the state of the object.

[quads id=1]


state transition diagram symbols

Figure: state transition diagram symbols

Example of State Transition Diagram:

Case Study: You need to develop a web-based application in such a way that user can search other users, and after getting search complete, the user can send the friend request to other users. If the request is accepted, then both users are added to the friend list of each other. If one user does not accept the friend request. The second user can send another friend request. The user can also block each other.


  1. First of all, identify the object that you will create during the development of classes in oop
  2. Identity the actions or events
  3. Identify the possible states for object
  4. Draw the diagram.

Object: friends 

Events or actions: Search to add a friend, add a friend, accept a friend, reject a friend, again add, block user and close.

States: Start, the friend added, friend rejected, user blocked and end.

state transition diagram in UML

Figure: state transition diagram

[quads id=2]
Fazal Rehman Shamil Click Here to Know More
Instructor, Researcher, Blogger, SEO Expert, Poet and Publisher of International Journal Of Software, Technology & Science ISSN : 2616 - 5325
Dear Professors and Resarchers!You are welome to Cite these tutorials in your research or slides etc. Please don't forget to mention the reference of website. Copy Paste of text is strcitly forbidden. Images can be reuse because images are protected with watermark.

Leave a Reply

Your email address will not be published. Required fields are marked *