Skip to main content

Extending Graph Rewriting for Refactoring

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3256))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Fowler, M.: Refactoring - Improving the Design of Existing Code. Addison-Wesley, Reading (1999)

    Google Scholar 

  2. Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois, Urbana-Champaign, IL, USA (1992)

    Google Scholar 

  3. Roberts, D.: Practical Analysis for Refactoring. PhD thesis, University of Illinois at Urbana-Champaign (1999)

    Google Scholar 

  4. Roberts, D., Brant, J., Johnson, R.: A refactoring tool for Smalltalk. Theory and Practice of Object Systems 3, 253–263 (1997)

    Article  Google Scholar 

  5. Beck, K., Fowler, M.: Planning extreme programming. Addison-Wesley, Reading (2001)

    Google Scholar 

  6. 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)

    Chapter  Google Scholar 

  7. 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)

    Chapter  Google Scholar 

  8. Kreowski, H.J., Kuske, S.: Graph transformation units with interleaving semantics. Formal Aspects of Computing 11, 690–723 (1999)

    Article  MATH  Google Scholar 

  9. Engels, G., Schürr, A.: Encapsulated hierarchical graphs, graph types and meta types. Electronic Notes in Theoretical Computer Science 2 (1995)

    Google Scholar 

  10. Drewes, F., Hoffmann, B., Plump, D.: Hierarchical graph transformation. In: Tiuryn, J. (ed.) FOSSACS 2000. LNCS, vol. 1784, pp. 98–113. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  11. Engelfriet, J., Rozenberg, G.: Handbook of Graph Grammars and Computing by Graph Transformation, vol. 1. World Scientific, Singapore (1997)

    Google Scholar 

  12. Janssens, D.: Actor grammars and Local Actions. In: Handbook of Graph Grammars and Computing by Graph Transformation, pp. 56–106. World Scientific, Singapore (1999)

    Google Scholar 

  13. Janssens, D.: ESM systems and the composition of their computations. Graph Transformations in Computer Science 776, 203–217 (1994)

    MathSciNet  Google Scholar 

  14. Janssens, D., Mens, T.: Abstract semantics for ESM systems. Fundamenta Informaticae 26, 315–339 (1996)

    MATH  MathSciNet  Google Scholar 

  15. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics