KNOD:面向自动程序修复的领域知识蒸馏树解码器
KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair
AI总结:
KNOD 通过三阶段树解码器和领域规则蒸馏,将语法语义知识直接注入补丁生成过程,在多个 APR 基准上修复缺陷数量超过现有工具。
摘要:
自动程序修复(APR)通过为有缺陷的程序自动生成补丁来提高软件可靠性。近年来,APR 技术利用深度学习(DL)构建模型,从现有补丁和代码语料中学习生成补丁。尽管前景广阔,基于深度学习的 APR 技术仍受到补丁空间中大量语法或语义错误补丁的困扰。这些补丁往往违反源代码的语法和语义领域知识,因此无法成为修复缺陷的正确补丁。我们提出了一种基于深度学习的 APR 方法 KNOD,它以直接且全面的方式融入领域知识来指导补丁生成。KNOD 具有两大创新点,包括:(1)一种新颖的三阶段树解码器,它根据固有的树结构直接生成修补后代码的抽象语法树;(2)一种新颖的领域规则蒸馏方法,它利用语法和语义规则以及师生分布,在训练和推理阶段将领域知识显式注入解码过程。我们在三个广泛使用的基准上评估了 KNOD。KNOD 在 Defects4J v1.2 上修复了 72 个缺陷,在 QuixBugs 上修复了 25 个缺陷,在额外的 Defects4J v2.0 基准上修复了 50 个缺陷,优于所有现有的 APR 工具。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。