Transformation- and Pattern-based State Machine Mining from Embedded C Code

Andreas Grosche, Burkhard Igel, Olaf Spinczyk


Automated extraction of state machine models from source code can improve comprehension of software system behavior required for many maintenance tasks and reuse in general. Furthermore, it can be used for subsequent automated processing such as refactoring and model-based verification. This paper presents an approach based on normalizing transformations of an input program and a pattern to find state machine implementations in the program and to extract relevant information. The results are used to create state machine models containing states, transitions, events, guards and actions. Fine-grained traceability between the model and the source code enables navigation and refactoring of model elements. We evaluate the approach by applying a prototypical implementation to industrial automotive embedded code and show that 74 % of the expected state machine implementations can be completely identified and 8 % partially.


Paper Citation