arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.14161cs.SE
收藏

SQL测试生成器的智能体进化

Agentic Evolution of SQL Test Generators

National University of Singapore(新加坡国立大学)

Suyang Zhong, Manuel Rigger

AI总结:

本文提出Gungnir方法,利用编码智能体进化DBMS测试生成器,通过见证重放机制验证能力,在SQLite等3款DBMS中发现44个已确认缺陷,34个已修复,该机制可推广至其他系统。

摘要:

自动化测试已在数据库管理系统(DBMS)中发现大量逻辑缺陷。现有工具通常仅支持少数SQL方言及这些方言的部分特性。基于大语言模型(LLM)的编码智能体可将额外SQL特性的语义编码为可复用的测试生成器,测试期间无需额外LLM调用,因此兼具高效率与低成本。但在存在潜在幻觉的情况下验证新增能力是关键挑战。本文提出Gungnir,一种利用编码智能体进化DBMS测试生成器的方法。核心机制为见证重放:编码智能体提供生成见证,记录生成目标语句所需的数据库设置与语义选择;验证器通过修改后的生成器重放这些选择,检查其是否复现目标语句;历史见证作为后续修改的回归测试。我们在SQLite、DuckDB和PostgreSQL上评估Gungnir,发现开发者确认的44个缺陷,其中34个已修复。除DBMS外,见证重放可推广至其他系统,以指导智能体扩展测试生成器。

英文摘要:

Automated testing has uncovered many logic bugs in Database Management Systems (DBMSs). Existing tools are typically limited to a few SQL dialects and a subset of these dialects' features. Coding agents based on Large Language Models (LLMs) could encode the semantics of additional SQL features into reusable test generators, requiring no additional LLM calls during testing and thus enabling high efficiency and low cost. However, a key challenge is validating the added capabilities in the presence of potential hallucinations. In this paper, we propose Gungnir, an approach for evolving DBMS test generators using coding agents. Our core mechanism is witness replay: the coding agent provides a generation witness recording the database setup and semantic choices needed to generate a target statement. A validator replays these choices through the modified generator and checks that it reproduces the target statement. Historical witnesses serve as regression tests for subsequent modifications. We evaluated Gungnir on SQLite, DuckDB, and PostgreSQL and found 44 bugs confirmed by developers, of which 34 have been fixed. Beyond DBMSs, witness replay could generalize to other systems to guide agents in extending test generators.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑