Towards Understandable Guards of Extracted State Machines from Embedded Software

The extraction of state machines from complex software systems can be very useful to understand the behavior of a software, which is a prerequisite for other software activities, such as maintenance, evolution and reengineering. However, using static analysis to extract state machines from real-world embedded software often leads to models that cannot be understood by humans: The extracted models contain a high number of states and transitions and very complex guards (transition conditions). Integrating user interaction into the extraction process can reduce these state machines to an acceptable size. However, the problem of highly complex guards remains. In this paper, we present a novel approach to reduce the complexity of guards in such state machines to a degree that is understandable for humans. The conditions are reduced by a combination of heuristic logic minimization, masking of infeasible paths, and using transition priorities. The approach is evaluated with software developers on industrial embedded C code. The results show that the approach is highly effective in making the guards understandable. Our controlled experiment shows that guards reduced by our approach and presented with priorities are easier to understand than guards without priorities.

[1]  Rainer Koschke,et al.  Towards Interactive Mining of Understandable State Machine Models from Embedded Software , 2018, MODELSWARD.

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

[3]  Gregor Snelting,et al.  Efficient path conditions in dependence graphs for software safety analysis , 2006, TSEM.

[4]  Amnon Naamad,et al.  The STATEMATE semantics of statecharts , 1996, TSEM.

[5]  J. C. Wortmann,et al.  Development and Evolution of Software Architectures for Product Families , 1998, Lecture Notes in Computer Science.

[6]  Alexander Serebrenik,et al.  Extraction of state machines of legacy C code with Cpp2XMI , 2008 .

[7]  James C. Corbett,et al.  Bandera: extracting finite-state models from Java source code , 2000, ICSE.

[8]  K. Lundqvist,et al.  Investigating the readability of state-based formal requirements specification languages , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[9]  Sofia Cassel,et al.  Graph-Based Algorithms for Boolean Function Manipulation , 2012 .

[10]  Robert E. Tarjan Testing flow graph reducibility , 1973, STOC '73.

[11]  Ashish Kumar SCHAEM: A Method to Extract Statechart Representation of FSMs , 2009, 2009 IEEE International Advance Computing Conference.

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

[13]  David Lorge Parnas,et al.  Software aging , 1994, Proceedings of 16th International Conference on Software Engineering.

[14]  Jiawei Han,et al.  Mining Software Specifications: Methodologies and Applications , 2011 .

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

[16]  Kwang-Ting Cheng,et al.  Automatic Functional Test Generation Using The Extended Finite State Machine Model , 1993, 30th ACM/IEEE Design Automation Conference.

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

[18]  Paolo Tonella,et al.  Reverse Engineering of Object Oriented Code , 2005, Monographs in Computer Science.

[19]  O. Coudert,et al.  Two-level logic minimization , 2001 .

[20]  Jørn Lind-Nielsen,et al.  BuDDy : A binary decision diagram package. , 1999 .

[21]  Mario Piattini,et al.  The impact of structural complexity on the understandability of UML statechart diagrams , 2010, Inf. Sci..

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

[23]  Heung Seok Chae,et al.  Systematic approach for constructing an understandable state machine from a contract-based specification: controlled experiments , 2014, Software & Systems Modeling.

[24]  Brad A. Myers,et al.  An Exploratory Study of How Developers Seek, Relate, and Collect Relevant Information during Software Maintenance Tasks , 2006, IEEE Transactions on Software Engineering.

[25]  R. Rudell,et al.  Multiple-Valued Logic Minimization for PLA Synthesis , 1986 .

[26]  Rainer Koschke,et al.  On State Machine Mining from Embedded Control Software , 2018, 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME).

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

[28]  Michele Lanza,et al.  I know what you did last summer: an investigation of how developers spend their time , 2015, ICPC '15.