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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 690a819b-e18d-46fd-bf3f-a8acb26126acCited by top-tier papers10
- 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
- Testing Gremlin-Based Graph Database Systems via Query DisassemblingYingying Zheng, Wensheng Dou, Lei Tang, Ziyu Cui et al.ISSTA 2024 · 6 citations
- Finding Logic Bugs in Spatial Database Engines via Affine Equivalent InputsWenjing Deng, Qiuyang Mang, Chengyu Zhang, Manuel RiggerSIGMOD 2025 · 3 citations
- Detecting Isolation Anomalies in Relational DBMSsRui Yang, Ziyu Cui, Wensheng Dou, Yu Gao et al.ISSTA 2025 · 3 citations
- Graphiti: Bridging Graph and Relational Database QueriesYang He, Ruijie Fang, Isil Dillig, Yuepeng WangPLDI 2025 · 3 citations
Builds on14
- Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 citations
- NEZHA: Efficient Domain-Independent Differential TestingTheofilos Petsios, Adrian Tang, Salvatore J. Stolfo, Angelos D. Keromytis et al.S&P 2017 · 132 citations
- Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 citations
- NNSmith: Generating Diverse and Valid Test Cases for Deep Learning CompilersJiawei Liu, Jinkun Lin, Fabian Ruffy, Cheng Tan et al.ASPLOS 2023 · 90 citations
- Structure-invariant testing for machine translationPinjia He, Clara Meister, Zhendong SuICSE 2020 · 84 citations
Related papers
- 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
- 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
- Understanding Query Optimization Bugs in Graph Database SystemsYuyu Chen, Zhongxing YuASPLOS 2026 · 1 citation
- Testing Graph Databases via Transformations Between Fixed-Length and Variable-Length QueriesJinxin Gui, Yuanhong Lan, Longlong Lu, Yifei Lu et al.VLDB 2026
- Testing Graph Databases with Synthesized QueriesZijing Yin, Si Liu, David A. BasinSIGMOD 2026 · 2 citations
