Skip to content

Commit 7668193

Browse files
committed
Initial commit
0 parents  commit 7668193

366 files changed

Lines changed: 104310 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python-app.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python 3.9
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.9
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install flake8 pytest
27+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28+
- name: Lint with flake8
29+
run: |
30+
# stop the build if there are Python syntax errors or undefined names
31+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
- name: Test with pytest
35+
run: |
36+
pytest
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.7, 3.8, 3.9]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Test with pytest
38+
run: |
39+
pytest

.gitignore

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
temp/*
2+
temp
3+
.vscode
4+
*stats.json
5+
home.py
6+
params.json
7+
souffle_installations/
8+
# Byte-compiled / optimized / DLL files
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
13+
# C extensions
14+
*.so
15+
16+
# Distribution / packaging
17+
.Python
18+
build/
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
pip-wheel-metadata/
31+
share/python-wheels/
32+
*.egg-info/
33+
.installed.cfg
34+
*.egg
35+
MANIFEST
36+
37+
# PyInstaller
38+
# Usually these files are written by a python script from a template
39+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
40+
*.manifest
41+
*.spec
42+
43+
# Installer logs
44+
pip-log.txt
45+
pip-delete-this-directory.txt
46+
47+
# Unit test / coverage reports
48+
htmlcov/
49+
.tox/
50+
.nox/
51+
.coverage
52+
.coverage.*
53+
.cache
54+
nosetests.xml
55+
coverage.xml
56+
*.cover
57+
*.py,cover
58+
.hypothesis/
59+
.pytest_cache/
60+
61+
# Translations
62+
*.mo
63+
*.pot
64+
65+
# Django stuff:
66+
*.log
67+
local_settings.py
68+
db.sqlite3
69+
db.sqlite3-journal
70+
71+
# Flask stuff:
72+
instance/
73+
.webassets-cache
74+
75+
# Scrapy stuff:
76+
.scrapy
77+
78+
# Sphinx documentation
79+
docs/_build/
80+
81+
# PyBuilder
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
.python-version
93+
94+
# pipenv
95+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
97+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
98+
# install all needed dependencies.
99+
#Pipfile.lock
100+
101+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
102+
__pypackages__/
103+
104+
# Celery stuff
105+
celerybeat-schedule
106+
celerybeat.pid
107+
108+
# SageMath parsed files
109+
*.sage.py
110+
111+
# Environments
112+
.env
113+
.venv
114+
env/
115+
venv/
116+
ENV/
117+
env.bak/
118+
venv.bak/
119+
120+
# Spyder project settings
121+
.spyderproject
122+
.spyproject
123+
124+
# Rope project settings
125+
.ropeproject
126+
127+
# mkdocs documentation
128+
/site
129+
130+
# mypy
131+
.mypy_cache/
132+
.dmypy.json
133+
dmypy.json
134+
135+
# Pyre type checker
136+
.pyre/

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[![Python package](https://github.com/numairmansur/queryFuzz/actions/workflows/python-package.yml/badge.svg)](https://github.com/numairmansur/queryFuzz/actions/workflows/python-package.yml)
2+
[![Python application](https://github.com/numairmansur/queryFuzz/actions/workflows/python-app.yml/badge.svg)](https://github.com/numairmansur/queryFuzz/actions/workflows/python-app.yml)
3+
4+
5+
<img src="https://numairmansur.github.io/queryfuzz.png" width="400" height="220" />
6+
7+
8+
Datalog is a popular query language with applications in several domains.
9+
Like any complex piece of software, Datalog engines may contain bugs.
10+
The most critical ones manifest as incorrect results when evaluating queries (query bugs).
11+
Given the wide applicability of the language, query bugs may have detrimental consequences,
12+
for instance, by compromising the soundness of a program analysis that is implemented
13+
and formalized in Datalog.
14+
15+
QueryFuzz implements the metamorphic testing approach for Datalog engines described in:
16+
```
17+
M. N. Mansur, M. Christakis, V. Wüstholz - Metamorphic Testing of Datalog Engines -
18+
In Proceedings of the 29th Joint European Software Engineering Conference and Symposium on
19+
the Foundations of Software Engineering (ESEC/FSE'21).
20+
```
21+
22+
# Installation:
23+
24+
## Ubuntu/Debian:
25+
Support for C++17 is required, which is supported in g++ 7/clang++ 7 on.
26+
```
27+
sudo apt-get install autoconf automake bison build-essential clang doxygen flex g++ git libffi-dev libncurses5-dev libtool libsqlite3-dev make mcpp python sqlite zlib1g-dev
28+
git clone https://github.com/numairmansur/queryFuzz
29+
virtualenv --python=/usr/bin/python3.7 venv
30+
source venv/bin/activate
31+
cd queryFuzz
32+
python setup.py install
33+
```
34+
35+
# Usage:
36+
37+
## Testing `Soufflé`:
38+
You can immediately start testing `Soufflé` by just typing the following command:
39+
```
40+
queryfuzz
41+
```
42+
When you run this command for the first time, it will download and install Soufflé. We use
43+
`Soufflé` as our backend tool to compare and find discrepancies in the results of two Datalog programs.
44+
After successfully installing `Soufflé`, the above command will start the fuzzing procedure
45+
on the latest revision of `Soufflé`.
46+
47+
If you want to test a different version of `Soufflé`, please build and install that version
48+
and paste the path to `Soufflé` executable in the `path_to_souffle_engine` field in file
49+
`/path/to/queryFuzz/params.json`.
50+
51+
52+
## Testing `µZ`:
53+
If you want to run queryFuzz on `µZ`, please first build and install the appropriate version of `z3`.
54+
Then paste the path to `z3` executable in the `path_to_z3_engine` field in file `/path/to/queryFuzz/params.json`.
55+
You can then begin the fuzzing procedure by running:
56+
```
57+
queryfuzz --engine=z3
58+
```
59+
60+
## Testing `DDlog`:
61+
If you want to run queryFuzz on `DDlog`, please first build and install the appropriate version of `DDlog`.
62+
Then paste the path to `DDlog` executable in the `path_to_ddlog_engine` field in file `/path/to/queryFuzz/params.json`.
63+
You would also have to add path to `DDlog` home directory in the `path_to_ddlog_home_dir` field in `/path/to/queryFuzz/params.json`.
64+
You can then begin the fuzzing procedure by running:
65+
```
66+
queryfuzz --engine=ddlog
67+
```
68+
69+
## Want to test your own Datalog engine?
70+
If you want to use QueryFuzz to test your own Datalog engine, please get in touch at <numair@mpi-sws.org>.
71+
72+
## Running on multiple cores:
73+
74+
If you wish to run parallel instances of Queryfuzz on `n` cores, use the `--cores` flag. For example:
75+
```
76+
queryfuzz --cores=n
77+
```
78+
79+
# Reproducing query bugs reported in our ESEC/FSE'21 paper:
80+
Please follow the instructions [here](https://github.com/Practical-Formal-Methods/queryFuzz/tree/master/queryfuzz/fse_repl).
81+

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-minimal

docs/index.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Welcome to GitHub Pages
2+
3+
You can use the [editor on GitHub](https://github.com/numairmansur/queryFuzz/edit/master/docs/index.md) to maintain and preview the content for your website in Markdown files.
4+
5+
Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.
6+
7+
### Markdown
8+
9+
Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for
10+
11+
```markdown
12+
Syntax highlighted code block
13+
14+
# Header 1
15+
## Header 2
16+
### Header 3
17+
18+
- Bulleted
19+
- List
20+
21+
1. Numbered
22+
2. List
23+
24+
**Bold** and _Italic_ and `Code` text
25+
26+
[Link](url) and ![Image](src)
27+
```
28+
29+
For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).
30+
31+
### Jekyll Themes
32+
33+
Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/numairmansur/queryFuzz/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file.
34+
35+
### Support or Contact
36+
37+
Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out.

queryfuzz/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)