Requirement with Test Case Distribution
Use this metric to count the number of requirements that are linked to tests and the
number of requirements that are missing links to tests. The metric analyzes only
requirements where the Type is set to
Functional and that are linked to a unit with a link where the
Type is set to
requirement is linked to a test if it has a link where the Type is
This metric returns the result as a distribution of the results of the
Analyzes only requirements where the Type is set to
Functionaland that are linked to a unit with a link where the Type is set to
Counts links to tests in the project where the link type is set to
Verifies, including links to tests that test other models or subsystems. For each requirement that is linked to tests, check that the links are to tests that run on the unit that implements the requirement.
To collect data for this metric:
In the Model Testing Dashboard, place your cursor over the Requirements with Tests widget.
getMetricswith the metric ID
Collecting data for this metric loads the model file and requires a Requirements Toolbox™ license.
For this metric, instances of
Value as a distribution structure that contains these fields:
BinCounts— The number of requirements in each bin, returned as an integer vector. The first bin includes requirements that are not linked to tests. The second bin includes requirements that are linked to at least one test.
BinEdges— The logical output results of the
RequirementWithTestCasemetric, returned as a vector with entries
OverallCount— The total number of functional requirements implemented in the unit with a link where the Type is set to
OverallCountis calculated as the sum of the integers in
Ratios— The ratio of requirements missing links to tests and the ratio of requirements with links to tests, returned as an integer vector that contains these elements:
Ratios(1)— Percentage of requirements missing links to model tests.
Ratios(2)— Percentage of requirements with links to model tests.
Each ratio is calculated as the
BinCountsvalue divided by the
OverallCountvalue. For example, if 27.27% of unit requirements are missing links to tests and 72.73% of unit requirements have links to tests,
Ratiosreturns an integer vector with the percentages in decimal form:
The default compliance thresholds for this metric are:
0requirements are missing links to tests
1or more requirements are missing links to tests