Cloning and Expanding Graph Transformation Rules for Refactoring

Refactoring is a software engineering technique that aims at enhancing the structure of object-oriented software while preserving its behavior. Several authors have studied how graph transformation can be used to specify refactoring, because such specifications are more precise and can thus, in principle, easier be verified to preserve a program's behavior. It has turned out that ''standard'' ways of graph transformation do not suffice to define refactoring: their expressive power must be increased if they shall be useful in this application area. Two mechanisms have been proposed so far: one for cloning, and one for expanding nodes by graphs. However, the mechanisms and notations needed are rather complex. In this paper we provide, in the context of double pushout graph transformation, a more elegant and intuitive description. It is based on a notion of rule instantiation, where the instantiation transforms rule schemes into rule instances by cloning and expansion. The power of the technique is demonstrated by an application to two well-known refactoring operations.

[1]  Hartmut Ehrig,et al.  The Category of Typed Graph Grammars and its Adjunctions with Categories , 1994, TAGT.

[2]  Don Roberts,et al.  Practical analysis for refactoring , 1999 .

[3]  Berthold Hoffmann,et al.  Abstraction and Control for Shapely Nested Graph Transformation , 2003, Fundam. Informaticae.

[4]  Tom Mens,et al.  Formalising Behaviour Preserving Program Transformations , 2002, ICGT.

[5]  Hartmut Ehrig,et al.  Handbook of graph grammars and computing by graph transformation: vol. 2: applications, languages, and tools , 1999 .

[6]  Annegret Habel,et al.  Graph Unification and Matching , 1994, TAGT.

[7]  Hans-Jörg Kreowski,et al.  Formal Methods in Software and Systems Modeling, Essays Dedicated to Hartmut Ehrig, on the Occasion of His 60th Birthday , 2005, Formal Methods in Software and Systems Modeling.

[8]  Berthold Hoffmann,et al.  Graph Transformation with Variables , 2005, Formal Methods in Software and Systems Modeling.

[9]  Gabriele Taentzer,et al.  Specifying Integrated Refactoring with Distributed Graph Transformations , 2003, AGTIVE.

[10]  Ralph E. Johnson,et al.  A Refactoring Tool for Smalltalk , 1997, Theory Pract. Object Syst..

[11]  Shane Sendall Combining Generative and Graph Transformation Techniques for Model Transformation : An Effective Alliance ? , 2003 .

[12]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[13]  Detlef Plump,et al.  Towards Graph Programs for Graph Algorithms , 2004, ICGT.

[14]  Berthold Hoffmann,et al.  Context-exploiting shapes for diagram transformation , 2003 .

[15]  Dirk Janssens,et al.  Extending Graph Rewriting for Refactoring , 2004, ICGT.

[16]  Azriel Rosenfeld,et al.  Graph Grammars and Their Application to Computer Science , 1990, Lecture Notes in Computer Science.

[17]  Albert Zündorf,et al.  The PROGRES approach: language and environment , 1999 .

[18]  Hartmut Ehrig,et al.  Introduction to the Algebraic Theory of Graph Grammars (A Survey) , 1978, Graph-Grammars and Their Application to Computer Science and Biology.

[19]  William F. Opdyke,et al.  Refactoring object-oriented frameworks , 1992 .