Software developers like to reuse software components such as libraries or frameworks because it lets them build a system more quickly, but then the system depends on the components that they reused. Ideally, the programming interface (API) to a component never changes. In practice, components change their APIs. Upgrading an application to the new API is error-prone, tedious, and disruptive to the development process. Although some tools and ideas have been proposed to solve the evolution of APIs, most upgrades are done manually. This makes maintaining software expensive. Our goal is to automate the upgrading and make it practical.
Our study of the API changes in five components revealed that over 80% of the changes that break existing applications are caused by refactorings. Refactorings are program transformations that improve the structure of existing components. We suggest that refactoring-based upgrading tools can be used to effectively upgrade applications. We propose an approach that is both automated and safe, without any overhead on the component producers. First, component refactorings are automatically detected (either inferred or recorded), then they are incorporated into applications by replaying. This is the process used to automate the upgrading of applications: along with the new version of the component, component developers ship the log of refactorings applied to create the new version. An application developer can then upgrade the application to the new version by using a refactoring tool to replay the log of refactorings.
We developed a toolset to automatically upgrade applications in response to component refactorings. First, we developed a record-and-replay extension to a refactoring engine which records component refactorings and replays them on the applications. To handle those cases when component refactorings are not recorded, we developed RefactoringCrawler, a tool that detects refactorings in Java components. The empirical evaluation of RefactoringCrawler shows that it scales to real-world components, and its accuracy in detecting refactorings is over 85%, a significant improvement over existing solutions.
Not only components evolve, but applications evolve too. Besides refactorings, components and applications evolve through edits. Refactorings and edits can interfere with each other thus impeding the replay. To address this, we developed MolhadoRef, the first software merging system that intelligently merges refactorings and edits from components and applications, therefore upgrading the applications. Experimental evaluation shows that MolhadoRef automatically resolves more merge conflicts than traditional text-based systems while producing fewer merge errors.
To address those cases when the source code of the application cannot be changed in response to component refactorings, we developed a tool, RefactoringBinaryAdapter (ReBA). ReBA automatically generates an adapter between component and application thus enabling old binary applications to run with the latest version of the component without requiring changes in the application.
Not only does our toolset reduce the burden of manual upgrades, but it will influence component designers as well. Without fear that they break the existing applications, designers will be bolder in the kind of changes they can make to their designs. Given this new found freedom, designers will continue to refactor the design of software components to make them easier to understand and use.
Cited By
- Tsantalis N, Mansouri M, Eshkevari L, Mazinanian D and Dig D Accurate and efficient refactoring detection in commit history Proceedings of the 40th International Conference on Software Engineering, (483-494)
- Dig D, Johnson R, Marinov D, Bailey B and Batory D COPE Proceedings of the 38th International Conference on Software Engineering Companion, (773-776)
- Daniel B, Luo Q, Mirzaaghaei M, Dig D, Marinov D and Pezzè M Automated GUI refactoring and test script repair Proceedings of the First International Workshop on End-to-End Test Script Engineering, (38-41)
- Kuhlemann M and Sturm M Patching product line programs Proceedings of the 2nd International Workshop on Feature-Oriented Software Development, (33-40)
- Hattori L, Lungu M and Lanza M Replaying past changes in multi-developer projects Proceedings of the Joint ERCIM Workshop on Software Evolution (EVOL) and International Workshop on Principles of Software Evolution (IWPSE), (13-22)
- Wloka J, Sridharan M and Tip F Refactoring for reentrancy Proceedings of the 7th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering, (173-182)
Recommendations
Automated upgrading of component-based applications
OOPSLA '06: Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applicationsFrameworks and libraries change their APIs. Migrating an application to the new API is tedious and disrupts the development process. Although some tools and ideas have been proposed to solve the evolution of APIs, most updates are done manually. Our ...
A Genetic Algorithm for Automated Refactoring of Component-Based Software
BICT'15: Proceedings of the 9th EAI International Conference on Bio-inspired Information and Communications Technologies (formerly BIONETICS)Nowadays a software undergoes modifications done by different people to quickly fulfill new requirements, but its underlying design is not adjusted properly after each update. This leads to the emergence of bad smells. Refactoring provides a de facto ...
Describing and using non functional aspects in component based applications
AOSD '02: Proceedings of the 1st international conference on Aspect-oriented software developmentOne of the major progress due to component based technology is the capability to let the "infrastructure" manage some (non functional or extra functional) aspects such as persistency, distribution and so on without having to change the application code, ...