Collect metric data on model testing artifacts
metric.Engine object represents the metric engine that
you can execute with the
execute object function to collect metric data on
the status and quality of requirements-based testing activities. Use
getMetrics to access the metric data and return an array of
metric.Result objects. The metrics analyze testing artifacts such as
requirements, test results, and coverage results. Use the metric data to assess the status and
quality of your requirements-based model testing.
projectPath— Path of project
Path of the project for which you want to collect metric data, specified as a character vector or string scalar.
ProjectPath— Project for metric collection
This property is read-only.
Project for which the engine collects metric data, returned as a string.
|Collect metric data for Model Testing Dashboard|
|Generate report file that contains metric results|
|Return errors that occurred during artifact tracing|
|Return metric identifiers for available metrics|
|Access metric data for model testing artifacts|
|Open testing artifact traced from the metric result|
|Update trace information for any pending artifact changes in the project|
metric.Engine object to collect metric data
on the requirements-based testing artifacts in a project.
Open the project. At the command line, type
metric.Engine object for the project.
metric_engine = metric.Engine();
Update the trace information for
metric_engine to reflect
any pending artifact changes and
ensure that all test
results are tracked.
Collect results for the metric
Requirements per test case by
executing the metric engine.
Use the function
getMetrics to access the results.
results = getMetrics(metric_engine,'RequirementsPerTestCase'); for n = 1:length(results) disp(['Test Case: ',results(n).Artifacts(1).Name]) disp([' Number of Requirements: ',num2str(results(n).Value)]) end
Test Case: Set button Number of Requirements: 0 Test Case: Decrement button hold Number of Requirements: 1 Test Case: Resume button Number of Requirements: 1 Test Case: Cancel button Number of Requirements: 1 Test Case: Decrement button short Number of Requirements: 2 Test Case: Increment button hold Number of Requirements: 1 Test Case: Increment button short Number of Requirements: 2 Test Case: Enable button Number of Requirements: 1
The results show that the test case
Set button is missing links
to requirements. To fix this, you would link the test case to the requirement that it