Clone detection in MATLAB Stateflow models

Abstract MATLAB Simulink is one of the leading tools for model-based software development in the automotive industry. One extension to Simulink is Stateflow, which allows the user to embed Statecharts as components in a Simulink model. These state machines contain nested states, an action language that describes events, guards, conditions, actions, and complex transitions. As Stateflow has become increasingly important in Simulink models for the automotive sector, we extend previous work on clone detection of Simulink models to Stateflow components. While Stateflow models are stored in the same file as the Simulink models that host them, the representations differ. Our approach incorporates a pretransformation that converts the Stateflow models into a form that allows us to use the SIMONE model clone detector to identify candidates and cluster them into classes. In addition, we push the results of the Stateflow clone detection back into the Simulink models, improving the accuracy of the clones found in the host Simulink models. We validated our approach on the MATLAB Simulink/Stateflow demo set. Our approach showed promising results on the identification of Stateflow clones in isolation, as well as integrated components of the Simulink models that are hosting them.

[1]  Jian Chen,et al.  Clone Detection in Matlab Stateflow Models , 2014 .

[2]  Chanchal K. Roy,et al.  A Survey on Software Clone Detection Research , 2007 .

[3]  James R. Cordy,et al.  Grammatical Inference in Software Engineering: An Overview of the State of the Art , 2012, SLE.

[4]  James R. Cordy,et al.  Submodel pattern extraction for simulink models , 2013, SPLC '13.

[5]  Jian Chen,et al.  Clone Detection in Matlab Stateflow Models , 2014, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[6]  James R. Cordy,et al.  The TXL source transformation language , 2006, Sci. Comput. Program..

[7]  Bernhard Schätz,et al.  Clone detection in automotive model-based development , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[8]  James R. Cordy,et al.  Models are code too: Near-miss clone detection for Simulink models , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

[9]  Harald Störrle VMQL: A generic visual model query language , 2009, 2009 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[10]  Harald Störrle Towards clone detection in UML domain models , 2010, ECSA '10.

[11]  David B. Skillicorn,et al.  Contextualized semantic analysis of web services , 2011, 2011 13th IEEE International Symposium on Web Systems Evolution (WSE).

[12]  Elmar Jürgens,et al.  Index-based model clone detection , 2011, IWSC '11.

[13]  David Harel,et al.  Statecharts: A Visual Formalism for Complex Systems , 1987, Sci. Comput. Program..

[14]  Elmar Jürgens,et al.  CloneDetective - A workbench for clone detection research , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[15]  James R. Cordy,et al.  An approach to clone detection in behavioural models , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[16]  Rainer Koschke,et al.  Survey of Research on Software Clones , 2006, Duplication, Redundancy, and Similarity in Software.

[17]  Chanchal Kumar Roy,et al.  Comparison and evaluation of code clone detection techniques and tools: A qualitative approach , 2009, Sci. Comput. Program..

[18]  Daniel S. Hirschberg,et al.  Algorithms for the Longest Common Subsequence Problem , 1977, JACM.

[19]  James R. Cordy,et al.  Towards qualitative comparison of Simulink model clone detection approaches , 2012, 2012 6th International Workshop on Software Clones (IWSC).

[20]  Hoan Anh Nguyen,et al.  Complete and accurate clone detection in graph-based models , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[21]  Bernhard Schätz,et al.  Model clone detection in practice , 2010, IWSC '10.

[22]  Chanchal Kumar Roy,et al.  The NiCad Clone Detector , 2011, 2011 IEEE 19th International Conference on Program Comprehension.

[23]  Douglas H. Martin,et al.  Towards Web Services Tagging by Similarity Detection , 2010, The Smart Internet.

[24]  Tilman Seifert,et al.  Tool Support for Continuous Quality Assessment , 2005, 13th IEEE International Workshop on Software Technology and Engineering Practice (STEP'05).

[25]  James R. Cordy,et al.  Near-miss model clone detection for Simulink models , 2012, 2012 6th International Workshop on Software Clones (IWSC).

[26]  Douglas H. Martin,et al.  Analyzing web service similarity using contextual clones , 2011, IWSC '11.

[27]  Zhiyi Ma,et al.  Detecting Duplications in Sequence Diagrams Based on Suffix Trees , 2006, 2006 13th Asia Pacific Software Engineering Conference (APSEC'06).

[28]  Bernhard Schätz,et al.  Semantic clone detection for model-based development of embedded systems , 2011, MODELS'11.