DeepAI AI Chat
Log In Sign Up

Learning How to Mutate Source Code from Bug-Fixes

by   Michele Tufano, et al.
USI Università della Svizzera italiana
William & Mary

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.


Enabling Mutation Testing for Android Apps

Mutation testing has been widely used to assess the fault-detection effe...

DeepMutants: Training neural bug detectors with contextual mutations

Learning-based bug detectors promise to find bugs in large code bases by...

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...

DeepMutation: A Neural Mutation Tool

Mutation testing can be used to assess the fault-detection capabilities ...

Efficient Mutation Testing via Pre-Trained Language Models

Mutation testing is an established fault-based testing technique. It ope...

The Inversive Relationship Between Bugs and Patches: An Empirical Study

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

Empirical Notes on the Interaction Between Continuous Kernel Fuzzing and Development

Fuzzing has been studied and applied ever since the 1990s. Automated and...