paperbot · PL 论文追踪

全部论文 待读 收藏

P2 LLM-Based Test Case Generation in DBMS through Monte Carlo Tree Search

基于 LLM 的 DBMS 测试用例生成:通过蒙特卡洛树搜索
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文关注 DBMS 的 SQL 测试用例生成,属于测试/模糊测试方向,而非用户核心关注的静态分析、形式化验证、浮点程序分析或贝叶斯程序分析;虽使用 LLM 与 MCTS,但与所列 PL 与 AI 交叉方向匹配有限。引用 0 inbox
Yujia Chen, Yingli Zhou, Fangyuan Zhang, Cuiyun Gao
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 MIST,用特征引导的错误驱动合成与 MCTS 变异,为专有 SQL 方言生成语法有效且高覆盖的测试用例。

数据库管理系统(DBMS)的可靠性依赖高质量 SQL 测试用例,但传统 fuzzing 在适配专有 SQL 方言时需要大量人工改造。轻量级大语言模型(LLM)虽可在安全与隐私约束下部署,却难以生成符合专有方言语法的查询,且生成的查询语义雷同、执行路径浅,覆盖率迅速饱和。为此,作者提出 MIST:一个基于 LLM 与蒙特卡洛树搜索的 DBMS 测试用例生成框架,分两阶段。第一阶段为特征引导的错误驱动测试用例合成,构建层次化特征树并利用错误反馈引导 LLM 生成,以产出语法有效、语义多样的方言查询;第二阶段为基于 MCTS 的测试用例变异,在覆盖率反馈下联合优化种子查询选择与变异规则应用,从而探索更深执行路径。作者在三个常用 DBMS 与四个轻量 LLM 上评估,相比行覆盖率最高的基线方法,行覆盖率平均提升 43.3%、函数覆盖率提升 32.3%、分支覆盖率提升 46.4%,在 Optimizer 模块的行覆盖率达 69.3%。

问题
如何在安全与隐私约束下使用轻量级 LLM 为不同专有 SQL 方言生成语法有效、语义多样且能深入执行的测试用例,避免传统 fuzzing 的方言适配开销与 LLM 生成查询的覆盖率饱和。
方法
提出 MIST 两阶段框架:先以层次化特征树结合错误反馈引导 LLM 合成方言相关的有效查询,再用蒙特卡洛树搜索联合优化种子查询选择与变异规则应用,并以覆盖率反馈指导搜索。
评估
在三个广泛使用的 DBMS 与四个轻量级 LLM 上进行实验,与行覆盖率最高的基线对比,报告行、函数、分支覆盖率的提升以及 Optimizer 模块的覆盖情况。
原文摘要(Abstract)

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 to 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.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2603-21530,
  title = {LLM-Based Test Case Generation in DBMS through Monte Carlo Tree Search},
  author = {Yujia Chen and Yingli Zhou and Fangyuan Zhang and Cuiyun Gao},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3774748.3793625}
}