Example: Work with Inner Values

This chapter provides an example of how to use Inner Values in your tests. Tricentis recommend the following workflow:

  1. Create Requirements based on use cases you have identified for your project needs.

  2. Create a TestCase-Design TestSheet based on your Requirements.

    Use linear expansion to combine Instances in the TestSheet. The Inner Value does not depend on the order in which the TestCases are executed as long as the StraightThrough is executed first. With linear expansion, the execution state of TestCases (passed or failed) also does not influence the Contribution or Inner Value of other TestCases.

  3. Link your TestSheet to your Requirements.

  4. Link your Requirements to your TestCases.

The following example shows you how to perform these steps in greater detail.

Premise

For a vehicle insurance policy, you might identify the following hypothetical use cases and weights:

Use Case

Weight

Take out insurance policy

32

Edit insurance claim

16

Change insurance conditions

2

Cancel insurance

1

Taking out an insurance policy has the heaviest weight because it carries the greatest business risk if it fails. In this example, taking out an insurance policy is further subject to the following conditions:

  • People under 18 may not take out an insurance policy

  • There is an additional 20% charge for people between the ages of 18 and 23

  • There is a 10% discount for people over the age of 59

  • There is a 5% discount for women

Create Requirements

Once you have identified your use cases and weights, the next step is to enter this information into the Requirements section of Tosca Commander.

To do so, follow the steps below:

  1. Create a RequirementSet that contains 4 Requirements, one for each use case.

  2. In the Details tab of the RequirementSet, add the Weight, Relative Weight (%), and Contribution (%) columns via the Column Chooser.

  3. Enter the weights defined in the table above into the Weight column.

Tricentis Tosca automatically makes the following calculations for the relative weights and contribution:

  • Relative Weight (%): percentage of the total weight

  • Contribution (%): percentage of the entire RequirementSet

In this case, these are the same.

Example Requirements and weights

Create a TestCase-Design TestSheet based on your Requirements

Once you have specified your Requirements and weights, it is time to create a TestSheet. This TestSheet should contain Attributes and Instances that are based on your Requirements.

To do so, follow the steps below:

  1. When you take out an insurance policy, the conditions depend on age and sex. Hence, create a TestSheet with the Attributes Age and Sex to reflect these conditions.

  2. Specify the weights of the Attributes in the Weight column, which can be added via the Column Chooser. In this example, age is a more important factor than sex, so weight age and sex at a ratio of 2:1.

  3. Create Instances within the Attributes to specify the different age and sex variations.

  4. Specify the weight of each Instance based on their importance to the TestCase. The Relative Weight (%) of Instances within an Attribute should add up to 100%.

    In this example, men between the ages of 24 and 59 are the most likely to take out an insurance policy and are therefore weighted more heavily than women or other age groups as shown in the image below. The male to female weighting in this example is 7:3.

  5. Specify a StraightThrough path and invalid Instances. The StraightThrough path should reflect the Instances with the heaviest weights.

    In this example, men between the ages of 24 and 59 represent the StraightThrough path. <18 is an invalid Instance since people under the age of 18 cannot take out an insurance policy.

TestSheet with Attribute and Instance weights

  1. Right-click on the TestSheet and generate Instances using linear expansion.

    In linear expansionTricentis Tosca first creates a StraightThrough Instance and then creates all other combinations by changing out one StraightThrough Instance for one non-StraightThrough Instance.

  1. Update the weights in the Instances Collection to reflect the Instance combinations. To do so, right-click on the TestSheet and select Update instance weights.

    Tricentis Tosca calculates the updated weights as follows:

    • The StraightThrough Instance is a combination of Age 24...59 and Sex Male. The StraightThrough contribution is therefore calculated by adding these two Instance contributions together: 26.67 + 23.33 = 50

    • The other Instance combinations (18...23, >59, Female, and <18) differ from the StraightThrough in one Attribute. Therefore, only the contribution of the differing Attribute is taken into account.

Generated Instances with updated weights

Link TestSheet to Requirements

To calculate the contribution of individual TestCases based on the RequirementSet, you need to link your TestSheet with your RequirementSet and update the weights:

  1. Drag and drop your TestSheet onto the Requirement(s) to be linked to TestCases. In this example, you need to drop the TestSheet onto the Take out insurance policy Requirement. Tricentis Tosca automatically creates TestCase substitute links.

  2. To transfer the weights you have defined in your TestSheet, right-click the Requirement and select Update weights for TestCase Links from the context menu.

    Tricentis Tosca then transfers Weight and Relative Weight (%) to the TestCase substitute links. The Contribution (%) column indicates how much a TestCase substitute link contributes to the RequirementSet.

    The contribution is calculated relative to the parent node:

    (Relative Weight (%) * Relative Weight (%) of parent node)/100 = Contribution (%)

    For instance, the contribution of the <18 TestCase substitution link is (6.7 * 62.75)/100 = 4.2

Updated weights in the TestCase substitute links

Add further dependencies

If new dependencies arise, you can create additional Instances. Suppose, for example, that an additional specification is added to our vehicle insurance example:

  • A 10% discount is granted to women age 60 and over, and to men age 65 and over. This replaces the previous 10% discount for everyone over the age of 59.

To add this new dependency to your TestSheet, follow the steps below:

  1. Change the >59 Instance to >64 and add a 60...64 Instance to reflect the new age groups. In the screenshot below, the Instance 60...64 is shown in bold because you have not used it in an Instance combination yet.

  2. The original >59 Instance had a weight of 3. Reallocate this weight to your new Instances so that 60...64 has a weight of 1 and >64 has a weight of 2.

    This reflects the fact that the >64 Instance applies to both men and women and therefore carries more risk if it fails.

  3. Trigger a recalculation of your Instance weights to include the WeightLack: Right-click on the TestSheet and select Update instance weights from the context menu.

    To see how much the unused Instance 60...64 would influence the Contribution(%) to the TestSheet, hover your mouse over the TestSheet.

Tooltip displaying Instance and WeightLack

  1. To include the unused Instance in the Contribution (%) calculation, right-click on the TestSheet and select Reset WeightLack from the context menu.

    Tricentis Tosca updates the Contribution (%) and Relative Weight (%) of the Instances in the Instances Collection:

WeightLack reset to include unused Instance in Contribution calculation

  1. To include the new Instance in your Instance combinations, hold down the Ctrl key to highlight Instance 60...64 and the Attribute Sex. Right-click and select Complete Instances ->All combinations from the context menu.

    Tricentis Tosca adds the Instance combinations Vehicle Insurance Example_1 and Vehicle Insurance Example_2.

Added Instance combinations

  1. Update the Instance weights again by right-clicking on the TestSheet and selecting Update instance weights from the context menu.

    As all of the Instances of the Vehicle Insurance Example_2 Instance combination have already been used, the displayed Weight is 0.

Updated weights

  1. Manually recalculate the weights of Vehicle Insurance Example_1 and Vehicle Insurance Example_2 according to the previously defined male:female weight ratio of 7:3. Thus, you split the original value of 67 into the values 47 and 20.

    Enter these values into the Weight fields of Vehicle Insurance Example_1 and Vehicle Insurance Example_2 respectively.

    Tricentis Tosca automatically recalculates the Contribution (%) of both Instances.

    The Inner Value and Contribution generally have the same value, unless you make manual changes. In this case, the Instance weights were manually changed, so the Inner Value and Contribution do not have the same value.

Weight manually adjusted

Add new Instances to Requirements

To add the newly created Instances to your Requirements, follow the steps below:

  1. Drag and drop the Instances onto the Take out insurance policy Requirement. Tricentis Tosca automatically creates two new TestCase substitute links.

Additional Instances added as TestCase substitute links in Requirements section

  1. To include the newly added TestCase substitute links in the weight calculation, right-click on the Requirement and select Update weights for TestCase Links.

Updated TestCase substitution link weights

Link Requirements to TestCases

After you have linked your Requirements with your TestCase-Design TestSheet, you can link your Requirements to your TestCases section to create TestCases.

To do so, drag the RequirementSet onto a TestCase folder in the TestCases section.

Tricentis Tosca then performs the following actions:

  • It creates TestCases based on your Requirements in the TestCase folder

  • It changes the TestCase substitute links in the Requirement sections to blue TestCase links:

TestCase links in Requirements section

You can now work with your TestCases: link them to Modules and then to the Execution section.