Skip to main content
QUICK REVIEW

[論文レビュー] A Differential Fuzzing-Based Evaluation of Functional Equivalence in LLM-Generated Code Refactorings

Simantika Dristi, Matthew B. Dwyer|arXiv (Cornell University)|Feb 17, 2026
Software Testing and Debugging Techniques被引用数 0
ひとこと要約

この論文は differential fuzzing(Eq@DFuzz)を用いて、6つのモデル、3つのデータセット、2種類のリファクタリングにわたるLLM生成コードのリファクタリングの機能的同等性を評価し、実質的な非同等性とテストスイートを用いた評価のギャップを明らかにする。

ABSTRACT

With the rapid adoption of large language models (LLMs) in automated code refactoring, assessing and ensuring functional equivalence between LLM-generated refactoring and the original implementation becomes critical. While prior work typically relies on predefined test cases to evaluate correctness, in this work, we leverage differential fuzzing to check functional equivalence in LLM-generated code refactorings. Unlike test-based evaluation, a differential fuzzing-based equivalence checker needs no predefined test cases and can explore a much larger input space by executing and comparing thousands of automatically generated test inputs. In a large-scale evaluation of six LLMs (CodeLlama, Codestral, StarChat2, Qwen-2.5, Olmo-3, and GPT-4o) across three datasets and two refactoring types, we find that LLMs show a non-trivial tendency to alter program semantics, producing 19-35% functionally non-equivalent refactorings. Our experiments further demonstrate that about 21% of these non-equivalent refactorings remain undetected by the existing test suites of the three evaluated datasets. Collectively, the findings of this study imply that reliance on existing tests might overestimate functional equivalence in LLM-generated code refactorings, which remain prone to semantic divergence.

研究の動機と目的

  • LLM主導のコードリファクタリングをテストパス指標以上で信頼性のある評価へ動機づける。
  • 多様なデータセット上で複数のLLMが生成したリファクタリングの機能的同等性を評価する。
  • 従来のテストスイートは意味論的差異のかなりの部分を見逃す可能性があることを示す。

提案手法

  • 6つのLLM(CodeLlama, Codestral, StarChat2, Qwen-2.5, Olmo-3, GPT-4o)を用いてリファクタリングを生成する。
  • 2つのプロンプト(性能最適化とコード簡略化)を適用し、3つのデータセットで4,368件のリファクタリングを生成する。
  • 機能的同等性を Eq@DFuzz で評価する。Eq@DFuzz はリファクタリングごとに1,000–2,000件のテスト入力を生成する差分ファジングチェッカー。
  • Eq@DFuzz の結果を従来のテストスイートの正確性(Corr@Test)と比較する。
  • データセット(HumanEval, MBPP, APPS)とリファクタリングタイプ(単純化、最適化)を横断して同等性を分析する。
  • 非同等リファクタリングとテストスイートのギャップを報告する。
Figure 1. Overview of our approach
Figure 1. Overview of our approach

実験結果

リサーチクエスチョン

  • RQ1RQ1: 差分ファジングに従って、LLM生成コードリファクタリングのうち元のコードと機能的に同等とされる割合はどれくらいか?
  • RQ2RQ2: 既存のテストスイートは非同等を信頼性高く検出するか、それとも Eq@DFuzz に比してギャップがあるか?
  • RQ3RQ3: データセットとリファクタリングタイプによって同等性の割合はどう変化するか?
  • RQ4RQ4: リファクタリングの複雑さは意味論的偏差の可能性に影響を与えるか?

主な発見

ModelRefactoringHEMBPPAPPSOverall
CodeLlamaSimplification33.33%24.24%26.55%26.23%
CodeLlamaOptimization30.95%23.19%15.93%
CodestralSimplification23.81%36.07%40.35%35.14%
CodestralOptimization27.12%50.85%42.11%
StarChat2Simplification26.23%33.33%45.54%34.24%
StarChat2Optimization32.28%32.20%35.40%
Qwen-2.5Simplification13.18%27.14%30.09%22.01%
Qwen-2.5Optimization18.32%18.18%27.52%
Olmo-3Simplification18.55%12.70%43.88%21.73%
Olmo-3Optimization14.40%8.96%28.09%
GPT-4oSimplification8.53%15.71%20.18%18.58%
GPT-4oOptimization19.69%27.42%28.57%
  • LLMs はモデル、データセット、リファクタリングタイプを横断して、非同等リファクタリングの割合が substantial(19-35%)である。
  • APPS データセットは非同等性が最も高く(32.09%)、MBPP(25.33%)および HumanEval(22.10%)と比較して顕著。
  • 非同等率は単純化と最適化の間でほぼ同等(約26%)。
  • 非同等リファクタリングの約21% が既存スイートの全テストを通過(Corr@Test = 1)するが、Eq@DFuzz では非同等。
  • テストスイートへの依存は、LLM生成リファクタリングの機能的同等性を過大評価する可能性がある。

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

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

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

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