Model Test Status Distribution
Metric ID
slcomp.mt.TestStatusDistribution
Description
This metric returns a distribution of the status of the results of model tests that run on the unit. A model test can have a status of either:
Passed
Failed
Disabled
Untested
This metric returns the result as a distribution of the results of the Model Test Status metric.
Supported Artifacts
You can collect this metric for the Units in your project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.
Computation Details
The metric:
Includes only simulation tests in the project that test the model or subsystems in the unit for which you collect metric data.
Does not count the status of tests that run in software-in-the-loop (SIL) or processor-in-the-loop (PIL) mode. The metric shows these tests as untested.
Collection
To collect data for this metric, use getMetrics
with the metric ID
slcomp.mt.TestStatusDistribution
.
Collecting data for this metric loads the model file and requires a Simulink® Test™ license.
Results
For this metric, instances of metric.Result
return Value
as a distribution structure that contains these fields:
BinCounts
— The number of tests in each bin, returned as a vector.BinEdges
— The outputs of the test status metric, returned as a vector. The outputs represent the test result statuses:0
— The test failed.1
— The test passed.2
— The test is disabled.3
— The test is untested.
OverallCount
— The total number of tests. The metric calculatesOverallCount
as the sum of the integers inBinCounts
.Ratios
— The ratio of a test result status to the total number of tests, returned as a vector that contains these elements:Ratios(1)
— Percentage of tests that failed.Ratios(2)
— Percentage of tests that passed.Ratios(3)
— Percentage of tests that are disabled.Ratios(4)
— Percentage of tests that are untested.
The percentages are in decimal form. For example, if 10% of unit tests passed and the remaining unit tests are untested,
Ratios
returns a vector with the percentages in decimal form:[0; 0.1000; 0; 0.9000]
.
Compliance Thresholds
The default compliance thresholds for this metric are:
Compliant
— Each of the tests passedNon-Compliant
—1
or more tests are untested, disabled, or have failedWarning
— None