From UML State Machine to code and back again!
Van Cam Pham, Ansgar Radermacher, Sébastien Gérard · Annals of Computer Science and Information Systems · 2016
UML state machines and their visual representations are much more suitable to describe logical behaviors of system entities than equivalent text based description such as IF-THEN-ELSE or SWITH-CASE constructions.Although many industrial tools and research prototypes can generate executable code from such a graphical language, generated code could be manually modified by programmers.After code modifications, round-trip engineering is needed to make the model and code consistent, which is a critical aspect to meet quality and performance constraints required for software systems.Unfortunately, current UML tools only support structural concepts for roundtrip engineering such as those available from class diagrams.In this paper, we address the round-trip engineering of UML statemachine and its related generated code.We propose an approach consisting of a forward process which generates code by using transformation patterns, and a backward process which is based on code pattern detection to update the original state machine model from the modified code.We implemented a prototype and conducted several experiments on different aspects of the roundtrip engineering to verify the proposed approach.