Class TestModel


  • public class TestModel
    extends java.lang.Object
    A class containing all important information needed for one combinatorial test. This includes the desired testing strength, the parameters and forbidden/error constraints. Forbidden constraints should never appear in any test input as they just cannot be executed, while error constraints should lead to validation or other kinds of errors in an application and should therefore be tested
    • Constructor Detail

      • TestModel

        public TestModel​(int strength,
                         int[] parameterSizes,
                         java.util.Collection<TupleList> forbiddenTupleLists,
                         java.util.Collection<TupleList> errorTupleLists)
        Parameters:
        strength - the desired testing strength. Must be equal to or greater than one and at most the number of parameters
        parameterSizes - the sizes of all parameters. [2, 3, 5] means the first parameter has 2 values, the second one 3 and the last one 5. All parameters need to have at least two values. Must not be null
        forbiddenTupleLists - all forbidden combinations. Must not be null. The sizes of the corresponding parameters must be respected. Must not contain duplicate ids
        errorTupleLists - all error combinations. Must not be null. The sizes of the corresponding parameters must be respected. Must not contain duplicate ids or ids contained in the forbiddenTupleLists
    • Method Detail

      • getStrength

        public int getStrength()
        Returns:
        the testing strength
      • getParameterSizes

        public int[] getParameterSizes()
        Returns:
        the number of values for each parameter
      • getForbiddenTupleLists

        public java.util.List<TupleList> getForbiddenTupleLists()
        Returns:
        all forbidden combinations. Tests containing these combinations cannot be executed
      • getErrorTupleLists

        public java.util.List<TupleList> getErrorTupleLists()
        Returns:
        all error combinations. Tests containing these combinations can be executed but should cause an error
      • getExclusionConstraints

        public java.util.List<InternalConstraint> getExclusionConstraints()
      • getNumberOfParameters

        public int getNumberOfParameters()
        Returns:
        the number of parameters
      • getSizeOfParameter

        public int getSizeOfParameter​(int parameterId)
        Parameters:
        parameterId - the id of a parameter in the model
        Returns:
        the number of values this parameter has
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object