Extracting Visual Contracts from Java Programs

Visual contracts model the operations of components or services by preand post-conditions formalised as graph transformation rules. They provide a precise intuitive notation to support testing, understanding and analysis of software. However, due to their detailed specification of data states and transformations, modelling real applications is an error-prone process. In this paper we propose a dynamic approach to reverse engineering visual contracts from Java based on tracing the execution of Java operations. The resulting contracts give an accurate description of the observed object transformations, their effects and preconditions in terms of object structures, parameter and attribute values, and their generalised specification by universally quantified (multi) objects. While this paper focusses on the fundamental technique rather than a particular application, we explore potential uses in our evaluation, including in program understanding, review of test reports and debugging.

[1]  Reiko Heckel,et al.  Testing against Visual Contracts: Model-Based Coverage , 2012, ICGT.

[2]  Reiko Heckel,et al.  Electronic Communications of the EASST Volume 58 ( 2013 ) Proceedings of the 12 th International Workshop on Graph Transformation and Visual Modeling Techniques ( GTVMT 2013 ) Learning Minimal and Maximal Rules from Observations of Graph Transformations , 2013 .

[3]  Reiko Heckel,et al.  Verification of Architectural Refactorings: Rule Extraction and Tool Support , 2008, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[4]  Paolo Tonella,et al.  Reverse engineering of the interaction diagrams from C++ code , 2003, International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings..

[5]  Mario Vento,et al.  Thirty Years Of Graph Matching In Pattern Recognition , 2004, Int. J. Pattern Recognit. Artif. Intell..

[6]  Qingshan Jiang,et al.  Notice of Retraction A New Approach of Graph Isomorphism Detection Based on Decision Tree , 2010 .

[7]  Horst Bunke,et al.  Efficient subgraph matching using topological node feature constraints , 2015, Pattern Recognit..

[8]  Reiko Heckel,et al.  International Journal of Web Services Research , Vol . 2 , No . 2 , 2005 1 Model-based development of Web service descriptions enabling a precise matching concept , 2005 .

[9]  Gerti Kappel,et al.  Model-to-Model Transformations By Demonstration , 2010, ICMT@TOOLS.

[10]  Salvatore Tabbone,et al.  Attributed Graph Matching Using Local Descriptions , 2009, ACIVS.

[11]  Dániel Varró,et al.  Model transformation by example using inductive logic programming , 2008, Software & Systems Modeling.

[12]  Houari A. Sahraoui,et al.  Generating model transformation rules from examples using an evolutionary algorithm , 2012, 2012 Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering.

[13]  H. J. Sander Bruggink,et al.  Towards Process Mining with Graph Transformation Systems , 2014, ICGT.

[14]  Atanas Rountev,et al.  Static control-flow analysis for reverse engineering of UML sequence diagrams , 2005, PASTE '05.

[15]  Martin Gogolla,et al.  Proceedings of the Third international conference on Theory and practice of model transformations , 2010 .

[16]  Hartmut Ehrig,et al.  Fundamentals of Algebraic Graph Transformation (Monographs in Theoretical Computer Science. An EATCS Series) , 1992 .

[17]  Jun Kong,et al.  Program Behavior Discovery and Verification: A Graph Grammar Approach , 2010, IEEE Transactions on Software Engineering.

[18]  Ricardo Terra,et al.  On-the-fly extraction of hierarchical object graphs , 2012, Journal of the Brazilian Computer Society.

[19]  Tewfik Ziadi,et al.  A Fully Dynamic Approach to the Reverse Engineering of UML Sequence Diagrams , 2011, 2011 16th IEEE International Conference on Engineering of Complex Computer Systems.

[20]  Clémentine Nebut,et al.  Easing Model Transformation Learning with Automatically Aligned Examples , 2011, ECMFA.

[21]  Stephen McCamant,et al.  The Daikon system for dynamic detection of likely invariants , 2007, Sci. Comput. Program..

[22]  Reiko Heckel,et al.  Towards Dynamic Reverse Engineering Visual Contracts from Java , 2014 .

[23]  Tom Mens,et al.  A Taxonomy of Model Transformation , 2006, GRaMoT@GPCE.

[24]  Gerti Kappel,et al.  Model Transformation By-Example: A Survey of the First Wave , 2012, Conceptual Modelling and Its Theoretical Foundations.

[25]  Lawrence B. Holder,et al.  Learning patterns in the dynamics of biological networks , 2009, KDD.

[26]  Klaus-Dieter Schewe,et al.  Conceptual Modelling and Its Theoretical Foundations , 2012, Lecture Notes in Computer Science.

[28]  Gabriele Taentzer,et al.  Henshin: advanced concepts and tools for in-place EMF model transformations , 2010, MODELS'10.

[29]  Reiko Heckel,et al.  Test Case Generation Using Visual Contracts , 2013, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[30]  Reiko Heckel,et al.  Model-Driven Monitoring: An Application of Graph Transformation for Design by Contract , 2006, ICGT.