Refactoring planning for design smell correction in object-oriented software
- Pérez García, Francisco Javier
- Yania Crespo Directora
Universidad de defensa: Universidad de Valladolid
Fecha de defensa: 06 de julio de 2011
- Mario G. Piattini Velthuis Presidente/a
- Miguel Á. Laguna Secretario/a
- Radu Marinescu Vocal
- Miguel Alexandre Wermelinger Vocal
- Serge Demeyer Vocal
Tipo: Tesis
Resumen
The evolution of a software system often implies a certain degree of deterioration of the system's structure. This mainly happens because maintenance efforts concentrate more on bug correction and the addition of new functionality, than on the control and improvement of the system's architecture and design. Bad design practices, often due to inexperience, insufficient knowledge or time pressure, are at the origin of design smells. Design smells are problems encountered in the system's structure which do not produce compile or run-time errors, but negatively affect software quality factors. Correcting or, at least, reducing design smells can improve software quality. Refactoring is a key technique in software evolution. It can be used to improve the structure and quality of a software system without changing its observable behaviour. Consequently, refactoring also seems to be the most adequate technique to correct design smells. Most design smell management approaches focus on suggesting which are the best redesign changes to perform, and which are the best structures to remedy a smell in order to recover the original design intent. These suggestions are often given in terms of refactorings. One of the difficulties in applying refactoring operations is that it is rare that the preconditions of the desired refactorings could be fulfilled by the system's source code in its current state. Therefore, the developer has to plan ahead and apply a significant amount of additional changes to solve this problem. This is a recurring issue appearing when a refactoring process pursues a complex objective, such as correcting design smells. This PhD Thesis Dissertation is aimed at improving the automation of the refactoring activity when it is oriented to the correction of design smells. The approach is based on the definition of refactoring strategies and the instantiation of refactoring plans from them. Refactoring strategies are specifications of complex refactoring sequences aimed at a certain goal, such as the correction of design smells, that can be easily automated. Refactoring plans are refactoring sequences, instantiated from refactoring strategies, that can be applied to the system to effectively achieve that goal. Refactoring strategies and refactoring plans allow the necessary preparatory refactorings to be computed, thus helping the developer to circumvent the violation of refactoring preconditions. Automated planning is an artificial intelligence branch that seeks to generate sequences of actions that will achieve a certain goal when they are performed. The study presented in this document demonstrates that automated planning is a suitable technique for instantiating refactoring plans and thus, for supporting the problem of performing complex refactoring processes. We have found that hierarchical task network planning provides, among all the existing planning approaches, the best balance between search-based and procedural-based strategies for the problem of refactoring planning. Therefore, this research introduces the generation of refactoring plans --based on hierarchical task network planning-- as an approach to support the automation of the design smells correction activity.