Generators are classes that provide test data. Generators must be defined for classes run by OnlineRunner, or other runners generating test data in runtime. Some generators must be provided with parameters. Generator parameters may be either required or optional. Required parameters must be provided for a generator to run. If user does not provide optional parameter, default value is used.
Cartesian product generator
This generator will generate test data that are cartesian product (all possible combinations) of equivalence classes representing parameters of the test function. The generator does not require any parameters.
The generator generates such combinations that all possible n-tuples of the test function input domain represented by equivalence classes are covered. The result is quasi-optimal in the sense of minimal number of test cases, however it cannot be guaranteed that all n-tuples cannot be covered by less test cases. In case where constraints defined for the equivalence classes in the model prohibit existence of test cases covering specific tuple, such tuple will not be generated and the user will not be notified in any way about it.
- N – integer between 1 and diemension of input domain (number of function parameters). For example for pairwise coverage, the value of this parameter must be set to 2.
- coverage – integer between 1 and 100, 100 by default. It determines minimal percent value of the total n-tuples to be covered by generated test cases.
Generates random values from valid state space. The result is uniform if the valid combinations are distributed uniformly over the space of possible combinations.
- length – a positive integer defining number of test cases to generate
duplicates – boolean parameter (by default
false) indicating whether duplicates are allowed. In case of
falsethe number of generated test cases will not be higher than size of the valid combinations space. The value
Adaptive random generator
Generalization of RandomGenerator.class. It generates a set of candidates for test cases and selects the one with the biggest distance to already executed test cases. The distance between test cases is defined by number of different elements in the vector (i.e. two identical vectors have distance 0 and two completely different vectors of n elements have distance n).
- length – positive integer defining number of test cases to generate
- duplicates – with the same meaning as for RandomGenerator.class
- depth – -1 or any non-negative number defining number of executed test cases to which the candidates will be optimized. Default value -1 means that all history will be considered. Assigning 0 to this parameter makes the generator purely random generator.
- candidate set size – positive number of candidate test cases generated each time when new test case is requested. Each of the potential test cases from the candidate set will be measured for optimum distance from the already executed test cases. Default value is 100.