Testing Graph Databases with Synthesized Queries
Zijing Yin, Si Liu, David A. Basin
Abstract
Graph databases (GDBs) are increasingly used in many applications. However, their advanced features make them prone to logic bugs. Despite recent advances in GDB testing, a common limitation of existing approaches is the lack of ground truth for their test oracles. This results in both incorrectly identified bugs and overlooked bugs.
We introduce GQS (Graph Query Synthesis), the first automated testing approach for detecting logic bugs in graph databases (GDBs) based on an established ground truth. GQS starts by randomly generating a graph and selecting a set of properties associated with its elements, whose key-value pairs form the expected result set serving as the ground truth. It then synthesizes a query intended to retrieve these values from the graph. When the query is executed on the graph by the GDB under test, any discrepancy between the actual result set and the ground truth indicates a logic bug. To extensively test a GDB, we develop novel techniques that synthesize both syntactically and semantically complex queries.
We implement GQS in a tool that incorporates the first Cypher query synthesizer specifically designed for testing GDBs. Overall, we find 36 previously unknown bugs across four production GDBs, of which 26 are logic bugs, with some remaining undetected for up to five years. Additionally, our tool demonstrates superior effectiveness in bug detection compared to the state-of-the-art testers.
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 69791795-e264-4afb-b2bf-f749c0d53eafCited by top-tier papers1
Ask how each one uses itBuilds on25
- Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 citations
- Finding bugs in database systems via query partitioningManuel Rigger, Zhendong SuOOPSLA 2020 · 116 citations
- Detecting optimization bugs in database engines via non-optimizing reference engine constructionManuel Rigger, Zhendong SuFSE 2020 · 104 citations
- Elle: Inferring Isolation Anomalies from Experimental ObservationsPeter Alvaro, Kyle KingsburyVLDB 2021 · 88 citations
- Detecting Logic Bugs of Join Optimizations in DBMSXiu Tang, Sai Wu, Dongxiang Zhang, Feifei Li et al.SIGMOD 2023 · 34 citations
Related papers
- Testing Gremlin-Based Graph Database Systems via Query DisassemblingYingying Zheng, Wensheng Dou, Lei Tang, Ziyu Cui et al.ISSTA 2024 · 6 citations
- 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
- Understanding Query Optimization Bugs in Graph Database SystemsYuyu Chen, Zhongxing YuASPLOS 2026 · 1 citation
- Dinkel: State-Aware and Granular Framework for Validating Graph DatabasesCeline Wüst, Zu-Ming Jiang, Zhendong SuVLDB 2026
- Testing Graph Database Engines via Query PartitioningMatteo Kamm, Manuel Rigger, Chengyu Zhang, Zhendong SuISSTA 2023 · 29 citations
