Class PrimitiveStrengthGroup


  • public class PrimitiveStrengthGroup
    extends Object
    Class representing a group of parameters which should be tested at another strength than the default testing strength.

    This concept is in general called mixed-strength combinatorial testing where there is a defined default testing strength and a number of parameter groups which deviate from this default strength. Such a mechanism is useful to model multiple subsystems in a combinatorial test without increasing the testing strength between the subsystems unnecessarily. Additionally, parameters which are prone to appear in failure-causing combinations can be tested at a higher strength to increase confidence.

    • Method Detail

      • ofStrength

        public static PrimitiveStrengthGroup ofStrength​(it.unimi.dsi.fastutil.ints.IntSet parameters,
                                                        int strength)
        Constructs a new PrimitiveStrengthGroup between the given parameters and the used strength.
        Parameters:
        parameters - the parameters in the group which should be tested to the given higher testing strength. Must not be null
        strength - the strength to which the given parameters should be tested. Must not be negative and must be at most the number of parameters in the group
        Returns:
        the created group at the given strength
      • ofHighestStrength

        public static PrimitiveStrengthGroup ofHighestStrength​(it.unimi.dsi.fastutil.ints.IntSet parameters)
        Constructs a new PrimitiveStrengthGroup between the given parameters of the highest possible strength. In practice this means that the cartesian product between the values of the given parameters has to appear in the final test suite.
        Parameters:
        parameters - the parameters to test at the highest possible strength. Must not be null
        Returns:
        the created groups at a strength equal to the number of parameter in the group
      • getParameters

        public it.unimi.dsi.fastutil.ints.IntSet getParameters()
      • getNumberOfParameters

        public int getNumberOfParameters()
      • getStrength

        public int getStrength()
      • getAllSubGroups

        public List<it.unimi.dsi.fastutil.ints.IntSet> getAllSubGroups()
        Returns all possible sub groups of size strength in this PrimitiveStrengthGroup.

        For example, if this PrimitiveStrengthGroup consists of parameters [0, 1, 2, 3] and the strength is 2, then the following sets are returned: {0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}.

        If the strength is zero and empty list is returned.

        Returns:
        all possible sub-combinations of the parameters in this groups which have the size strength. Never returns null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object