GraphGenie: To detect logic bugs in graph database engines

database engines logic bugs

GraphGenie

GraphGenie is a bug-finding tool to detect logic bugs and performance issues (we also find internal errors) in graph database management systems. Specifically, unlike most existing testing works mutating query predicates, GraphGenie leverages Graph Query Transformations (GQT) to construct semantically equivalent or variant graph query patterns, which enables comparative analysis of their results to reveal bugs. GraphGenie has been tested and found previously unknown bugs on popular graph database engines like Neo4j.

If you use, extend, or build upon GraphGenie we kindly ask you to cite our ICSE’24 paper:

@inproceedings{jiang2024detecting,
title={Detecting Logic Bugs in Graph Database Management Systems via Injective and Surjective Graph Query Transformation},
author={Jiang, Yuancheng and Liu, Jiahao and Ba, Jinsheng and Yap, Roland H.C. and Liang, Zhenkai and Rigger, Manuel},
booktitle={Proceedings of the 46th International Conference on Software Engineering},
publisher = {{ACM}},
year={2024},
doi = {10.1145/3597503.3623307}
}

Install

git clone https://github.com/YuanchengJiang/GraphGenie.git
apt install python3
apt install python3-pip
pip3 install configparser
pip3 install neo4j
pip3 install redisgraph
pip3 install psycopg2

Graph Database Engine Setup

We do not initialize graph data. We use existing graph dataset like recommendations. We give concrete steps for setting up the Neo4j below. For other graph database engines, please refer to official documentations for installation and dataset initialization. We include the python drivers for RedisGraph and AgensGraph in our code.

Neo4j

apt install openjdk-17-jdk;
cd dbs;
wget https://dist.neo4j.org/neo4j-community-5.11.0-unix.tar.gz;
tar -xvf neo4j-community-5.11.0-unix.tar.gz;
git clone https://github.com/neo4j-graph-examples/recommendations.git;
cd neo4j-community-5.11.0;
./bin/neo4j-admin database load --from-stdin --overwrite-destination=true neo4j < ../recommendations/data/recommendations-50.dump;
echo "dbms.transaction.timeout=30s" >> ./conf/neo4j.conf
./bin/neo4j start

Then please connect to the server to config your password (the default username:neo4j password:neo4j) (password is 12344321 in our default setting)

./bin/cypher-shell

Use

Config graphgenie.ini first and then start the testing:

If you test Neo4j, simply run the main.py

./main.py

For other databases, you need to first initialize the dataset and specify

node_labels, edge_labels, node_properties, connectivity_matrix

in main.py line 332, or implement your own schema scanner (should be similar to Neo4j one).

Copyright (C) 2023 YuanchengJiang

Source: https://github.com/YuanchengJiang/