Extending Graph Rewriting for Refactoring

Refactorings are transformations that change the structure of a program, while preserving the behavior. The topic has attracted a lot of attention recently, since it is a promising approach towards the problem of program erosion. Nevertheless a solid theoretical foundation is still lacking. In this paper we focus on improving the expressive power of graph rewriting rules, so that more refactorings can be expressed by single rules. Two new mechanisms are introduced: a notion of refinement of graphs, enabling one to treat specific substructures (e.g. syntax trees of expressions) as a whole, and a notion of duplication, enabling one to use parts of rewriting rules as prototypes that can be instantiated several times. Both mechanisms can be viewed as ways to specify large or infinite sets of rules in a concise way. It is shown that the refactorings PushdownMethod, ExtractMethod and InlineMethod can be expressed using the proposed techniques.

[1]  Alan Bundy,et al.  Constructing Induction Rules for Deductive Synthesis Proofs , 2006, CLASE.

[2]  Dirk Janssens,et al.  ESM Systems and the Composition of Their Computations , 1993, Dagstuhl Seminar on Graph Transformations in Computer Science.

[3]  Berthold Hoffmann,et al.  Hierarchical Graph Transformation , 2000, J. Comput. Syst. Sci..

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

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

[6]  Tom Mens,et al.  Case Study: Simulation of a LAN , 2003, Software Evolution Through Transformations @ ICGT.

[7]  Martin Fowler,et al.  Planning Extreme Programming , 2000 .

[8]  Gregor Engels,et al.  Encapsulated hierarchical graphs, graph types, and meta types , 1995, SEGRAGRA.

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

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

[11]  Dirk Janssens Actor grammars and local actions , 1999 .

[12]  Grzegorz Rozenberg,et al.  Handbook of Graph Grammars and Computing by Graph Transformations, Volume 1: Foundations , 1997 .

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

[14]  Manfred Nagl,et al.  Applications of Graph Transformations with Industrial Relevance , 2004, Lecture Notes in Computer Science.

[15]  Hans-Jörg Kreowski,et al.  Graph Transformation Units with Interleaving Semantics , 1999, Formal Aspects of Computing.

[16]  Tom Mens,et al.  Abstract Semantics for ESM Systems , 1996, Fundam. Informaticae.