Create Instances using relations

Relations allow you to specify project-specific dependencies. These dependencies help you to customize Instance combinations so they meet your business requirements. Tricentis Tosca automatically checks the consistency of any relations you have created.

You can use relations to generate Instances with linear expansion. Moreover, relations allow you to generate additional Instance combinations, exclude certain combinations, or combine specific Instances with each other.

You define relations on the TestCase-Design TestSheet level. These relations will be considered once you generate and combine Instances using the Linear expansion [Relations] combinatorial method. As with regular linear expansion, you must define a StraightThrough path.

Define relations

Before you can generate Instances using relations, you need to define the relations you want Tricentis Tosca to consider. To do so, follow the steps below:

  1. If you are working in a multi-user environment, checkout your TestSheet.

  1. Select a TestSheet and switch to the Relations tab.

  2. Click on theicon to add a new relation.

Tricentis Tosca creates a relation with the following properties:

Property

Explanation

Name

Name of the relation.

You can change the name by double clicking into the entry field and typing in a new name.

Relation Type

Specifies how Tricentis Tosca should generate selected Instance relations (see step 4 below).

The following options are available:

  • Required: default value. All selected Instances must be combined with each other.

  • Forbidden: All combinations that are possible for the selected Instances should not be generated. Use this to exclude certain combinations from your generated Instances.

  • Constrained: All selected Instances are bound together and should only be combined with each other.

Generation Method

Only available if you choose the Relation Type Required. Specifies how Instances should be combined.

The following options are available:

  • AllCombinations: Generate all possible combinations of the selected Instances.

  • Pairwise: Generate all possible pair combinations.

Alternatively, you can specify the Name, Relation Type, and Generation Method in the Core Properties tab on the right. You can also enter a description of your relation here if desired.

New relation

  1. Click on your TestSheet and select the Attributes and/or Instances you want to include in your relation. To do so, click the plus sign next to the respective Attribute or Instance.

    If you select an Attribute, Tricentis Tosca automatically selects all Instances that are mapped to that Attribute.

    You cannot include Attributes or Instances within classes that you have previously defined as not business relevant.

Tricentis Tosca automatically checks whether your relation is complete.

A green checkmark next to the name of the relation indicates a complete relation. A red exclamation mark denotes an incomplete, erroneous, or contradictory relation. Hover your mouse over the icon for more information.

Incomplete relation

Tricentis Tosca also performs an initial consistency check on the created relations. To see the result, check the status bar at the bottom of the workspace window:

  • Blue status bar: The consistency of your relation has not been checked because your relation is empty.

  • Green status bar: Your relations are consistent.

  • Red status bar: Your relations are not consistent. Click on the magnifier symbol in the status bar to see only the inconsistent relations.

If you modify or add relations, you need to click on the TestSheet to trigger another consistency check.

Only inconsistent relations are shown

To view all relations again, right-click on the TestSheet and select Reset Relations Filter from the context menu.

Generate Instances using relations

After you have defined the relations according to your project needs, you can generate your Instances using the defined relations.

To do so, right-click on the relevant TestSheet and select Generate Instances -> Linear expansion [Relations].

In this example, you want to exclude persons under the age of 18 when you generate your Instances.

To do so, you perform the following actions:

  • Create a relation and set the property Relation Type to Forbidden

  • Include the nodes <18 and Person in your relation

Forbidden relation

Once you generate your Instances with the combinatorial method Linear expansion [Relations], the forbidden relation is left blank:

Linear expansion [Relations] with forbidden relation

Modified relation

If you delete an Attribute or an Instance that is used in a relation, Tricentis Tosca automatically modifies the relation.

You can enable the option Show Relation Hints under Project->Options->TestCaseDesign. In this case, Tricentis Tosca provides you with information about the relation modification:

Information about modified relation

Filter relations

If you only want to see certain relations in your Relations view, you can filter for them.

To do so, add the column Filter with the Column Chooser and select the applicable filters from the respective dropdown menu.

You can filter by Relation Type, Generation Method, Name or State at the TestSheet level, or Instance usageat the Attribute level. Filters are displayed in blue.

In the example below, Tricentis Tosca only displays relations with the following characteristics:

  • Relation Type is Required

  • Generation Method is AllCombinations

  • Age is 24...59

All other relations are filtered out.

Filtered relations

If you want to remove your filters, right-click on the TestSheet and select Reset Relations Filter from the context menu.