Main Content

Summary of Model Testing Statuses for Project

Since R2025a

Metric ID

project.mt.ComponentTestStatusDistribution

Description

This metric returns the distribution of failed, passed, disabled, and untested component tests for the components in the project.

The Project Model Testing dashboard uses the results from this metric in the Test Status section of the dashboard.

Test Status section of dashboard showing a summary of test statuses, the number of component tests, and the number of tests in the project

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:

  • Aggregates the Model Test Status metric results from the components in the project.

  • Includes only tests in the project that test the model or subsystems in the components in the project 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, execute the metric engine and use getMetrics with the metric ID project.mt.ComponentTestStatusDistribution.

metric_engine = metric.Engine;
execute(metric_engine,"project.mt.ComponentTestStatusDistribution");
results = getMetrics(metric_engine,"project.mt.ComponentTestStatusDistribution")

Collecting data for this metric loads the model file and test result files and requires a Simulink® Test™ license.

Results

For this metric, instances of metric.Result return the Value as a distribution structure that contains these fields:

  • BinCounts — Number of tests in each bin, returned as a vector.

    • BinCounts(1) — Number of tests that failed.

    • BinCounts(2) — Number of tests that passed.

    • BinCounts(3) — Number of tests that are disabled.

    • BinCounts(4) — Number of tests that are untested.

  • BinEdges — Potential values of the slcomp.mt.TestStatus metric, returned as a vector with entries:

    • 0 — The test failed.

    • 1 — The test passed.

    • 2 — The test is disabled.

    • 3 — The test is untested.

  • OverallCount — Total number of component tests in the project. A component test directly tests either the entire component or lower-level elements in the component, like subsystems.

  • Ratios

    • Ratios(1) — Percentage of tests that failed, represented as a decimal.

    • Ratios(2) — Percentage of tests that passed, represented as a decimal.

    • Ratios(3) — Percentage of tests that are disabled, represented as a decimal.

    • Ratios(4) — Percentage of tests that are untested, represented as a decimal.

  • UniqueBinCounts

    • UniqueBinCounts(1) — Number of tests that failed.

    • UniqueBinCounts(2) — Number of tests that passed.

    • UniqueBinCounts(3) — Number of tests that are disabled.

    • UniqueBinCounts(4) — Number of tests that are untested.

  • UniqueCount — Number of unique tests in the project.

  • UniqueRatios

    • UniqueRatios(1) — Percentage of unique tests that failed, represented as a decimal.

    • UniqueRatios(2) — Percentage of unique tests that passed, represented as a decimal.

    • UniqueRatios(3) — Percentage of unique tests that are disabled, represented as a decimal.

    • UniqueRatios(4) — Percentage of unique tests that are untested, represented as a decimal.

Compliance Thresholds

The default compliance thresholds for this metric are:

  • Compliant — Each of the tests passed

  • Non-Compliant1 or more tests are untested, disabled, or have failed

  • Warning — None

See Also

| | | |

Topics