Promptly porting patches from a source codebase to its variants (e.g., forks and branches) is essential for mitigating propagated defects and vulnerabilities. Recent studies have explored automated patch porting to reduce manual effort and delay, but existing approaches mainly handle inconsistencies visible in a patch's local context and struggle with those requiring global mapping knowledge between codebases. We refer to such non-local inconsistencies as implicit inconsistencies. Implicit inconsistencies pose greater challenges for developers to resolve due to their non-local nature. To address them, we propose MIP, which enables collaboration among an LLM, a compiler, and code analysis utilities. MIP adopts different strategies for different cases: when source identifiers exist in the target codebase, it leverages compiler diagnostics; otherwise, it retrieves matched code segment pairs from the two codebases as mapping knowledge for mitigation. Experiments on two representative scenarios, cross-fork and cross-branch patch porting, show that MIP successfully resolves more than twice as many patches as the best-performing baseline in both settings. A user study with our industry partner further demonstrates its practical effectiveness.


翻译:及时将补丁从源代码库移植到其变体(如分支和派生版本)对于减轻传播的缺陷和漏洞至关重要。近期研究探索了自动化补丁移植以减少人工成本和延迟,但现有方法主要处理补丁局部上下文中可见的不一致,难以应对需要跨代码库全局映射知识的问题。我们将这类非局部不一致称为隐式不一致。由于其跨局部特性,隐式不一致给开发者带来更大的解决挑战。为此,我们提出MIP方法,该方法能够协调大语言模型、编译器和代码分析工具协同工作。MIP针对不同场景采用差异化策略:当源标识符在目标代码库中存在时,利用编译器诊断信息;否则,从两个代码库中检索匹配的代码段对作为映射知识进行缓解。在跨分支和跨派生版本补丁移植两类典型场景的实验表明,MIP在两个实验设置中成功解决的补丁数量均为最优基线的两倍以上。与行业合作伙伴开展的用户研究进一步验证了其实际有效性。

0
下载
关闭预览

相关内容

【博士论文】深度学习中的推理不一致性及其缓解方法
专知会员服务
26+阅读 · 2025年4月5日
专知会员服务
63+阅读 · 2021年3月12日
TensorFlow 2.0新特性之Ragged Tensor
深度学习每日摘要
18+阅读 · 2019年4月5日
迁移自适应学习最新综述,附21页论文下载
一次 PyTorch 的踩坑经历,以及如何避免梯度成为NaN
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
超越网格:作战环境对炮兵的影响
专知会员服务
2+阅读 · 5月31日
BES:让语言模型通过双向进化搜索自我改进
专知会员服务
6+阅读 · 5月30日
以色列-美国-伊朗战争中的无人机:关键要点
专知会员服务
7+阅读 · 5月30日
《Palantir任务保障性软件安全标准(MA-S2)》
专知会员服务
19+阅读 · 5月30日
基于声学的无人机检测技术综述
专知会员服务
11+阅读 · 5月30日
《当代混合战争分析框架:俄乌战争经验教训》
专知会员服务
10+阅读 · 5月30日
相关VIP内容
【博士论文】深度学习中的推理不一致性及其缓解方法
专知会员服务
26+阅读 · 2025年4月5日
专知会员服务
63+阅读 · 2021年3月12日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员