Explore Traceability Information Using Trace Views
When you develop software units and components, you create numerous artifacts like models, requirements, and tests. To understand the relationships between these artifacts and how those relationships impact your units and components, you can use the trace views in the Model Testing and Model Design Dashboards. A trace view is an interactive diagram that shows specific traceability information for artifacts in a project. Trace views provide a detailed, tree-like structure of the project artifacts and show relationships, individual artifact information, and a hierarchical view of the relationships between the artifacts in a project.
You can access trace views from the Model Testing Dashboard or Model Design Dashboard. The dashboards use traceability information to detect when changes to your project make the dashboard metric results outdated. You can use the default trace views to view:
Design dependencies
Requirement-to-design traceability
Tests and results
Units and components
To find the required files for a whole project or to find required products and add-ons, use the Dependency Analyzer. For more information, see Analyze Project Dependencies.
Access Trace Views
Open the project that you want to analyze. For this example, in the MATLAB® Command Window, enter:
openExample("slcheck/ExploreTestingMetricDataInModelTestingDashboardExample"); openProject("cc_CruiseControl");
Open the Dashboard window. On the Project tab, click either Model Testing Dashboard or Model Design Dashboard.
When you open either dashboard, the dashboard analyzes the project and collects information about the project artifacts, the artifact structure, and the traceability relationships between artifacts. The dashboard creates a digital thread that stores these attributes and unique identifiers for your project artifacts. The dashboard automatically populates the Project panel with the artifacts from the current project that are compatible with the currently selected dashboard.
In the Project panel, select the artifact that you want to view a trace view for. For this example, select cc_LightControl.
When you select an artifact in the Project panel, the Artifacts panel shows the artifacts that the digital thread traces to that artifact. For more information on the artifact analysis and tracing that the dashboard performs, see Monitor Artifact Traceability and Detect Outdated Results with Digital Thread.
Open a trace view for the artifact. In the Traceability section of the toolstrip, click Trace View.
To navigate and explore the trace view:
Zoom in or out by using the scroll wheel on your mouse or by using the Zoom In and Zoom Out buttons in the Navigate section of the toolstrip.
Pan vertically and horizontally by holding the space bar and clicking and dragging the mouse.
Highlight the connection between artifacts by clicking the arrow between the artifacts. You can click an artifact or arrow to select it. You can also move the artifacts and arrows in the trace view to rearrange the diagram.
Open a new trace view tab for the next artifact listed in the Project panel by clicking Add New in the toolstrip.
Reset the diagram to the original layout and zoom level by clicking Restore to Default in the toolstrip.
View information about an artifact by pointing to the artifact. The tooltip for the artifact shows detailed information and an Open Artifact button that you can use to open the artifact directly from the trace view.
By default, the dashboard opens the Design Dependency trace view, but you can view other traceability information by using different trace views. In the View section of the Trace View tab, use the trace view gallery to select a different trace view.
If you expect an artifact to appear in a trace view and it does not, see Resolve Missing Artifacts, Links, and Results.
Design Dependency Trace View
The Design Dependency trace view shows the library blocks, data dictionaries, model references, and MATLAB files that trace to the selected unit or component.
For example, the Design Dependency trace view for the example
software unit cc_LightControl
shows that the unit:
Contains the subsystem
Enabled Subsystem
Requires the three data dictionary files:
cc_CruiseControlData.sldd
,lib_BaseConfig.sldd
, anddas_DrivingAssistantSpecData.sldd
You can use the trace view to examine the relationships that the dashboard
identifies between design artifacts and to inspect component and unit dependencies.
If you point to lib_BaseConfig.sldd in the trace view, the
tooltip shows that this data dictionary file belongs to the referenced project
lib_CommonLib
. To view the artifact relationship type, point
to the arrow between artifacts. For example, the unit
cc_LightControl
requires the data dictionary file
cc_CruiseControlData.sldd
and the unit
cc_LightControl
contains the subsystem Enabled
Subsystem
.
Requirement to Design Trace View
The Requirement to Design trace view shows the functional requirements that trace to the selected unit or component.
For example, the Requirement to Design trace view for the
example software component cc_LightControl
shows that three
requirement links trace to three functional requirements: Show cruise
control light indicator
, Show cruise control set indicator
light
, and Show cruise control light when ignition switch is
turned
. The trace view shows that the dashboard traced the
relationship from the block diagram for the unit, to the requirement link, and then
to the functional requirement.
When you point to a functional requirement, the tooltip shows where the requirement is in the requirements hierarchy and shows an Open Artifact button that you can use to open the requirement directly in the Requirements Editor.
Tests and Results Trace View
The Tests and Results trace view shows the test cases and test results that trace to the selected unit or component. The trace view shows the Simulink® Test™ files and test suites that contain test cases that trace to the current unit or component. If you have test results associated with the test cases, the trace view traces those results to the test case and identifies whether the results are from model tests, software-in-the-loop (SIL) tests, or processor-in-the-loop (PIL) tests. The Tests and Results trace view can also show dependencies on external files like coverage filters, baseline files, parameter override sets, and configuration setting overrides.
When you point to a Simulink Test case result, you can open the result directly in Test Manager by clicking click Open Artifact in the tooltip.
Units and Components View
The Units and Components trace view shows the relationships between the units and components in your project. A unit is a functional entity in your software architecture that you can execute and test independently or as part of larger system tests. A component is an entity that integrates multiple testable units together. By default, the dashboard and trace view considers Simulink models as units and System Composer™ architecture models as components. However, to track the unit testing activities for your project, you can also reconfigure the dashboard to recognize the different testing levels of your models. You can specify which entities in your software architecture are units or higher-level components by labeling them in your project and configuring the dashboard to recognize the labels. For more information, see Categorize Models in Hierarchy as Components or Units.
For example, the example project uses the project labels SW Verification
Unit
and SW Verification Components
to categorize
its Simulink models. The Units and Components trace view for
the example project shows that the Simulink model cc_CruiseControl
is a component that traces
to four units: cc_ControlMode
,
cc_DriverSwRequest
, cc_LightControl
, and
cc_ThrottleController
.