Painting Flowers: Reasons for Using Single-State State Machines in Model-Driven Engineering
MSR - Technical Paper
Models, as the main artifact in model-driven engineering, have been extensively used for goals such as code generation and verification in the area of embedded systems modeling. One of the most popular behavioral modeling techniques is state machine. Many state machine modeling guidelines recommend that a state machine should have more than one state in order to be meaningful. However, single-state state machines (SSSMs) violating this recommendation have been used in modeling cases reported in the literature. In this paper, we investigate the use of SSSMs by studying their prevalence and roles in the domain of embedded systems, as well as why developers use them and what advantages and disadvantages developers perceive. We employ the sequential explanatory strategy to study 1500 state machines from 26 components at a large company producing embedded systems. We observe that 25 out of 26 components contain SSSMs, making up 25.3% of the model base. To understand the reasons for this extensive usage we conduct a series of interviews followed by a grounded theory building. The results suggest that SSSMs are used to interface with the existing code base, to deal with tool limitations, to facilitate maintenance and to ease verification. Based on our results, we provide implications to modeling tool builders. Furthermore, we formulate two hypotheses about the effectiveness of SSSMs as well as the impacts of SSSMs on development, maintenance and verification.