Reference
UnitTestDesign.Excursion
— TypeThis class requests tests that are excursions from a base case.
UnitTestDesign.GND
— TypeGreedy Non-deterministic (GND).
This algorithm searches for test cases. It will generate tuples of any order. It generates a different set every time it is invoked.
Arguments
rng::Random.AbstractRNG
: This option is a random number generator. Set this if you want to generate the same test cases twice in a row.M::Int
: The number of times it should create a candidate test case each time it creates a candidate. The default is 50. Raising this number could improve test cases and slow generation.
Extended
This algorithm starts with the seeded test cases and then adds test cases, one at a time. It chooses those parameters that are least used, so far, and then chooses values of those parameters that are least covered by previous tuples. At each step, there is some probability of choosing among nearly-equal next values.
It's not complicated, but it can be slow because every next choice checks against all possible tuples. For large numbers of parameters or large numbers of possible values of each parameter, this generator can be slow, so test it for fewer values first and gradually increase the number of parameters or parameter values.
UnitTestDesign.IPOG
— TypeIn-parameter-order General (IPOG).
This algorithm generates test cases quickly. It will generate tuples of any order. It always generates the same set of test cases for the same set of input values.
Lei, Yu, Raghu Kacker, D. Richard Kuhn, Vadim Okun, and James Lawrence. 2008. “IPOG/IPOG-D: Efficient Test Generation for Multi-Way Combinatorial Testing.” Software Testing, Verification & Reliability 18 (3): 125–48.
UnitTestDesign.all_pairs
— Methodall_pairs(parameters...; kwargs...)
Ensure that the returned test cases include every pair of parameters at least once.
Examples
all_pairs([1, 2, 3], ["a", "b", "c"], [true, false])
See also: all_tuples
UnitTestDesign.all_triples
— Methodall_triples(parameters...; kwargs...)
Ensure that the returned test cases include every combination of three parameters at least once.
See also: all_tuples
UnitTestDesign.all_tuples
— Methodall_tuples(parameters...; n_way, engine, disallow, seeds, wayness, Counter)
Given a tuple of parameters, generate all test cases that cover all n_way
combinations of those parameters.
Arguments
engine=IPOG()
: Theengine
isIPOG()
,GND()
orExcursion()
.disallow=nothing
: The disallow function is a function of the parameters that returnstrue
when that combination should be forbidden.seeds=[]
: is a list of test cases that must be included among those
generated.
wayness
is a dictionary that specifies subsets of parameters for which to increase then_way
combinations. For instance, if the combinations are two-way, and you want the third-sixth parameters to be three-way covered, use,wayness = Dict(3 => [[3, 4, 5, 6]])
.Counter=Int
The Counter is an integer type to use for
the computation. It must be large enough to hold the integer number of the parameters.
Examples
all_tuples([1, 2, 3], ["a", "b", "c"], [true, false]; n_way = 2)
parameters = fill(collect(1:3), 10)
all_tuples(parameters...; n_way = 4, engine = Excursion())
UnitTestDesign.all_values
— Methodall_values(parameters...; kwargs...)
Ensure that the test cases include every value of every parameter at least once.
See also: all_tuples
UnitTestDesign.full_factorial
— Methodfull_factorial(parameters...)
full_factorial(parameters...; disallow = filter_function)
Generates a test case for every combination of the parameters.
Examples
full_factorial([0.1, 0.2, 0.3], ["low", "high"], [false, true])
If you specify a filter function, it will remove combinations that are disallowed.
UnitTestDesign.pairs_excursion
— Methodpairs_excursion(parameters...; kwargs...)
This starts with the first choice for each of the parameters. It creates test cases by varying each parameter, one at a time, through its possible values. Then it walks pairs of parameters away from the base case.
Examples
pairs_excursion([:a, :b], [1, 2], [1, 2], ["a", "b"])
See also: all_tuples
UnitTestDesign.triples_excursion
— Methodpairs_excursion(parameters...; kwargs...)
This starts with the first choice for each of the parameters. It creates test cases by varying each parameter, one at a time, through its possible values. Then it walks pairs of parameters away from the base case, and finally triples.
See also: all_tuples
UnitTestDesign.values_excursion
— Methodvalues_excursion(parameters...; kwargs...)
This starts with the first choice for each of the parameters. It creates test cases by varying each parameter, one at a time, through its possible values.
Examples
values_excursion([:a, :b, :c], [1, 2, 3])
See also: all_tuples