Traceability is the cornerstone of any formal documentation system, especially those intended for managing functional safety. It enables product teams to associate every work artifact (e.g., a specific requirement) with all the related project artifacts (e.g., design, code, or tests), both backward and forward. Traceability enables everyone to see how every work artifact relates to the requirement — and vice versa — at any point during development. This ability fosters team collaboration and enables early detection of possible production risks.
Traceability is enabled by the consistent use of Unique Identifiers (UIDs), which are short text labels associated with all work artifacts, such as requirements, architecture elements, design elements, coding standard deviations, tests, functional safety documents, etc.
The most important feature of UIDs is their uniqueness within the whole system under consideration. To avoid name conflicts, it is advantageous to establish general rules for constructing the UIDs. Throughout spexygen documentation, the UIDs have the general structure consisting of fields separated by underscores:
+------------------ [1] Work artifact type (e.g., 'SRS' for Software Requirement Specification) | +-------------- [2] Component unique identifier (e.g, 'QP' for QP Framework) | | +---------- [3] Work artifact ID (abbreviation or number) | | | +------- [4] Work artifact number | | | | +--- [5] Optional variant letter ('A', 'B', 'C'...) | | | | |+-- [6] Optional version number (1, 2, 3...) | | | | || SRS_xxx_yyy_zz[_A2]
Examples: SRS_QP_AO_10, SAS_QP_QHsm
The various fields in the UID are as follows:
[1]
the UID starts with a fields corresponding to the type of the work artifact. Here are the suggested artifact type names:
SRS
) and various other work items (e.g., tests, TUN
, TIN
, or TAC
).[2]
the Component Unique Identifier (CUI) denotes the component addressed by this UID, which should be unique enough to avoid name conflicts with other software components in a larger system.
[3]
"Work artifact ID" field identifies the artifact subject within the "work artifact type" [1]
. This is the most flexible part in the UID to accommodate other existing conventions, such as MISRA deviations, the work artifact ID
field should be easily identifiable with the MISRA Rule/Directive ID, such as D04_01
for "Directive 4.1", or R10_04
for "Rule 10.4". Still, please note that the more structured UID convention of using two-digits for feature groups (e.g., D04_10
instead of D4_10
) provide additional benefits, such as correct order under a simple alphabetical sort. This property is missing in the original MISRA IDs (e.g., a simple alphabetical sort will place Rule 10.8 before Rule 8.10).
[4]
"Work artifact number" filed identifies the aspect of the work artifact
[5]
optionally, the UID might contain a variant letter ('A', 'B', 'C',...)
[6]
optionally, the UID might end with a single-digit version number (0..9).
Alternatively, UIDs of code elements follow the rules established by doxygen, with the following general form:
+-------------- [1] Namespace (e.g., module, class) | +--- [2] element (e.g., attribute or operation) | | [namespace]_[element]
Examples: QHsm::QHsm_ctor(), QTimeEvt::QTimeEvt_disarm()
Backward traceability begins at a specific work artifact and links it to the original artifact. For example, architecture element can be linked with an upstream requirement, or code artifact with the upstream design. Backward traceability gives visibility into why specific artifacts were created and how different pieces of a system fit together. Tracing in this way also allows testers to find gaps or missing work artifacts.
As illustrated in the diagram below, backward traceability is provided explicitly in the spexygen documentation and the source code. Specifically, the downstream work artifacts provide trace information to the related upstream artifact by means of the Unique Identifier (UIDs).
@ref SRS_PRJ_Foo_03 "SRS_PRJ_Foo_03"
or @ref free_fun() "free_fun()"
, inside the spexygen documentation for the source code.Forward traceability begins at the original artifact and links it with all the resulting forward work items. For example, a requirement can be linked with source code elements that implement that requirement. This type of trace ensures that each original artifact (e.g., requirement) is not only satisfied but verified and validated. In the spexygen documentation the forward traceability is generated automatically by the spexygen.py
Python script.
Bidirectional traceability is the ability to perform both forward and backward traceability. Bidirectional traceability is the optimal type of traceability because it gives teams full visibility from requirements through architecture, design, source code, tests, and back again. The system implemented in the spexygen documentation provides such bidirectional traceability.