Lune

ICSE2023顶会

Testing Database Engines via Query Plan Guidance

Jinsheng Ba, Manuel Rigger

摘要

Database systems are widely used to store and query data. Test oracles have been proposed to find logic bugs in such systems, that is, bugs that cause the database system to compute an incorrect result. To realize a fully automated testing approach, such test oracles are paired with a test case generation technique; a test case refers to a database state and a query on which the test oracle can be applied. In this work, we propose the concept of Query Plan Guidance (QPG) for guiding automated testing towards “interesting” test cases. SQL and other query languages are declarative. Thus, to execute a query, the database system translates every operator in the source language to one of the potentially many so-called physical operators that can be executed; the tree of physical operators is referred to as the query plan. Our intuition is that by steering testing towards exploring a variety of unique query plans, we also explore more interesting behaviors-some of which are potentially incorrect. To this end, we propose a mutation technique that gradually applies promising mutations to the database state, causing the DBMS to create potentially unseen query plans for subsequent queries. We applied our method to three mature, widely-used, and extensively-tested database systems-SQLite, TiDB, and CockroachDB-and found 53 unique, previously unknown bugs. Our method exercises <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">4.85−408.48×4.85-408.48\times</tex> more unique query plans than a naive random generation method and <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">7.46×7.46\times</tex> more than a code coverage guidance method. Since most database systems-including commercial ones-expose query plans to the user, we consider QPG a generally applicable, black-box approach and believe that the core idea could also be applied in other contexts (e.g., to measure the quality of a test suite).

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 32 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Keep It Simple: Testing Databases via Differential Query Plans 引用了 Finding bugs in database systems via query partitioning
  • Keep It Simple: Testing Databases via Differential Query Plans 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Keep It Simple: Testing Databases via Differential Query Plans 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Keep It Simple: Testing Databases via Differential Query Plans 引用了 Testing Database Engines via Pivoted Query Synthesis
  • 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 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Finding bugs in database systems via query partitioning 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Testing Database Systems via Differential Query Execution 引用了 Finding bugs in database systems via query partitioning
  • Testing Database Systems via Differential Query Execution 引用了 Detecting Isolation Bugs via Transaction Oracle Construction
  • Detecting Isolation Bugs via Transaction Oracle Construction 引用了 Testing Database Systems via Differential Query Execution
  • Testing Database Systems via Differential Query Execution 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Testing Database Systems via Differential Query Execution 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting optimization bugs in database engines via non-optimizing reference engine construction 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Detecting optimization bugs in database engines via non-optimizing reference engine construction 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Mozi: Discovering DBMS Bugs via Configuration-Based Equivalent Transformation 引用了 Finding bugs in database systems via query partitioning
  • Mozi: Discovering DBMS Bugs via Configuration-Based Equivalent Transformation 引用了 Testing Database Systems via Differential Query Execution
  • Mozi: Discovering DBMS Bugs via Configuration-Based Equivalent Transformation 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Mozi: Discovering DBMS Bugs via Configuration-Based Equivalent Transformation 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Mozi: Discovering DBMS Bugs via Configuration-Based Equivalent Transformation 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting Isolation Bugs via Transaction Oracle Construction 引用了 Finding bugs in database systems via query partitioning
  • Detecting Isolation Bugs via Transaction Oracle Construction 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Detecting Isolation Bugs via Transaction Oracle Construction 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Detecting Isolation Bugs via Transaction Oracle Construction 引用了 Testing Database Engines via Pivoted Query Synthesis
  • Detecting Logic Bugs in Database Engines via Equivalent Expression Transformation 引用了 Finding bugs in database systems via query partitioning
  • Detecting Logic Bugs in Database Engines via Equivalent Expression Transformation 引用了 Testing Database Systems via Differential Query Execution
  • Detecting Logic Bugs in Database Engines via Equivalent Expression Transformation 引用了 Detecting optimization bugs in database engines via non-optimizing reference engine construction
  • Detecting Logic Bugs in Database Engines via Equivalent Expression Transformation 引用了 APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems
  • Detecting Logic Bugs in Database Engines via Equivalent Expression Transformation 引用了 Testing Database Engines via Pivoted Query Synthesis
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper32

  1. Testing Database Systems via Differential Query ExecutionJiansen Song, Wensheng Dou, Ziyu Cui, Qianwang Dai 等ICSE 2023 · 26 次引用
  2. Keep It Simple: Testing Databases via Differential Query PlansJinsheng Ba, Manuel RiggerSIGMOD 2024 · 23 次引用
  3. Detecting Logic Bugs in Database Engines via Equivalent Expression TransformationZu-Ming Jiang, Zhendong SuOSDI 2024 · 22 次引用
  4. Detecting Isolation Bugs via Transaction Oracle ConstructionWensheng Dou, Ziyu Cui, Qianwang Dai, Jiansen Song 等ICSE 2023 · 21 次引用
  5. Mozi: Discovering DBMS Bugs via Configuration-Based Equivalent TransformationJie Liang, Zhiyong Wu, Jingzhou Fu, Mingzhe Wang 等ICSE 2024 · 18 次引用

它引用的 Paper11

  1. Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 次引用
  2. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 次引用
  3. Detecting optimization bugs in database engines via non-optimizing reference engine constructionManuel Rigger, Zhendong SuFSE 2020 · 104 次引用
  4. APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database SystemsJinho Jung, Hong Hu, Joy Arulraj, Taesoo Kim 等VLDB 2020 · 77 次引用
  5. SyzVegas: Beating Kernel Fuzzing Odds with Reinforcement LearningDaimeng Wang, Zheng Zhang, Hang Zhang, Zhiyun Qian 等USENIX Security 2021 · 75 次引用

相关 Paper

  1. Detecting Logical Bugs of DBMS with Coverage-based GuidanceYu Liang, Song Liu, Hong HuUSENIX Security 2022
  2. Constant Optimization Driven Database System TestingChi Zhang, Manuel RiggerSIGMOD 2025 · 8 次引用
  3. One DBMS, Two Modes, and a Bunch of Bugs: Catching Logic Bugs in Distributed DBMSs via Differential TestingZi-Xuan Fu, Jia-Ju Bai, Hong-Bo Feng, Kang ChenSIGMOD 2026
  4. Towards a Unified Query Plan RepresentationJinsheng Ba, Manuel RiggerICDE 2025
  5. Scaling Automated Database System TestingSuyang Zhong, Manuel RiggerASPLOS 2026 · 4 次引用
黄昏的海面,两侧是细线勾勒的悬崖