Search papers, labs, and topics across Lattice.
This paper introduces DBcover, a novel LLM-driven framework for white-box SQL test generation aimed at improving coverage in relational database management systems (RDBMSs). By leveraging lightweight dynamic analysis to establish SQL-to-path correspondences and utilizing a unified knowledge graph for context retrieval, DBcover effectively guides the generation of SQL test cases that target previously uncovered code regions. Experimental results indicate that DBcover achieves significant coverage improvements, reaching 80.1% for PostgreSQL and 82.3% for MySQL, showcasing its applicability even in closed-source environments like KingbaseES.
Achieving over 80% coverage in SQL testing, DBcover transforms how we approach reliability in RDBMSs by intelligently leveraging contextual reasoning.
Relational Database Management Systems (RDBMSs) are the backbone of modern data-intensive applications, making reliability and robustness critical. However, achieving high coverage in RDBMS testing remains challenging because of large codebases and complex execution logic. Traditional fuzzing relies on random SQL generation and cannot capture the correspondence between SQL inputs and internal execution paths, while symbolic execution suffers from prohibitive cost and scalability limitations. We propose DBcover, an LLM-driven white-box SQL test generation framework based on contextual reasoning. DBcover uses lightweight dynamic analysis to extract SQL-to-path correspondence and call graphs as global context, and collects source-level information around target functions as local context. These contexts are organized in a unified knowledge graph for efficient retrieval and reuse. DBcover then performs two-phase test generation: it first selects a semantically relevant seed whose execution path is close to the uncovered target, and then guides the LLM with global and local context to generate SQL test cases that trigger previously uncovered code regions. Experiments show that DBcover achieves 80.1% and 82.3% coverage on PostgreSQL and MySQL, and is also effective on the enterprise RDBMS KingbaseES, demonstrating its practical applicability to closed-source systems.