0% found this document useful (0 votes)
32 views3 pages

CCC2143 Lab 3

This document provides an overview of state machine diagrams: 1. A state machine diagram models the behavior of a single object and specifies the sequence of states an object transitions through in response to events over its lifetime. 2. Key elements of state machine diagrams are states, transitions between states triggered by inputs or events, and initial and final states. 3. The document includes guidelines for drawing state machine diagrams and examples of diagrams for an OTP authentication process and ATM machine. 4. As an exercise, students are asked to draw a state machine diagram for one of several systems, identifying states, events, and transitions.

Uploaded by

Park Ugyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views3 pages

CCC2143 Lab 3

This document provides an overview of state machine diagrams: 1. A state machine diagram models the behavior of a single object and specifies the sequence of states an object transitions through in response to events over its lifetime. 2. Key elements of state machine diagrams are states, transitions between states triggered by inputs or events, and initial and final states. 3. The document includes guidelines for drawing state machine diagrams and examples of diagrams for an OTP authentication process and ATM machine. 4. As an exercise, students are asked to draw a state machine diagram for one of several systems, identifying states, events, and transitions.

Uploaded by

Park Ugyen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CCC2143

SOFTWARE ENGINEERING
LAB 3 - STATE DIAGRAM

What is a state machine diagram?


In the Unified Modeling Language (UML), a state machine diagram models
the behaviour of a single object, specifying the sequence of events that an
object goes through during its lifetime in response to events. The primary
focus of the state machine diagram is to depict the states of a system. These
states are essential while drawing a state transition diagram.

State Machine Elements:

○ States: States represent the conditions or situations that a system can


be in at any given time. It is denoted by a round-cornered rectangle.
○ Transitions: Transitions represent the changes from one state to another
in response to an input. It are denoted by lines with arrowheads.
○ Inputs: Inputs represent the events or conditions that trigger a transition
from one state to another.
○ Decision box: Outputs represent the actions or results that occur when
a transition is made.
○ Initial State: the system starts before any inputs are received, it is
denoted by a filled black circle.
○ Final State: the system transitions to when it has completed its task. It is
denoted by a circle with a dot inside.

UML State machine diagram is used for:


○ modelling the object states of a system
○ pinpointing the events responsible for state transitions
○ Specifying the context and requirements of a system
○ Modeling the basic flow of events in a use case

1
Figure 1: State Machine Diagram Elements

Guidelines be considered while drawing a state chart diagram:

○ The name of a state transition must be unique.


○ The name of a state must be easily understandable and describe the
behaviour of a state.
○ If there are multiple objects, then only essential objects should be
implemented.
○ Proper names for each transition and event must be given.

Example 1 OTP user authentication process

2
Example 2 ATM Machine

Exercise
1. Choose one of the following system applications:
a. Traffic light control system
b. Food delivery service
c. Online shopping cart
d. Student registration system

2. Draw a state machine diagram. Identify the states, events and


transitions for the chosen system.
3. You should have a minimum of 4 states and one decision box in your
diagram.
4. Label the transitions to indicate the events that change the state of the
system.
5. Save the diagram in Word document/Google Docs format
6. Submit your work at the end of the lab session to Moodle

You might also like