Less is More

Oct 01, 2019

Check our Tool Demo Video:

Visit the publication website:

https://sites.google.com/view/scam2019

Abstract

There is a consensus in the software engineering literature that improving software quality will involve making trade-offs between conflicting objectives. Thus, refactoring studies either aggregated these quality metrics to evaluate possible code changes or treated them separately to find trade-offs. For the first category of work, it is challenging to define upfront the weights for the quality objectives since developers are not able to express them upfront. For the second category of work, the number of possible trade-offs between quality objectives is large which make developers reluctant to look at many refactoring solutions.

In this paper, we propose, for the first time, a way to convert multi-objective search into a mono-objective one after few interactions with the developer to identify a good refactoring solution based on his preferences. The first step consists of using a multi-objective search to generate different possible refactoring strategies by finding a trade-off between several conflicting quality attributes. Then, an unsupervised learning algorithm clusters the different trade-off solutions, called the Pareto front, to guide the developers in selecting their region of interests and reduce the number of refactoring options to explore. Finally, the extracted preferences from the developer are used to transform the multi-objective search into a mono-objective one by taking the preferred cluster of the Pareto front as the initial population for the mono-objective search and generating an evaluation function based on the weights that are automatically computed from the position of the cluster in the Pareto front. Thus, the developer will just interact with only one refactoring solution generated by the mono-objective search. We selected 32 participants to manually evaluate the effectiveness of our tool on 6 open source projects and one industrial project. The results show that the recommended refactorings are more accurate than the current state of the art.

approach overview