skip to main content
10.1145/3533767.3534409acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections

Finding bugs in Gremlin-based graph database systems via Randomized differential testing

Authors Info & Claims
Published:18 July 2022Publication History

ABSTRACT

Graph database systems (GDBs) allow efficiently storing and retrieving graph data, and have become the critical component in many applications, e.g., knowledge graphs, social networks, and fraud detection. It is important to ensure that GDBs operate correctly. Logic bugs can occur and make GDBs return an incorrect result for a given query. These bugs are critical and can easily go unnoticed by developers when the graph and queries become complicated. Despite the importance of GDBs, logic bugs in GDBs have received less attention than those in relational database systems.

In this paper, we present Grand, an approach for automatically finding logic bugs in GDBs that adopt Gremlin as their query language. The core idea of Grand is to construct semantically equivalent databases for multiple GDBs, and then compare the results of a Gremlin query on these databases. If the return results of a query on multiple GDBs are different, the likely cause is a logic bug in these GDBs. To effectively test GDBs, we propose a model-based query generation approach to generate valid Gremlin queries that can potentially return non-empty results, and a data mapping approach to unify the format of query results for different GDBs. We evaluate Grand on six widely-used GDBs, e.g., Neo4j and HugeGraph. In total, we have found 21 previously-unknown logic bugs in these GDBs. Among them, developers have confirmed 18 bugs, and fixed 7 bugs.

References

  1. 2021. Benchmarking TigerGraph Using the Liked Data Benchmark Council Social Network Benchmark. https://www.tigergraph.com/benchmark/ Google ScholarGoogle Scholar
  2. 2021. Cypher Query Language. https://neo4j.com/developer/cypher/ Google ScholarGoogle Scholar
  3. 2021. HugeGraph. https://hugegraph.github.io/hugegraph-doc/ Google ScholarGoogle Scholar
  4. 2021. HugeGraph-Client Quick Start. https://hugegraph.github.io/hugegraph-doc/quickstart/hugegraph-client.html Google ScholarGoogle Scholar
  5. 2021. JaCoCo is a free code coverage library for Java.. https://www.jacoco.org/jacoco/ Google ScholarGoogle Scholar
  6. 2021. JanusGraph. https://janusgraph.org Google ScholarGoogle Scholar
  7. 2021. Neo4j. https://neo4j.com/ Google ScholarGoogle Scholar
  8. 2021. Neo4j-Gremlin. https://github.com/thinkaurelius/neo4j-gremlin-plugin Google ScholarGoogle Scholar
  9. 2021. The Next Generation Multi-Model Database Supporting Graphs Key/Value, Documents and Time-Series. https://arcadedb.com/ Google ScholarGoogle Scholar
  10. 2021. Open Source, Distributed, Scalable, Lightning Fast. https://nebula-graph.io/ Google ScholarGoogle Scholar
  11. 2021. OrientDB. https://orientdb.org Google ScholarGoogle Scholar
  12. 2021. RDF Triple Stores vs. Labeled Property Graphs: What’s the Difference? https://neo4j.com/blog/rdf-triple-store-vs-labeled-property-graph-difference/ Google ScholarGoogle Scholar
  13. 2021. SQLancer. https://github.com/sqlancer/sqlancer Google ScholarGoogle Scholar
  14. 2021. SQLsmith. https://github.com/anse1/sqlsmith Google ScholarGoogle Scholar
  15. 2021. TigerGraph. https://www.tigergraph.com/ Google ScholarGoogle Scholar
  16. 2021. TinkerGraph. https://github.com/tinkerpop/blueprints/wiki/tinkergraph Google ScholarGoogle Scholar
  17. 2021. TinkerPop. https://tinkerpop.apache.org/ Google ScholarGoogle Scholar
  18. 2021. TinkerPop Documentation. https://tinkerpop.apache.org/docs/3.4.10/reference/ Google ScholarGoogle Scholar
  19. 2021. TinkerPop Github. https://github.com/tinkerpop Google ScholarGoogle Scholar
  20. 2021. TITAN: Distributed Graph Database. http://titan.thinkaurelius.com/ Google ScholarGoogle Scholar
  21. 2021. What is openCypher? http://www.opencypher.org/ Google ScholarGoogle Scholar
  22. 2022. DB-Engines Ranking of Graph DBMS. https://db-engines.com/en/ranking/graph+dbms Google ScholarGoogle Scholar
  23. 2022. ISSTA 22 Artifact for "Finding Bugs in Gremlin-Based Graph Database Systems via Randomized Differential Testing". https://doi.org/10.5281/zenodo.6534721 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ibrahim Abdelaziz, Razen Harbi, Zuhair Khayyat, and Panos Kalnis. 2017. A Survey and Experimental Comparison of Distributed SPARQL Engines for Very Large RDF Data. Proc. VLDB Endow., 10, 13 (2017), 2049–2060. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ibrahim Abdelaziz, Essam Mansour, Mourad Ouzzani, Ashraf Aboulnaga, and Panos Kalnis. 2017. Query Optimizations over Decentralized RDF Graphs. In International Conference on Data Engineering (ICDE). 139–142. Google ScholarGoogle ScholarCross RefCross Ref
  26. Renzo Angles, Peter A. Boncz, Josep Lluís Larriba-Pey, Irini Fundulaki, Thomas Neumann, Orri Erling, Peter Neubauer, Norbert Martínez-Bazan, Venelin Kotsev, and Ioan Toma. 2014. The Linked Data Benchmark Council: A Graph and RDF Industry Benchmarking Effort. ACM SIGMOD Record, 43, 1 (2014), 27–31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Renzo Angles, Arnau Prat-Pérez, David Dominguez-Sal, and Josep Lluís Larriba-Pey. 2013. Benchmarking Database Systems for Social Network Applications. In Proceedings of International Workshop on Graph Data Management Experiences and Systems (GRADES). 15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Marcelo Arenas, Claudio Gutiérrez, and Juan F. Sequeda. 2021. Querying in the Age of Graph Databases and Knowledge Graphs. In Proceedings of International Conference on Management of Data (SIGMODE). 2821–2828. Google ScholarGoogle Scholar
  29. Shafiul Azam Chowdhury, Soumik Mohian, Sidharth Mehra, Siddhant Gawsane, Taylor T. Johnson, and Christoph Csallner. 2018. Automatically finding bugs in a commercial cyber-physical system development tool chain with SLforge. In Proceedings of the 40th International Conference on Software Engineering, ICSE 2018, Gothenburg, Sweden, May 27 - June 03, 2018. 981–992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Christoph Csallner and Yannis Smaragdakis. 2004. JCrasher: an automatic robustness tester for Java. Softw. Pract. Exp., 34, 11 (2004), 1025–1050. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Pascal Cuoq, Benjamin Monate, Anne Pacalet, Virgile Prevosto, John Regehr, Boris Yakobowski, and Xuejun Yang. 2012. Testing Static Analyzers with Randomly Generated Programs. In NASA Formal Methods - 4th International Symposium (NFM). 120–125. Google ScholarGoogle Scholar
  32. Alin Deutsch. 2018. Querying Graph Databases with the GSQL Query Language. In Simpósio Brasileiro de Banco de Dados (SBBD). 313. Google ScholarGoogle Scholar
  33. Orri Erling, Alex Averbuch, Josep Lluís Larriba-Pey, Hassan Chafi, Andrey Gubichev, Arnau Prat-Pérez, Minh-Duc Pham, and Peter A. Boncz. 2015. The LDBC Social Network Benchmark: Interactive Workload. In Proceedings of ACM SIGMOD International Conference on Management of Data (SIGMOD). 619–630. Google ScholarGoogle Scholar
  34. Orri Erling and Ivan Mikhailov. 2009. RDF Support in the Virtuoso DBMS. In Networked Knowledge-Networked Media. 7–24. Google ScholarGoogle Scholar
  35. Diogo Fernandes and Jorge Bernardino. 2018. Graph Databases Comparison: AllegroGraph, ArangoDB, InfiniteGraph, Neo4J, and OrientDB. In Proceedings of International Conference on Data Science, Technology and Applications (DATE). 373–380. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Nadime Francis, Alastair Green, Paolo Guagliardo, Leonid Libkin, Tobias Lindaaker, Victor Marsault, Stefan Plantikow, Mats Rydberg, Petra Selmer, and Andrés Taylor. 2018. Cypher: An Evolving Query Language for Property Graphs. In Proceedings of International Conference on Management of Data (SIGMOD). 1433–1445. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Jinho Jung, Hong Hu, Joy Arulraj, Taesoo Kim, and Woon-Hak Kang. 2019. APOLLO: Automatic Detection and Diagnosis of Performance Regressions in Database Systems. Proc. VLDB Endow., 13, 1 (2019), 57–70. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Timotej Kapus and Cristian Cadar. 2017. Automatic testing of symbolic execution engines via program generation and differential testing. In International Conference on Automated Software Engineering (ASE). 590–600. Google ScholarGoogle ScholarCross RefCross Ref
  39. Shadi Abdul Khalek, Bassem Elkarablieh, Yai O. Laleye, and Sarfraz Khurshid. 2008. Query-Aware Test Generation Using a Relational Constraint Solver. In International Conference on Automated Software Engineering (ASE). 238–247. Google ScholarGoogle Scholar
  40. Norman Köster. 2020. An Extensible Graph Query Language for Model-Based Information Retrieval in Intelligent Environments. Ph.D. Dissertation. Bielefeld University, Germany. Google ScholarGoogle Scholar
  41. Tibor Kovács, Gábor Simon, and Gergely Mezei. 2019. Benchmarking Graph Database Backends - What Works Well with Wikidata? Acta Cybern., 24, 1 (2019), 43–60. Google ScholarGoogle ScholarCross RefCross Ref
  42. Matteo Lissandrini, Martin Brugnara, and Yannis Velegrakis. 2018. Beyond Macrobenchmarks: Microbenchmark-Based Graph Database Evaluation. Proc. VLDB Endow., 12, 4 (2018), 390–403. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Baozhu Liu, Xin Wang, Pengkai Liu, Sizhuo Li, Qiang Fu, and Yunpeng Chai. 2021. UniKG: A Unified Interoperable Knowledge Graph Database System. In Proceedings of IEEE International Conference on Data Engineering (ICDE). 2681–2684. Google ScholarGoogle ScholarCross RefCross Ref
  44. Muhammad Numair Mansur, Maria Christakis, and Valentin Wüstholz. 2021. Metamorphic testing of Datalog engines. In ESEC/FSE ’21: 29th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Athens, Greece, August 23-28, 2021. 639–650. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. William M. McKeeman. 1998. Differential Testing for Software. Digit. Tech. J., 10, 1 (1998), 100–107. Google ScholarGoogle Scholar
  46. Anil Pacaci, Alice Zhou, Jimmy Lin, and M. Tamer Özsu. 2017. Do We Need Specialized Graph Databases? Benchmarking Real-Time Social Networking Applications. In Proceedings of International Workshop on Graph Data-management Experiences and Systems (GRADES). 12:1–12:7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Yuxiang Ren, Hao Zhu, Jiawei Zhang, Peng Dai, and Liefeng Bo. 2021. EnsemFDet: An Ensemble Approach to Fraud Detection based on Bipartite Graph. In International Conference on Data Engineering (ICDE). 2039–2044. Google ScholarGoogle ScholarCross RefCross Ref
  48. Manuel Rigger and Zhendong Su. 2020. Detecting Optimization Bugs in Database Engines via Non-Optimizing Reference Engine Construction. In Proceedings of ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). 1140–1152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Manuel Rigger and Zhendong Su. 2020. Finding Bugs in Database Systems via Query Partitioning. Proceedings of the ACM on Programming Languages, 4, OOPSLA (2020), Article 211, 30 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Manuel Rigger and Zhendong Su. 2020. Testing Database Engines via Pivoted Query Synthesis. In Proceedings of USENIX Symposium on Operating Systems Design and Implementation (OSDI). 667–682. Google ScholarGoogle Scholar
  51. Marko A. Rodriguez. 2015. The Gremlin Graph Traversal Machine and Language (Invited Talk). In Proceedings of the Symposium on Database Programming Languages. 1–10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Donald S. Slutz. 1998. Massive Stochastic Testing of SQL. In Proceedings of International Conference on Very Large Data Bases (VLDB). 618–622. Google ScholarGoogle Scholar
  53. Thodoris Sotiropoulos, Stefanos Chaliasos, Vaggelis Atlidakis, Dimitris Mitropoulos, and Diomidis Spinellis. 2021. Data-Oriented Differential Testing of Object-Relational Mapping Systems. In Proceedings of IEEE/ACM International Conference on Software Engineering (ICSE). 1535–1547. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Harsh Thakkar, Renzo Angles, Marko Rodriguez, Stephen Mallette, and Jens Lehmann. 2020. Let’s Build Bridges, not Walls: SPARQL Querying of TinkerPop Graph Databases with SPARQL-Gremlin. In Proceedings of IEEE International Conference on Semantic Computing (ICSC). 408–415. Google ScholarGoogle ScholarCross RefCross Ref
  55. Ran Wang, Zhengyi Yang, Wenjie Zhang, and Xuemin Lin. 2020. An Empirical Study on Recent Graph Database Systems. In Proceedings of International Conference on Knowledge Science, Engineering and Management (KSEM). 328–340. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Finding bugs in Gremlin-based graph database systems via Randomized differential testing
          Index terms have been assigned to the content through auto-classification.

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            ISSTA 2022: Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis
            July 2022
            808 pages
            ISBN:9781450393799
            DOI:10.1145/3533767

            Copyright © 2022 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 18 July 2022

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate58of213submissions,27%

            Upcoming Conference

            ISSTA '24

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader