paperbot · PL 论文追踪

全部论文 待读 收藏

P2 DBcover: A White-box SQL Test Generation Framework for Coverage Improvement

DBcover:面向覆盖率提升的白盒 SQL 测试生成框架
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文属于 LLM 驱动的数据库测试生成,结合动态分析与知识图谱提升 RDBMS 代码覆盖率,与用户关注的“LLM/Agent 改进静态分析/形式化验证”或“PL→AI 分析 ML/Agent 程序”不直接匹配;仅在 LLM+程序分析工具和工业落地方面有间接关联。引用 0 inbox
Yankai Rong, Shuang Liu, Jinhao Dong, Qiang Yin, Wei Lu, Jianhua Wang, Xiaoyong Du
crossref: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 LLM 驱动的白盒 SQL 测试生成框架 DBcover,借助 SQL-路径知识图谱显著提升 RDBMS 代码覆盖率。

关系数据库管理系统代码规模庞大、逻辑复杂,测试覆盖率难以提升。传统 fuzzing 依赖随机 SQL 生成,无法刻画 SQL 与代码路径之间的对应关系(SQL-to-path correspondence),覆盖率低;符号执行方法虽在原理上可行,却计算开销过高、难以扩展到大型系统。本文提出 DBcover,一个 LLM 驱动的数据库测试生成框架,通过上下文推理实现白盒、代码感知的 SQL 测试生成。它用轻量动态分析抽取 SQL 与路径的对应关系及调用图作为全局上下文,并以目标函数周边的源码依赖信息作为局部上下文,将两类上下文统一组织成知识图谱,支持迭代生成中的高效检索、推理与复用。生成采用两阶段策略:种子选择阶段依据知识图中的 SQL-路径关系挑选语义相关的已有测试用例,查询生成阶段由 LLM 结合全局与局部上下文,以细粒度推理流水线合成可触发未覆盖代码的 SQL 测试。实验表明 DBcover 显著优于现有 fuzzer,在 PostgreSQL 与 MySQL 上分别达到 80.1% 和 82.3% 的覆盖率,并在企业级闭源数据库 KingbaseES 上验证了有效性与实用性。

问题
RDBMS 测试中随机 SQL 生成难以捕捉 SQL 与代码路径的对应关系,而符号执行方法开销过大、扩展性差,导致代码覆盖率长期偏低。
方法
DBcover 通过轻量动态分析提取 SQL-to-path 对应关系与调用图作为全局上下文、目标函数源码依赖作为局部上下文,统一构建知识图谱;再以两阶段流程先选种子测试、后由 LLM 结合上下文推理合成新 SQL。
评估
在 PostgreSQL、MySQL 以及企业级闭源 RDBMS KingbaseES 上开展实验,与现有 fuzzer 对比覆盖率,PostgreSQL 与 MySQL 分别达到 80.1% 与 82.3%。
原文摘要(Abstract)

Relational Database Management Systems (RDBMSs) form the backbone of modern data-intensive applications, making their reliability and robustness of paramount importance. However, due to the large code base and immense code complexity, achieving high coverage in RDBMS testing remains a formidable challenge. Traditional fuzzing approaches rely on random SQL generation, which fails to capture the intricate correspondence between SQL and paths (SQL-to-path correspondence) within the codebase, leading to low code coverage. Symbolic execution–based methods can, in principle, address this issue but incur prohibitive computational costs and suffer from scalability bottlenecks on large systems. We propose DBcover, an LLM-driven database test generation framework that performs white-box, code-aware SQL test generation through contextual reasoning. DBcover integrates lightweight dynamic analysis to extract SQL-to-path correspondence and call graphs as global context, and constructs source-level dependency information around target functions as local context. Both types of contextual information are organized within a unified knowledge graph, enabling efficient retrieval, reasoning, and reuse across iterative test generation. Built upon this contextual foundation, DBcover adopts a two-phase test generation strategy. In the seed selection phase, it identifies a semantically relevant existing test case by analyzing SQL-to-path relationships within the knowledge graph. In the query generation phase, the LLM, equipped with both global and local context, employs a fine-grained reasoning pipeline to synthesize new SQL test cases that accurately trigger previously uncovered code regions. Experimental results show that DBcover substantially outperforms existing fuzzers, achieving \(80.1\%\) and \(82.3\%\) coverage on PostgreSQL and MySQL. Experiments conducted on an enterprise RDBMS KingbaseES demonstrate the effectiveness and practical applicability of our approach on closed-source RDBMSs.

链接与引用

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

BibTeX
@inproceedings{paperbot11592,
  title = {DBcover: A White-box SQL Test Generation Framework for Coverage Improvement},
  author = {Yankai Rong and Shuang Liu and Jinhao Dong and Qiang Yin and Wei Lu and Jianhua Wang and Xiaoyong Du},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3774748.3793626}
}