Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
numairmansur committed Jun 7, 2021
0 parents commit 7668193
Show file tree
Hide file tree
Showing 366 changed files with 104,310 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
39 changes: 39 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
136 changes: 136 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
temp/*
temp
.vscode
*stats.json
home.py
params.json
souffle_installations/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[![Python package](https://github.com/numairmansur/queryFuzz/actions/workflows/python-package.yml/badge.svg)](https://github.com/numairmansur/queryFuzz/actions/workflows/python-package.yml)
[![Python application](https://github.com/numairmansur/queryFuzz/actions/workflows/python-app.yml/badge.svg)](https://github.com/numairmansur/queryFuzz/actions/workflows/python-app.yml)


<img src="https://numairmansur.github.io/queryfuzz.png" width="400" height="220" />


Datalog is a popular query language with applications in several domains.
Like any complex piece of software, Datalog engines may contain bugs.
The most critical ones manifest as incorrect results when evaluating queries (query bugs).
Given the wide applicability of the language, query bugs may have detrimental consequences,
for instance, by compromising the soundness of a program analysis that is implemented
and formalized in Datalog.

QueryFuzz implements the metamorphic testing approach for Datalog engines described in:
```
M. N. Mansur, M. Christakis, V. Wüstholz - Metamorphic Testing of Datalog Engines -
In Proceedings of the 29th Joint European Software Engineering Conference and Symposium on
the Foundations of Software Engineering (ESEC/FSE'21).
```

# Installation:

## Ubuntu/Debian:
Support for C++17 is required, which is supported in g++ 7/clang++ 7 on.
```
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
git clone https://github.com/numairmansur/queryFuzz
virtualenv --python=/usr/bin/python3.7 venv
source venv/bin/activate
cd queryFuzz
python setup.py install
```

# Usage:

## Testing `Soufflé`:
You can immediately start testing `Soufflé` by just typing the following command:
```
queryfuzz
```
When you run this command for the first time, it will download and install Soufflé. We use
`Soufflé` as our backend tool to compare and find discrepancies in the results of two Datalog programs.
After successfully installing `Soufflé`, the above command will start the fuzzing procedure
on the latest revision of `Soufflé`.

If you want to test a different version of `Soufflé`, please build and install that version
and paste the path to `Soufflé` executable in the `path_to_souffle_engine` field in file
`/path/to/queryFuzz/params.json`.


## Testing `µZ`:
If you want to run queryFuzz on `µZ`, please first build and install the appropriate version of `z3`.
Then paste the path to `z3` executable in the `path_to_z3_engine` field in file `/path/to/queryFuzz/params.json`.
You can then begin the fuzzing procedure by running:
```
queryfuzz --engine=z3
```

## Testing `DDlog`:
If you want to run queryFuzz on `DDlog`, please first build and install the appropriate version of `DDlog`.
Then paste the path to `DDlog` executable in the `path_to_ddlog_engine` field in file `/path/to/queryFuzz/params.json`.
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`.
You can then begin the fuzzing procedure by running:
```
queryfuzz --engine=ddlog
```

## Want to test your own Datalog engine?
If you want to use QueryFuzz to test your own Datalog engine, please get in touch at <numair@mpi-sws.org>.

## Running on multiple cores:

If you wish to run parallel instances of Queryfuzz on `n` cores, use the `--cores` flag. For example:
```
queryfuzz --cores=n
```

# Reproducing query bugs reported in our ESEC/FSE'21 paper:
Please follow the instructions [here](https://github.com/Practical-Formal-Methods/queryFuzz/tree/master/queryfuzz/fse_repl).

1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-minimal
37 changes: 37 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Welcome to GitHub Pages

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.

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.

### Markdown

Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for

```markdown
Syntax highlighted code block

# Header 1
## Header 2
### Header 3

- Bulleted
- List

1. Numbered
2. List

**Bold** and _Italic_ and `Code` text

[Link](url) and ![Image](src)
```

For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).

### Jekyll Themes

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.

### Support or Contact

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.
Empty file added queryfuzz/__init__.py
Empty file.
Loading

0 comments on commit 7668193

Please sign in to comment.