arXiv論文メモ
新着一覧
cs.SE · 査読状況未確認

記号実行と大規模言語モデルを組み合わせたテスト生成

NEUROTESTGEN: Neuro-Symbolic Guided Test Generation with Large Language Models

Ruixin Zhang, Jiho Shin, Hung Viet Pham, Song Wang

この論文をやさしく読む

ひとことで言うと

通したいコードの行や分岐を指定し、記号実行で得た条件を言語モデルに渡してテストを作る方法です。

何に役立つ?

複雑な経路条件を持つプログラムで、狙った箇所を実行するテストケースを生成する際に役立つと考えられます。

この研究の面白いところ

記号実行が正確な経路条件を示し、言語モデルが具体的なテストを作る構成で、失敗したテストへの修正指針も反復して与えます。

どこまで分かった?

要旨ではベンチマークでの優位性を述べていますが、改善幅や対象プロジェクトの詳細な条件は示していません。反復は対象に到達するか設定した上限までです。

v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。

アブストラクトの日本語訳

高い構造的網羅率を確保することは、自動テスト生成の基本的な課題であり、特に特定の行や分岐に到達するために複雑な制御フローとデータフローの制約を満たす必要があるソフトウェアでは難しい。大規模言語モデル(LLM)は人間が書くようなテストケースを作れる一方、厳密な経路条件を満たす入力の生成は苦手である。逆に記号実行は制約を体系的に導けるが、現実的で実行可能なテストケースの構築が難しく、規模を拡大しにくい。本研究は、必要なコード網羅率を狙うテストケースを生成するため、記号実行とLLMによるテスト合成を統合したNEUROTESTGENを提案する。メソッド内で対象とする文の集合が与えられると、まず記号解析エンジンであるZ3 SMTソルバーを用い、経路ごとの制約を抽出して目的の網羅率に向けた記号的な指針を作る。この指針に従ってLLMが、構造的に妥当で意味のある具体的なテストケースを合成する。SMTソルバーでは扱いにくい複雑なオブジェクトの制約を含む経路では、LLMを利用してもっともらしい制約を推定する。さらに、生成されたテストを検証して修正の指針を返す反復的なフィードバックを組み込み、対象の行や分岐を通るか、設定した上限に達するまで続ける。広く使われているベンチマークによる実証評価では、Llama 3.3 70B1、GPT-4o Mini、Claude 3.5 Haiku3、Claude Sonnet 4.6を含む複数のLLMで、最先端の比較手法を有意に上回った。

v1の要旨から自動生成。本文の精読・人による確認は未実施。

初稿
2026-09-24(UTC)
最新改訂
2026-09-24 · v1
査読・掲載
査読状況未確認
arXivで読むPDF

更新履歴

取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。

原文の要旨

Ensuring high structural coverage remains a fundamental challenge in automated test generation, particularly for complex software systems where reaching specific lines or branches requires satisfying intricate control- and data-flow constraints. Large Language Models (LLMs) have recently demonstrated strong capabilities in producing human-like test cases; however, they often struggle to generate inputs that satisfy precise path conditions. Conversely, symbolic execution can systematically derive such constraints, but it often fails to construct realistic, executable test cases and is constrained by scalability limitations. In this paper, we introduce NEUROTESTGEN, a hybrid approach that integrates symbolic execution with LLM-driven test synthesis to generate test cases targeting on-demand code coverage. Given a set of target statements within a method, NEUROTESTGEN first employs a symbolic analysis engine (i.e., the Z3 SMT solver) to extract path-specific constraints and construct a symbolic guidance specification for the desired coverage goal. This specification is then used to guide an LLM in synthesizing concrete test cases that are both structurally valid and semantically meaningful. For paths involving complex object-related constraints that are difficult for SMT solvers to handle, NEUROTESTGEN leverages LLMs to infer plausible constraints. Furthermore, NEUROTESTGEN incorporates an iterative feedback loop that validates LLM-generated tests and provides corrective guidance until the target line or branch is covered or a limit is reached. Our empirical evaluation on a widely used benchmark demonstrates that NEUROTESTGEN significantly outperforms the state-of-the-art approach across multiple LLMs, including Llama 3.3 70B1, GPT-4o Mini, Claude 3.5 Haiku3, and Claude Sonnet 4.6.

arXiv ID: 2609.30178 / 要約の誤りについて