CONSTRAINTS Section
Constraints are an extremely important and powerful part of AnkrPt Pairwise. They let us define limits while building test cases, making it possible to ensure proper tests. Constraints use the following structure:
CONSTRAINTS (1) When [criteria] is/isIn/isNot/isNotIn [value] (2) And/Or [criteria] is/isIn/isNot/isNotIn [value] (3) Then [criteria] is/isIn/isNot/isNotIn [value] (4) And [criteria] is/isIn/isNot/isNotIn [value] (5)
1 | CONSTRAINTS tag identifying the start of a Constraints section. |
2 | When defines the beginning of a constraint |
3 | And and Or define additional criteria for the constraint |
4 | Then is the beginning of the Then section for its associated When |
5 | And defines additional Then criteria. Or is not allowed with Then. |
Let’s see an example.
Some basic rules of the Constraints section are:
-
every constraint requires both a When and Then statement.
-
Or is not allowed with the Then clause.
-
And and Or follow basic programming logic with Or tested first followed by And.
Constraints are built with keywords, criteria, and values (including negative ones) based upon basic logical conditions using a "When this Then that" structure.
Keywords
Keyword |
Description |
When |
defines the beginning of a Constraint |
Then |
defines the beginning of the Then clause |
And |
logic operator to And your criteria |
Or |
logic operator to Or your criteria |
Is |
lets you define a single value that the condition must match |
IsIn |
defines multiple possible values that the Constraint must match one of |
IsNot |
defines a single value which the Constraint cannot be |
IsNotIn |
defines a list of values which the Constraint cannot match any of |
-
THEN conditions should be based on explicit requirements.
-
WHEN and THEN are defined once per Constraint; usage of both is mandatory.
-
you must use defined criteria.
-
REQUIRED TESTS are less important than CONSTRAINTS - it is required to resolve conflict before test generation.
-
OR is not allowed to define multiple values for the same criteria, use isIn or isNotIn instead.
It’s essential to use CONSTRAINTS wisely otherwise you might accidentally eliminate some needed pairs from test generation. You should verify the dependencies between constraints to avoid the risk of omitting essential pair combinations. |
To better understand the impact of your constraints, pairs not considered valid for tests is provided in the generation summary. |