DeepDebug: Fixing Python Bugs Using Stack Traces, Backtranslation, and Code Skeletons
Dawn Drain, Colin B. Clement, Guillermo Serrato et al. · arXiv (Cornell University) · 2021
The joint task of bug localization and program repair is an integral part of the software development process. In this work we present DeepDebug, an approach to automated debugging using large, pretrained transformers. We begin by training a bug-creation model on reversed commit data for the purpose of generating synthetic bugs. We apply these synthetic bugs toward two ends. First, we directly train a backtranslation model on all functions from 200K repositories. Next, we focus on 10K repositories for which we can execute tests, and create buggy versions of all functions in those repositories that are covered by passing tests. This provides us with rich debugging information such as stack traces and print statements, which we use to finetune our model which was pretrained on raw source code. Finally, we strengthen all our models by expanding the context window beyond the buggy function itself, and adding a skeleton consisting of that function's parent class, imports, signatures, docstrings, and method bodies, in order of priority. On the QuixBugs benchmark, we increase the total number of fixes found by over 50%, while also decreasing the false positive rate from 35% to 5% and decreasing the timeout from six hours to one minute. On our own benchmark of executable tests, our model fixes 68% of all bugs on its first attempt without using traces, and after adding traces it fixes 75% on first attempt. We will open-source our framework and validation set for evaluating on executable tests.
Cited by 14 works. doi:10.48550/arxiv.2105.09352 Open-access PDF
Authors
References
- BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
- Language Models are Few-Shot Learners
- Defects4J: a database of existing faults to enable controlled testing studies for Java programs
- Understanding Back-Translation at Scale
- IntelliCode compose: code generation using transformer
- An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translation
- An analysis of patch plausibility and correctness for generate-and-validate patch generation systems
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation
- SEQUENCER: Sequence-to-Sequence Learning for End-to-End Program Repair