Lune

ICSE2024Top-tier venue

Testing Graph Database Systems via Equivalent Query Rewriting

Qiuyang Mang, Aoyang Fang, Boxi Yu, Hanfei Chen, Pinjia He

Abstract

Graph Database Management Systems (GDBMS), which utilize graph models for data storage and execute queries via graph traversals, have seen ubiquitous usage in real-world scenarios such as recommendation systems, knowledge graphs, and social networks. Much like Relational Database Management Systems (RDBMS), GDBMS are not immune to bugs. These bugs typically manifest as logic errors that yield incorrect results (e.g., omitting a node that should be included), performance bugs (e.g., long execution time caused by redundant graph scanning), and exception issues (e.g., unexpected or missing exceptions). This paper adapts Equivalent Query Rewriting (EQR) to GDBMS testing. EQR rewrites a GDBMS query into equivalent ones that trigger distinct query plans, and checks whether they exhibit discrepancies in system behaviors. To facilitate the realization of EQR, we propose a general concept called Abstract Syntax Graph (ASG). Its core idea is to embed the semantics of a base query into the paths of a graph, which can be utilized to generate new queries with customized properties (e.g., equivalence). Given a base query, an ASG is constructed and then an equivalent query can be generated by finding paths collectively carrying the complete semantics of the base query. To this end, we further design Random Walk Covering (RWC), a simple yet effective path covering algorithm. As a practical implementation of these ideas, we develop a tool GRev, which has successfully detected 22 previously unknown bugs across 5 popular GDBMS, with 15 of them being confirmed. In particular,

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Finding Logic Bugs in Spatial Database Engines via Affine Equivalent Inputs cites Finding bugs in database systems via query partitioning
  • Finding Logic Bugs in Spatial Database Engines via Affine Equivalent Inputs cites Testing Database Engines via Pivoted Query Synthesis
  • Detecting Isolation Anomalies in Relational DBMSs cites Finding bugs in database systems via query partitioning
  • Detecting Isolation Anomalies in Relational DBMSs cites Testing Gremlin-Based Graph Database Systems via Query Disassembling
  • Detecting Isolation Anomalies in Relational DBMSs cites Testing Database Engines via Pivoted Query Synthesis
  • Finding bugs in database systems via query partitioning cites Structure-invariant testing for machine translation
  • Finding bugs in database systems via query partitioning cites Testing Database Engines via Pivoted Query Synthesis
  • Graphiti: Bridging Graph and Relational Database Queries cites Finding bugs in database systems via query partitioning
  • Testing Gremlin-Based Graph Database Systems via Query Disassembling cites Finding bugs in database systems via query partitioning
  • Testing Gremlin-Based Graph Database Systems via Query Disassembling cites Testing Database Engines via Pivoted Query Synthesis
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. MR-Adopt: Automatic Deduction of Input Transformation Function for Metamorphic TestingCongying Xu, Songqiang Chen, Jiarong Wu, Shing-Chi Cheung et al.ASE 2024 · 6 citations
  2. Testing Gremlin-Based Graph Database Systems via Query DisassemblingYingying Zheng, Wensheng Dou, Lei Tang, Ziyu Cui et al.ISSTA 2024 · 6 citations
  3. Finding Logic Bugs in Spatial Database Engines via Affine Equivalent InputsWenjing Deng, Qiuyang Mang, Chengyu Zhang, Manuel RiggerSIGMOD 2025 · 3 citations
  4. Detecting Isolation Anomalies in Relational DBMSsRui Yang, Ziyu Cui, Wensheng Dou, Yu Gao et al.ISSTA 2025 · 3 citations
  5. Graphiti: Bridging Graph and Relational Database QueriesYang He, Ruijie Fang, Isil Dillig, Yuepeng WangPLDI 2025 · 3 citations

Builds on14

  1. Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 citations
  2. NEZHA: Efficient Domain-Independent Differential TestingTheofilos Petsios, Adrian Tang, Salvatore J. Stolfo, Angelos D. Keromytis et al.S&P 2017 · 132 citations
  3. Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 citations
  4. NNSmith: Generating Diverse and Valid Test Cases for Deep Learning CompilersJiawei Liu, Jinkun Lin, Fabian Ruffy, Cheng Tan et al.ASPLOS 2023 · 90 citations
  5. Structure-invariant testing for machine translationPinjia He, Clara Meister, Zhendong SuICSE 2020 · 84 citations

Related papers

  1. Finding bugs in Gremlin-based graph database systems via Randomized differential testingYingying Zheng, Wensheng Dou, Yicheng Wang, Zheng Qin et al.ISSTA 2022 · 36 citations
  2. Detecting Logic Bugs in Graph Database Management Systems via Injective and Surjective Graph Query TransformationYuancheng Jiang, Jiahao Liu, Jinsheng Ba, Roland H. C. Yap et al.ICSE 2024 · 14 citations
  3. Understanding Query Optimization Bugs in Graph Database SystemsYuyu Chen, Zhongxing YuASPLOS 2026 · 1 citation
  4. Testing Graph Databases via Transformations Between Fixed-Length and Variable-Length QueriesJinxin Gui, Yuanhong Lan, Longlong Lu, Yifei Lu et al.VLDB 2026
  5. Testing Graph Databases with Synthesized QueriesZijing Yin, Si Liu, David A. BasinSIGMOD 2026 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines