Update trace information for pending artifact changes in the project
updateArtifacts( updates the
trace information for pending artifact changes in the metric results specified by
metricEngine to ensure that artifacts
are captured by the metrics. If an artifact was created, deleted, or modified since the last
time you used
performs traceability analysis and updates the trace information.
When you collect metrics programmatically, call
before running tests to ensure that the dashboard
tracks the test results.
If the dashboard user interface is not used for a project, the dashboard does not track test results produced in Simulink Test Manager that have not been exported to a results file or been saved to a report.
Note that there is also a function
updateArtifacts (Fixed-Point Designer) in the Fixed-Point Designer™ documentation.
Collect Metrics for Testing Artifacts in a Project
Collect metric results on the requirements-based testing artifacts in a project.
Open a project that contains models and testing artifacts. For this example, in the MATLAB® Command Window, enter:
metric.Engine object. You can use the
metric.Engine object to collect metric results for the current
metric_engine = metric.Engine();
Update the trace information for
metric_engine to ensure that the artifact information is up to date.
Collect results for the metric
'RequirementsPerTestCase' by using the
execute function on the
Use the function
getMetrics to access the results. Assign the array of result objects to the
results = getMetrics(metric_engine,'RequirementsPerTestCase');
Access the metric results data by using the properties of the
metric.Result objects in the array.
for n = 1:length(results) disp(['Test Case: ',results(n).Artifacts(1).Name]) disp([' Number of Requirements: ',num2str(results(n).Value)]) end
metricEngine — Metric engine object
Metric engine object for which you want to collect metric results, specified as a
Introduced in R2021b