Towards Interactive Mining of Understandable State Machine Models from Embedded Software

State machines are an established formalism for specifying the behavior of a software component. Unfortunately, such design models often do not exist at all, especially for legacy code, or they are lost or not kept up to date during software evolution – although they would be very helpful for program comprehension. Therefore, it is desirable to extract state machine models from code and also from legacy models. The few existing approaches for that – when applied to real-world systems written in C – deliver models that are too complex for being comprehensible to humans. This is mainly because C functions are typically much longer than object oriented methods, for which these approaches were originally intended. In this paper, we propose and investigate different measures to reduce the complexity of such mined models to an understandable degree. Since the code alone does not contain all required information for abstraction, user interaction is essential. Also, different users will be interested in different aspects of the code. Therefore, we introduce several possibilities for influencing the state machine extraction process, such as providing additional constraints for reducing the state space. We show the effectiveness of these interactions in several case studies. The combination of these interactions gives the user a rich set of possibilities for exploring the functionality of the software.

[1]  Jochen Quante,et al.  Experience Report: White Box Test Case Generation for Automotive Embedded Software , 2016, 2016 IEEE Ninth International Conference on Software Testing, Verification and Validation Workshops (ICSTW).

[2]  Manfred Broy,et al.  What is the Benefit of a Model-Based Design of Embedded Software Systems in the Car Industry? , 2012 .

[3]  Rainer Koschke,et al.  Static object trace extraction for programs with pointers , 2005, J. Syst. Softw..

[4]  Matthew B. Dwyer,et al.  Bandera: extracting finite-state models from Java source code , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[5]  James R. Larus,et al.  Mining specifications , 2002, POPL '02.

[6]  Moria Abadi,et al.  Automatic recovery of statecharts from procedural code , 2012, 2012 Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering.

[7]  Rainer Koschke,et al.  How do professional developers comprehend software? , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[8]  Koushik Sen DART: Directed Automated Random Testing , 2009, Haifa Verification Conference.

[9]  Stéphane S. Somé,et al.  Enhancing program comprehension with recovered state models , 2002, Proceedings 10th International Workshop on Program Comprehension.

[10]  James C. King,et al.  Symbolic execution and program testing , 1976, CACM.

[11]  Tao Xie,et al.  Automatic extraction of abstract-object-state machines from unit-test executions , 2006, ICSE.

[12]  Neil Walkinshaw,et al.  Automated discovery of state transitions and their functions in source code , 2008 .

[13]  Rajib Mall,et al.  Extracting finite state representation of Java programs , 2014, Software & Systems Modeling.

[14]  David Chenho Kung,et al.  On object state testing , 1994, Proceedings Eighteenth Annual International Computer Software and Applications Conference (COMPSAC 94).

[15]  Mario Piattini,et al.  Empirical Validation of Metrics for UML Statechart Diagrams , 2003, ICEIS.

[16]  Brian A. Nejmeh,et al.  NPATH: a measure of execution path complexity and its applications , 1988, CACM.

[17]  Mathew Hall,et al.  Inferring Computational State Machine Models from Program Executions , 2016, 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[18]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[19]  Insup Lee,et al.  High-Level Model Extraction via Symbolic Execution , 2012 .

[20]  Noah Pywes,et al.  Recovery of software design, state-machines and specifications from source code , 1996, Proceedings of ICECCS '96: 2nd IEEE International Conference on Engineering of Complex Computer Systems (held jointly with 6th CSESAW and 4th IEEE RTAW).

[21]  Jochen Quante,et al.  A Program Interpreter Framework for Arbitrary Abstractions , 2016, 2016 IEEE 16th International Working Conference on Source Code Analysis and Manipulation (SCAM).