Reducing Interactive Refactoring Effort via Clustering-Based Multi-Objective Search

Reducing Interactive Refactoring Effort via Clustering-Based Multi-Objective Search

September 7, 2018
4 min read
research

Reducing Interactive Refactoring Effort via Clustering-Based Multi-Objective Search

Published in: 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE)

Overview

Refactoring is nowadays widely adopted in the industry because bad design decisions can be very costly and extremely risky. However, finding the right balance between automated and manual refactoring remains a significant challenge in software engineering.

The Problem

  • Automated refactoring does not always lead to the desired design
  • Manual refactoring is error-prone, time-consuming and not practical for radical changes
  • Interactive refactoring can be repetitive, expensive, and tedious since developers must evaluate recommended refactorings and adapt them to the targeted design, especially in large systems where the number of possible strategies can grow exponentially

Our Solution

We propose an interactive approach combining the use of multi-objective search and unsupervised learning to reduce the developer's interaction effort when refactoring systems.

How It Works

  1. Multi-Objective Search: Generate different possible refactoring strategies by finding a trade-off between several conflicting quality attributes

  2. Clustering Algorithm: Use unsupervised learning to cluster the different trade-off solutions (Pareto front) to guide developers in selecting their region of interests

  3. Feedback Integration: Developer feedback at both cluster and solution levels automatically generates constraints to reduce the search space in next iterations

  4. Focused Search: The system focuses on the region of developer preferences in subsequent iterations

Evaluation Results

We evaluated our tool with 14 active developers on 5 open source projects and 1 industrial system.

Key Findings:

  • ✅ Participants found their desired refactorings faster than current state-of-the-art approaches
  • ✅ Participants found their desired refactorings more accurately than existing tools
  • ✅ Significant reduction in developer interaction effort
  • ✅ Improved scalability for large software systems

Tool Demo

Check out our tool demonstration video:

Resources

🔗 Publication Website: https://sites.google.com/view/ase2018

Abstract

Refactoring is nowadays widely adopted in the industry because bad design decisions can be very costly and extremely risky. On the one hand, automated refactoring does not always lead to the desired design. On the other hand, manual refactoring is error-prone, time-consuming and not practical for radical changes. Thus, recent research trends in the field focused on integrating developers feedback into automated refactoring recommendations because developers understand the problem domain intuitively and may have a clear target design in mind. However, this interactive process can be repetitive, expensive, and tedious since developers must evaluate recommended refactorings, and adapt them to the targeted design especially in large systems where the number of possible strategies can grow exponentially.

In this paper, we propose an interactive approach combining the use of multi-objective and unsupervised learning to reduce the developer's interaction effort when refactoring systems. We generate, first, using multi-objective search 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. The feedback from the developer, both at the cluster and solution levels, are used to automatically generate constraints to reduce the search space in the next iterations and focus on the region of developer preferences. We selected 14 active developers to manually evaluate the effectiveness our tool on 5 open source projects and one industrial system. The results show that the participants found their desired refactorings faster and more accurate than the current state of the art.

Impact

This research contributes to the field of automated software engineering by:

  • Introducing a novel interactive refactoring approach
  • Demonstrating the effectiveness of combining multi-objective optimization with machine learning
  • Providing empirical evidence of reduced developer effort in refactoring tasks
  • Advancing the state-of-the-art in interactive software engineering tools

Want to learn more about our research? Contact me or explore our other publications.

ASE
Conference
Tool
Refactoring
Multi-Objective Search
Machine Learning