Revisiting the Plastic Surgery Hypothesis via Large Language Models

03/18/2023
by   Chunqiu Steven Xia, et al.
0

Automated Program Repair (APR) aspires to automatically generate patches for an input buggy program. Traditional APR tools typically focus on specific bug types and fixes through the use of templates, heuristics, and formal specifications. However, these techniques are limited in terms of the bug types and patch variety they can produce. As such, researchers have designed various learning-based APR tools with recent work focused on directly using Large Language Models (LLMs) for APR. While LLM-based APR tools are able to achieve state-of-the-art performance on many repair datasets, the LLMs used for direct repair are not fully aware of the project-specific information such as unique variable or method names. The plastic surgery hypothesis is a well-known insight for APR, which states that the code ingredients to fix the bug usually already exist within the same project. Traditional APR tools have largely leveraged the plastic surgery hypothesis by designing manual or heuristic-based approaches to exploit such existing code ingredients. However, as recent APR research starts focusing on LLM-based approaches, the plastic surgery hypothesis has been largely ignored. In this paper, we ask the following question: How useful is the plastic surgery hypothesis in the era of LLMs? Interestingly, LLM-based APR presents a unique opportunity to fully automate the plastic surgery hypothesis via fine-tuning and prompting. To this end, we propose FitRepair, which combines the direct usage of LLMs with two domain-specific fine-tuning strategies and one prompting strategy for more powerful APR. Our experiments on the widely studied Defects4j 1.2 and 2.0 datasets show that FitRepair fixes 89 and 44 bugs (substantially outperforming the best-performing baseline by 15 and 8), respectively, demonstrating a promising future of the plastic surgery hypothesis in the era of LLMs.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/25/2022

Practical Program Repair in the Era of Large Pre-trained Language Models

Automated Program Repair (APR) aims to help developers automatically pat...
research
07/17/2022

Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learning

Due to the promising future of Automated Program Repair (APR), researche...
research
09/15/2023

Practical Program Repair via Preference-based Ensemble Strategy

To date, over 40 Automated Program Repair (APR) tools have been designed...
research
04/01/2023

Keep the Conversation Going: Fixing 162 out of 337 bugs for 0.42 each using ChatGPT

Automated Program Repair (APR) aims to automatically generate patches fo...
research
09/12/2023

RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair

Automatic program repair (APR) is crucial to reduce manual debugging eff...
research
12/21/2022

Improving Automated Program Repair with Domain Adaptation

Automated Program Repair (APR) is defined as the process of fixing a bug...
research
06/02/2023

Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errors

Although the dynamic type system of Python facilitates the developers in...

Please sign up or login with your details

Forgot password? Click here to reset