Compartilhar via


Combination Class

Provides methods for controlling how Spec Explorer produces value or parameter combinations.

Namespace: Microsoft.Modeling
Assembly: Microsoft.Xrt.Runtime (in Microsoft.Xrt.Runtime.dll)

Usage

'Usage

Syntax

'Declaration
public static class Combination

Remarks

You can specify how Spec Explorer handles parameter expansion in a model program at the point where an action method is defined, or in a Cord script, either in a configuration block associated with an action declaration, or in an embedded code block in a behavior machine.

A value combination configuration consists of a set of statements that describe in a declarative way how value combinations are produced. Some of those statements apply only if a particular combination method is chosen using the Strategy method.

To specify the default parameter expansion strategy in a Spec Explorer configuration, use the DefaultParameterExpansion switch. For more information about the DefaultParameterExpansion switch, see Model Evaluation and Exploration Switches.

This class supports the following combination declarations.

Domains

A domain is not part of the Combination class. However, a domain is a special type of constraint that interacts with how Spec Explorer expands values. A domain is not required for value combination generation, as Spec Explorer can derive a domain from more general constraints such as inequalities. For more information about parameter domains, see Parameter Domains, the DomainAttribute class, and the Cord script Domain clause.

Interactions

To specify for which value combinations Spec Explorer should generate a full Cartesian product space, use the Interaction method. To specify for which value combinations Spec Explorer should generate pairwise or n-wise combinations, use the Pairwise, PairwiseDeep, NWise, or NWiseDeep method.

Isolations

For each specified isolation, Spec Explorer produces one isolated combination, which it excludes from all other combinations it produces. Spec Explorer does not apply such isolated combinations towards an interaction coverage goal. To specify for which value combinations Spec Explorer should generate isolated combinations, use the Isolated method.

For example, to use isolation conditions for invalid values, declare each invalid combination as isolated. Spec Explorer then generates each invalid combination once and only once in generating a transition system.

Seeds

For each seeded condition, Spec Explorer produces at least one combination, independent of interaction coverage goals. If the parameter expansion point for the enclosing rule is set to ParameterExpansionPoint.OnExit, Spec Explorer automatically generates seeds for each path condition. To specify a seeded condition, use the Seeded method.

Limits

To limit the number of combinations that Spec Explorer produces, use the SetLimit method.

Spec Explorer uses the following algorithm, which attempts to produce the desired interactions with the smallest number of combinations, to generate parameters.

  • First, Spec Explorer produces all the isolated combinations. If I1 and I2 are isolation conditions, and C is the set of constraints, then Spec Explorer produces one combination that satisfies C & I1 & !I2, and one combination that satisfies C & !I1 & I2. Spec Explorer does not count the isolated combinations towards interaction coverage. For the remaining solutions, let C' = C & !I1 & !I2 be the constraints refined by exclusion of the isolated combinations.

  • Next, Spec Explorer produces the seeded combinations. If S1 and S2 are seeding conditions, then Spec Explorer produces one combination that satisfies C' & S1 and one combination that satisfies C' & S2. Spec Explorer does count the seeded combinations towards interaction coverage.

  • Finally, Spec Explorer produces new combinations that satisfy the constraint C' and that are necessary to reach the interaction coverage goal.

At any point in this algorithm, Spec Explorer can stop the enumeration of combinations when it reaches a declared limit. In general, Spec Explorer performs lazy combination enumeration. Thus, when limits are declared, Spec Explorer can enumerate over even a large combinatorial space.

Spec Explorer raises an exception during exploration if any declared isolated combination does not exist; that is, if there does not exist a combination that satisfies the involved constraints. In contrast, if all interactions can be covered with the given constraints, Spec Explorer does not raise an exception, and restricts the combination set. In general, the algorithm finds the greatest possible number of interactions that satisfy the declared constraints.

Inheritance Hierarchy

System.Object
  Microsoft.Modeling.Combination

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003

See Also

Reference

Combination Members
Microsoft.Modeling Namespace

Other Resources

Parameter Generation