paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AntiCopyPaster: Extracting Code Duplicates As Soon As They Are Introduced in the IDE

AntiCopyPaster:在 IDE 中尽早提取刚引入的代码重复
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 2/10 · 论文是在 IDE 中检测代码粘贴重复并推荐 Extract Method 重构,属于软件工程/开发者工具与经典机器学习分类,不涉及用户关注的静态分析×LLM/Agent、形式化验证、浮点程序分析或贝叶斯程序分析。虽然与“机器学习与程序语言”有弱交集,但并非核心方向。引用 11 inbox
Eman Abdullah Alomar, Anton Ivanov, Zarina Kurbatova, Yaroslav Golubev, Mohamed Wiem Mkaouer, Ali Ouni, Timofey Bryksin, Le Nguyen, Amit Kini, Aditya Thakur
crossref: 2026-09-12

AI 速览

一句话:在 IDE 中追踪代码粘贴,实时检测重复并主动建议 Extract Method 重构,并用分类模型决定是否推荐。

代码重复的传播会加重维护负担,而现有重构推荐方法往往脱离开发者工作流,无法在重复刚引入时及时干预。本文提出 AntiCopyPaster,一个 IntelliJ IDEA 插件。它跟踪 IDE 内的代码复制粘贴操作,在开发者粘贴片段后搜索当前打开文件中的重复,并等待短暂时间让开发者继续编辑,最后基于一组特征用分类模型判断是否需要提取。与已有方法不同,该工具主动、即时地推荐 Extract Method 重构,而非事后或离线分析。摘要未报告具体的用户实验或量化评估结果。

问题
代码重复在开发过程中不断传播,现有方法未集成到开发者工作流中,无法在重复刚产生时及时推荐重构。
方法
开发 IntelliJ IDEA 插件,跟踪粘贴的代码片段,在当前文件中搜索重复,延迟等待开发者编辑后,基于多个特征用分类模型推断是否建议 Extract Method 重构。
评估
摘要未提及具体的评估方法或实验结果,仅说明分类模型基于多个特征进行重构决策。
原文摘要(Abstract)

We developed a plugin for IntelliJ IDEA called AntiCopyPaster, which tracks the pasting of code fragments inside the IDE and suggests the appropriate Extract Method refactoring to combat the propagation of duplicates. Unlike the existing approaches, our tool is integrated with the developer’s workflow, and pro-actively recommends refactorings. Since not all code fragments need to be extracted, we develop a classification model to make this decision. When a developer copies and pastes a code fragment, the plugin searches for duplicates in the currently opened file, waits for a short period of time to allow the developer to edit the code, and finally inferences the refactoring decision based on a number of features.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7205,
  title = {AntiCopyPaster: Extracting Code Duplicates As Soon As They Are Introduced in the IDE},
  author = {Eman Abdullah Alomar and Anton Ivanov and Zarina Kurbatova and Yaroslav Golubev and Mohamed Wiem Mkaouer and Ali Ouni and Timofey Bryksin and Le Nguyen and Amit Kini and Aditya Thakur},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3559537}
}