paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Quantifying the benefits of code hints for refactoring deprecated Java APIs

量化代码提示对重构已废弃 Java API 的收益
FSE Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering2025匹配度 3/10 · 论文聚焦用符号合成与LLM自动重构Java废弃API,属于程序合成与LLM辅助软件维护,与用户核心关注的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析等方向均不直接相关;仅在“LLM作为PL工具”和工业落地案例上有边缘交集。引用 0 inbox
Cristina David, Pascal Kesseli, Daniel Kroening, Hanliang Zhang
crossref: 2026-09-12

AI 速览

一句话:用符号合成与 LLM 两个引擎自动重构 Java 废弃 API,量化 Javadoc 代码提示对重构成功率的提升。

在 Amazon 等公司,手动重构遗留代码以消除对已废弃 API 的调用既易错又耗时。本文研究废弃 Java API 的重构能在多大程度上被自动化,并量化 Javadoc 代码提示对该任务的收益。为此作者构建了两个自动重构引擎:符号引擎基于类型导向与基于组件的程序合成,神经引擎则使用大语言模型。他们将两个引擎应用于重构 Oracle JDK 15 中已废弃的方法,并在有、无代码提示两种设定下进行对比。实验表明,代码提示是此类自动化的使能条件:即使表现最差的引擎在带提示任务上也能正确重构 71%,而缺少提示时最好也只有 14%。因此,向 Javadoc 中补充更多代码提示可以显著提升使用废弃 API 的代码的重构效果。

问题
手动重构遗留代码以消除对已废弃 API 的调用是易错且耗时的过程;本文探究该任务可被自动化的程度,以及 Javadoc 代码提示在其中起多大作用。
方法
构建两个自动重构引擎:一个基于类型导向、基于组件的程序合成的符号引擎,另一个基于大语言模型的神经引擎,并将其用于重构废弃 API。
评估
在 Oracle JDK 15 的废弃方法上运行两个引擎,比较有、无代码提示时正确重构任务的比例(有提示最低 71%,无提示最高仅 14%)。
原文摘要(Abstract)

When done manually by engineers at Amazon and other companies, refactoring legacy code in order to eliminate uses of deprecated APIs is an error-prone and time-consuming process. In this paper, we investigate to which degree refactorings for deprecated Java APIs can be automated, and quantify the benefit of Javadoc code hints for this task. To this end, we build a symbolic and a neural engine for the automatic refactoring of deprecated APIs. The former is based on type-directed and component-based program synthesis, whereas the latter uses LLMs. We applied our engines to refactor the deprecated methods in the Oracle JDK 15. Our experiments show that code hints are enabling for the automation of this task: even the worst engine correctly refactors 71% of the tasks with code hints, which drops to at best 14% on tasks without. Adding more code hints to Javadoc can hence boost the refactoring of code that uses deprecated APIs.

链接与引用

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

BibTeX
@inproceedings{paperbot9000,
  title = {Quantifying the benefits of code hints for refactoring deprecated Java APIs},
  author = {Cristina David and Pascal Kesseli and Daniel Kroening and Hanliang Zhang},
  booktitle = {FSE},
  year = {2025},
  doi = {10.1145/3696630.3728567}
}