KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair
Authors:
- 1 May 2023
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 1251-1263
Abstract
Automated Program Repair (APR) improves soft-ware 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 in-corporates 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.Keywords
All Related Versions
This publication has 36 references indexed in Scilit:
- Precise Condition Synthesis for Program Repair2017
- Abstract Syntax Networks for Code Generation and Semantic Parsing2017
- Nopol: Automatic Repair of Conditional Statement Bugs in Java ProgramsIEEE Transactions on Software Engineering, 2016
- Language to Logical Form with Neural Attention2016
- Latent Predictor Networks for Code Generation2016
- Defects4J: a database of existing faults to enable controlled testing studies for Java programs2014
- Ensemble-based classifiersArtificial Intelligence Review, 2009
- Ensemble based systems in decision makingIEEE Circuits and Systems Magazine, 2006
- Maintaining mental models2006
- On Information and SufficiencyThe Annals of Mathematical Statistics, 1951