Generating Bug-Fixes Using Pretrained Transformers

04/16/2021
by   Dawn Drain, et al.
14

Detecting and fixing bugs are two of the most important yet frustrating parts of the software development cycle. Existing bug detection tools are based mainly on static analyzers, which rely on mathematical logic and symbolic reasoning about the program execution to detect common types of bugs. Fixing bugs is typically left out to the developer. In this work we introduce DeepDebug: a data-driven program repair approach which learns to detect and fix bugs in Java methods mined from real-world GitHub repositories. We frame bug-patching as a sequence-to-sequence learning task consisting of two steps: (i) denoising pretraining, and (ii) supervised finetuning on the target translation task. We show that pretraining on source code programs improves the number of patches found by 33 while domain-adaptive pretraining from natural language to code further improves the accuracy by another 32 evaluation metric into non-deletion and deletion-only fixes, and show that our best model generates 75 art. In contrast to prior work, we attain our best results when generating raw code, as opposed to working with abstracted code that tends to only benefit smaller capacity models. Finally, we observe a subtle improvement from adding syntax embeddings along with the standard positional embeddings, as well as with adding an auxiliary task to predict each token's syntactic class. Despite focusing on Java, our approach is language agnostic, requiring only a general-purpose parser such as tree-sitter.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/05/2021

HIPPODROME: Data Race Repair using Static Analysis Summaries

Implementing bug-free concurrent programs is a challenging task in moder...
research
05/19/2021

DeepDebug: Fixing Python Bugs Using Stack Traces, Backtranslation, and Code Skeletons

The joint task of bug localization and program repair is an integral par...
research
03/13/2023

InferFix: End-to-End Program Repair with LLMs

Software development life cycle is profoundly influenced by bugs: their ...
research
05/26/2021

Self-Supervised Bug Detection and Repair

Machine learning-based program analyses have recently shown the promise ...
research
10/30/2017

Semantic Code Repair using Neuro-Symbolic Transformation Networks

We study the problem of semantic code repair, which can be broadly defin...
research
04/22/2020

Towards Runtime Verification of Programmable Switches

Is it possible to patch software bugs in P4 programs without human invol...
research
03/17/2021

On the Rise and Fall of Simple Stupid Bugs: a Life-Cycle Analysis of SStuBs

Bug detection and prevention is one of the most important goals of softw...

Please sign up or login with your details

Forgot password? Click here to reset