paperbot · PL 论文追踪

全部论文 待读 收藏

P2 MELT: Mining Effective Lightweight Transformations from Pull Requests

MELT:从 Pull Request 中挖掘有效的轻量级变换
ASE 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)2023匹配度 3/10 · 该论文聚焦于从 Pull Request 中挖掘 API 迁移规则的程序合成/代码转换,属于 PL 与软件工程交叉,但未涉及用户核心关注的 LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析。仅与程序转换和工程落地有弱关联,因此匹配度较低。引用 16 inbox
Daniel Ramos, Hailie Mitchell, Inês Lynce, Vasco Manquinho, Ruben Martins, Claire Le Goues
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 MELT,从开源库 Pull Request 中挖掘轻量级、可解释的 API 迁移转换规则,并泛化以更好迁移客户端代码。

开发者更新 API 常需手工、耗时且易错。本文提出 MELT,其洞察是合并进开源库的 Pull Request 蕴含足够信息,可直接挖掘 API 迁移规则。MELT 利用库源码中的代码示例与基于 Pull Request 自动生成的示例,在 Comby 中推断结构化搜索替换规则;针对单例规则过窄,提出泛化过程以提升对客户端项目的适用性。规则语法驱动、可解释、易适配,并能嵌入库工作流,无需等待客户端迁移。在四个流行库上,作者从代码示例与自动生成示例分别挖出 461 和 114 条规则,泛化使匹配数提升 9 倍;应用于客户端项目并运行测试后,警告总体减少,部分测试用例被修复。

问题
如何自动地从开源库 Pull Request 中学习 API 迁移规则,并使其足够通用以更新客户端项目。
方法
MELT 利用库源码与 Pull Request 自动生成的代码示例,在 Comby 中推断结构化搜索替换规则,并通过泛化过程扩大规则适用范围。
评估
在四个流行库的 Pull Request 上挖掘规则,统计规则数量与泛化带来的匹配提升,并将规则应用于客户端项目、运行测试,观察警告与测试用例修复情况。
原文摘要(Abstract)

Software developers often struggle to update APIs, leading to manual, time-consuming, and error-prone processes. We introduce Melt, a new approach that generates lightweight API migration rules directly from pull requests in popular library repositories. Our key insight is that pull requests merged into open-source libraries are a rich source of information sufficient to mine API migration rules. By leveraging code examples mined from the library source and automatically generated code examples based on the pull requests, we infer transformation rules in Comby, a language for structural code search and replace. Since inferred rules from single code examples may be too specific, we propose a generalization procedure to make the rules more applicable to client projects. Melt rules are syntax-driven, interpretable, and easily adaptable. Moreover, unlike previous work, our approach enables rule inference to seamlessly integrate into the library workflow, removing the need to wait for client code migrations. We evaluated Melt on pull requests from four popular libraries, successfully mining 461 migration rules from code examples in pull requests and 114 rules from auto-generated code examples. Our generalization procedure increases the number of matches for mined rules by 9×. We applied these rules to client projects and ran their tests, which led to an overall decrease in the number of warnings and fixing some test cases demonstrating MELT's effectiveness in real-world scenarios.

链接与引用

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

BibTeX
@inproceedings{abs-2308-14687,
  title = {MELT: Mining Effective Lightweight Transformations from Pull Requests},
  author = {Daniel Ramos and Hailie Mitchell and Inês Lynce and Vasco Manquinho and Ruben Martins and Claire Le Goues},
  booktitle = {ASE},
  year = {2023},
  doi = {10.1109/ase56229.2023.00117}
}