Reinforcement Learning for Mutation Operator Selection in Automated Program Repair

06/09/2023
by   Carol Hanna, et al.
0

Automated program repair techniques aim to aid software developers with the challenging task of fixing bugs. In heuristic-based program repair, a search space of program variants is created by applying mutation operations on the source code to find potential patches for bugs. Most commonly, every selection of a mutation operator during search is performed uniformly at random. The inefficiency of this critical step in the search creates many variants that do not compile or break intended functionality, wasting considerable resources as a result. In this paper, we address this issue and propose a reinforcement learning-based approach to optimise the selection of mutation operators in heuristic-based program repair. Our solution is programming language, granularity-level, and search strategy agnostic and allows for easy augmentation into existing heuristic-based repair tools. We conduct extensive experimentation on four operator selection techniques, two reward types, two credit assignment strategies, two integration methods, and three sets of mutation operators using 22,300 independent repair attempts. We evaluate our approach on 353 real-world bugs from the Defects4J benchmark. Results show that the epsilon-greedy multi-armed bandit algorithm with average credit assignment is best for mutation operator selection. Our approach exhibits a 17.3 improvement upon the baseline, by generating patches for 9 additional bugs for a total of 61 patched bugs in the Defects4J benchmark.

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
03/01/2023

The Inversive Relationship Between Bugs and Patches: An Empirical Study

Software bugs pose an ever-present concern for developers, and patching ...
research
08/18/2023

SHAPFUZZ: Efficient Fuzzing via Shapley-Guided Byte Selection

Mutation-based fuzzing is popular and effective in discovering unseen co...
research
10/30/2018

Multi-Location Program Repair: Roads Ahead

Automated program repair (APR) has great potential to reduce the effort ...
research
10/30/2018

Multi-Location Program Repair Strategies Learned from Past Successful Experience

Automated program repair (APR) has great potential to reduce the effort ...
research
12/06/2019

FlakiMe: Laboratory-Controlled Test Flakiness Impact Assessment. A Case Study on Mutation Testing and Program Repair

Much research on software testing makes an implicit assumption that test...
research
07/19/2018

FuzzerGym: A Competitive Framework for Fuzzing and Learning

Fuzzing is a commonly used technique designed to test software by automa...

Please sign up or login with your details

Forgot password? Click here to reset