Live modeling in the context of state machine models and code generation

  • PDF / 1,570,852 Bytes
  • 25 Pages / 595.276 x 790.866 pts Page_size
  • 94 Downloads / 165 Views

DOWNLOAD

REPORT


REGULAR PAPER

Live modeling in the context of state machine models and code generation Mojtaba Bagherzadeh1 · Karim Jahed1 · Benoit Combemale1 · Juergen Dingel1 Received: 8 September 2019 / Revised: 23 July 2020 / Accepted: 9 September 2020 © Springer-Verlag GmbH Germany, part of Springer Nature 2020

Abstract Live modeling has been recognized as an important technique to edit behavioral models while being executed and helps in better understanding the impact of a design choice. In the context of model-driven development, models can be executed by interpretation or by the translation of models into existing programming languages, often by code generation. This work is concerned with the support of live modeling in the context of state machine models when they are executed by code generation. To this end, we propose an approach that is completely independent of any live programming support offered by the target language. This independence is achieved with the help of a model transformation which equips the model with support for features which are required for live modeling. A subsequent code generation then produces a self-reflective program that allows changes to the model elements at runtime (through synchronization of design and runtime models). We have applied the approach in the context of UML-RT and created a prototype (Live-UMLRT) that provides a full set of services for live modeling of UML-RT state machines such as re-execution, adding/removing states and transitions, and adding/removing action code. We have evaluated the prototype on several use cases. The evaluation shows that (1) generation of a self-reflective and model instrumentation can be carried out with reasonable performance, and (2) our approach can apply model changes to the running execution faster than the standard approach that depends on the live programming support of the target language. Keywords Model execution · Live modeling · Model-level debugging · MDD · UML-RT

1 Introduction Model-driven development (MDD) is a model-centric software development approach in which models serve as the primary software development artifacts, rather than source code [19]. Thanks to existing MDD tools (e.g., [44,50]), many facilities are available to simplify software development using models specifically in the domain of real-time embedded systems (RTE). One of the main facilities is the Communicated by Nelly Bencomo.

B

Mojtaba Bagherzadeh [email protected] Karim Jahed [email protected] Benoit Combemale [email protected] Juergen Dingel [email protected]

1

School of Computing, Queen’s University, Kingston, ON, Canada

execution of models, which is supported either by interpretation or by the translation into existing programming languages, often by code generation (translational execution) [18]. Live programming [15,55] aims to free developers from the “edit–compile–run” cycle and allows them to change programs at runtime and get immediate feedback on the change. Often, a form of live programming is supported by several existing pro