DeepMutants: Training neural bug detectors with contextual mutations

07/14/2021
by   Cedric Richter, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/30/2018

DeepBugs: A Learning Approach to Name-based Bug Detection

Natural language elements in source code, e.g., the names of variables a...
research
07/01/2022

Can we learn from developer mistakes? Learning to localize and repair real bugs from real bug fixes

Real bug fixes found in open source repositories seem to be the perfect ...
research
12/27/2018

Learning How to Mutate Source Code from Bug-Fixes

Mutation testing has been widely accepted as an approach to guide test c...
research
11/16/2022

Artificial Disfluency Detection, Uh No, Disfluency Generation for the Masses

Existing approaches for disfluency detection typically require the exist...
research
09/18/2022

Infrared: A Meta Bug Detector

The recent breakthroughs in deep learning methods have sparked a wave of...
research
04/21/2022

On Distribution Shift in Learning-based Bug Detectors

Deep learning has recently achieved initial success in program analysis ...
research
04/06/2021

A new perspective on the competent programmer hypothesis through the reproduction of bugs with repeated mutations

The competent programmer hypothesis states that most programmers are com...

Please sign up or login with your details

Forgot password? Click here to reset