A systematic review of code generation proposals from state machine specifications

https://doi.org/10.1016/j.infsof.2012.04.008Get rights and content

Abstract

Context

Model Driven Development (MDD) encourages the use of models for developing complex software systems. Following a MDD approach, modelling languages are used to diagrammatically model the structure and behaviour of object-oriented software, among which state-based languages (including UML state machines, finite state machines and Harel statecharts) constitute the most widely used to specify the dynamic behaviour of a system. However, generating code from state machine models as part of the final system constitutes one of the most challenging tasks due to its dynamic nature and because many state machine concepts are not supported by the object-oriented programming languages. Therefore, it is not surprising that such code generation has received great attention over the years.

Objective

The overall objective of this paper is to plot the landscape of published proposals in the field of object oriented code generation from state machine specifications, restricting the search neither to a specific context nor to a particular programming language.

Method

We perform a systematic, accurate literature review of published studies focusing on the object oriented implementation of state machine specifications.

Results

The systematic review is based on a comprehensive set of 53 resources in all, which we have classified into two groups: pattern-based and not pattern-based. For each proposal, we have analysed both the state machine specification elements they support and the means the authors propose for their implementation. Additionally, the review investigates which proposals take into account desirable features to be considered in software development such as maintenance or reusability.

Conclusions

One of the conclusions drawn from the review is that most of the analysed works are based on a software design pattern. Another key finding is that many papers neither support several of the main components of the expressive richness of state machine specifications nor provide an implementation strategy that considers relevant qualitative aspects in software development.

Introduction

Model Driven Development (MDD) [1], [2] encourages the use of models in the software development process with the aim of generating the application source code through automatic model transformations. Following this approach, modelling languages are used during the design and analysis processes for diagrammatically model the artifacts that specify the structure and behaviour of systems. In particular, whereas class diagrams are the mainstay of object-oriented analysis and design for representing the static structure of a system, state machine specifications (including UML state machines [3], finite state machines [4] and Harel statecharts [5]) are considered the most widely used method to specify the dynamic behaviour of reactive systems.

The models describing the different aspects of a system are taken as a starting point to finally develop the software system. At this point, it is well known that the software industry does not always provide satisfactory solutions to fill the gap between high-level modeling languages and programming languages. In particular, generating code from state machine diagrams constitutes one of the most challenging tasks due to their dynamic nature and because many of the state machine specification concepts are not directly supported by the object-oriented programming languages [6], [7], [8], [9], [10], [11] (such as events [8], states [8], [7], history pseudostates [8], or fork pseudostates [7]).

Therefore, it is not surprising that there are a wide number of proposals in the literature devoted to studying the implementation of state machine specifications in different programming languages in a wide variety of application contexts such as distributed control systems [12], decentralization of production control systems [13], [14], e-voting systems [15], [16], [17], or even NASA space missions [18], [19], [20]. This number could grow in the foreseeable future because, if the Model-Driven Development (MDD) approach [1], [2] overcomes its challenges [21], it will likely be increasingly applied to the development of software systems.

Taking this into account, the purpose of this paper is to review the research done in the field of object oriented code generation from state machine specifications, and provide an exhaustive analysis and comparison of these proposals.

Keeping this objective in mind, the scope of this review is limited to the literature that (i) provides proposals for generating code structures from state machine specifications, (ii) discusses the implementation possibilities of state machine specifications, and/or (iii) tackles the implementation of dynamic behaviour in general. Furthermore, in this review we take into account proposals applied generaly without specifying a certain domain for application as well as those presented for use in specific contexts. Our target readership is mainly researchers and software developers who need a satisfactory solution for implementation of the behavioural models representing the dynamics of the system they are considering. Since the needs can be extremely varied, we show all the proposals we have found trying to bring out the strengths and weaknesses of each one, thereby facilitating the selection of the most suitable solution.

In this paper we address the following research questions:

  • RQ1

    What techniques or implementation methods have been used for generating object oriented code from state machine specifications (including UML state machines, finite state machines and Harel statecharts)?

  • RQ2

    What state machine specification elements are translated into code by each technique or implementation method?

  • RQ3

    What are the desired software development features considered by the published proposals? This question can also lead to another question: What approaches provide a software tool that implements the proposed methodology/technique?

The review of the research work in the field has been performed systematically carrying out a three-based dimension comparison that in turn provides an answer to each of the given research questions. On one hand, and taking into account question RQ1, we have analysed the general characteristics of each proposal in terms of the implementation technique it proposes. In particular, given the fact that most of the proposals are based on a pattern design [22] for implementing state machine specifications, we have classified these papers depending on whether they are based on a specific pattern or not. This first dimension of comparison corresponds to what we have called pattern-based comparison. On the other hand, considering question RQ2, we have analysed which state machine elements are considered by each proposal, distinguishing between core elements (such as state, transition, hierarchy, and concurrency) [5] and secondary elements (such as history, choice, or activity). We will refer to this dimension of comparison as element-based comparison. In addition, based on question RQ3, we have determined a taxonomy of features expected to be considered in software development such as maintenance, reusability, or memory needs. Based on such a taxonomy, we have carried out what we have called a feature-based comparison, which has allowed us to analyse and compare such varied proposals from a different perspective.

One of the main conclusions drawn from this review is that there are many papers that neither support several of the main components of the expressive richness of state machine specifications, such as hierarchy and concurrency [5], nor provide an implementation strategy that takes into account relevant qualitative aspects in software development such as maintenance, modularity, or reusability. Another conclusion is that UML state machines are the most common form of state machine specification used in code generation studies.

The paper is structured as follows: the next section describes the method of our systematic review, which includes inclusion and exclusion criteria, data sources and search strategy, paper selection, quality assessment and data extraction. Results are presented in Section 3. Section 4 discusses the results obtained from the review, limitations of the study and threats to validity. Finally, Section 5 covers some conclusions.

Section snippets

Research method

The method we have followed to review the research work done in the field of code generation from state machine specifications is a systematic review [23], [24]. Generally speaking, a systematic review is a process by means of which all available research concerning a research subject of interest is assessed and interpreted. Such a review is undertaken through an accurate and reliable methodology stated in a review protocol. This protocol mainly specifies the research questions to be addressed,

Results

This section describes the analysis of the data extracted from the selected papers. First, we present in Section 3.1 the main characteristics of the 53 studies in the review and then, in Sections 3.2 Pattern-based comparison (RQ1), 3.3 Element-based comparison, 3.4 Feature-based comparison, we synthesize the data from all the papers to answer each question as described in Section 2.6. A complete explanation of certain proposals presented herein regarding the three comparison aspects is

Discussion

In this section we address three main issues. First, we summarize the principal findings of the systematic review, highlight the strengths and weaknesses of the evidence gathered, and discuss the relevance and contribution of the different techniques and implementation methods of state machine specifications into code published in the literature. Second, we discuss the study limitations. Finally, we analyse the threats to validity arising from the procedures we followed to perform the

Conclusions

In this paper we provide a systematic literature review of peer-reviewed published studies that focus on the code generation from state machine specifications. For this task, the review presented herein has been conducted using an accurate and reliable process that has allowed us to identify, analyse, and compare a comprehensive set of 53 relevant proposals published within the research topic.

The systematic review has addressed the following main research questions: (RQ1) What techniques or

Acknowledgments

This work has been partially supported by the Spanish Ministry of Science and Innovation (projects TIN2009-13584 and SMOTY (IPT-2011-1328-390000)) and the Centre for Industrial Technological Development (CDTI) (project THOFU (CEN20101019)).

References (83)

  • D. Harel

    Statecharts: a visual formulation for complex systems

    Science of Computer Programming

    (1987)
  • B. Pérez et al.

    Authoring and verification of clinical guidelines: a model driven approach

    Journal of Biomedical Informatics

    (2010)
  • B. Selic

    The pragmatics of model-driven development

    IEEE Software

    (2003)
  • OMG Model Driven Architecture, Committed Companies & Their Products, 2010....
  • OMG, UML 2.3 Superstructure Specification, Document Formal/2010-05-05, 2010. <http://www.omg.org/> (last visited May...
  • J.V. Gurp, J. Bosch, On the implementation of finite state machines, in: Proceedings of the 3rd Annual IASTED...
  • I.A. Niaz, J. Tanaka, Code generation from UML statecharts, in: Proc. 7th IASTED Conf. on Software Engineering and...
  • I.A. Niaz, J. Tanaka, Mapping UML statecharts to java code, in: Proceedings of the IASTED Conf. on Software...
  • I. Azim, Automatic Code Generation From UML Class and Statechart Diagrams, PhD Dissertation, University of Tsukuba,...
  • A. Jakimi et al.

    An object-oriented approach to UML scenarios engineering and code generation

    International Journal of Computer Theory and Engineering (IJCTE)

    (2009)
  • A. Jakimi et al.

    Automatic code generation from UML statechart

    International Journal of Computer Theory and Engineering (IJCTE)

    (2009)
  • J. Ali

    Using Java Enums to implement concurrent–hierarchical state machines

    Journal of Software Engineering

    (2010)
  • T. Tomura, S. Kanai, K. Uehiro, S. Yamamoto, Object-oriented design pattern approach for modeling and simulating open...
  • H.J. Köhler, U.A. Nickel, J. Niere, A. Zündorf, Using UML as a Visual Programming Language, Tech. Rep. tr-ri-99-205,...
  • H.J. Köhler, U. Nickel, J. Niere, A. Zündorf, Integrating UML diagrams for production control systems, in: Proc. of the...
  • R. Tiella, A. Villafiorita, S. Tomasi, Speciffication of the control logic of an eVoting system in UML: the ProVotE...
  • R. Tiella, A. Villafiorita, S. Tomasi, FSMC+, a tool for the generation of Java code from statecharts, in: Principles...
  • A. Villafiorita et al.

    Development, formal verification, and evaluation of an E-voting system with VVPAT

    IEEE Transactions on Information Forensics and Security

    (2009)
  • E. Benowitz, K. Clark, G. Watney, Auto-coding UML statecharts for flight software, in: Proceedings of the Second IEEE...
  • K.P. Kiri L. Wagstaff, L. Scharenbroich, From Protocol Specification to Statechart to Implementation, JPL Technical...
  • K.L. Wagstaff, E. Benowitz, D.J. Byrne, K. Peters, G. Watney, Automatic code generation for instrument flight software,...
  • S. Teppola, P. Parviainen, J. Takalo, Challenges in deployment of model driven development, in: The Fourth...
  • E. Gamma et al.

    Design Patterns: Elements of Reusable Object-Oriented Software

    (1995)
  • B. Kitchenham, Procedures for Performing Systematic Reviews, Technical Report tr/se-0401, Keele University, 2004....
  • B. Kitchenham, S. Charters, Guidelines for Performing Systematic Literature Reviews in Software Engineering, Version 2...
  • M. Petticrew et al.

    Systematic Reviews in the Social Sciences: A Practical Guide

    (2005)
  • Gentleware, Poseidon for UML Case Tool, 2012. <http://www.gentleware.com/> (last visited May...
  • Rhapsody, 2012. <http://www.ibm.com/developerworks/rational/products/rhapsody/> (last visited May...
  • Borland Together 2008 Edition for Eclipse, 2012. <http://www.borland.com/us/products/together/> (last visited May...
  • Executable UML, UniMod, UniMod Project, 2008. <http://unimod.sourceforge.net/> (last visited May...
  • IBM, IBM Rational Rose, 2012. <http://www-01.ibm.com/software/awdtools/developer/rose/> (last visited May...
  • Tigris.org, Open Source Software Engineering Tools, ArgoUML Modeling Tool, 2012. <http://argouml.tigris.org> (last...
  • T. Allegrini, Code Generation Starting from Statecharts Specified in UML, argoUML White Paper, 2002....
  • I. Niaz, Automatic Code Generation From UML Class and Statechart Diagrams, PhD Dissertation, University of Tsukuba,...
  • K.O. Chow, W. Jia, V.P. Chan, J. Cao, Model-based generation of Java code, in: Proc. International Conf. On Parallel...
  • B. Pérez, Towards Decision Facts Management Systems: The Particular Case of Clinical Guidelines, PhD Thesis, University...
  • P. Adamczyk, The anthology of the finite state machine design patterns, in: Proceedings of the 10th Conference on...
  • P. Adamczyk, Selected patterns for implementing finite state machines, in: Proceedings of the 11th Conference on...
  • J. Ali, Implementing statecharts using Java enums, in: Proceedings of the 2nd International Conference on Education...
  • D. Babitsky, Hierarchical state machine design in C++, C/C++ Users Journal. <http://drdobbs.com/cpp/184402040> (last...
  • F. Chauvel et al.

    Code generation from UML models with semantic variation points

  • Cited by (43)

    • Early analysis of requirements using NLP and Petri-nets

      2024, Journal of Systems and Software
    • Systematic mapping study of template-based code generation

      2018, Computer Languages, Systems and Structures
      Citation Excerpt :

      Unlike Mehmood et al. [21], they did not follow a systematic and repeatable process. Dominguez et al. [23] performed a systematic literature review of studies that focus on code generation from state machine specifications. The study is based on a set of 53 papers, which have been classified into two groups: pattern-based and not pattern-based.

    • BackGen—Backend Generator

      2023, Lecture Notes in Networks and Systems
    View all citing articles on Scopus
    View full text