Integrating Interobject Scenarios with Intraobject Statecharts for Developing Reactive Systems

David Harel, Rami Marelly, Assaf Marron, Smadar Szekely

TL;DR

This paper introduces a novel development environment that bridges the gap between high-level requirements and detailed implementation by integrating scenario-based programming (Live Sequence Charts) with object-oriented Statecharts. By allowing these two paradigms to co-execute, developers can incrementally transition from "what" a system should do to "how" it does it, maintaining a working, testable model throughout the entire lifecycle.

What Problem Does This Paper Address?

In software engineering, there is a persistent "conceptual gap" between the requirements layer (how stakeholders describe behavior) and the implementation layer (how code is actually structured).

Requirements are often inter-object: they describe "stories" or scenarios that involve multiple components working together (e.g., "When the user presses 'Ctrl+Alt+Del', the task manager appears"). Conversely, implementation is typically intra-object: it focuses on the internal logic of a single component and how it reacts to various stimuli.

Translating between these two views is error-prone and often results in a "waterfall" where requirements are discarded once coding begins. The authors aim to create a unified environment where both views can coexist, allowing for a "smooth back-and-forth transition" during development.

Methods

The authors integrated two powerful visual formalisms and their respective tools:

  • Live Sequence Charts (LSC) via the PlayGo tool: Used for scenario-based programming. LSCs are "executable requirements" that describe allowed, desired, and forbidden sequences of events across multiple objects.
  • Statecharts via the Yakindu tool: Used for intra-object behavior. Statecharts extend traditional state machines with hierarchy and concurrency, making them ideal for specifying the final reactive logic of individual components.

Key Technical Innovations: * Shared Object Model: Both LSCs and Statecharts operate on the exact same set of objects and events, ensuring semantic consistency. * Execution Bridge: A specialized component that coordinates events between the two engines. * Priority Rules: To allow for refinement, events triggered by Statecharts (the implementation) are given priority over LSC events (the specification). * Violation Reporting: If a Statechart implementation performs an action forbidden by an LSC requirement, the system reports a violation rather than blocking the action, allowing the "real" code to run while flagging bugs.

Datasets

Not discussed in the paper. As a methodology and tooling paper, it evaluates its approach using illustrative case studies rather than large-scale datasets. The primary examples used are a Switch-Light system and a classic Railcar system benchmark.

Key Insights and Ideas

  • The Duality of Views: The paper highlights that inter-object scenarios and intra-object state machines are duals. Scenarios provide the "full story" but hide individual object reactivity; state machines provide "full reactivity" but hide the overall system story.
  • Incremental Implementation: Developers don't have to switch from "requirements mode" to "coding mode" all at once. They can implement one component as a Statechart while leaving the rest of its environment as LSC scenarios.
  • Requirements as Prototypes: Because LSCs are executable (via a process called "play-out"), the requirements themselves constitute a functional simulator from day one.
  • Living Specifications: LSCs can be retained even after full implementation to serve as run-time monitors, ensuring the final system behavior remains consistent with original requirements.

Key Results

  • Successful Tool Integration: The authors successfully linked PlayGo and Yakindu, creating a synchronized environment where clocks and object models are shared.
  • Demonstrated Workflow: Through the Railcar case study, they showed how a complex system can be built by starting with abstract LSCs and gradually replacing them with detailed Statecharts.
  • Executable Refinement: The system remains executable at every stage of the "refinement trip," allowing for continuous testing and validation against stakeholders' original visions.

Limitations and Future Work

  • Mapping Complexity: Currently, mapping between parameterized LSC events and Statechart events can be cumbersome; the authors seek a more straightforward approach.
  • Semantic Variations: Future versions should allow users to choose different event selection and execution-order policies via plug-ins.
  • Procedural Integration: The authors plan to enable integration with components written in standard procedural languages like Java or C++.
  • Advanced SBP Features: Integrating "smart play-out" (using look-ahead algorithms to avoid deadlocks in scenarios) into the joint environment remains a goal.

Summary updated

BibTeX
@article{harel2021integrating,
  author = {David Harel and Rami Marelly and Assaf Marron and Smadar Szekely},
  title = {{Integrating Interobject Scenarios with Intraobject Statecharts for Developing Reactive Systems}},
  journal = {IEEE Des. Test},
  year = {2021},
  doi = {10.1109/mdat.2020.3006805},
}
Figure