Test Status Distribution
R2026bMetric ID
modeltesting.TestResultAnalysis[slcomp.TestStatusDistribution]
Description
This metric returns the distribution of test statuses for the model test results in the unit. The metric reports how many tests are in each status category.
Use this metric to assess the overall status of model testing for a unit.
Supported Artifacts
This metric collects metric results for Units in the project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.
Collection
To collect data for this metric, execute the metric engine with the metric ID.
metric_engine = metric.Engine;
results = execute(metric_engine,"modeltesting.TestResultAnalysis[slcomp.TestStatusDistribution]")View the metric result values for a specific unit.
results(1).Value results(1).ScopeAlias
To collect all metrics in the modeltesting.TestResultAnalysis group at
once, use the group name with empty
brackets. Use the MetricID property to distinguish results from different
metrics in the
group.
results = execute(metric_engine,"modeltesting.TestResultAnalysis[]")Results
The metric returns an array of objects, one for each unit in the project.
Use the metric.ResultValue property of the metric result object to view the metric
result values. Use the ScopeId and ScopeAlias
properties to identify which unit the result belongs to.
The ScopeAlias property returns the name of the unit.
The Value property returns a structure with these
fields:
Total— Total number of tests for the unit.Failed— Number of tests with a failed status.Passed— Number of tests with a passed status.Disabled— Number of tests with a disabled status.NotRun— Number of tests that have not been run. A test has a status of not run when there is no test result available for the test.Untested— Number of tests that ran, but no verification was performed. This occurs if noverifystatements or other criteria were specified, or if the criteria were specified but not executed.