Charla: An Approach to Prioritize Code Smells for Refactoring

Prof. Santiago Vidal
24 Junio, 2015 - 14:30
Auditorio DCC, Piso 4
Prof. Alex Berguel, académico DCC




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 developers 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 important for the goals of the system or its health. Therefore, the developer has to manually 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 contribute to the system quality but with a limited refactoring expenditure. Given an object-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 prioritization of code smells based on assessing their relationships with modifiability issues. 


Santiago A. Vidal received the M. Sc. and Ph. D. degrees in computer science from UNICEN University in 2011 and 2013, respectively. He is a Teacher Assistant at the Computer Science Department of UNICEN and also a research fellow of CONICET-Argentina. His main research interests include software evolution and maintenance.