
A Refactoring-Based Approach to Support Binary Backward-Compatible Framework Upgrades Dissertation zur Erlangung des akademischen Grades Doktoringenieur (Dr.-Ing.) vorgelegt an der Technischen Universität Dresden Fakultät Informatik eingereicht von M.Sc. Ilie ¸Savga geboren am 02.02.1975 in Chi¸sinau,˘ Republik Moldau Gutachter: Prof. Dr. rer. nat. habil. Uwe Aßmann (Technische Universität Dresden) Prof. Dr. Friedrich Steimann (Fernuniversität in Hagen) Tag der Verteidigung: Dresden, den 21 April 2010 Dresden, den 16 Juni 2009 c Copyright 2009, Ilie ¸Savga. All rights reserved. To my parents and wife, for their endless love and support Abstract A successful software framework—a software component encompassing reusable design decisions for a family of related applications—usually has to evolve considerably due to new or changed requirements, or quality improvements. Although the Application Programming Interface (API) of a framework should stay stable, in practice it often changes during framework evolution. When upgrading the framework to a new, improved version, such changes may invalidate plugins—modules that instantiated one of the previous framework versions into a final application. Such application-breaking API changes are backward- incompatible with existing plugins: plugin sources cannot be recompiled, or plugin binaries cannot be linked and run with a new framework release. When upgrading the framework, its developers are forced to either manually adapt plugins or manually specify update patches. Both tasks are usually error-prone and expensive, the costs often becoming unacceptable in case of large and complex frameworks. Existing approaches to automate component adaptation demand cumbersome specifications, which the developers are reluctant to write and maintain. Finally, intrusive update of existing applications via modifying their sources or binaries may be impossible at all, in case their sources or binaries are unavailable, or software licenses forbid their change. This thesis elaborates on an adaptation technology that supports binary backward-compatible framework upgrade—existing plugins link and run with the new framework release without recompiling. To protect existing plugins from API changes, we create binary adapters that constitute an adaptation layer placed between plugins of an old version and the upgraded framework. From the point of view of an existing plugin, the adaptation layer looks like the original framework (before the API changes), while from the point of view of the framework the adaptation layer looks like the updated plugin. Via the adaptation layer, plugins may invoke the improved functionality of the upgraded framework, while the framework may call back functionality of existing plugins. Most adapters of the adaptation layer can be created automatically basing on the history of API changes. This automation is inspired by several case studies of API evolution, reporting that most application- breaking evolutionary API changes of software components are refactorings—behavior-preserving program transformations. Since refactorings have formally defined semantics, we know precisely how they change framework APIs and, in case of application-breaking API refactorings, can formally define adaptation actions. In particular, we rely on the semantics of application-breaking API refactorings to automatically derive compensating binary adapters in our adaptation tool ComeBack!. The tool evaluation shows that most application-breaking API refactorings can be addressed automatically, and that the performance overhead implied by adapters is acceptable in a large number of adaptation scenarios. i ii Acknowledgments First, I wish to thank my supervisor Prof. Uwe Aßmann for his support, guidance and patience while supervising my work. Our collaboration started in 2002 in Linköping, Sweden, where Uwe supervised my master thesis and the follow-up work in the EASYCOMP project. While moving back to Germany in 2004, Uwe offered me to follow him for a doctoral position at TU Dresden; I did not hesitate a second when accepting his offer and Uwe helped me a lot not to feel sorry about this decision later on. Thank you Uwe! I am indebted to Michael Rudolf for his indispensable help in developing most (if not all) aspects of the refactoring-based framework adaptation. While supervising Michael’s bachelor, internship and master theses, I learned from him at least as much as he learned from me. Michael co-authored all scientific publications related to my thesis and heavily influenced all major conceptual and technological decisions taken. Michael was also the main developer of the Comeback! tool, in the implementation of which he showed to be the greatest Java programmer I have ever met. Finally, he delivered extremely valuable comments on early, late, and the final drafts of this document. A big thanks to you Michael, without you this thesis would have been impossible! I was fortunate to work with Sebastian Götz, who helped a lot in performing the thesis’ case study, in implementing the Comeback! tool, and in co-authoring several related publications. It was an honour for me to have Prof. Friedrich Steimann as the second reviewer of the thesis. I thank him very much for finding time in his overbooked calender to scientifically x-ray my thesis and to kindly suggest its improvements. I want to thank our research group for their feedback on my ideas, papers, and the thesis document. Jakob Henriksson, whom I shared an office with, gave important insights on early drafts of the thesis and saved a lot of my time by providing guidance during the tricky bureaucratic process of thesis submission. Thanks to Andreas Bartho, Birgit Demuth, Jendrik Johannes, Mirko Seifert, and Christian Wende for their invaluable comments on the written text of the thesis and its related papers. Many thanks to Steffen Zschaler, who not only commented on our major papers published, but also provided important hints on how to improve the thesis structure and content. Special thanks to Florian Heidenreich and Sven Karol for tolerating me in the FeasiPle project during the last months of my thesis writing. I want to mention Danny Dig, whom it always was a great pleasure to meet with. Danny has been a convinced proponent of the refactoring-based adaptation, and his feedback on my work as well as his own contributions to this research field have been of great value in forwarding my research. Very personal thanks on Ulrich and Uta Bergk for their enormous help in solving many routine problems I would otherwise have had to solve and, especially, for their extremely encouraging friendly support. I thank my friends Serghei ”Kumank” Ghelici, Alexei ”Llik” Mihailov, Adrian Pop, Vladimir ”Vovec” Sterpu, and the whole Stroikins family for visiting me and for inviting me to visit them, regardless of the country borders and distances between us. Although our meetings could hardly be considered scientific, the positive energy I accumulated during those visits helped me a lot in my further work. I thank my parents Nicolae and Ala for always supporting me and inspiring me to bring out the best in myself. Specifically in hard times during my graduation, I appreciated very much their interminable confidence in my abilities to achieve my final goal. I am especially thankful to my wife Natasha for being an extraordinary wife and mother. Without her love and support, I never would make it through. I thank her and my children Yuri and Ala for filling my life with a lot of reasons to live and to love. Finally, but not lastly, I am thankful to God for granting me the skills to achieve this accomplishment. iii iv List of Publications This thesis is partially based on the following peer-reviewed publications: • Ilie ¸Savga, Michael Rudolf, Sebastian Götz, and Uwe Aßmann. Practical refactoring-based framework upgrade. In GPCE ’08: Proceedings of the 7th International Conference on Generative Programming and Component Engineering, pages 171–180, New York, NY, USA, 2008. ACM. • Ilie ¸Savga and Michael Rudolf. Refactoring-based adaptation of adaptation specifications. In SERA ’08: Best Papers Selection Proceedings of the 6th Conference on Software Engineering Research, Management and Applications, volume 150 of Studies in Computational Intelligence, pages 189–203. Springer Verlag, 2008. • Ilie ¸Savga, Michael Rudolf, and Sebastian Götz. Comeback!: a refactoring-based tool for binary- compatible framework upgrade. In ICSE Companion ’08: Companion of the 30th International Conference on Software Engineering, pages 941–942, New York, NY, USA, 2008. ACM. • Ilie ¸Savga, Michael Rudolf, and Jan Lehmann. Controlled adaptation-oriented evolution of object- oriented components. In C. Pahl, editor, IASTED SE ’08: Proceedings of the IASTED International Conference on Software Engineering. Acta Press, 2008. • Ilie ¸Savga and Michael Rudolf. Refactoring-based support for binary compatibility in evolving frame- works. In GPCE ’07: Proceedings of the 6th International Conference on Generative Programming and Component Engineering, pages 175–184, New York, NY, USA, 2007. ACM. • Ilie ¸Savga and Michael Rudolf. Refactoring-driven adaptation in evolving frameworks. In WRT ’07: Proceedings of the 1st Workshop on Refactorings Tools, 2007. Printed as the TU Berlin Technical Report ISSN 1436-9915. • Ilie ¸Savga, Michael Rudolf, Jacek Sliwerski,´ Jan Lehmann, and Harald Wendel. API changes— how far would you go? In CSMR ’07: Proceedings of the 11th European Conference on Software Maintenance and Reengineering,
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages224 Page
-
File Size-