Hierarchical Delta Debugging Framework
Picireny is a Python 3 implementation of the Hierarchical Delta Debugging (HDD in short) algorithm adapted to use ANTLR v4 for parsing both the input and the grammar(s) describing the format of the input. It relies on picire to provide the implementation of the core Delta Debugging algorithm along with various tweaks like parallelization. Just like the picire framework, picireny can also be used either as a command line tool or as a library.
Both Hierarchical Delta Debugging and Delta Debugging automatically reduce “interesting” tests while keeping their “interesting” behaviour. (E.g., “interestingness” may mean failure-inducing input to a system-under-test.) However, HDD is an improvement that tries to investigate less test cases during the reduction process by making use of knowledge on the structure of the input.
The tool (and the algorithm) works iteratively in several ways. As a first step, it splits up the input into tokens and organizes them in a tree structure as defined by a grammar. Then, iteratively, it invokes Delta Debugging on each level of the tree from top to bottom, and DD is an iterative process itself, too. Finally, the nodes kept in the tree are “unparsed” to yield a reduced but still “interesting” output.
Requirements
Install
The quick way:
pip install picireny
Alternatively, by cloning the project and running setuptools:
python setup.py install
Once the project is installed, a helper script becomes available that downloads the right version of the ANTLR v4 tool jar:
picireny-install-antlr4
Usage
picireny uses the same CLI as picire and hence accepts the same options. On top of the inherited ones, picireny accepts several further arguments:
--grammars (required): List of grammars describing the input format. (You can write them by hand or simply download them from the ANTLR v4 grammars repository.
--start-rule (required): Name of the rule where parsing has to start.
--antlr (optional): Path the ANTLR tool jar.
--parser (optional): Language of the generated parser. Currently ‘python’ (default) and ‘java’ targets (faster, but needs JDK) are supported.
--islands (optional): File describing how to process island grammars if needed.
Example usage to reduce an HTML file:
picireny --input=<path/to/the/input.html> --test=<path/to/the/tester> \
--grammars "HTMLLexer.g4 HTMLParser.g4" --start-rule document \
--parallel --subset-iterator=skip --complement-iterator=backward
Compatibility
picireny was tested on:
Linux (Ubuntu 14.04 / 15.10)
Mac OS X (OS X El Capitan - 10.11).
Copyright and Licensing
See LICENSE.
Metadata
Release files for picireny 17.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| picireny-17.1.tar.gz | 35.4 kB | Details |
Release files / picireny-17.1.tar.gz
| Download URL | picireny-17.1.tar.gz |
|---|---|
| Size | 35.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abf32c77b49f33983b2f66b07e0f23d4dab001e300c517a184c21efeaa4f81b6
|
|
BLAKE2b-256 checksum How to use checksums |
d93466e9c78a9392c5362dae6f8fda70d7b2196080884e7f9e32fa5887a9a23a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |