Learning How to Mutate Source Code from Bug-Fixes

12/27/2018
by   Michele Tufano, et al.
0

Mutation testing has been widely accepted as an approach to guide test case generation or to assess the effectiveness of test suites. Empirical studies have shown that mutants are representative of real faults; yet they also indicated a clear need for better, possibly customized, mutation operators and strategies. While some recent papers have tried to devise domain-specific or general purpose mutator operators by manually analyzing real faults, such an activity is effort- (and error-) prone and does not deal with an important practical question as to how to really mutate a given source code element. We propose a novel approach to automatically learn mutants from faults in real programs. First, our approach processes bug fixing changes using fine-grained differencing, code abstraction, and change clustering. Then, it learns mutation models using a deep learning strategy. We have trained and evaluated our technique on a set of 787k bugs mined from GitHub. Starting from code fixed by developers in the context of a bug-fix, our empirical evaluation showed that our models are able to predict mutants that resemble original fixed bugs in between 9 the automatically generated mutants are lexically and syntactically correct.

READ FULL TEXT
research
07/27/2017

Enabling Mutation Testing for Android Apps

Mutation testing has been widely used to assess the fault-detection effe...
research
07/14/2021

DeepMutants: Training neural bug detectors with contextual mutations

Learning-based bug detectors promise to find bugs in large code bases by...
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...
research
02/12/2020

DeepMutation: A Neural Mutation Tool

Mutation testing can be used to assess the fault-detection capabilities ...
research
01/09/2023

Efficient Mutation Testing via Pre-Trained Language Models

Mutation testing is an established fault-based testing technique. It ope...
research
07/02/2023

LLM4CBI: Taming LLMs to Generate Effective Test Programs for Compiler Bug Isolation

Compiler bugs pose a significant threat to safety-critical applications,...
research
03/01/2023

The Inversive Relationship Between Bugs and Patches: An Empirical Study

Software bugs pose an ever-present concern for developers, and patching ...

Please sign up or login with your details

Forgot password? Click here to reset