Automated Program Repair (APR) improves software reliability by generating patches for a buggy program automatically. Recent APR techniques leverage deep learning (DL) to build models to learn to generate patches from existing patches and code corpora. While promising, DL-based APR techniques suffer from the abundant syntactically or semantically incorrect patches in the patch space. These patches often disobey the syntactic and semantic domain knowledge of source code and thus cannot be the correct patches to fix a bug. We propose a DL-based APR approach KNOD, which incorporates domain knowledge to guide patch generation in a direct and comprehensive way. KNOD has two major novelties, including (1) a novel three-stage tree decoder, which directly generates Abstract Syntax Trees of patched code according to the inherent tree structure, and (2) a novel domain-rule distillation, which leverages syntactic and semantic rules and teacher-student distributions to explicitly inject the domain knowledge into the decoding procedure during both the training and inference phases. We evaluate KNOD on three widely-used benchmarks. KNOD fixes 72 bugs on the Defects4J v1.2, 25 bugs on the QuixBugs, and 50 bugs on the additional Defects4J v2.0 benchmarks, outperforming all existing APR tools.


翻译:摘要:自动化程序修复(APR)通过自动为缺陷程序生成补丁来提升软件可靠性。近期APR技术利用深度学习(DL)构建模型,从现有补丁和代码语料库中学习补丁生成。尽管前景可观,但基于DL的APR技术在补丁空间中面临大量语法或语义错误补丁的难题。这些补丁通常违反源代码的语法与语义领域知识,因而无法作为修正缺陷的正确补丁。我们提出基于DL的APR方法KNOD,以直接且全面的方式融合领域知识以指导补丁生成。KNOD包含两大创新点:(1)一种新颖的三阶段树解码器,能依据固有树结构直接生成修补代码的抽象语法树;(2)一种新颖的领域规则蒸馏方法,利用语法与语义规则以及师生分布,在训练与推理阶段将领域知识显式注入解码过程。我们在三个广泛使用的基准集上评估KNOD。KNOD在Defects4J v1.2修复72个缺陷、在QuixBugs修复25个缺陷、在附加Defects4J v2.0基准集修复50个缺陷,性能超越所有现有APR工具。

0
下载
关闭预览

相关内容

领域知识:特定行业,方向的专业知识。
百篇论文纵览大型语言模型最新研究进展
专知会员服务
70+阅读 · 2023年3月31日
【CVPR2021】基于反事实推断的视觉问答框架
专知会员服务
27+阅读 · 2021年3月4日
【MIT】硬负样本的对比学习
专知会员服务
40+阅读 · 2020年10月14日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
53+阅读 · 2019年9月29日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
vae 相关论文 表示学习 1
CreateAMind
12+阅读 · 2018年9月6日
【论文】图上的表示学习综述
机器学习研究会
15+阅读 · 2017年9月24日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
Arxiv
19+阅读 · 2021年6月15日
VIP会员
最新内容
深入Project Maven:为何人工智能在战场上依然失灵
锻造未来士兵:外骨骼、基因工程与赛博格
专知会员服务
7+阅读 · 7月19日
《无人机蜂群通信技术研究》50页
专知会员服务
7+阅读 · 7月19日
战力倍增器:自主武器系统与乌克兰及加沙冲突
人工智能赋能战场情报:提速决策进程
专知会员服务
6+阅读 · 7月17日
《拥抱新兴技术:面向未来军官的教育革新》
专知会员服务
8+阅读 · 7月17日
相关基金
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
1+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员