Abstract
Modern IDEs for object-oriented languages like Java provide support for a basic set of simple automated refactorings whose behaviour is easy to describe intuitively. It is, however, surprisingly difficult to specify their behaviour in detail. In particular, the popular precondition-based approach tends to produce somewhat unwieldy descriptions if advanced features of the object language are taken into account. This has resulted in refactoring implementations that are complex, hard to understand, and even harder to maintain, yet these implementations themselves are the only precise "specification" of many refactorings. We have in past work advocated a different approach based on several complementary notions of dependencies that guide the implementation, and on the concept of microrefactorings that structure it. We show in this work that these concepts are powerful enough to provide high-level specifications of many of the refactorings implemented in Eclipse. These specifications are precise enough to serve as the basis of a clean-room reimplementation of these refactorings that is very compact, yet matches Eclipse's for features and outperforms it in terms of correctness.
- }}Umut A. Acar, Amal Ahmed, and Matthias Blume. Imperative Self-Adjusting Computation. In POPL, pages 309--322, 2008. Google Scholar
Digital Library
- }}John Boyland. Incremental Evaluators for Remote Attribute Grammars. Electr. Notes Theor. Comput. Sci., 65(3), 2002.Google Scholar
- }}Ittai Balaban, Frank Tip, and Robert Fuhrer. Refactoring support for class library migration. In OOPSLA, pages 265--279, 2005. Google Scholar
Digital Library
- }}A. Demers, T. Reps, and T. Teitelbaum. Incremental Evaluation for Attribute Grammars with Applications to Syntax-directed Editors. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 105--116. ACM Press, 1981. Google Scholar
Digital Library
- }}Torbjörn Ekman and Görel Hedin. The JastAdd Extensible Java Compiler. In OOPSLA, 2007. Google Scholar
Digital Library
- }}Torbjörn Ekman and Görel Hedin. The JastAdd system - modular extensible compiler construction. Sci. Comput. Program., 69(1-3):14--26, 2007. Google Scholar
Digital Library
- }}Eclipse Foundation. Eclipse 3.5. http://www.eclipse.org, 2010.Google Scholar
- }}Martin Fowler. Refactoring: improving the design of existing code. Addison Wesley, 2000. Google Scholar
Digital Library
- }}Alejandra Garrido and José Meseguer. Formal Specification and Verification of Java Refactorings. In SCAM, 2006. Google Scholar
Digital Library
- }}William G. Griswold. Program Restructuring as an Aid to Software Maintenance. Ph.D. thesis, University of Washington, 1991. Google Scholar
Digital Library
- }}JetBrains. IntelliJ IDEA 9.0.1. http://www.jetbrains.com, 2010.Google Scholar
- }}Joshua Kerievsky. Refactoring to Patterns. Addison Wesley, 2005. Google Scholar
Digital Library
- }}Adam Kiezun, Michael D. Ernst, Frank Tip, and Robert M. Fuhrer. Refactoring for Parameterizing Java Classes. In ICSE, pages 437--446, 2007. Google Scholar
Digital Library
- }}Günter Kniesel and Helge Koch. Static Composition of Refactorings. The Science of Computer Programming, 52(1-3):9--51, 2004. Google Scholar
Digital Library
- }}Hannes Kegel and Friedrich Steimann. Systematically Refactoring Inheritance to Delegation in Java. In International Conference on Software Engineering (ICSE), pages 431--440. ACM Press, 2008. Google Scholar
Digital Library
- }}Ralf Lämmel. Towards Generic Refactoring. In Rule-based Programming (RULE), pages 15--28. ACM Press, 2002. Google Scholar
Digital Library
- }}William Harry Maddox. Incremental Static Semantic Analysis. Ph.D. thesis, University of California, Berkeley, 1997.Google Scholar
- }}William F. Opdyke. Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana-Champaign, 1992. Google Scholar
Digital Library
- }}Arnaud Payement. Type-based Refactoring using JunGL. Master's thesis, Oxford University Computing Laboratory, 2006.Google Scholar
- }}M. Pennings, D. Swierstra, and H. Vogt. Using cached functions and constructors for incremental attribute evaluation. In PLILP, pages 130--144. Springer Verlag, 1992. Google Scholar
Digital Library
- }}Max Schäfer and Oege de Moor. Of Gnats and Dragons -- Sources of Complexity in Implementing Refactorings. In WRT, 2009.Google Scholar
- }}Max Schäfer, Julian Dolby, Manu Sridharan, Frank Tip, and Emina Torlak. Correct Refactoring of Concurrent Java Code. In Theo D'Hondt, editor, ECOOP, 2010.Google Scholar
Cross Ref
- }}Max Schäfer, Torbjörn Ekman, and Oege de Moor. Sound and Extensible Renaming for Java. In Gregor Kiczales, editor, OOPSLA. ACM Press, 2008. Google Scholar
Digital Library
- }}Max Schäfer, Torbjörn Ekman, Ran Ettinger, and Mathieu Verbaere. Refactoring bugs. http://progtools.comlab.ox.ac.uk/projects/refactoring/bugreports, 2010.Google Scholar
- }}Quinten David Soetens. Formalizing Refactorings Implemented in Eclipse. Master's thesis, University of Antwerp, 2009.Google Scholar
- }}J. Saraiva, S. D. Swierstra, and M. F. Kuiper. Functional incremental attribute evaluation. In Compiler Construction, pages 279--294, 2000. Google Scholar
Digital Library
- }}Friedrich Steimann and Andreas Thies. From Public to Private to Absent: Refactoring Java Programs under Constrained Accessibility. In Sophia Drossopoulou, editor, ECOOP, 2009. Google Scholar
Digital Library
- }}Max Schäfer, Mathieu Verbaere, Torbjörn Ekman, and Oege de Moor. Stepping Stones over the Refactoring Rubicon -- Lightweight Language Extensions to Easily Realise Refactorings. In Sophia Drossopoulou, editor, ECOOP, 2009.Google Scholar
- }}Frank Tip. Refactoring Using Type Constraints. In SAS, pages 1--17, 2007. Google Scholar
Digital Library
- }}Frank Tip, Adam Kiezun, and Dirk Bäumer. Refactoring for Generalization using Type Constraints. In OOPSLA, pages 13--26, 2003. Google Scholar
Digital Library
- }}Mathieu Verbaere, Ran Ettinger, and Oege de Moor. JunGL: a Scripting Language for Refactoring. In Dieter Rombach and Mary Lou Soffa, editors, International Conference on Software Engineering (ICSE), pages 172--181. ACM Press, 2006. Google Scholar
Digital Library
- }}Mathieu Verbaere. A Language to Script Refactoring Transformations. D.Phil. thesis, Oxford University Computing Laboratory, 2008.Google Scholar
- }}Jan Wloka, Manu Sridharan, and Frank Tip. Refactoring for Reentrancy. In ESEC/SIGSOFT FSE, pages 173--182, 2009. Google Scholar
Digital Library
Index Terms
Specifying and implementing refactorings
Recommendations
Specifying and implementing refactorings
OOPSLA '10: Proceedings of the ACM international conference on Object oriented programming systems languages and applicationsModern IDEs for object-oriented languages like Java provide support for a basic set of simple automated refactorings whose behaviour is easy to describe intuitively. It is, however, surprisingly difficult to specify their behaviour in detail. In ...
Deriving refactorings for aspectJ
OOPSLA '04: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applicationsIn this paper we present aspect-oriented programming laws that are useful for deriving refactorings for AspectJ. The laws help developers to verify if the transformations they define preserve behavior. We illustrate that by deriving several AspectJ ...
Design and Implementation of a Tool for Specifying Specification in SOFL
Revised Selected Papers of the Second International Workshop on Structured Object-Oriented Formal Language and Method - Volume 7787Structure Object-oriented Formal Language SOFL is not just a formal language for writing formal specification. It is also an approach and a methodology. SOFL provides a three-step approach for modelling a software system using formal specification. ...







Comments