Constant Optimization Driven Database System Testing
Chi Zhang, Manuel Rigger
摘要
Logic bugs are bugs that can cause database management systems (DBMSs) to silently produce incorrect results for given queries. Such bugs are severe, because they can easily be overlooked by both developers and users, and can cause applications that rely on the DBMSs to malfunction. In this work, we propose Constant-Optimization-Driven Database Testing (CODDTest) as a novel approach for detecting logic bugs in DBMSs. This method draws inspiration from two well-known optimizations in compilers: constant folding and constant propagation. Our key insight is that for a certain database state and query containing a predicate, we can apply constant folding on the predicate by replacing an expression in the predicate with a constant, anticipating that the results of this predicate remain unchanged; any discrepancy indicates a bug in the DBMS. We evaluated CODDTest on five mature and extensively-tested DBMSs-SQLite, MySQL, CockroachDB, DuckDB, and TiDB-and found 45 unique, previously unknown bugs in them. Out of these, 24 are unique logic bugs. Our manual analysis of the state-of-the-art approaches indicates that 11 logic bugs are detectable only by CODDTest. We believe that CODDTest is easy to implement, and can be widely adopted in practice.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Scaling Automated Database System Testing 引用了 Finding bugs in database systems via query partitioning
- Scaling Automated Database System Testing 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
- Scaling Automated Database System Testing 引用了 Testing Database Engines via Pivoted Query Synthesis
- ValScope: Value-Semantics-Aware Metamorphic Testing for Detecting Logical Bugs in DBMSs 引用了 Finding bugs in database systems via query partitioning
- ValScope: Value-Semantics-Aware Metamorphic Testing for Detecting Logical Bugs in DBMSs 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
- ValScope: Value-Semantics-Aware Metamorphic Testing for Detecting Logical Bugs in DBMSs 引用了 Testing Database Engines via Pivoted Query Synthesis
- Detecting Data-Type-Related Logic Bugs in Relational DBMSs via Compatible Database Construction 引用了 Scaling Automated Database System Testing
- Detecting Data-Type-Related Logic Bugs in Relational DBMSs via Compatible Database Construction 引用了 Finding bugs in database systems via query partitioning
- Detecting Data-Type-Related Logic Bugs in Relational DBMSs via Compatible Database Construction 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
- Detecting Data-Type-Related Logic Bugs in Relational DBMSs via Compatible Database Construction 引用了 Testing Database Engines via Pivoted Query Synthesis
- Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State Verification 引用了 Finding bugs in database systems via query partitioning
- Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State Verification 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
- Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State Verification 引用了 Testing Database Engines via Pivoted Query Synthesis
- Finding bugs in database systems via query partitioning 引用了 Validating SMT solvers via semantic fusion
- Finding bugs in database systems via query partitioning 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
- Finding bugs in database systems via query partitioning 引用了 Testing Database Engines via Pivoted Query Synthesis
- Detecting optimization bugs in database engines via non-optimizing reference engine construction 引用了 Testing Database Engines via Pivoted Query Synthesis
- Automated Discovery of Test Oracles for Database Management Systems Using LLMs 引用了 Scaling Automated Database System Testing
- Automated Discovery of Test Oracles for Database Management Systems Using LLMs 引用了 Finding bugs in database systems via query partitioning
- Automated Discovery of Test Oracles for Database Management Systems Using LLMs 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
- Automated Discovery of Test Oracles for Database Management Systems Using LLMs 引用了 Testing Database Engines via Pivoted Query Synthesis
- Automated Discovery of Test Oracles for Database Management Systems Using LLMs 引用了 Evaluating Fuzz Testing
引用它的顶会 Paper6
- Scaling Automated Database System TestingSuyang Zhong, Manuel RiggerASPLOS 2026 · 4 次引用
- Fawkes: Finding Data Durability Bugs in DBMSs via Recovered Data State VerificationZhiyong Wu, Jie Liang, Jingzhou Fu, Wenqian Deng 等SOSP 2025 · 1 次引用
- Automated Discovery of Test Oracles for Database Management Systems Using LLMsQiuyang Mang, Runyuan He, Suyang Zhong, Xiaoxuan Liu 等SIGMOD 2026 · 1 次引用
- ValScope: Value-Semantics-Aware Metamorphic Testing for Detecting Logical Bugs in DBMSsLi Lin, Liehang Chen, Rongxin WuOSDI 2026
- Detecting Data-Type-Related Logic Bugs in Relational DBMSs via Compatible Database ConstructionJiansen Song, Wensheng Dou, Yingying Zheng, Yu Gao 等VLDB 2026
它引用的 Paper17
- Evaluating Fuzz TestingGeorge Klees, Andrew Ruef, Benji Cooper, Shiyi Wei 等CCS 2018 · 753 次引用
- Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 次引用
- Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 次引用
- Detecting optimization bugs in database engines via non-optimizing reference engine constructionManuel Rigger, Zhendong SuFSE 2020 · 104 次引用
- Validating SMT solvers via semantic fusionDominik Winterer, Chengyu Zhang, Zhendong SuPLDI 2020 · 80 次引用
相关 Paper
- Testing Database Systems via Differential Query ExecutionJiansen Song, Wensheng Dou, Ziyu Cui, Qianwang Dai 等ICSE 2023 · 26 次引用
- SRS: Detecting Logic Bugs of Join Implementation in DBMSs via Set Relation SynthesisJinhui Lai, Chi Zhang, Bingyan Li, Chenglin Liang 等SIGMOD 2026 · 4 次引用
- EPSC: Testing Database Management Systems via Equivalent Prepared Statement ConstructionChi Zhang, Jie Liang, Zhiyong Wu, Dalong Shi 等SIGMOD 2026 · 2 次引用
- Detecting Logic Bugs in DBMSs via Equivalent Data ConstructionWenqian Deng, Jie Liang, Zhiyong Wu, Jingzhou Fu 等SIGMOD 2026 · 1 次引用
- Detecting Metadata-Related Logic Bugs in Database Systems via Raw Database ConstructionJiansen Song, Wensheng Dou, Yu Gao, Ziyu Cui 等VLDB 2024 · 13 次引用
