Analyze requirement metrics
After you weight your requirements and link test cases and playlists to them, Tosca Cloud calculates a set of metrics that show how thoroughly each requirement is tested and how its tests are performing. Use these metrics to focus effort on tests where risk is highest and get insights into release readiness.
These metrics appear as read-only columns and recalculate automatically whenever a weight, link, or test progress changes, so the values always reflect the current state.
Relative weight in %
Relative weight in % shows how much a requirement's weight matters compared to the other requirements at the same level in the same requirement set.
Use it to see which requirements carry the most risk compared to their siblings so you can prioritize testing efforts.
Tosca Cloud calculates relative weight as: (Requirement weight / sum of all requirement weights on the same level) × 100
Relative weight only compares a requirement with its siblings on the same level. If you want to compare requirements and sub-requirements across different levels within a requirement set, use contribution in %.
Contribution in %
Contribution in % shows how a requirement's weight contributes to the requirement set it's in.
Use it to see which requirements carry the most risk across the whole requirement set, not just compared to their siblings.
Tosca Cloud calculates contribution depending on where a requirement sits in the requirement set:
-
For a top-level requirement, contribution is its share of all top-level weights:
(Requirement weight / sum of all top-level requirement weights) × 100 -
For a sub-requirement, contribution is its share among its sibling sub-requirements, scaled by the contribution of its parent requirement:
Parent contribution × (Sub-requirement weight / sum of sibling sub-requirement weights)
Coverage specified in %
Coverage specified in % shows how thoroughly a requirement's testing has been planned. It reflects two things:
-
How many test cases are linked to the requirement.
-
How far along those test cases are, taking into account each link's relative weight.
Use it to find requirements whose testing lags behind their risk level.
Tosca Cloud calculates coverage specified in two steps:
-
For each requirement, coverage specified is the sum of each linked test case's relative weight multiplied by its work state value:
Σ (relative weight of linked test case × work state value) -
Then, at the requirement set level, Tosca Cloud sums the relative weight of each requirement multiplied by its coverage specified in %, and then rounds to the nearest whole number:
Σ (relative weight of requirement × coverage specified of requirement) × 100
Here's how each test case's work state contributes to the calculation:
|
Work state |
Value |
|---|---|
|
Completed |
1.0 (100%) |
|
In Work |
0.5 (50%) |
|
Planned |
0.2 (20%) |
|
Unassigned test case link |
0 |
Coverage run in %
Coverage run in % shows how far a requirement's linked test cases have progressed through testing, without regard to test outcome. Test cases that passed or failed count in full. Test cases that haven't finished yet only partially count.
Use it to check whether your highest-risk requirements have been tested, not just planned for.
Tosca Cloud calculates coverage run in two steps:
-
For a single requirement, coverage run is the sum of each linked test case's relative weight multiplied by its test result value:
Σ (relative weight of linked test case × test result value) -
At the requirement set level, Tosca Cloud sums the relative weight of each requirement multiplied by its coverage run in %, and then rounds to the nearest whole number:
Σ (relative weight of a requirement × coverage run of a requirement) × 100
Test results come from the most recent run of the topmost playlist linked to the requirement set.
Here's how the test results contribute to the calculation:
|
Test result |
Value |
|---|---|
|
Passed or failed |
1.0 (100%) |
|
In progress |
0.5 (50%) |
|
Not ran |
0.2 (20%) |
Run results in %
Run results in % tells you how your tests turned out in detail, so you can catch requirements that are fully tested but still failing.
This metric reflects the results of linked test cases, their weight, and the requirements that lack test case links. It splits a requirement's test weight and progress across four results, shown as colors in the column:
-
Passed (green): Test case ran and passed.
-
Failed (red): Test case ran and failed.
-
Not ran (light grey): Test case is linked but hasn't run yet.
-
Not linked (dark grey): Requirement wasn't assigned a test case link.
Tosca Cloud calculates run results from the most recent run of the topmost playlist linked to the requirement set.
Calculation for a playlist that has run
Tosca Cloud calculates every requirement's run results based on the linked test case's weight, work state, and a result from the last run.
First, Tosca Cloud calculates the weight per state for each, individual linked test case:
-
Defines the contribution factor for each linked test case based on the work state:
Work state
Contribution factor
Completed
1.0 (100%)
In Work
0.5 (50%)
Planned
0.2 (20%)
Unassigned test case link
0
-
For test cases with results Passed, Failed, or Not ran, Tosca Cloud multiplies test case weight by the contribution factor from step 1:
Test case weight × contribution factor -
For test cases without links (Not linked), Tosca Cloud performs the same calculation, but subtracts the contribution factor from 1.0:
Test case weight × (1.0 − contribution factor)
Then, to define the run results for all test cases of a requirement, Tosca Cloud calculates the following:
-
Adds up the weights per state calculated above for the four test results collected. For example, all test cases with a result Passed add up together.
-
Divides each result's total weight per state by the requirement's total weight, and multiplies by 100:
(total weight of a result / total weight of all linked test cases) × 100
Calculate run results for a requirement with 4 linked test cases.
|
Test case |
Weight |
Work state |
Result |
Weight per state |
Weight per Not linked |
|---|---|---|---|---|---|
|
TC1 |
10 |
Completed |
Passed |
10 × 1.0 = 10 |
10 × 0 = 0 |
|
TC2 |
6 |
In Work |
Passed |
6 × 0.5 = 3 |
6 × 0.5 = 3 |
|
TC3 |
15 |
Planned |
Failed |
15 × 0.2 = 3 |
15 × 0.8 = 12 |
|
TC4 |
10 |
Completed |
Not ran |
10 × 1.0 = 10 |
10 × 0 = 0 |
The total weight for all test cases linked to the requirement is 41.
The weight per state of Passed totals 13, Failed totals 3, Not ran totals 10, and Not linked totals 15.
Tosca Cloud then divides each result's total by the requirement's total weight of 41 and turns that into a percentage, giving Passed 32%, Failed 7%, Not ran 24%, and Not linked 37%.
Calculation for a playlist that hasn't run yet
A playlist that hasn't run doesn't have results, so instead of Passed or Failed, every result counts as Not ran.
In this case, Tosca Cloud calculates the result in the same way as it would for a playlist that has run, but the work states contribute different percentages to the results:
-
Completed: Contributes 100% to Not ran instead of Passed or Failed.
-
In Work: 50% to Not ran, 50% to Not linked.
-
Planned: 20% to Not ran, 80% to Not linked.
If a requirement has sub-requirements
A requirement can contain either linked test cases or sub-requirements, never both. When a requirement has sub-requirements, Tosca Cloud takes the run results of each sub-requirement and combines them, weighted by each sub-requirement's relative weight. A sub-requirement with a higher relative weight has more influence on the parent's run results.
What's next
Now that you know where each requirement stands, here's what you can do about it:
-
Link more test cases to requirements with low coverage specified to close the gap before it affects your release readiness.
-
Trigger a test run after you fix failing tests, so the run results metric reflects the fix.