Calculation example for Execution State (%)

This example takes you through the process of calculating the Execution State (%) of a RequirementSet. This calculation is based on the Relative Weights and TestCase Workstates of the linked TestCases.

At the start of the example, the RequirementSet contains one Requirement: Requirement A. You can recreate this Requirement by following chapter "Calculation example for Coverage Specified (%)".

Requirement A from Coverage Specified (%) example

Once you have created Requirement A, follow the steps below:

  1. Specify how Tosca Commander should aggregate your results. To do so, add the column Result Aggregation and set it to First.

  2. Create a new Requirement named Requirement B and weight it with a value of 3.

  3. Link it to two TestCases that fulfill the following criteria:

    • TestCase Workstate is COMPLETED

    • TestCase has not been executed yet

    In this example, these are the TestCases TestCase B1 and TestCase B2.

  4. If your AutoCalculateRequirements setting is turned off, update the Requirement values by making a right-click on RequirementSet and selecting Update Outdated Values from the context menu.

Tricentis Tosca automatically calculates the Relative Weight (%) as follows:

  • Requirement A: 25%

  • Requirement B: 75%

Relative Weight (%) example

  1. Add the columns Coverage Specified (%) and Execution State (%) with the Column Chooser.

    • Since you have not executed TestCase B1 and TestCase B2 yet, the value for Requirement B is the same in both columns. The value 100% for Coverage Specified (%) results from the TestCases' Workstate: COMPLETED.

    • The values for Requirement A are the result of chapter "Calculation example for Coverage Specified (%)".

Coverage Specified (%) and Execution State (%) example

The RequirementSet level shows aggregated values. Tosca Commander calculates the RequirementSet Coverage Specified(%) as follows:

Requirement

Relative Weight

Covered TestCases (yellow)

Aggregated Coverage

Requirement A

0.25

0.43

0.25*0.43 = 0.108

Requirement B

0.75

1.00

0.75*1.00 = 0.75

 

 

SUM

0.858

 

 

Percentage

85.8%

The percentage value is rounded to the nearest whole number.

Tosca Commander displays the percentage of covered TestCases in yellow in the Coverage Specified (%) column. The percentage of linked, but not executed TestCases are displayed in white.

  1. Create an ExecutionList out of all TestCases and link this ExecutionList to your RequirementSet.

  2. If your AutoCalculateRequirements setting is turned off, update the Requirement values by making a right-click on RequirementSet and selecting Update Outdated Values from the context menu.

  3. Run the ExecutionList and update the Requirement values again, if required.

The TestCase Link icons indicate the execution result of each TestCase link.

TestCase

TestCase Workstate*

Execution result

TestCase 1

PLANNED = 0.2

Passed

TestCase 2

IN_WORK = 0.5

Passed

TestCase 3

COMPLETED =1.0

Failed

TestCase B1

COMPLETED = 1.0

Passed

TestCase B2

COMPLETED =1.0

No Result

*TestCase Workstate reflects the what state of completion a particular TestCase has reached. A planned TestCase is calculated as 20% complete, a TestCase that is in work is calculated as 50% complete, and a completed TestCase is calculated as 100% complete.

Execution results

Tosca Commander displays the results in the Execution State (%) column. These results are calculated as follows:

  • Requirement B has two linked TestCases: one Passed, one with No Result. This results in an Execution State (%) of 50% Passed, 50% No Result.

  • Requirement A has only 43% Coverage Specified. This coverage is split:

Execution result

TestCase

Relative Weight

TestCase Workstate

Execution State

Passed

TestCase 1

0.4

PLANNED = 0.2

0.4*0.2 = 0.08

 

TestCase 2

0.3

IN_WORK = 0.5

0.3*0.5 = 0.15

 

 

 

SUM IN %

0.23*100= 23%

Failed

TestCase 3

0.2

COMPLETED = 1.0

0.2*1.0 = 0.2

 

 

 

SUM IN %

0.2*100 = 20%

The remaining 57% consists of the following elements:

  • one unlinked TestCase

  • the missing coverage of TestCase 1 and TestCase 2

Calculation of missing coverage

TestCase

Relative Weight

TestCase Workstate reached

TestCase Workstate missing

Missing Coverage

TestCase 1

0.4

0.2

1.0 -0.2=0.8

0.4*0.8 = 0.32

TestCase 2

0.3

0.5

1.0 -0.5=0.5

0.3*0.5 = 0.15

<No TestCase linked>

0.1

x

x

0.10

 

 

 

Sum

0.57*100= 57%

Tosca Commander aggregates the information at RequirementSet level:

Execution result

Requirement

Relative Weight of Requirement

Execution State

Aggregated Execution State

Passed

Requirement A

0.25

0.23

0.25*0.23 = 0.0575

 

Requirement B

0.75

0.50

0.75*0.50 = 0.375

 

 

 

SUM IN %

0.4325*100 = 43.2%

Failed

Requirement A

0.25

0.2

0.25*0.2 = 0.05

 

 

 

SUM IN %

0.05*100 = 5%

No Result

Requirement B

0.75

0.50

0.75*0.50 = 0.375

 

 

 

SUM IN %

0.375*100 = 37.5%

Unlinked

Requirement A

0.25

0.57

0.25*0.57 = 0.142

 

 

 

SUM IN %

0.142*100 = 14.2%

Tosca Commander rounds these values to the nearest whole number. You can find the exact values in the RequirementSet property StatusText.

RequirementSet Execution State