public class Reducer extends Object
system input definition
, updates the associated test case generators
to reduce the number of generated test cases.Constructor and Description |
---|
Reducer()
Creates a new Reducer object.
|
Modifier and Type | Method and Description |
---|---|
static Optional<ITestCaseGenerator> |
reduce(FunctionInputDef inputDef)
For a
function input definition , returns a test case generator
that reduces
the number of test cases normally generated, using default options . |
static Optional<ITestCaseGenerator> |
reduce(FunctionInputDef inputDef,
ITestCaseGenerator generator,
FunctionTestDef baseDef,
ReducerOptions options)
For a
function input definition , updates the given test case generator
to reduce the number of generated test cases, using the given options . |
static Optional<GeneratorSet> |
reduce(SystemInputDef inputDef)
For a
system input definition , returns a set of test case generators
that reduces
the number of test cases normally generated, using default options . |
static Optional<GeneratorSet> |
reduce(SystemInputDef inputDef,
GeneratorSet genDef,
SystemTestDef baseDef,
ReducerOptions options)
For a
system input definition , returns a set of test case generators
that reduces the number of test cases normally generated, using the given options . |
public static Optional<GeneratorSet> reduce(SystemInputDef inputDef, GeneratorSet genDef, SystemTestDef baseDef, ReducerOptions options)
system input definition
, returns a set of test case generators
that reduces the number of test cases normally generated, using the given options
.
Returns Optional.empty()
if test cases were not reduced.
When a new GeneratorSet
is returned, the generator
for each function specified
by the given options
is updated according the procedure defined
here
.public static Optional<GeneratorSet> reduce(SystemInputDef inputDef)
system input definition
, returns a set of test case generators
that reduces
the number of test cases normally generated, using default options
.
Returns Optional.empty()
if test cases were not reduced.public static Optional<ITestCaseGenerator> reduce(FunctionInputDef inputDef, ITestCaseGenerator generator, FunctionTestDef baseDef, ReducerOptions options)
function input definition
, updates the given test case generator
to reduce the number of generated test cases, using the given options
.
The reducing process operates as a sequence of "rounds". Each round consists of a series of test case generations executions
called "samples". Each sample uses a new random seed to generate test cases for the specified function in
an attempt to find a seed that produces the fewest test cases.
If all samples in a round complete without reducing the current minimum test case count, the reducing process
terminates. Otherwise, as soon as a new minimum is reached, a new round begins. The number of samples in each
subsequent round is determined using the "resample factor"
.
At the end of the reducing process, if test cases have been reduced, returns a updated ITestCaseGenerator
with the
random seed value that produce the minimum test case count. Otherwise, returns Optional.empty()
.public static Optional<ITestCaseGenerator> reduce(FunctionInputDef inputDef)
function input definition
, returns a test case generator
that reduces
the number of test cases normally generated, using default options
.
Returns Optional.empty()
if test cases were not reduced.Copyright © 2024 The Cornutum Project. All rights reserved.