EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

State Diagram

Home » Software Development » Software Development Tutorials » Software Engineering Tutorial » State Diagram

State Diagram

Introduction to State Diagram

The state is a mode or condition of being. A state diagram is a dynamic model that shows the state changes that an object goes through during its lifetime in response to events. It is used to help the developer better understand any complex functionality of specialized areas of the system. A state diagram is also called as state chart diagrams, depict the dynamic behavior of the system in response to external and internal events.

How to Design State Diagram?

Given below shows how to design a state diagram:

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

1. Initial State

A filled circle denotes it. It shows the starting point or the first activity of the diagram. This state is also called a pseudo-state, where the state has no variables and no activities.

Symbol:

State Diagram 1

2. Final State

A filled circle with a border denotes it. It shows the end of the state diagram. This is also a pseudo-state because it does not have any variable or action described. A state diagram can have zero or more final state.

Symbol:

Final

3. State

It represents the state of the object at an instant if time. The state is a recognizable situation and exists over an interval of time. A denoted rectangle and compartment denote this to describe state name, variable and activities.

Symbol:

State Diagram 3

4. Transition

Transition is a change from one state to other. An arrow denotes it. The event and action causing the transition are written beside the arrow, separated by a slash. A transition that occurs when the state completed activity is called a trigger less transition. If an event has no occur after the completion of some event or action, that event or action is called the guard condition, i.e. depicted by square brackets around the description id the event or action in the form of a Boolean expression. The transition then takes place after the guard condition occurs.

Symbol:

Transition

5. Event and Action

A trigger that causes a transition to occur and changes the state is called as an event or action. An event that occurs at a particular time has no duration. An event or action is written above the transition that it causes.

Popular Course in this category
Sale
Software Testing Training (9 Courses, 2 Projects)9 Online Courses | 2 Hands-on Projects | 60+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (8,507 ratings)
Course Price

View Course

Related Courses
Cyber Security Training (10 Courses, 3 Projects)All in One Software Development Bundle (600+ Courses, 50+ projects)

6. History State

Flow may require that the object go into a wait state and go back to the state it was in on the occurrence of a certain event. This is shown with the help of the letter H enclosed within a circle.

7. Signal

When an event causes a message or trigger to be sent to a state that causes the transition, then that message sent by the event is called as a signal. This is denoted by the << Signal>> icon above the action or event.

8. Self Transition

A state can have a transition that returns to itself, which is called s self transition. This is most useful when an effect is associated with the transition.

9. Action Inside State

Actions execute a function, assign a value to a data variable or initiate another transaction. Specify these internal actions one per line. These internal actions are processed without causing a state change. It takes the form: action-label or action- expression.

Action- the label can be any of the following:

  • Entry: Executes the associated action-expression upon the state entry. For example, entry / count: = 0; sum: = 0.
  • Exit: It executes the associated action expression upon the state exit. For example, exit/ring bell.
  • Do: It executes the associated action expression upon the state entry and continues until state exit. For example, do/display flashing light.
  • Include: This action expression must name finite automation. The named Automation is a placeholder for a nested state diagram. For example, include / Order processing.

Action-expression- description bod computation.

Uses of State Diagram

  • A state diagram is used to design the dynamic aspect of the system.
  • It defines the state of the components and state changes triggered by an event. Events are internal and external factors influencing the system.
  • During system implementation, it is important to clarify the different states of the object during its lifetime. A state diagram is used for this purpose. When this state and even are triggered, they are used to model it, and these model are used during the system implementation.
  • Mainly used to model the object states of the system.
  • A state diagram is also used to identify events causing the changes in the state.
  • Used to model reactive system.
  • A state diagram is also used for forward and reverse engineering.

Example

Given below is the example of state diagram:

Here we will take an example of ATM and will draw a state diagram.

State Diagram 5

Recommended Articles

This is a guide to State Diagram. Here we discuss the introduction, how to design a state diagram? Uses and example, respectively. You may also have a look at the following articles to learn more –

  1. UML Interaction Diagrams
  2. UML Component Diagram
  3. UML Diagram Softwares
  4. Types of UML Diagrams

All in One Software Development Bundle (600+ Courses, 50+ projects)

600+ Online Courses

50+ projects

3000+ Hours

Verifiable Certificates

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
Software Engineering Tutorial
  • UML Daigram
    • StarUML
    • Architecture of UML
    • StarUML? Download
    • Types of UML Diagrams
    • UML Activity Diagram
    • UML Component?Diagram
    • UML Deployment Diagram
    • UML Diagram Softwares
    • UML Object?Diagram
    • UML Sequence Diagram
    • UML Use Case Diagram
    • State Diagram
    • Class Diagram
    • UML Dependency
    • UML Interaction Diagrams
    • Data Flow Diagrams
  • Basic
    • What is Software Engineering?
    • What is SDET
    • What Is SDLC
    • SDLC Methodologies
    • Software Classification
    • Software Design
    • Software Design Principles
    • Software Metrics
    • Utility Software Types
    • UI Design Tools
    • User Interface Design Principles
    • Architectural Design in Software Engineering
    • Software Configuration Management
    • Software Configuration Management Tools
    • What is Risk Management?
    • System Engineering
    • ES6 Features
    • Object oriented programming paradigm
    • CASE Tools
  • Models
    • Prototype Model
    • What is Spiral Model
    • Waterfall?Model
    • Prototyping Tools
    • Incremental Model
    • Iterative Model
    • RAD Model
    • Fish Model
    • What is Scrum Methodology?
    • RUP? Methodology
    • COCOMO Model
    • Big Bang Model
    • System Models
    • People Capability Maturity Model
    • Analysis Modeling
    • User Interface Design
    • Capability Maturity Model Integration
    • What is Agile Development?
    • Agile Process Model
    • Rational Unified Process
  • Advanced
    • Functional Point Analysis
    • Software Quality Control
    • Quality Assurance Tools
    • Prototype model advantages and disadvantages
    • UML Modelling Tools
    • Tomcat Server
    • Quality Software
    • UI Prototyping
    • Hybrid Model
    • Behavioral Model in Software Engineering
    • Flowchart symbols
    • Critical System
    • Legacy System
    • SOA Architecture
    • Software Quality Attributes
    • Software Maintenance
    • Software Cost Estimation
    • Software Inspection
    • Cohesion in Software Engineering
    • Coupling in Software Engineering
    • Component-based Software Engineering
    • Design Modeling in Software Engineering
    • Iterative Methodology
    • System Flow Diagram
    • Data Flow Architecture
    • SEICMM
    • Function Oriented Design
  • Interview Questions
    • Software Engineering Interview Questions
    • SDLC Interview Questions

Related Courses

Software Testing Course

Cyber Security Training

Software Development Course Training

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • 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

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

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

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

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

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

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

EDUCBA Login

Forgot Password?

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

Let’s Get Started

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

EDUCBA

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

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

Independence Day Offer - Software Testing Course Learn More