AntiCopyPaster 3.0: Just-in-Time Clone Refactoring
ACM Transactions on Software Engineering and Methodology · 31.05.2026 · 35 (5) · 1-52
DOI: 10.1145/3749100 ↗Kurz gefasst
Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 24.04.2026. Verfasst von Eman Abdullah AlOmar und 7 weiteren Autor:innen. Die Arbeit nennt 87 Literaturangaben.
Abstract (Originalsprache)
Refactoring is a crucial practice in software maintenance that aims at improving design and coding practices while addressing design flaws. The Extract Method refactoring is particularly popular for consolidating duplicate code fragments into a single method. Various studies have explored ways to recommend Extract Method refactoring opportunities using techniques such as program slicing, program dependency graph analysis, change history analysis, structural similarity, and feature extraction. Despite their effectiveness, these approaches often disrupt the developer’s workflow, requiring them to pause their coding and assess the refactoring opportunities suggested throughout the project, without considering the specific development context. To enhance the adoption of Extract Method refactoring, our previous work proposed AntiCopyPaster 2.0 and investigated the effectiveness of detecting and extracting code clones without disrupting the developer’s workflow. To address these limitations, we develop a new approach in this article that supports the detection of Type-1 and Type-2 clones using the Program Structure Interface (PSI) and includes a custom-built Extract Method refactoring tool. We implement our approach using an IntelliJ IDEA extension plugin. Additionally, we integrated name recommendation models, including IntelliJ’s built-in recommender and Code2Vec , to enhance the quality of method names and improve developer productivity. To evaluate the accuracy and usefulness of our approach, we conducted a qualitative study involving 13 developers. The results indicate that (1) developers appreciate the approach and are satisfied with various aspects of the plugin’s functionality, (2) PSI effectively identifies clones by analyzing the structural and semantic aspects of the code, (3) IntelliJ’s naming recommender often provides default generic names, while code2vec produces descriptive and relevant names based on the code context, (4) the performance of AntiCopyPaster remains stable regardless of the file size and the number of clones present, (5) despite different detection and correction mechanisms, JDeodorant and AntiCopyPaster were able to perform method extraction, and AntiCopyPaster features just-in-time detection and correction, and (6) our results show an improvement in code quality after performing Extract Method refactoring with both refactoring tools. We envision that our AntiCopyPaster solution can streamline the Extract Method refactoring process, enhancing both developer efficiency and code quality by seamlessly integrating Type-2 clone detection and name recommendation capabilities in the development workflow.
Zitieren
APA
AlOmar, E. A., Ashkenas, J., Feliciano, R., Angelakos, M., Haralamppopoulos, D., Qian, X., Mkaouer, M. W., & Ouni, A. (2026). AntiCopyPaster 3.0: Just-in-Time Clone Refactoring. ACM Transactions on Software Engineering and Methodology, 35(5), 1-52. https://doi.org/10.1145/3749100
Vancouver
AlOmar EA, Ashkenas J, Feliciano R, Angelakos M, Haralamppopoulos D, Qian X, et al. AntiCopyPaster 3.0: Just-in-Time Clone Refactoring. ACM Transactions on Software Engineering and Methodology. 2026;35(5):1-52. doi:10.1145/3749100
BibTeX
@article{AlOmar2026,
author = {AlOmar, Eman Abdullah and Ashkenas, Jacob and Feliciano, Robert and Angelakos, Matthew and Haralamppopoulos, Dimitrios and Qian, Xing and Mkaouer, Mohamed Wiem and Ouni, Ali},
title = {AntiCopyPaster 3.0: Just-in-Time Clone Refactoring},
journal = {ACM Transactions on Software Engineering and Methodology},
year = {2026},
volume = {35},
number = {5},
pages = {1--52},
doi = {10.1145/3749100}
}
EUVIMED