arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2107.06657cs.SEcs.LG
收藏

DeepMutants:使用上下文突变训练神经缺陷检测器

DeepMutants: Training neural bug detectors with contextual mutations

Carl von Ossietzky University Oldenburg(奥尔登堡卡尔·冯·奥西茨基大学)

Cedric Richter, Heike Wehrheim

摘要:

基于学习的bug检测器承诺通过利用自然提示(如变量和函数的名称或注释)在大型代码库中发现bug。尽管如此,现有的技术往往表现不佳时,与现实的错误。我们认为缺陷检测器学习目前缺乏现实的有缺陷的训练样本。事实上,现实世界的错误是稀缺的,这使得现有的方法训练人工创造的,大多是不切实际的突变体。在这项工作中,我们提出了一种新的上下文突变算子,它结合了突变上下文的知识,动态注入自然和更现实的错误代码。我们的方法采用了一个掩蔽的语言模型,以产生一个上下文相关的分布在可行的令牌替换。评估表明,从语言模型采样不仅产生突变体,更准确地代表真正的错误,但也导致更好地执行错误检测器,无论是在人工基准测试和真实世界的源代码。

英文摘要:

Learning-based bug detectors promise to find bugs in large code bases by exploiting natural hints such as names of variables and functions or comments. Still, existing techniques tend to underperform when presented with realistic bugs. We believe bug detector learning to currently suffer from a lack of realistic defective training examples. In fact, real world bugs are scarce which has driven existing methods to train on artificially created and mostly unrealistic mutants. In this work, we propose a novel contextual mutation operator which incorporates knowledge about the mutation context to dynamically inject natural and more realistic faults into code. Our approach employs a masked language model to produce a context-dependent distribution over feasible token replacements. The evaluation shows that sampling from a language model does not only produce mutants which more accurately represent real bugs but also lead to better performing bug detectors, both on artificial benchmarks and on real world source code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑