Versions Compared

Key

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

...

So that the model can understand the requirements, you have the option to define invalid constraints (values that can never be tested together), and/or bound constraints (values that can only be tested together) .

...

to train the model.

Invalid constraints

Invalid constraints restrict parameter values that can never be tested together.

...

Tip

Do you need to add a lot of Invalid Constraints?

  • Imagine you had an application that asked, “Would you like to add a hotel to your travel reservation?” Any scenarios with “Do Not Add a hotel” would require many, many different Invalid Constraints between things like “Do Not Add a Hotel” and “Hotel Chain Preference = X”. For situations like those, the Bound Constraint feature will help you accomplish your constraint handling much faster.
  • If you have more than 10 or so Invalid Constraints (or Bound Constraints) in your plan, you might find that it is faster to export your plan into Excel and document your paired values in Excel. If so, make sure to both (1) add multiple paired values in Xray Test Case Designer before you export into Excel (so you can copy and paste the Xray Test Case Designer formatting for Invalid Constraints and/or Bound Constraints), and (2) ensure that you use the exact spelling of Values (e.g., ‘cutting and pasting’ Values will usually be safer than typing)

Watch out for “Not Applicable” Values.

  • Do you need to add some of them to your plan? Do you need to invalidate the combination of “Not Applicable” with other specific Values?
  • Especially watch out for situations where you have multiple related “Not Applicable” values in a plan. Would it make sense to create a “Bound Constraint” between ‘Hotel Chain Preference = Not Applicable’ and ‘Type of Room’ = Not Applicable’?




Bound constraints

Bound constraints restrict parameter values that can only be tested together.

...

Namely, it’s adding a lot of “Invalid Constraints” as described in the previous article in this section.

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)

UI Step

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

UI Step

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

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.

...



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.

One-way Bound Pair

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

...

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.

...

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.

Advanced Constraints View

Syntax Summary

...

Flying From[the Philippines] != Flying to[the Philippines]

...

Person[Child] -> Size[XS]

...

Children[1, More than 1] -> Class[Coach]

...

Adults[More than 1] <-> Class[First]

...

If more than 1 adult traveling then class needs to be First; First class is only available for more than 1 adults traveling

...

Adults[1, More than 1] <-> Class[First]

...

Hotel Reservation[Not Added] >> Hotel Quality

...

Hotel Reservation[Do Not Add] >> Hotel Quality::Hotel Price Range

...

Hotel Reservation[Do Not Add] >> Hotel Quality :: !!

...

Hotel Reservation[Not Added] >> !!

...


"Skip" constraints

"Skip" constraints are only available under the Advanced Mode which is enabled per request (toggle in the top left of the Constraints screen).

"Skip" constraints allow for certain parameters to be excluded from test cases when it is not appropriate for them to appear. It is a faster alternative to the "Not applicable" + Bound Pairs approach. However, as the feature is in the beta stage, please note that there are a couple open defects, specifically around the interaction of "Skip" constraints with the regular ones. So if you encounter any issues, feel free to reach out to Support or avoid skips for the time being.

How to Use Skip Constraints

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

Image Added

In this model, 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 Added

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

 

"Skip" constraints

...

How to Use Skip Constraints

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

Image Removed

In it, 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”.

...

Image Removed

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 (refer only to line 2):

Image Removed

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 Removed

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:

          Parameter[Parameter Value] >> First Parameter to be skipped :: Last parameter Parameter(s) to be skipped

The boundaries are inclusive, thereforeSo, for our example, that looks like this (refer only to line 1):the syntax is this:

Image 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.Image Removed

Now, when we generate our test suite by navigating to Scenarios, any rows with “Coach” for row that includes “Ticket Type” as “Coach” or "Business" will have no value for “Food Choice”, “Drink Choice”, or “Checked Bag” (both skip constraints are active):

Image Removed

The final component of "Skip" constraints is the ‘skip to end’ capability. In this case, we can tell Xray Test Case 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 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 syntaxImage Removed
Then, we use the syntax below to skip to end:

          Parameter[Parameter Value] >> First Parameter to be skipped ::!!

For our example, that looks like this:

Image Removed

Constraint Management

View a Constraint

UI Steps
sizesmall
UI Step

To view constraints, select the option "Rules" and then "Constraints" on the model

Image Removed

UI Step

A list with all the bound and invalid constraints will be displayed (the same applies to the Advanced view).

Image Removed

Edit a Constraint

...

It is not possible to edit a constrain at the Standard View. In the Standard View you are only allowed to delete and create a new constraint.

Delete a Constraint

To delete a constraint, hover over it in the table list and select the delete option:
Image Removed

Another option is to, on bulk view mode, delete the desired constraint line:
Image Removed

Tips

...

: Last parameter to be skipped

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

Image 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 Added


The final component of "Skip" constraints is the ‘skip to end’ capability. In this case, we can tell Xray Test Case 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 Added

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

          Parameter[Parameter Value] >> First Parameter to be skipped::!!

For our example, that looks like this:

Image 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 Added


View a Constraint

UI Steps
sizesmall
UI Step

To view constraints, select the option "Rules" and then "Constraints" on the model

Image Added

UI Step

A list with all the bound and invalid constraints will be displayed.

Image Added


Edit a Constraint

To edit a constraint, you need to change view to "bulk" . Then you can edit the constrain type selecting the corresponding operator. 

Image Added

It is not possible to edit a constrain at the Standard View. In the Standard View you are only allowed to delete and create a new constrain.

Delete a Constraint

To delete a constraint, hover the constraint and select the delete option:
Image Added

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

...

Another option is to, on bulk view mode, delete the desired constraint line:
Image Added