ISISTAN   23985
INSTITUTO SUPERIOR DE INGENIERIA DEL SOFTWARE
Unidad Ejecutora - UE
congresos y reuniones científicas
Título:
An approach to prioritize code smells for refactoring
Autor/es:
VIDAL, SANTIAGO A.; MARCOS, CLAUDIA A.; DÍAZ PACE, J. ANDRÉS
Lugar:
Rio de Janeiro
Reunión:
Otro; First Latin-American School on Software Engineering (ELA-ES); 2013
Institución organizadora:
PUC-RIO
Resumen:
Software evolution and maintenance involve high costs in the development process, particularly as systems become larger and complex. A usual concern that makes system maintenance and evolution difficult is the existence of structural design problems, which were not sufficiently taken care of in early development stages. These design problems are often described as code smells. A code smell is a symptom in the source code that helps to identify a design problem. In this way, code smells allow de- velopers to detect fragments of code that should be re-structured, in order to improve the quality of the system. A technique commonly used to fix code smells is refactoring. Different semi-automated tools can be applied to identify code smells in a system. However, a major limitation of existing tools is that they usually find numerous code smells. This is a challenging problem for the developer, for a number of reasons. First, she can get overwhelmed by the amount of information to be analyzed. Second, the effort needed to fix all the code smells usually exceeds the budget that the developer has available for refactoring. Third, in practice, not all code smells are equally im- portant for the goals of the system or its health. Therefore, the developer has to manu- ally peruse the list of code smells and select a set of smells that will be fixed. In this context, the provision of tool support for assisting the developer to quickly identify high-priority code smells becomes essential. In our research, we propose a semi- automated approach called SpIRIT (Smart Identification of Refactoring opportunITies) that treats refactoring as a cost-effective activity. By cost-effective, we mean that the analysis and re-structuring efforts are driven by a handful of code problems considered as critical for the current system, so that solving those problems will positively con- tribute to the system quality but with a limited refactoring expenditure. Given an ob- ject-oriented system with a number of code smells, SpIRIT assists the developer in two tasks: (i) prioritizing the code smells, and (ii) suggesting candidate refactorings for each smell using a cost-benefit analysis. The novel aspect of our approach is the prioritiza- tion of code smells based on assessing their relationships with modifiability issues. Our assessment of a code smell instance is determined by the following factors: past com- ponent modifications, important modifiability scenarios for the system, and types of code smells. Regarding the suggestion of refactorings, SpIRIT seeks to determine refac- toring alternatives for each code smell of its ranking. After searching through the de- sign space of refactoring alternatives, the tool should assess a set of candidate refactor- ings in terms of the improvement that their application would produce in the system.