Skip to main content
QUICK REVIEW

[Paper Review] A Critical Review of Large Language Model on Software Engineering: An Example from ChatGPT and Automated Program Repair

Quanjun Zhang, Tongke Zhang|arXiv (Cornell University)|Oct 13, 2023
Software Engineering ResearchComputer Science31 citations
TL;DR

The paper constructs EvalGPTFix to evaluate ChatGPT’s automated program repair capabilities on unseen Java bugs from AtCoder, showing ChatGPT fixes 109 of 151 bugs with a basic prompt and up to 143 bugs when using enhanced prompts and dialogues, outperforming CodeT5 and PLBART. It also analyzes prompt designs, dialogue-based repair, and data-leakage concerns around black-box LLMs in SE.

ABSTRACT

Large Language Models (LLMs) have been gaining increasing attention and demonstrated promising performance across a variety of Software Engineering (SE) tasks, such as Automated Program Repair (APR), code summarization, and code completion. For example, ChatGPT, the latest black-box LLM, has been investigated by numerous recent research studies and has shown impressive performance in various tasks. However, there exists a potential risk of data leakage since these LLMs are usually close-sourced with unknown specific training details, e.g., pre-training datasets. In this paper, we seek to review the bug-fixing capabilities of ChatGPT on a clean APR benchmark with different research objectives. We first introduce {\benchmark}, a new benchmark with buggy and the corresponding fixed programs from competitive programming problems starting from 2023, after the training cutoff point of ChatGPT. The results on {\benchmark} show that ChatGPT is able to fix 109 out of 151 buggy programs using the basic prompt within 35 independent rounds, outperforming state-of-the-art LLMs CodeT5 and PLBART by 27.5\% and 62.4\% prediction accuracy. We also investigate the impact of three types of prompts, i.e., problem description, error feedback, and bug localization, leading to additional 34 fixed bugs. Besides, we provide additional discussion from the interactive nature of ChatGPT to illustrate the capacity of a dialog-based repair workflow with 9 additional fixed bugs. Inspired by the findings, we further pinpoint various challenges and opportunities for advanced SE study equipped with such LLMs (e.g.,~ChatGPT) in the near future. More importantly, our work calls for more research on the reevaluation of the achievements obtained by existing black-box LLMs across various SE tasks, not limited to ChatGPT on APR.

Motivation & Objective

  • Assess the bug-fixing effectiveness of ChatGPT on a clean, unseen APR benchmark (EvalGPTFix).
  • Investigate how different prompts (problem description, error feedback, bug localization) influence repair performance.
  • Explore whether dialogue-based interaction improves iterative bug fixing with ChatGPT.

Proposed method

  • Construct EvalGPTFix: 151 buggy-correct Java pairs from AtCoder contests (2023) with test-case-based validation and static/dynamic filtering to ensure unseen data.
  • Use ChatGPT (gpt-3.5-turbo) with repeated prompts to fix each bug across up to 35 rounds, stopping when no new fixes occur for three consecutive rounds.
  • Benchmark against state-of-the-art LLMs CodeT5 and PLBART by fine-tuning them on FixEval data and evaluating patches against AtCoder test suites.
  • Evaluate prompts by adding: (a) problem descriptions, (b) error information, (c) bug localization, and (d) interactive dialogues, measuring additional fixed bugs.
  • Report recall, bug-type fix rates, and cross-model overlap to assess relative strengths.

Experimental results

Research questions

  • RQ1RQ1: How effective is ChatGPT at repairing buggy programs in EvalGPTFix?
  • RQ2RQ2: How do different prompts affect ChatGPT’s repair performance?
  • RQ3RQ3: Can dialogue-based interaction further improve ChatGPT’s repair outcomes?

Key findings

  • ChatGPT fixed 109 of 151 bugs with the basic prompt in EvalGPTFix.
  • Adding problem descriptions, error information, and bug localization fixed an additional 18, 25, and 10 bugs, respectively.
  • Dialogues contributed 9 more fixes beyond prompt-based attempts.
  • Overall, ChatGPT fixed 143 bugs in EvalGPTFix, indicating strong potential for repairing real-world buggy programs.
  • CodeT5 fixed 79 bugs and PLBART fixed 41 bugs, showing ChatGPT’s superior repair capability in this study.
  • There is a notable randomness in ChatGPT’s outputs, requiring multiple rounds (up to 35) to stabilize results.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.