Skip to main content
QUICK REVIEW

[論文レビュー] Can We Classify Flaky Tests Using Only Test Code? An LLM-Based Empirical Study

Alexander Berndt, Vekil Bekmyradov|arXiv (Cornell University)|Feb 5, 2026
Software Engineering Research被引用数 0
ひとこと要約

研究は大規模言語モデルがテストコードのみを用いて崩れやすいテストを分類できるかを評価しており、LLMはこのタスクに苦戦し、MCCスコアは低く、顕著な非決定性があり、追加の文脈なしでは人間の実現性が限られることを示している。

ABSTRACT

Flaky tests yield inconsistent results when they are repeatedly executed on the same code revision. They interfere with automated quality assurance of code changes and hinder efficient software testing. Previous work evaluated approaches to train machine learning models to classify flaky tests based on identifiers in the test code. However, the resulting classifiers have been shown to lack generalizability, hindering their applicability in practical environments. Recently, pre-trained Large Language Models (LLMs) have shown the capability to generalize across various tasks. Thus, they represent a promising approach to address the generalizability problem of previous approaches. In this study, we evaluated three LLMs (two general-purpose models, one code-specific model) using three prompting techniques on two benchmark datasets from prior studies on flaky test classification. Furthermore, we manually investigated 50 samples from the given datasets to determine whether classifying flaky tests based only on test code is feasible for humans. Our findings indicate that LLMs struggle to classify flaky tests given only the test code. The results of our best prompt-model combination were only marginally better than random guessing. In our manual analysis, we found that the test code does not necessarily contain sufficient information for a flakiness classification. Our findings motivate future work to evaluate LLMs for flakiness classification with additional context, for example, using retrieval-augmented generation or agentic AI.

研究の動機と目的

  • 事前学習済みLLMがタスク特定の微調整なしでテストコードだけを用いて崩れやすいテストを分類できるかを評価する。
  • ベンチマークデータセットを横断して、ゼロショット、ゼロショットCoT、few-shot CoTの複数プロンプト戦略を評価する。
  • LLMベースの分類の決定性を分析し、テストコードに基づく崩れやすさに対する人間の判断と比較する。
  • 追加の文脈や検索拡張アプローチを組み込む将来の研究に向けた提言を提供する。

提案手法

  • 温度0で4つのプロンプト設定の下で3つのLLM(GPT-4o、GPT-OSS-120b、Qwen3-Coder-480b)を評価する。
  • ゼロショット、ゼロショットの連鎖思考(CoT)、およびfew-shotの連鎖思考プロンプトを用い、6つのインコンテキストデモ(3つは崩れやすい、3つは非崩れやすい)を用意する。
  • 崩れやすさの2つのベンチマーク(IDoFTサブセットとFlakeBench)で評価し、加重precision、加重recall、加重F1、MCCを測定する。
  • 設定ごとに3回の繰り返しで正規化ハミング距離を用いて非決定性を評価する。
  • IDoFTからの50サンプルについて、テストコードのみでの分類の実現性を評価する人間の判断調査を実施する。

実験結果

リサーチクエスチョン

  • RQ1RQ1: ゼロショット、ゼロショットCoT、few-shot CoTプロンプト下で、テストコードに基づく崩れやすさテスト分類におけるLLMの性能はどうか。
  • RQ2RQ2: 繰り返し実行におけるLLMベースの崩れやすさ分類の非決定性の程度はどれくらいか。
  • RQ3RQ3: 人間はテストコードのみを用いて崩れやすいテストをどの程度分類できるか。

主な発見

  • LLMsはテストコードのみを用いた崩れやすさ分類で、両データセットを通じて不十分な性能を示す。
  • IDoFTではfew-shot CoTで得られる最良のMCCは0.27;FlakeBenchではGPT-OSSのゼロショットプロンプトでMCCが0.17にピーク。
  • few-shotプロンプトは一般目的モデルのIDoFT結果を概ね改善するが、全体の性能は依然として乏しく(MCC≤0.27)。
  • 顕著な非決定性が観測され(設定ごとに正規化ハミング距離が最大0.25に達する場合あり)、本番運用での信頼性に懸念を生む。
  • Qwen-Codeは全体的に非決定性が低く、いくつかの設定では繰り返しで同一結果を得られる。
  • 人間の分析は、テストコードだけではより高度な崩れのタイプを識別するには不十分であり、いくつかの崩れはテストコードを超えた文脈を必要とする。

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

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

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

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