Prioritizing code-smells correction tasks using chemical reaction optimization Ali Ouni • Marouane Kessentini • Slim Bechikh • Houari Sahraoui Ó Springer Science+Business Media New York 2014 Abstract The presence of code-smells increases significantly the cost of maintenance of systems and makes them difficult to change and evolve. To remove code-smells, refac- toring operations are used to improve the design of a system by changing its internal structure without altering the external behavior. In large-scale systems, the number of code-smells to fix can be very large and not all of them can be fixed automatically. Thus, the prioritization of the list of code-smells is required based on different criteria such as the risk and importance of classes. However, most of the existing refactoring approaches treat the code-smells to fix with the same importance. In this paper, we propose an approach based on a chemical reaction optimization metaheuristic search to find the suitable refactoring solutions (i.e., sequence of refactoring operations) that maximize the number of fixed riskiest code-smells according to the maintainer’s preferences/criteria. We evaluate our approach on five medium- and large-sized open-source systems and seven types of code-smells. Our experimental results show the effectiveness of our approach compared to other existing approaches and three different others metaheuristic searches. Keywords Search-based software engineering Refactoring, software quality Code-smells Chemical reaction optimization A. Ouni (&) H. Sahraoui DIRO, GEODES Lab, University of Montreal, Montreal, QC, Canada e-mail: ouniali@iro.umontreal.ca H. Sahraoui e-mail: sahraouh@iro.umontreal.ca A. Ouni M. Kessentini S. Bechikh CIS, SBSE-Michigan Lab, University of Michigan, Michigan, MI, USA e-mail: marouane@umich.edu S. Bechikh e-mail: slimb@umich.edu 123 Software Qual J DOI 10.1007/s11219-014-9233-7