Automated program repair (APR) faces the challenge of test overfitting, where generated patches pass validation tests but fail to generalize. Existing methods for patch assessment involve generating new tests or manual inspection, which can be time-consuming or biased. In this paper, we propose a novel technique, INVALIDATOR, to automatically assess the correctness of APR-generated patches via semantic and syntactic reasoning. INVALIDATOR leverages program invariants to reason about program semantics while also capturing program syntax through language semantics learned from a large code corpus using a pre-trained language model. Given a buggy program and the developer-patched program, INVALIDATOR infers likely invariants on both programs. Then, INVALIDATOR determines that an APR-generated patch overfits if: (1) it violates correct specifications or (2) maintains erroneous behaviors from the original buggy program. In case our approach fails to determine an overfitting patch based on invariants, INVALIDATOR utilizes a trained model from labeled patches to assess patch correctness based on program syntax. The benefit of INVALIDATOR is threefold. First, INVALIDATOR leverages both semantic and syntactic reasoning to enhance its discriminative capability. Second, INVALIDATOR does not require new test cases to be generated, but instead only relies on the current test suite and uses invariant inference to generalize program behaviors. Third, INVALIDATOR is fully automated. Experimental results demonstrate that INVALIDATOR outperforms existing methods in terms of Accuracy and F-measure, correctly identifying 79% of overfitting patches and detecting 23% more overfitting patches than the best baseline.


翻译:自动程序修复(APR)面临测试过拟合的挑战,即生成的补丁虽能通过验证测试却无法泛化。现有补丁评估方法涉及生成新测试或人工审查,既耗时又易产生偏差。本文提出一种新技术INVALIDATOR,通过语义与句法推理自动评估APR生成补丁的正确性。INVALIDATOR利用程序不变量推理程序语义,同时通过预训练语言模型从大规模代码语料中学习语言语义以捕获程序句法。给定缺陷程序与开发者修复后的程序,INVALIDATOR推断两者上的可能不变量,进而判定APR生成的补丁存在过拟合的条件为:(1)违反正确规范,或(2)保留原始缺陷程序的错误行为。当基于不变量无法判定过拟合补丁时,INVALIDATOR利用标记补丁训练的模型,依据程序句法评估补丁正确性。INVALIDATOR的优势有三:其一,融合语义与句法推理增强判别能力;其二,无需生成新测试用例,仅依赖现有测试套件并通过不变量推断泛化程序行为;其三,全自动化运行。实验结果表明,INVALIDATOR在准确率与F值上优于现有方法,正确识别79%的过拟合补丁,且较最优基线多检测23%的过拟合补丁。

0
下载
关闭预览

相关内容

Automator是苹果公司为他们的Mac OS X系统开发的一款软件。 只要通过点击拖拽鼠标等操作就可以将一系列动作组合成一个工作流,从而帮助你自动的(可重复的)完成一些复杂的工作。Automator还能横跨很多不同种类的程序,包括:查找器、Safari网络浏览器、iCal、地址簿或者其他的一些程序。它还能和一些第三方的程序一起工作,如微软的Office、Adobe公司的Photoshop或者Pixelmator等。
【CVPR2022】循环动态嵌入的视频目标分割
专知会员服务
19+阅读 · 2022年5月16日
[WWW2021]图结构估计神经网络
专知会员服务
43+阅读 · 2021年3月29日
令人沮丧的C++性能调试
InfoQ
0+阅读 · 2022年10月24日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
使用BERT做文本摘要
专知
23+阅读 · 2019年12月7日
一文带你读懂自然语言处理 - 事件提取
AI研习社
10+阅读 · 2019年5月10日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
【泡泡一分钟】端到端的弱监督语义对齐
泡泡机器人SLAM
53+阅读 · 2018年4月5日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
0+阅读 · 2023年5月6日
Arxiv
0+阅读 · 2023年5月5日
Arxiv
19+阅读 · 2020年7月21日
Arxiv
11+阅读 · 2018年4月8日
VIP会员
最新内容
对抗环境下超视距目标打击的情报支援
专知会员服务
1+阅读 · 33分钟前
《无人机对海面作战影响评估》
专知会员服务
11+阅读 · 7月21日
印度精确打击与指挥架构的断层
专知会员服务
6+阅读 · 7月20日
美空军AI完成F-16战斗机自主空战历史性试飞
专知会员服务
6+阅读 · 7月20日
相关VIP内容
【CVPR2022】循环动态嵌入的视频目标分割
专知会员服务
19+阅读 · 2022年5月16日
[WWW2021]图结构估计神经网络
专知会员服务
43+阅读 · 2021年3月29日
相关资讯
令人沮丧的C++性能调试
InfoQ
0+阅读 · 2022年10月24日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
使用BERT做文本摘要
专知
23+阅读 · 2019年12月7日
一文带你读懂自然语言处理 - 事件提取
AI研习社
10+阅读 · 2019年5月10日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
【泡泡一分钟】端到端的弱监督语义对齐
泡泡机器人SLAM
53+阅读 · 2018年4月5日
相关基金
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
1+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员