[論文レビュー] Large Language Models in Fault Localisation
本研究は Defects4J における fault localisation のために ChatGPT-3.5 と ChatGPT-4 を評価し、ChatGPT-4 (Log) が関数レベルの文脈内で最良の TOP-1 パフォーマンスを示すが、クラスレベルの文脈になるとその効果は大幅に低下することを明らかにした;補助的なエラーログは精度と一貫性を向上させる。
Large Language Models (LLMs) have shown promise in multiple software engineering tasks including code generation, program repair, code summarisation, and test generation. Fault localisation is instrumental in enabling automated debugging and repair of programs and was prominently featured as a highlight during the launch event of ChatGPT-4. Nevertheless, the performance of LLMs compared to state-of-the-art methods, as well as the impact of prompt design and context length on their efficacy, remains unclear. To fill this gap, this paper presents an in-depth investigation into the capability of ChatGPT-3.5 and ChatGPT-4, the two state-of-the-art LLMs, on fault localisation. Using the widely-adopted large-scale Defects4J dataset, we compare the two LLMs with the existing fault localisation techniques. We also investigate the consistency of LLMs in fault localisation, as well as how prompt engineering and the length of code context affect the fault localisation effectiveness. Our findings demonstrate that within function-level context, ChatGPT-4 outperforms all the existing fault localisation methods. Additional error logs can further improve ChatGPT models' localisation accuracy and consistency, with an average 46.9% higher accuracy over the state-of-the-art baseline SmartFL on the Defects4J dataset in terms of TOP-1 metric. However, when the code context of the Defects4J dataset expands to the class-level, ChatGPT-4's performance suffers a significant drop, with 49.9% lower accuracy than SmartFL under TOP-1 metric. These observations indicate that although ChatGPT can effectively localise faults under specific conditions, limitations are evident. Further research is needed to fully harness the potential of LLMs like ChatGPT for practical fault localisation applications.
研究の動機と目的
- Defects4J の実データのバグに対する fault localisation における ChatGPT-3.5 および ChatGPT-4 の能力を評価する。
- ChatGPT ベースの localisation を最先端のベースライン(SBFL、MBFL、SmartFL)と比較する。
- プロンプト設計とコードコンテキスト長が localisation の有効性に与える影響を調査する。
- 繰り返し実験における一貫性を評価し、エラーログとコンテキストが localisation に与える影響を検証する。
- より新しいデータセットである StuDefects へ評価を拡張することで過学習の懸念に対処する。
提案手法
- Defects4J の Java プロジェクトを6つ使用して fault localisation 手法を評価する。
- SBFL(Ochiai、Dstar)、MBFL(Metallaxis ベース)、SmartFL、および4つの ChatGPT 設定(Origin/Log プロンプトを使用した ChatGPT-3.5/4)を比較する。
- LLM のトークン制限に合わせて関数レベルのコードコンテキストを用い、ChatGPT のコンテキストをベースラインに合わせる。
- プロンプトには origin バージョン(ターゲット関数のみ)と log バージョン(対話内の故障ログとエラーメッセージ)を含む。
- TOP-N(TOP-1 から TOP-5)を用いて評価し、5回の繰り返しで平均化する;有意性には Wilcoxon の符号付き順位検定を用いる。
- Defects4J 以外の generalisability を検証するため StuDefects へ分析を拡張する。
実験結果
リサーチクエスチョン
- RQ1RQ1. 最先端のベースラインと比較して、ChatGPT は fault localisation においてどの程度の性能を示すか?
- RQ2RQ1.1 Defects4J における TOP-N 指標で ChatGPT-3.5 および ChatGPT-4 はどのように性能を示すか?
- RQ3RQ1.2 繰り返し実験において ChatGPT の fault localisation はどれだけ一貫しているか?
- RQ4RQ2 コンポーネントの有無を含むプロンプト設計は ChatGPT の fault localisation の性能にどう影響するか?
- RQ5RQ3 プロンプト内のコードコンテキストの長さは ChatGPT の性能にどのように影響するか?
主な発見
- ChatGPT-4 (Log) は平均 TOP-1 が 23.13 で最も高く、Defects4J で SmartFL を 46.9% 上回る。
- ChatGPT-4 (Log) は Defects4J で他の設定と比べて TOP-1 から TOP-5 にかけてより高い TOP-N 値を示す。
- ChatGPT-4 (Log) は他の手法との重複が最も高く、他のベースラインには捉えられない多くの固有の欠陥を特定する。
- 関数レベルからクラスレベルへとコードコンテキストを拡張すると、ChatGPT-4 の有効性が著しく低下し、SmartFL と比較して TOP-1 が 49.9% 減少する。
- エラーログをプロンプトに組み込むことが最も影響力のある要素であり、省略すると正確度が 25.6% 減少する。
- 拡張された StuDefects の評価は Defects4J と整合する結果を示し、ChatGPT-4 (Log) は TOP-1 で最先端を約 52.9% 上回る。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。