Inferring visual contracts from Java programs

Visual contracts model the operation of components or services by pre- and post-conditions formalised as graph transformation rules. They provide a precise intuitive notation to support testing, understanding and analysis of software. Their detailed specification of internal data states and transformations, referred to as deep behavioural modelling, is an error-prone activity. 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, patterns, and invariants. 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]  Atanas Rountev,et al.  Static control-flow analysis for reverse engineering of UML sequence diagrams , 2005, PASTE '05.

[2]  Hartmut Ehrig,et al.  Fundamentals of Algebraic Graph Transformation , 2006, Monographs in Theoretical Computer Science. An EATCS Series.

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

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

[6]  Reiko Heckel,et al.  Compositional Verification of Architectural Refactorings , 2009, WADS.

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

[8]  Leonardo Mariani,et al.  A Technique for Verifying Component-Based Software , 2005, Electron. Notes Theor. Comput. Sci..

[9]  Reiko Heckel,et al.  Extracting Visual Contracts from Java Programs , 2015 .

[10]  Martin Gogolla,et al.  OCL-Based Runtime Monitoring of Applications with Protocol State Machines , 2012, ECMFA.

[11]  Reiko Heckel,et al.  Towards Contract-based Testing of Web Services , 2005, Electron. Notes Theor. Comput. Sci..

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

[13]  Michael D. Ernst,et al.  Finding the needles in the haystack: Generating legal test inputs for object-oriented programs , 2006 .

[14]  Udo Kelter,et al.  A rule-based approach to the semantic lifting of model differences in the context of model versioning , 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011).

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

[16]  Reiko Heckel,et al.  Automatic Inference of Rule-Based Specifications of Complex In-place Model Transformations , 2017, ICMT.

[17]  Philip A. Bernstein,et al.  Reverse engineering models from databases to bootstrap application development , 2010, 2010 IEEE 26th International Conference on Data Engineering (ICDE 2010).

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

[19]  Udo Kelter,et al.  Automatically Deriving the Specification of Model Editing Operations from Meta-Models , 2016, ICMT.

[20]  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.

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

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

[23]  Udo Kelter,et al.  Generating Edit Operations for Profiled UML Models , 2013, ME@MoDELS.

[24]  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.

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

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

[27]  L. Favre,et al.  Recovering Activity Diagrams from Object Oriented Code : an MDA-based Approach , 2011 .

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

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

[30]  Mark Harman,et al.  The Oracle Problem in Software Testing: A Survey , 2015, IEEE Transactions on Software Engineering.

[31]  Timo Kehrer,et al.  Extensible Debugger Framework for Extensible Languages , 2015, Ada-Europe.

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

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

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

[35]  Albert Zündorf,et al.  eDOBS - Graphical Debugging for Eclipse , 2006, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[36]  Gabriele Taentzer,et al.  A tool environment for quality assurance based on the Eclipse Modeling Framework , 2012, Automated Software Engineering.

[37]  Reiko Heckel,et al.  Extracting Visual Contracts from Java Programs (T) , 2015, 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).

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

[39]  Dániel Varró,et al.  Model transformation by example , 2006, MoDELS'06.

[40]  Timo Kehrer,et al.  Henshin: A Usability-Focused Framework for EMF Model Transformation Development , 2017, ICGT.

[41]  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 .

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

[43]  Udo Kelter,et al.  Reasoning about product-line evolution using complex feature model differences , 2016, Automated Software Engineering.

[44]  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 .

[45]  Gordon Fraser,et al.  Do Automatically Generated Unit Tests Find Real Faults? An Empirical Study of Effectiveness and Challenges (T) , 2015, 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).

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

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

[48]  Reiko Heckel,et al.  Visual contract extractor: A tool for reverse engineering visual contracts using dynamic analysis , 2016, 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE).