English

Leveraging Static Analysis for Bug Repair

Software Engineering 2023-04-24 v2

Abstract

We propose a method combining machine learning with a static analysis tool (i.e. Infer) to automatically repair source code. Machine Learning methods perform well for producing idiomatic source code. However, their output is sometimes difficult to trust as language models can output incorrect code with high confidence. Static analysis tools are trustable, but also less flexible and produce non-idiomatic code. In this paper, we propose to fix resource leak bugs in IR space, and to use a sequence-to-sequence model to propose fix in source code space. We also study several decoding strategies, and use Infer to filter the output of the model. On a dataset of CodeNet submissions with potential resource leak bugs, our method is able to find a function with the same semantics that does not raise a warning with around 97% precision and 66% recall.

Keywords

Cite

@article{arxiv.2304.10379,
  title  = {Leveraging Static Analysis for Bug Repair},
  author = {Ruba Mutasim and Gabriel Synnaeve and David Pichardie and Baptiste Rozière},
  journal= {arXiv preprint arXiv:2304.10379},
  year   = {2023}
}

Comments

13 pages. DL4C 2023

R2 v1 2026-06-28T10:12:35.594Z