Extraction of state machines of legacy C code with Cpp2XMI

Analysis of legacy code is often focussed on extracting either metrics or relations, e.g. call relations or structure relations. For object-oriented programs, e.g. Java or C++ code, such relations are commonly represented as UML diagrams: e.g., such tools as Columbus [1] and Cpp2XMI [2] are capable of extracting from the C++ code UML class, and UML class, sequence and activity diagrams, respectively. New challenges in UML diagram extraction arise when a) additional UML diagrams and b) non-object-oriented programs are considered. In this paper we present an ongoing work on extracting state machines from the legacy C code, motivated by the popularity of state machine models in embedded software [3]. To validate the approach we consider an approximately ten-years old embedded system provided by the industrial partner. The system lacks up-to-date documentation and is reportedly hard to maintain.

[1]  Frank Schiller,et al.  A Concept for a Safe Realization of a State Machine in Embedded Automotive Applications , 2007, SAFECOMP.

[2]  Mohammad Reza Mousavi,et al.  CPP2XMI: Reverse Engineering of UML Class, Sequence, and Activity Diagrams from C++ Source Code , 2006, 2006 13th Working Conference on Reverse Engineering.

[3]  Tibor Gyimóthy,et al.  Columbus - reverse engineering tool and schema for C++ , 2002, International Conference on Software Maintenance, 2002. Proceedings..