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)面临测试过度拟合的挑战,即生成的补丁在验证测试中通过,但无法推广。现有的补丁评估方法涉及生成新测试或手动检查,这可能耗时或存在偏差。在本文中,我们提出了一种新颖的技术——无效化器,通过语义和句法推理自动评估APR生成的补丁的正确性。无效化器利用程序不变量推理程序语义,同时通过使用预训练的语言模型从大型代码语料库中学习的语言语义来捕获程序语法。给定一个有缺陷的程序和开发人员修补的程序,无效化器会推断两个程序上的可能不变量。然后,无效化器确定修补程序过度拟合的条件为:(1)它违反了正确的规范或(2)保留了原本有故障的程序上的错误行为。如果我们的方法无法根据不变量确定是否存在过度拟合的补丁,则无效化器利用来自标记补丁的训练模型,根据程序的句法评估补丁的正确性。无效化器的好处是三重的。首先,无效化器利用语义和句法推理来增强其判别能力。其次,无效化器不需要生成新的测试用例,而是仅依赖于当前的测试套件,并利用不变量推理推广程序的行为。第三,无效化器是完全自动化的。实验结果表明,与最佳基线相比,无效化器在准确度和F值方面表现更好,能够正确识别79%的过度拟合补丁,并检测到比最佳基线多23%的过度拟合补丁。

0
下载
关闭预览

相关内容

Automator是苹果公司为他们的Mac OS X系统开发的一款软件。 只要通过点击拖拽鼠标等操作就可以将一系列动作组合成一个工作流,从而帮助你自动的(可重复的)完成一些复杂的工作。Automator还能横跨很多不同种类的程序,包括:查找器、Safari网络浏览器、iCal、地址簿或者其他的一些程序。它还能和一些第三方的程序一起工作,如微软的Office、Adobe公司的Photoshop或者Pixelmator等。
【CVPR2022】循环动态嵌入的视频目标分割
专知会员服务
18+阅读 · 2022年5月16日
[WWW2021]图结构估计神经网络
专知会员服务
42+阅读 · 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
14+阅读 · 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会员
相关VIP内容
【CVPR2022】循环动态嵌入的视频目标分割
专知会员服务
18+阅读 · 2022年5月16日
[WWW2021]图结构估计神经网络
专知会员服务
42+阅读 · 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
14+阅读 · 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会员