Main Content

Independent Tests

Since R2025a

Metric ID

slcomp.mt.IndependentTests

Description

You can use this metric to count the number of tests for the component design, or a part of the design, in a different execution context than the component itself. Independent tests can execute independently of the component and can behave differently depending on the conditions specified in the test harness. Therefore, these tests do not definitively indicate the quality of component testing.

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 tests on:

    • Libraries

    • Subsystem references

    • Virtual subsystems

    These tests can execute independently of the component and can behave differently depending on the conditions specified in the test harness.

  • Excludes component tests. To see the number of component tests, see Component Tests.

Note

Independent tests do not definitively indicate the quality of component testing and therefore these tests do not contribute to the other model testing metric results.

Collection

To collect data for this metric, execute the metric engine and use getMetrics with the metric ID slcomp.mt.IndependentTests.

metric_engine = metric.Engine;
execute(metric_engine,"slcomp.mt.IndependentTests");
results = getMetrics(metric_engine,"slcomp.mt.IndependentTests")

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 properties:

  • Value — A structure that contains:

    • Count — Number of component tests in the project

  • Artifacts — An array of structures, with one structure for each component test. The structures contain the UUID, Name, ParentUUID, and ParentName for that component test.

See Also

| |

Topics