Stepping Stones over the Refactoring Rubicon

  • Authors:
  • Max Schäfer;Mathieu Verbaere;Torbjörn Ekman;Oege Moor

  • Affiliations:
  • Programming Tools Group, University of Oxford, UK;Programming Tools Group, University of Oxford, UK;Programming Tools Group, University of Oxford, UK;Programming Tools Group, University of Oxford, UK

  • Venue:
  • Genoa Proceedings of the 23rd European Conference on ECOOP 2009 --- Object-Oriented Programming
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Refactoring tools allow the programmer to pretend they are working with a richer language where the behaviour of a program is automatically preserved during restructuring. In this paper we show that this metaphor of an extended language yields a very general and useful implementation technique for refactorings: a refactoring is implemented by embedding the source program into an extended language on which the refactoring operations are easier to perform, and then translating the refactored program back into the original language. Using the well-known Extract Method refactoring as an example, we show that this approach allows a very fine-grained decomposition of the overall refactoring into a series of micro-refactorings that can be understood, implemented, and tested independently. We thus can easily write implementations of complex refactorings that rival and even outperform industrial strength refactoring tools in terms of correctness, but are much shorter and easier to understand.