Abstract
Modern development environments support refactoring by providing atomically behaviour-preserving transformations. While useful, these transformations are limited in three ways: (i) atomicity forces transformations to be complex and opaque, (ii) the behaviour preservation requirement disallows deliberate behaviour evolution, and (iii) atomicity limits code reuse opportunities for refactoring implementers.
We present ‘program metamorphosis’, a novel approach for program evolution and refactoring that addresses the above limitations by breaking refactorings into smaller steps that need not preserve behaviour individually. Instead, we ensure that sequences of transformations preserve behaviour together, and simultaneously permit selective behavioural change.
To evaluate program metamorphosis, we have implemented a prototype plugin for Eclipse. Our analysis and experiments show that (1) our plugin provides correctness guarantees on par with those of Eclipse’s own refactorings, (2) both our plugin and our approach address the aforementioned limitations, and (3) our approach fully subsumes traditional refactoring.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Arsac, J.J.: Syntactic source to source transforms and program manipulation. Commun. ACM 22(1), 43–54 (1979)
Beck, K.: eXtreme Programming eXplained, Embrace Change. Addison-Wesley, Reading (2000)
Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9(3), 319–349 (1987)
Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison-Wesley, Reading (1999)
Griswold, W.G., Notkin, D.: Program Restructuring as an Aid to Software Maintenance. Technical report, Univ. of Wash (1990)
Kiezun, A., Fuhrer, R.M., Keller, M.: Advanced Refactoring in Eclipse: Past, Present and Future. In: First Workshop on Refactoring Tools, Berlin (2007), https://netfiles.uiuc.edu/dig/RefactoringWorkshop/Presentations/AdvancedRefactoringInEclipse.pdf
Kniesel, G., Koch, H.: Static composition of refactorings. Sci. Comput. Program. 52(1-3), 9–51 (2004)
Li, H., Reinke, C., Thompson, S.: Tool Support for Refactoring Functional Programs. In: Jeuring, J. (ed.) ACM Sigplan Haskell Workshop, pp. 27–38 (2003)
Mens, T., Tourwe, T.: A survey of software refactoring. IEEE Trans. Softw. Eng. 30(2), 126–139 (2004)
Mytkowicz, T., Sweeney, P.F., Hauswirth, M., Diwan, A.: Time interpolation: So many metrics, so few registers. In: MICRO 2007: Proceedings of the 40th Annual IEEE/ACM International Symposium on Microarchitecture, Washington, DC, USA, pp. 286–300. IEEE Computer Society Press, Los Alamitos (2007)
Reichenbach, C., Diwan, A.: Program Metamorphosis. Technical Report CU-CS-1036-07, University of Colorado at Boulder (2007)
Russell, S., Norvig, P.: Artificial Intelligence: A Modern Approach, 2nd edn. Prentice-Hall, Englewood Cliffs (2003)
Schäfer, M., Ekman, T., de Moor, O.: Sound and Extensible Renaming for Java. In: Kiczales, G. (ed.) 23rd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2008). ACM Press, New York (2008)
Shavor, S., D’Anjou, J., Fairbrother, S., Kehn, D., Kellerman, J., McCarthy, P.: The Java Developers Guide to Eclipse. Addison-Wesley, Reading (2003)
Taneja, K., Dig, D., Xie, T.: Automated detection of API refactorings in libraries. In: ASE 2007: Proceedings of the twenty-second IEEE/ACM international conference on Automated software engineering, pp. 377–380. ACM Press, New York (2007)
Wadler, P.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73, 344–358 (1990)
Ward, M.P., Zedan, H.: MetaWSL and Meta-Transformations in the FermaT Transformation System. In: COMPSAC (1), pp. 233–238 (2005)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Reichenbach, C., Coughlin, D., Diwan, A. (2009). Program Metamorphosis. In: Drossopoulou, S. (eds) ECOOP 2009 – Object-Oriented Programming. ECOOP 2009. Lecture Notes in Computer Science, vol 5653. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03013-0_18
Download citation
DOI: https://doi.org/10.1007/978-3-642-03013-0_18
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-03012-3
Online ISBN: 978-3-642-03013-0
eBook Packages: Computer ScienceComputer Science (R0)