[論文レビュー] LLM-Based Test Case Generation in DBMS through Monte Carlo Tree Search
MIST は階層的特徴ツリーとモンテカルロ木探索に guided された軽量 LLM を用いて DBMS の SQL テストケースを生成し、パース、最適化、実行、ストレージの各段階でのコードカバレッジを改善します。
Database Management Systems (DBMSs) are fundamental infrastructure for modern data-driven applications, where thorough testing with high-quality SQL test cases is essential for ensuring system reliability. Traditional approaches such as fuzzing can be effective for specific DBMSs, but adapting them to different proprietary dialects requires substantial manual effort. Large Language Models (LLMs) present promising opportunities for automated SQL test generation, but face critical challenges in industrial environments. First, lightweight models are widely used in organizations due to security and privacy constraints, but they struggle to generate syntactically valid queries for proprietary SQL dialects. Second, LLM-generated queries are often semantically similar and exercise only shallow execution paths, thereby quickly reaching a coverage plateau. To address these challenges, we propose MIST, an LLM-based test case generatIon framework for DBMS through Monte Carlo Tree search. MIST consists of two stages: Feature-Guided Error-Driven Test Case Synthetization, which constructs a hierarchical feature tree and uses error feedback to guide LLM generation, aiming to produce syntactically valid and semantically diverse queries for different DBMS dialects, and Monte Carlo Tree Search-Based Test Case Mutation, which jointly optimizes seed query selection and mutation rule application guided by coverage feedback, aiming at boosting code coverage by exploring deeper execution paths. Experiments on three widely-used DBMSs with four lightweight LLMs show that MIST achieves average improvements of 43.3% in line coverage, 32.3% in function coverage, and 46.4% in branch coverage compared to the baseline approach with the highest line coverage of 69.3% in the Optimizer module.
研究の動機と目的
- DBMS の多様な方言と深い実行経路を捉える高品質な SQL テストケースを生成して robust なテストを促進する。
- 機能ガイド付き・エラー駆動の合成段階と MCTS ベースのミューテーション段階を用いて DAL/意味的ギャップを克服する。
- locally 展開された軽量 LLM のみを用いて DBMS コンポーネント全体のコードカバレッジを高める。
- 広範な実験を通じて異なる DBMS アーキテクチャと異なる LLM サイズに対する汎用性を示す。
提案手法
- 公式 DBMS ドキュメントから階層的特徴ツリーを構築し、LLM ベースのテストケース生成を誘導する。
- 実行されたテストからのエラーフィードバックを用いて、特徴ガイド付き・エラー駆動の合成 prompts を反復的に洗練する。
- カバレッジフィードバックに guided され、135 の方言対応ミューテーションルールを用いてテストケースを変異・拡張するためのモンテカルロ木探索を適用する。
- テストケースの成功を、機能的正しさではなく構文の妥当性とランタイムの安定性に焦点を当てた暗黙のオラクルとして扱う。
- 実行前に生成された SQL を後処理して実行可能性を確保し、非 SQL コンテンツを除去する。

実験結果
リサーチクエスチョン
- RQ1RQ1: MIST はベースラインと比較して DBMS のコードカバレッジをどの程度改善するか?
- RQ2RQ2: MIST は異なる DBMS モジュール(Parser、Optimizer、Executor、Storage)でどう性能を示すか?
- RQ3RQ3: カバレッジ向上に対する二段階(合成と変異)の寄与はどの程度か?
- RQ4RQ4: 結果は異なる LLM サイズと DBMS アーキテクチャに一般化するか?
主な発見
- MIST はベースラインと比べて行カバレッジを平均 43.3%、関数カバレッジを 32.3%、分岐カバレッジを 46.4% 向上させる。
- MIST は Optimizer モジュールで最も高い行カバレッジを達成(DuckDB 69.3%、PostgreSQL 63.4%)。
- DuckDB、PostgreSQL、SQLite のすべてで改善が観察され、4 つの評価対象 LLM 全体で、小型モデルが大きなベースラインを上回るケースも見られた。
- モジュールレベルの結果は、DuckDB および PostgreSQL の Parser、Optimizer、Executor、Storage の各領域で大幅な向上を示す。

より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。