A systematic review of code generation proposals from state machine specifications
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)
Statecharts: a visual formulation for complex systems
Science of Computer Programming
(1987)- et al.
Authoring and verification of clinical guidelines: a model driven approach
Journal of Biomedical Informatics
(2010) 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,...
- et al.
An object-oriented approach to UML scenarios engineering and code generation
International Journal of Computer Theory and Engineering (IJCTE)
(2009)
Automatic code generation from UML statechart
International Journal of Computer Theory and Engineering (IJCTE)
Using Java Enums to implement concurrent–hierarchical state machines
Journal of Software Engineering
Development, formal verification, and evaluation of an E-voting system with VVPAT
IEEE Transactions on Information Forensics and Security
Design Patterns: Elements of Reusable Object-Oriented Software
Systematic Reviews in the Social Sciences: A Practical Guide
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 SoftwareSystematic mapping study of template-based code generation
2018, Computer Languages, Systems and StructuresCitation 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.
Automatic Parametric Generation of Simulation Models from Project Information in Digital Twin Construction
2024, Lecture Notes in Civil EngineeringBackGen—Backend Generator
2023, Lecture Notes in Networks and Systems