Recommending Refactorings

via

Commit Message Analysis

Abstract:

The purpose of software restructuring, or refactoring, is to improve software quality and developer productivity. Prior studies have relied mainly on static and dynamic analyses of code to detect and recommend refactoring opportunities, such as code smells. Once identified, these smells are fixed by applying refactorings which then improve a set of quality metrics. While this approach has value and has shown promising results, many detected refactoring opportunities may not be related to a developer's current context and intention. Recent studies have shown that while developers document their refactoring intentions they may miss relevant refactorings aligned with their rationale. In this paper, we first identify refactoring opportunities by analyzing developer commit messages and check the quality improvements in the changed files, then we distill this knowledge into usable context-driven refactoring recommendations to complement static and dynamic analyses of code. The evaluation of our approach, based on six open source projects, shows that we outperform prior studies that apply refactorings based on static and dynamic analyses of code alone. This study provides compelling evidence of the value of using the information contained in existing commit messages to recommend future refactorings.

DEMO

Approach Overview

List of used keywords related to refactoring