Test Case Reducers: package fuzzinator.reduce
¶
- class fuzzinator.reduce.Picire(*, split_class='zeller', granularity=2, subset_first=True, subset_iterator='forward', complement_iterator='forward', parallel=False, combine_loops=False, jobs=2, max_utilization=100, atom='both', encoding=None, cache_class='ContentCache', **kwargs)¶
Test case reducer based on the Picire Parallel Delta Debugging Framework.
Optional parameters of the reducer:
split_class
,granularity
,subset_first
,subset_iterator
,complement_iterator
,parallel
,combine_loops
,jobs
,max_utilization
,atom
,encoding
,cache_class
Refer to https://github.com/renatahodovan/picire for configuring Picire.
Note: This reducer is capable of detecting new issues found during the test reduction (if any).
Example configuration snippet:
[sut.foo] #call=... cost=1 reduce=fuzzinator.reduce.Picire reduce_cost=4 [sut.foo.reduce] parallel=True jobs=4 subset_iterator=skip
- class fuzzinator.reduce.Picireny(*, split_class='zeller', granularity=2, subset_first=True, subset_iterator='forward', complement_iterator='forward', parallel=False, combine_loops=False, jobs=2, max_utilization=100, format=None, grammar=None, start=None, replacements=None, antlr=None, lang='python', build_hidden_tokens=False, hddmin='hdd', hdd_phases='["prune"]', hdd_star=True, flatten_recursion=False, squeeze_tree=True, skip_unremovable=True, skip_whitespace=False, encoding=None, cache_class='ContentCache', work_dir, **kwargs)¶
Test case reducer based on the Picireny Hierarchical Delta Debugging Framework.
Mandatory parameters of the reducer:
Either
format
orgrammar
andstart
must be defined.
Optional parameters of the reducer:
split_class
,granularity
,subset_first
,subset_iterator
,complement_iterator
,parallel
,combine_loops
,jobs
,max_utilization
,format
,grammar
,start
,replacements
,antlr
,lang
,build_hidden_tokens
,hddmin
,hdd_phases
,hdd_star
,flatten_recursion
,squeeze_tree
,skip_unremovable
,skip_whitespace
,encoding
,cache_class
Refer to https://github.com/renatahodovan/picireny for configuring Picireny.
Note: This reducer is capable of detecting new issues found during the test reduction (if any).
Example configuration snippet:
[sut.foo] #call=... cost=1 reduce=fuzzinator.reduce.Picireny reduce_cost=4 [sut.foo.reduce] hddmin=full grammar=["/home/alice/grammars-v4/HTMLParser.g4", "/home/alice/grammars-v4/HTMLLexer.g4"] start=htmlDocument parallel=True jobs=4 subset_iterator=skip
- class fuzzinator.reduce.Reducer¶
Abstract base class to represent test case reducers.
- __call__(*, sut_call, issue, on_job_progressed)¶
Reduce the test case of
issue
while ensuring that the reduced test case still triggers the original issue. Return a tuple consisting of a reduced test case for the issue (orNone
if the issue’s current test case could not be reduced) and a (potentially empty) list of new issues that were discovered during test case reduction (if any).Raises
NotImplementedError
by default.- Parameters:
sut_call (Call) – The SUT call that reported the original issue.
issue (dict[str, Any]) – The original issue, the test case of which should be reduced.
on_job_progressed – A bound
on_job_progressed
method with frozenjob_id
argument that may be notified about the progress of the reduction.
- Returns:
The reduced test case (if reduction was successful) and the list of new issues detected during reduction (if any).
- Return type: