Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Namely, it’s adding a lot of “Invalid Constraints” as described in the previous article in this section.This is the quick option… Bound Constraints!

How to use Bound Constraints

UI Steps
sizesmall
UI Step

Click on the green arrow icon to the right from the first value name (it appears on hover)

Image Added

...

UI Step

Click on the green arrow icon to the right from the second value name (it appears on hover)

Image Added

...

UI Step

Confirm how you’d like to have the bound constraint operate:

...

Image Added

Most of the time when you have “Not Applicable” as an option, you will use “mutually bound constraints” as in this case. Here, we want “Do Not Add a Hotel” to be bound with Type of Room as “Not Applicable” AND we want to have Type of Room of “Not Applicable” to be bound with “Do Not Add a Hotel” so we mark this one as a Mutually Bound Constraint.

Problem solved!

Summary

So what really just happened there?


When you add a Bound Pair, DesignWise Xray Enterprise Designer will constrain the first value chosen against all the other values in the parameter of the second value chosen. In the example above, creating a bound constraint of ‘Do Not Add Hotel’ and ‘Hotel Chain Preference’ = ‘Not Applicable’ means you are really invalidating these options:

  • ‘Do Not Add a Hotel’ with ‘Hotel Chain Preference = Marriott’ (this combination will never appear).
  • ‘Do Not Add a Hotel’ with ‘Hotel Chain Preference = Hilton’ (this combination will never appear).
  • ‘Do Not Add a Hotel’ with ‘Hotel Chain Preference = Motel One’ (this combination will never appear).
  • ‘Do Not Add a Hotel’ with ‘Hotel Chain Preference = Vivanta by Taj’ (this combination will never appear).

And because we created a MUTUALLY BOUND constraint, we are also invalidating this these combinations:

  • ‘Do Add a Hotel’ with ‘Hotel Chain Preference = Not Applicable’ (this combination will never appear).

...

“Bound Constraints” are rules for your model algorithm to ensure that two values must appear together. Knowing which type to use depends on your plan structure and business & technology requirements.

We will be using this set of values to demonstrate:

Image AddedImage Removed

As a reminder, to apply a bound constraint, you need to hover over value 1, click the green arrow icon to the right from the value name, then do the same for value 2, and select the appropriate option from the 3 provided ones.

...

We would like to exclude combinations like ‘Breed of Animal = Shiba Inu’ and ‘Type of Animal = Cat’ from the generated scenarios. We have 2 breeds for each of the first 2 types of animalanimals. Therefore, we can set up 4 one-way bound pairs from "Breed of Animal" to "Type of Animal":

Image RemovedImage Added

You can check your logic by reading the statement at the bottom of the dialog.

...

In this case, we wouldn't be able to say WHEN ‘Type of Animal = Cat’ THEN ‘Breed of Animal = Siamese’ because that would prevent 'Cat + Persian' from appearing and would leave 'Persian" without any possible pairing.

Image AddedImage Removed
Important

Note

...

You may argue that the statement at the bottom still looks correct in this direction, however you need to keep in mind how the word "must" is interpreted by the algorithm. Since the evaluation is done at the "pair of values" level, "must have Breed of Animal as Siamese" = "must NOT have Breed as Persian, Shiba Inu, Golden Retriever, Arabian" - of which "Persian" is incorrectly excluded, therefore this direction wouldn't work for this example. We could use such direction if we had multiple types that can be with only 1 breed.

Mutually Bound Pair

The underlying relationship type: one-to-one, represented by ALWAYS-ALWAYS statements in the left column.

With Mutually Bound Constraints, the values are exclusive to each other. In this example, there is only one horse breed in the second parameter. So, with 1 constraint, we can specify that "Horse" should not be paired with "Siamese, Persian, Shiba Inu, Golden Retriever" AND "Arabian" should not be paired with "Cat, Dog" - i.e., "Horse" and "Arabian" must only be tested together.

Image Removed


SummaryImage Added


The final set of rules for this model (in the verbal form) would look like this:

Image RemovedImage Added

In essence, Bound Constraints and Invalid Constraints perform similar tasks: they ensure that certain values only or never appear together - making all generated scenarios valid within the model scope. From a different point of view, Bound Constraints and Mutually Bound Constraints actually invalidate many values and Invalid Constraints bind many values, behind the scenes.

...

For example, let’s use this plan below for a flight booking system:

Image RemovedImage Added

In this planmodel, only customers who are in First Class get in-flight dining. Coach and Business class customers do not get in-flight dining. Therefore, test cases with Coach and Business class customers should have no value for “Food Choice”.


First, navigate to Rules→ Constraints. Next, click the toggle to change to Advanced Mode – that is the only way to implement "Skip" constraints:

Image RemovedImage Added

Once in Advanced Mode, we use the following syntax for "Skip" constraints:

            Parameter[Parameter Value] >> Parameter(s) to be skipped

So, for our example, the syntax is this:

Image RemovedImage Added

The ability to include multiple values in the same constraint is an aspect of the Advanced Mode that is not limited to "Skip" constraints.

Now, when we generate our test suite by navigating to Scenarios, any row that includes “Ticket Type” as “Coach” or "Business" will have no value for “Food Choice”:

Image RemovedImage Added

You can also skip multiple parameters that are listed next to each other in the Parameters screen. For example, let’s say that Coach customers now get no food, drink, or checked bag. Thus, they should have blanks for each of those parameters. Since we have those 3 sequentially in the table of parameters (refer to the model screenshot at the start of this article), we can use the following syntax:

...

The boundaries are inclusive, therefore, for our example, that looks like this:

Image RemovedImage Added

Now, when we generate our test suite by navigating to Scenarios, any rows with “Coach” for “Ticket Type” have no value for “Food Choice”, “Drink Choice”, or “Checked Bag”:

Image Modified


The final component of "Skip" constraints is the ‘skip to end’ capability. In this case, we can tell DesignWise Xray Enterprise Designer that for some parameters values, skip all parameters listed later (below) on the “Parameters” page.

So, for our example, we could return to our Parameters page and reorder the elements so that “Food Choice”, “Drink Choice”, and “Checked Bag” are the last three parameters:Image Removed

Image Added

Then, we use the syntax below to skip to end:

...

For our example, that looks like this:

Image RemovedImage Added

Lastly, you can do a quick review of available options & syntax by clicking the “Usage” button in top-right section of the Advanced Mode:

Image RemovedImage Added