The Inversive Relationship Between Bugs and Patches: An Empirical Study

03/01/2023
by   Jinhan Kim, et al.
0

Software bugs pose an ever-present concern for developers, and patching such bugs requires a considerable amount of costs through complex operations. In contrast, introducing bugs can be an effortless job, in that even a simple mutation can easily break the Program Under Test (PUT). Existing research has considered these two opposed activities largely separately, either trying to automatically generate realistic patches to help developers, or to find realistic bugs to simulate and prevent future defects. Despite the fundamental differences between them, however, we hypothesise that they do not syntactically differ from each other when considered simply as code changes. To examine this assumption systematically, we investigate the relationship between patches and buggy commits, both generated manually and automatically, using a clustering and pattern analysis. A large scale empirical evaluation reveals that up to 70 similarity between their lexical patterns; further, 44 be abstracted into the identical change patterns. Moreover, we investigate whether code mutation tools can be used as Automated Program Repair (APR) tools, and APR tools as code mutation tools. In both cases, the inverted use of mutation and APR tools can perform surprisingly well, or even better, when compared to their original, intended uses. For example, 89 SequenceR, a deep learning based APR tool, can also be found by its inversion, i.e., a model trained with faults and not patches. Similarly, real fault coupling study of mutants reveals that TBar, a template based APR tool, can generate 14 and Major respectively, when used as a mutation tool.

READ FULL TEXT
research
07/10/2018

Practical Program Repair via Bytecode Mutation

Software debugging is tedious, time-consuming, and even error-prone by i...
research
06/09/2023

Reinforcement Learning for Mutation Operator Selection in Automated Program Repair

Automated program repair techniques aim to aid software developers with ...
research
02/16/2019

Getafix: Learning to fix bugs automatically

Static analyzers, including linters, can warn developers about programmi...
research
04/06/2021

A large-scale study on human-cloned changes for automated program repair

Research in automatic program repair has shown that real bugs can be aut...
research
03/20/2019

TBar: Revisiting Template-based Automated Program Repair

Fix patterns (a.k.a fix templates) are the main ingredients that drive a...
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
02/07/2023

Impact of Combining Syntactic and Semantic Similarities on Patch Prioritization while using the Insertion Mutation Operators

Patch prioritization ranks candidate patches based on their likelihood o...

Please sign up or login with your details

Forgot password? Click here to reset