Skip to main content
QUICK REVIEW

[論文レビュー] An Analysis of the Automatic Bug Fixing Performance of ChatGPT

Dominik Sobania, Martin Briesch|arXiv (Cornell University)|Jan 20, 2023
Software Testing and Debugging Techniques被引用数 49
ひとこと要約

ChatGPT のバグ修正性能は QuixBugs で Codex および CoCoNut と競合しており、標準 APR よりはるかに優れている。対話ヒントを用いると成功率が著しく上昇する(最大で 31 of 40)。

ABSTRACT

To support software developers in finding and fixing software bugs, several automated program repair techniques have been introduced. Given a test suite, standard methods usually either synthesize a repair, or navigate a search space of software edits to find test-suite passing variants. Recent program repair methods are based on deep learning approaches. One of these novel methods, which is not primarily intended for automated program repair, but is still suitable for it, is ChatGPT. The bug fixing performance of ChatGPT, however, is so far unclear. Therefore, in this paper we evaluate ChatGPT on the standard bug fixing benchmark set, QuixBugs, and compare the performance with the results of several other approaches reported in the literature. We find that ChatGPT's bug fixing performance is competitive to the common deep learning approaches CoCoNut and Codex and notably better than the results reported for the standard program repair approaches. In contrast to previous approaches, ChatGPT offers a dialogue system through which further information, e.g., the expected output for a certain input or an observed error message, can be entered. By providing such hints to ChatGPT, its success rate can be further increased, fixing 31 out of 40 bugs, outperforming state-of-the-art.

研究の動機と目的

  • ChatGPT の自動バグ修正性能を標準ベンチマーク (QuixBugs) で評価する。
  • ChatGPT を Codex および伝統的な深層学習型 APR 手法 (CoCoNut, Codex) と比較する。
  • 対話ドリブンなヒントが ChatGPT のバグ修正成功に与える影響を調査する。
  • ChatGPT の応答タイプとフォローアップ対話が修正率に与える影響を特徴づける。

提案手法

  • QuixBugs の Python バグ(40 問題)をベンチマークとして使用する。
  • 各問題につき four 回 ChatGPT に以下のプロンプトで問い合わせる: 'Does this program have a bug? How to fix it?'(コメントなし)。
  • Ye らの既存文献の標準 APR 手法(2021 年)と DL ベースの手法 CoCoNut(Lutellier ら)および Codex(Prenner ら)と比較する。
  • ChatGPT の回答を事前に定義されたカテゴリに分類し、情報量の多さ、バグが見つからない場合、正しい修正などの応答パターンを分析する。
  • ヒントを提供して ChatGPT との対話を行い、修正率への影響を測定する(フォローアップのリクエストの効果を検証)。

実験結果

リサーチクエスチョン

  • RQ1ChatGPT は QuixBugs における Codex、CoCoNut、従来の APR アプローチと比較して自動バグ修正でどの程度実績を示すか?
  • RQ2対話ベースのヒントを組み込むことで ChatGPT のバグ修正成功率は向上するか?
  • RQ3バグ修正を求められた際に ChatGPT が生成する応答の種類は何で、これらは修正結果にどう影響するか?
  • RQ4追加情報(ヒント)のフォローアップが ChatGPT のバグ修正能力をどの程度高めるか?

主な発見

Benchmark problemChatGPTCodex [15]CoCoNut [14]Standard APR [13]
bitcount✗ (0 / 4)
breadth-first-search✓ (2 / 4)
bucketsort✓ (4 / 4)
depth-first-search✗ (0 / 4)
detect-cycle✗ (0 / 4)
find-first-in-sorted✓ (2 / 4)
find-in-sorted✓ (3 / 4)
flatten✓ (4 / 4)
gcd✗ (0 / 4)
get-factors✓ (1 / 4)
hanoi✗ (0 / 4)
is-valid-parenthesization✓ (2 / 4)
kheapsort✗ (0 / 4)
knapsack✓ (1 / 4)
kth✗ (0 / 4)
lcs-length✗ (0 / 4)
levenshtein✗ (0 / 4)
lis✗ (0 / 4)
longest-common-subsequence✗ (0 / 4)
max-sublist-sum✗ (0 / 4)
mergesort✓ (1 / 4)
minimum-spanning-tree✗ (0 / 4)
next-palindrome✓ (1 / 4)
next-permutation✗ (0 / 4)
pascal✓ (1 / 4)
possible-change✓ (1 / 4)
powerset✗ (0 / 4)
quicksort✓ (1 / 4)
reverse-linked-list✓ (2 / 4)
rpn-eval✗ (0 / 4)
shortest-path-length✓ (1 / 4)
shortest-path-lengths✗ (0 / 4)
shortest-paths✓ (1 / 4)
shunting-yard✓ (2 / 4)
sieve✗ (0 / 4)
sqrt✓ (1 / 4)
subsequences✓ (1 / 4)
to-base✗ (0 / 4)
topological-ordering✗ (0 / 4)
wrap✗ (0 / 4)
Σ (Solved)1921197
  • ChatGPT は 40 個のバグのうち 19 件を修正し、Codex (21) および CoCoNut (19) と比較しても遜色がなく、標準 APR よりははるかに優れている。
  • 対話によって ChatGPT の性能が向上する可能性があり、ヒントを提供すると 40 問中 31 問の修正に達する。
  • ChatGPT の結果には問題ごとのばらつきが大きく、修正は 1 回〜 2 回の実行で現れることが多い(bucket sort/flatten などの全実行で修正される問題もある)。
  • 従来の APR と比較すると、DL ベースのモデルは修正率が高い傾向を示す。これはより広い探索と learned repair パターンの学習による可能性が高い。一方、標準 APR はテストスイートへの過適合を起こしやすい。
  • 対話を可能にするインタラクションは、失敗入力や期待出力のようなターゲット情報の交換を可能にし、修正成功を大幅に高める。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。