Abstract
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.
Work partially supported through FWO – project “A Formal Foundation for Software Refactoring” and EU-TMR network SegraVis through Universiteit Antwerpen.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Fowler, M.: Refactoring - Improving the Design of Existing Code. Addison-Wesley, Reading (1999)
Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois, Urbana-Champaign, IL, USA (1992)
Roberts, D.: Practical Analysis for Refactoring. PhD thesis, University of Illinois at Urbana-Champaign (1999)
Roberts, D., Brant, J., Johnson, R.: A refactoring tool for Smalltalk. Theory and Practice of Object Systems 3, 253–263 (1997)
Beck, K., Fowler, M.: Planning extreme programming. Addison-Wesley, Reading (2001)
Mens, T., Demeyer, S., Janssens, D.: Formalising behaviour preserving program transformations. In: Corradini, A., Ehrig, H., Kreowski, H.-J., Rozenberg, G. (eds.) ICGT 2002. LNCS, vol. 2505, pp. 286–301. Springer, Heidelberg (2002)
Bottoni, P., Parisi Presicce, F., Taentzer, G.: Specifying integrated refactoring with distributed graph transformations. In: Pfaltz, J.L., Nagl, M., Böhlen, B. (eds.) AGTIVE 2003. LNCS, vol. 3062, pp. 227–242. Springer, Heidelberg (2004)
Kreowski, H.J., Kuske, S.: Graph transformation units with interleaving semantics. Formal Aspects of Computing 11, 690–723 (1999)
Engels, G., Schürr, A.: Encapsulated hierarchical graphs, graph types and meta types. Electronic Notes in Theoretical Computer Science 2 (1995)
Drewes, F., Hoffmann, B., Plump, D.: Hierarchical graph transformation. In: Tiuryn, J. (ed.) FOSSACS 2000. LNCS, vol. 1784, pp. 98–113. Springer, Heidelberg (2000)
Engelfriet, J., Rozenberg, G.: Handbook of Graph Grammars and Computing by Graph Transformation, vol. 1. World Scientific, Singapore (1997)
Janssens, D.: Actor grammars and Local Actions. In: Handbook of Graph Grammars and Computing by Graph Transformation, pp. 56–106. World Scientific, Singapore (1999)
Janssens, D.: ESM systems and the composition of their computations. Graph Transformations in Computer Science 776, 203–217 (1994)
Janssens, D., Mens, T.: Abstract semantics for ESM systems. Fundamenta Informaticae 26, 315–339 (1996)
Janssens, D., Demeyer, S., Mens, T.: Case study: Simulation of a LAN. In: Electronic Notes in Theoretical Computer Science, vol. 72(4), Elsevier, Amsterdam (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Van Eetvelde, N., Janssens, D. (2004). Extending Graph Rewriting for Refactoring. In: Ehrig, H., Engels, G., Parisi-Presicce, F., Rozenberg, G. (eds) Graph Transformations. ICGT 2004. Lecture Notes in Computer Science, vol 3256. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30203-2_28
Download citation
DOI: https://doi.org/10.1007/978-3-540-30203-2_28
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-23207-0
Online ISBN: 978-3-540-30203-2
eBook Packages: Springer Book Archive