LLMSQLMUTATOR: LLM-Powered Test Case Generation for Database Using Bug Reports
Chenglin Tian, Chaofan Li, Yawen Li, Yingxia Shao
Abstract
Relational Database Management Systems (DBMSs) are fundamental to modern software infrastructure, yet their inherent complexity and continuous evolution introduce critical defects that compromise data integrity and system reliability. While existing syntax-based and mutation-based automated testing approaches have demonstrated utility in DBMS validation, they suffer from three significant limitations, that are low quality seed SQLs, lack of bug knowledge, and ignorance of fine-grained constraints. To address these limitations, we propose LLM-SQLMutator, an innovative mutation-based automated DBMS testing tool that leverages large language models (LLMs) and bug reports. LLMSQLMUTATOR extracts the SQL statements from the bug report as mutation seeds, and extracts bug patterns and root causes from the bug reports as mutation guidance. Considering the semantic understanding capability of LLMs, we introduce bug-driven SQL mutation which uses LLMs to perform syntax-aware directed mutations on seed SQLs under the guidance of the bug knowledge. Finally, we propose the LLMbased semantic validation that uses database metadata as the basic validation knowledge and dynamically expand validation rules via LLMs, thereby helping LLMSQLMutator achieve comprehensive semantic validation. Extensive evaluations across six popular relational DBMSs demonstrate the advantages of LLMSQLMutator, and it detects 27 confirmed bugs.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Related papers
- SmartFuzz: Leveraging Large Language Models and Feature Composition to Generate High-Quality Seeds for Database FuzzingLi Lin, Jintai Hong, Yanlin Zhuang, Rongxin WuOOPSLA 2026
- Automated Discovery of Test Oracles for Database Management Systems Using LLMsQiuyang Mang, Runyuan He, Suyang Zhong, Xiaoxuan Liu et al.SIGMOD 2026 · 1 citation
- The Mutators Reloaded: Fuzzing Compilers with Large Language Model Generated Mutation OperatorsXianfei Ou, Cong Li, Yanyan Jiang, Chang XuASPLOS 2024 · 25 citations
- λ-Tune: Harnessing Large Language Models for Automated Database System TuningVictor Giannakouris, Immanuel TrummerSIGMOD 2025 · 20 citations
- SQUIRREL: Testing Database Management Systems with Language Validity and Coverage FeedbackRui Zhong, Yongheng Chen, Hong Hu, Hangfan Zhang et al.CCS 2020 · 5 citations
