首页|An Automated Approach to Discovering Software Refactorings by Comparing Successive Versions

An Automated Approach to Discovering Software Refactorings by Comparing Successive Versions

扫码查看
Software developers and maintainers frequently conduct software refactorings to improve software quality. Identifying the conducted software refactorings may significantly facilitate the comprehension of software evolution, and thus facilitate software maintenance and evolution. Besides that, the identified refactorings are also valuable for data-driven approaches in software refactoring. To this end, researchers have proposed a few approaches to identifying software refactorings automatically. However, the performance (especially precision) of such approaches deserves substantial improvement. To this end, in this paper, we propose a novel refactoring detection approach, called ReExtractor+. At the heart of ReExtractor+ is a reference-based entity matching algorithm that matches coarse-grained code entities (e.g., classes and methods) between two successive versions, and a context-aware statement matching algorithm that matches statements within a pair of matched methods. We evaluated ReExtractor+ on a benchmark consisting of 400 commits from 20 real-world projects. The evaluation results suggested that ReExtractor+ significantly outperformed the state of the art in refactoring detection, reducing the number of false positives by 57.4% and improving recall by 18.4%. We also evaluated the performance of the proposed matching algorithms that serve as the cornerstone of refactoring detection. The evaluation results suggested that the proposed algorithms excel in matching code entities, substantially reducing the number of mistakes (false positives plus false negatives) by 67% compared to the state-of-the-art approaches.

CodesSoftwareSoftware algorithmsVisualizationJavaComputer scienceSource codingSoftware qualityReviewsHistory

Bo Liu、Hui Liu、Nan Niu、Yuxia Zhang、Guangjie Li、He Jiang、Yanjie Jiang

展开 >

School of Computer Science and Technology, Beijing Institute of Technology, Beijing, China

Department of Electrical Engineering and Computer Science, University of Cincinnati, Cincinnati, OH, USA

National Innovation Institute of Defense Technology, Beijing, China

School of Software, Dalian University of Technology, Dalian, China

School of Computer Science and Technology, Beijing Institute of Technology, Beijing, China|School of Computer Science, Peking University, Beijing, China

展开 >

2025

IEEE transactions on software engineering

IEEE transactions on software engineering

ISSN:
年,卷(期):2025.51(5)
  • 84