Abstract

Statecharts, introduced by David Harel in 1987, is a formalism used to specify the behaviour of timed, autonomous, and reactive systems using a discrete-event abstraction. It extends Timed Finite State Automata with depth, orthogonality, broadcast communication, and history. Its visual representation is based on higraphs, which combine graphs and Euler diagrams. Many tools offer visual editing, simulation, and code synthesis support for the Statechart formalism. Examples include STATEMATE, Rhapsody, Yakindu, and Stateflow, each implementing different variants of Harel’s original semantics. This tutorial introduces modelling, simulation, and testing with Statecharts. As a running example, the behaviour of a digital watch, a simple yet sufficiently complex timed, autonomous, and reactive system is modelled. We start from the basic concepts of states and transitions and explain the more advanced concepts of Statecharts by extending the example incrementally. We discuss several semantic variants, such as STATEMATE and Rhapsody. We use Yakindu to model the example system.

Highlights

  • Complex systems exhibit some for of reactivity to the environment: the system reacts to stimuli coming from the environment by changing its internal state and can influence the environment through output events

  • Throughout the sections of this chapter, we introduce the constructs of the Statechart formalism by incrementally building the model of the behaviour of an example system

  • The example system we use in this chapter to demonstrate the capabilities of the Statechart formalism is a digital watch

Read more

Summary

Introduction

The systems that we analyse, design, and build today are characterised by an ever-increasing complexity. Multiple concurrently running software components are interpreting signals coming from the environment (the driver’s controls as well as sensors interpreting current driving conditions) and making (autonomous) decisions that generate signals to the car’s actuators. Such timed, reactive, autonomous behaviour needs to be specified in an appropriate language, in order to validate the behaviour with respect to its specification (using verification and validation techniques, such as formal verification, model checking, as well as testing techniques), and to deploy the software onto the system’s hardware components. Throughout the sections of this chapter, we introduce the constructs of the Statechart formalism by incrementally building the model of the behaviour of an example system.

Background
Running Example
Discrete-Event Abstraction
Process
Modelling with Statecharts
States and Transitions
Composite States
Orthogonal Regions
History
Syntactic Sugar
Full Statechart Model
Detailed Semantics
Testing Statecharts
Deploying Statecharts
Advanced Topics
Semantic Variations
Execution Platforms
Dynamic Structure
Summary
Literature and Further Reading
6.10 Self Assessment
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call