A statechart diagram shows a state machine, focusing on the flow of control from state to state. A state machine is a behavior that specifies the sequences of states an object goes through during its lifetime in response to events, together with its responses to those events.
Contents
Common Properties
A statechart diagram is a special kind of diagram and shares the same common properties as do all other diagrams like a name and graphical contents that are a projection into a model. What distinguishes a state chart diagram from other diagrams is its content.
Content
Statechart diagrams commonly contain:
- Simple states and composite states
- Transitions including events and actions
Common Uses
When we model the dynamic aspects of a system, a class or a use case, we will use statechart diagrams in one way:
- To model reactive (event-driven) objects.
Common Modeling Techniques
Modeling Reactive Objects
To model a reactive object:
- Choose the context for the state machine, whether it is a class, a use case or the system as a whole.
- Choose the initial and final states for the object.
- Decide on the stable states of the object. Start with the high-level states of the object and only then consider its possible substates.
- Decide on the meaningful partial ordering of stable states over the lifetime of the object.
- Decide on the events that may trigger a transition from state to state.
- Attach actions to these transitions and/or to these states.
- Consider ways to simplify your machine by using substates, branches, forks, joins and history states.
- Check that all states are reachable under some combination of events.
- Check that no state is a dead end.
- Trace through the state machine, either manually or by using tools, to check it against expected sequences of events and their responses.
Consider the following example:
Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.
He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.
He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.
Leave a Reply