arrow
返回

Investigating large language models capabilities for automatic code repair in Python

delete2024-05-09
delete2
PRE
AI
S
Safwan Omari *
K
Kshitiz Basnet
M
Mohammad Wardat
DOI:10.1007/s10586-024-04490-8delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Developers often encounter challenges with their introductory programming tasks as part of the development process. Unfortunately, rectifying these mistakes manually can be time-consuming and demanding. Automated program repair (APR) techniques offer a potential solution by synthesizing fixes for such errors. Previous research has investigated the utilization of both symbolic and neural techniques within the APR domain. However, these approaches typically demand significant engineering efforts or extensive datasets and training. In this paper, we explore the potential of using a large language model trained on code, specifically, we assess ChatGPT's capability to detect and repair bugs in simple Python programs. The experimental evaluation encompasses two benchmarks: QuixBugs and Textbook. Each benchmark consists of simple Python functions that implement well-known algorithms and each function contains a single bug. To gauge repair performance in various settings, several benchmark variations were introduced including addition of plain English documentation and code obfuscation. Based on thorough experiments, we found that ChatGPT was able to correctly detect and fix about 50% of the methods, when code is documented. Repair performance drops to 25% when code is obfuscated, and 15% when documentation is removed and code is obfuscated. Furthermore, when compared to existing APR systems, ChatGPT considerably outperformed them.
Keyword:
Automatic program repair
Large language models
Python
Bug detection

期刊

C
Cluster Computing-The Journal of Networks Software Tools and Applications
IF:
4.1
论文数:
5.1K
被引数:
7.5K

机构

Lewis University 封面图
Lewis University
学者数:
122
论文数: 96
被引数: 58
O
Oakland University
学者数:
3.7K
论文数: 3.0K
被引数: 2.7K
引用论文

引用论文

A New System for Descriptive Classification of Stones in the Upper Urinary Tract
err1995-02-01
err0
PREAI
errSteinar J. Karlsen; Lars Grenabo; Goran Holmberg; Hans Colstrup; Troels Munch Jorgensen; Ossi Lindell; Martii Ala-Opas; Nils M. Ulvik; Alexander Schultz; Donald P. Griffith
err分享
err收藏
Structure and function of negative-strand RNA virus polymerase complexes
err2021-01-01
err0
PREAI
errJesse D. Pyle; Sean P.J. Whelan; Louis-Marie Bloyet
err分享
err收藏
Chapter Twenty‐Eight Qualitative and Quantitative Characterization of Autophagy in Caenorhabditis elegans by Electron Microscopy
err2008-01-01
err0
PREAI
errTimea Sigmond; Judit Fehér; Attila Baksa; Gabriella Pásti; Zsolt Pálfia; Krisztina Takács‐Vellai; János Kovács; Tibor Vellai; Attila L. Kovács
err分享
err收藏
Comprehensive cellular‐resolution atlas of the adult human brain
err2016-12-05
err0
errOAAI
errSong‐Lin Ding; Joshua J. Royall; Susan M. Sunkin; Lydia Ng; Benjamin A.C. Facer; Phil Lesnar; Angie Guillozet‐Bongaarts; Bergen McMurray; Aaron Szafer; Tim A. Dolbeare; Allison Stevens; Lee Tirrell; Thomas Benner; Shiella Caldejon; Rachel A. Dalley; Nick Dee; Christopher Lau; Julie Nyhus; Melissa Reding; Zackery L. Riley; David Sandman; Elaine Shen; Andre van der Kouwe; Ani Varjabedian; Michelle Write; Lilla Zollei; Chinh Dang; James A. Knowles; Christof Koch; John W. Phillips; Nenad Sestan; Paul Wohnoutka; H. Ronald Zielke; John G. Hohmann; Allan R. Jones; Amy Bernard; Michael J. Hawrylycz; Patrick R. Hof; Bruce Fischl; Ed S. LeinReference
err分享
err收藏
Land cover influences on juvenile Rainbow Trout diet composition and condition in Lake Michigan tributaries
err2018-06-27
err0
errOAAI
errKyle J. Brumm; Jory L. Jonas; Carson G. Prichard; Nicole M. Watson; Kevin L. Pangle
err分享
err收藏
GenProg: A Generic Method for Automatic Software Repair
err2012-01-01
err594
PREAI
errLe Goues, Claire; ThanhVu Nguyen; Forrest, Stephanie; Weimer, Westley
err分享
err收藏
学者 查看更多内容