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% as compared to supervised training from scratch, while domain-adaptive pretraining from natural language to code further improves the accuracy by another 32%. We refine the standard accuracy evaluation metric into non-deletion and deletion-only fixes, and show that our best model generates 75% more non-deletion fixes than the previous state of the 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.


翻译:检测和修正错误是软件开发周期中两个最重要但最令人沮丧的部分。 现有的错误检测工具主要以静态分析器为基础, 这些分析器依赖于数学逻辑和对程序执行的象征性推理, 以探测常见的错误类型。 修复错误通常留给开发者。 在此工作中, 我们引入 Deep Debug: 一种数据驱动的程序修复方法, 学习探测和修正从现实世界 GitHub 库中提取的 Java 方法中的错误。 我们将错误检测作为从序列到序列的学习任务, 由两个步骤组成:( 一) 去除预训练前, 以及 (二) 监督对目标翻译任务进行微调。 我们显示, 源代码程序前培训会增加33%的补丁数, 而从抓开始监督培训, 而从自然语言到代码的域适应前训练, 进一步提高了另外32%的准确度。 我们将标准准确度评价指标改进为非删除和删除的补丁方法, 并显示我们最好的模型产生75 % 非删除的缩缩缩缩缩缩缩, 也就是我们最后的校正的校正的校正的校正的校正结果, 。 对比我们最后的校正的校正的校正的校正的校正的校正的校正的校正的校正, 我们的校正的校正的校正的校正的校正。

0
下载
关闭预览

相关内容

机器学习系统设计系统评估标准
【EMNLP2020】自然语言生成,Neural Language Generation
专知会员服务
39+阅读 · 2020年11月20日
Transformer文本分类代码
专知会员服务
117+阅读 · 2020年2月3日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
154+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
177+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
195+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
104+阅读 · 2019年10月9日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Transferring Knowledge across Learning Processes
CreateAMind
28+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
42+阅读 · 2019年1月3日
carla 学习笔记
CreateAMind
9+阅读 · 2018年2月7日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
Arxiv
17+阅读 · 2021年3月29日
Paraphrase Generation with Deep Reinforcement Learning
VIP会员
相关VIP内容
【EMNLP2020】自然语言生成,Neural Language Generation
专知会员服务
39+阅读 · 2020年11月20日
Transformer文本分类代码
专知会员服务
117+阅读 · 2020年2月3日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
154+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
177+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
195+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
104+阅读 · 2019年10月9日
相关资讯
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Transferring Knowledge across Learning Processes
CreateAMind
28+阅读 · 2019年5月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
42+阅读 · 2019年1月3日
carla 学习笔记
CreateAMind
9+阅读 · 2018年2月7日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
Top
微信扫码咨询专知VIP会员