Package: picireny
Hierarchical Delta Debugging FrameworkPicirenyis a Python implementation of the Hierarchical Delta Debugging
(HDD in short) algorithm adapted to useANTLRv4 for parsing both the input
and the grammar(s) describing the format of the input. It relies onPicireto provide the implementation of the core Delta Debugging algorithm along
with various tweaks like parallelization. Just like thePicireframework,Picirenycan 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.RequirementsPython>= 3.5JavaSE >= 7 JRE or JDK (the latter is optional, only needed if Java is used
as the parser language)InstallTo usePicirenyin another project, it can be added tosetup.cfgas an
install requirement (if usingsetuptoolswith declarative config):[options]install_requires=picirenyTo installPicirenymanually, e.g., into a virtual environment, usepip:pip install picirenyThe above approaches install the latest release ofPicirenyfromPyPI.
Alternatively, for the development version, clone the project and perform a
local install:pip install .UsagePicirenyuses the same CLI asPicireand hence accepts the sameoptions.
On top of the inherited ones,Picirenyaccepts several further arguments:--grammar(optional): List of grammars describing the input format. (You
can write them by hand or simply download them from theANTLR v4 grammars repository.)--start(optional): Name of the start rule (optionally prefixed with a
grammar name) as[grammarname:]rulename.--replacements(optional): Json file containing rule names and minimal
replacement strings (otherwise these are calculated automatically) (seeschema).--format(optional): Json file describing the input format (seeschemaandexample). This descriptor can incorporate all the above (--grammar,--startand--replacements) properties, along with the possibility of
island grammar definitions. If both--formatand the aforementioned
arguments are present, then the latter will override the appropriate values of
the format file.--antlr(optional): Path to the ANTLR tool jar.--parser(optional): Language of the generated parser. Currently ‘python’
(default) and ‘java’ targets (faster, but needs JDK) are supported.Note: although, all the arguments are optional, the grammar files and the start
rule of the top-level parser must be defined with an arbitrary combination of the--format,--grammars, and--startarguments.Example usage to reduce an HTML file:picireny --input=<path/to/the/input.html> --test=<path/to/the/tester> \
         --grammar HTMLLexer.g4 HTMLParser.g4 --start htmlDocument \
         --parallel --subset-iterator=skip --complement-iterator=backwardCompatibilityPicirenywas tested on:Linux (Ubuntu 14.04 / 16.04 / 18.04 / 20.04)OS X / macOS (10.11 / 10.12 / 10.13 / 10.14 / 10.15 / 11)Windows (Server 2012 R2 / Server version 1809 / Windows 10)Acknowledgement and CitationsPicirenyis motivated by the idea of Hierarchical Delta Debugging:Ghassan Misherghi and Zhendong Su. HDD: Hierarchical Delta Debugging.
In Proceedings of the 28th International Conference on Software Engineering
(ICSE ‘06), pages 142-151, Shanghai, China, May 2006. ACM.https://doi.org/10.1145/1134285.1134307The details of the modernized re-implementation and further improvements are
published in:Renata Hodovan and Akos Kiss. Modernizing Hierarchical Delta Debugging.
In Proceedings of the 7th International Workshop on Automating Test Case
Design, Selection, and Evaluation (A-TEST 2016), pages 31-37, Seattle,
Washington, USA, November 2016. ACM.https://doi.org/10.1145/2994291.2994296Renata Hodovan, Akos Kiss, and Tibor Gyimothy. Tree Preprocessing and Test
Outcome Caching for Efficient Hierarchical Delta Debugging.
In Proceedings of the 12th IEEE/ACM International Workshop on Automation of
Software Testing (AST 2017), pages 23-29, Buenos Aires, Argentina, May 2017.
IEEE.https://doi.org/10.1109/AST.2017.4Renata Hodovan, Akos Kiss, and Tibor Gyimothy. Coarse Hierarchical Delta
Debugging.
In Proceedings of the 33rd IEEE International Conference on Software
Maintenance and Evolution (ICSME 2017), pages 194-203, Shanghai, China,
September 2017. IEEE.https://doi.org/10.1109/ICSME.2017.26Akos Kiss, Renata Hodovan, and Tibor Gyimothy. HDDr: A Recursive Variant of
the Hierarchical Delta Debugging Algorithm.
In Proceedings of the 9th ACM SIGSOFT International Workshop on Automating
Test Case Design, Selection, and Evaluation (A-TEST 2018), pages 16-22, Lake
Buena Vista, Florida, USA, November 2018. ACM.https://doi.org/10.1145/3278186.3278189Daniel Vince, Renata Hodovan, Daniella Barsony, and Akos Kiss. Extending
Hierarchical Delta Debugging with Hoisting.
In Proceedings of the 2nd ACM/IEEE International Conference on Automation of
Software Test (AST 2021), pages 60-69, Madrid, Spain (Virtual), May 2021.
IEEE.https://doi.org/10.1109/AST52587.2021.00015Copyright and LicensingLicensed under the BSD 3-ClauseLicense.