Using the attribute mapping adapter, YAKINDU Traceability can automatically derive links based on the attributes of the artifacts. Trace links are created between each artifact of a type A and each artifact of a type B that have matching attributes.
Consider, for example, an artifact type Requirement with an attribute reqId and another artifact type Implementation that has an attribute implementsReqId. Using the attribute mapping adapter, you can automatically create links between the Requirements and their corresponding Implementation counterparts, respectively. The mapping between Requirements and Implementations is done using the requirement ID, a piece of information that is available on both sides. For each Requirement artifact, the adapter considers all Implementation artifacts and creates a link for those pairs where the reqId attribute of the Requirement equals the implementsReqId of the Implementation.
This was just an simple example. If you want to read about more capabilities of Attribute Mapping go to the Mathematical Background chapter.
For setting up everything, you have to define
The configuration effort, including the definition of the derivation rule, goes into the latter.
Of course you also need the artifact types A and B. They must have appropriately-defined attributes for matching.
The attribute mapping data access does all the work to derive links between A and B artifacts.
Open the YT configuration with the YT configuration editor, and add a new data access as described in section "Data accesses". Select Attribute Mapping as data access type.
For the data access, name and type are sufficient. The configuration panel remains empty. The actual configuration for mapping artifacts using keywords goes into the link type configuration, which will reference this data access.
Example:
Open the YT configuration with the YT configuration editor, and add a new link type as described in section "Configuring a link type".
The derivation rule is the core of link creation. It goes into the link type configuration panel, see below for an example.
Let’s have a look at the syntax of the derivation rule by considering some examples. In the subsequent text, a represents an artifact of type A, and b represents an artifact of type B.
The most simple case is attribute equality:
You can split an attribute value on a separator character, resulting in a list of strings on one side (or even on both sides):
If you don’t want to compare by exact matches of attribute values, you can use certain functions to first do something with the attribute values of the a and/or b artifacts before comparing the results:
([a-zA-Z]+) ([0-9]+)
regular expression. In particular, „SomeText” matches the first group, and „332” matches the second group. The replacement text „$2_$1” will thus be substituted by „332_SomeText”.
Functions can be combined in various ways:
You can combine several conditions in a logical conjunction by using the keyword and:
You can switch A and B for each individual condition. For instance, you could switch A and B in the first condition of the previous where clause and leave the second condition as it is.
The derivation rule supports the following keywords.
Please note: Instead of A or B attributes, you can alternatively use their built-in properties. This is done via the metadata keyword. A.metadata(Identifier) returns the position of a, A.metadata(Name) returns its name, and A.metadata(Resource) returns its resource.
Please also note: In order to speed up the process of link derivation, YAKINDU Traceability creates an associative array (a.k.a. map or dictionary) using the values of the configured attributes as keys. This approach is optimized for mappings using the in operator; the usage of contains or startWith might consume more time.
For reporting purposes, artifact attributes of the linked artifacts can be mapped and transformed to link attributes. The mappings are defined within the optional map { … } clause and refer to custom attributes defined for the link type. The value which is assigned to the attribute can be defined by string functions and can access all attributes of A and B.
In the first example, we will configure YT to derive links between requirements defined in a ReqIF file and requirement details defined in a Microsoft Excel file.
The derivation is based on references in Excel: Each requirement detail in Excel has a cell containing a comma-separated list of associated ReqIF requirements. To match the identifier in the list to the specific ReqIF requirement the contents in the Excel cell is traversed. The comma serves as separator to find out where the next identifier starts.
Please note: If A is identified within B.ReqID by its name, resource or position, instead of
A.ReqID
you can useA.metadata(Name)
,A.metadata(Resource)
, orA.metadata(Identifier)
. This way you don’t have to define and map a custom variable for A.
In the secound example, we will configure YT to derive links between test cases defined in a Microsoft Excel file (e.g. TestCases.xlsx) and their related test results which are stored in a copy of the TestCases.xlsx only with different suffix (e.g „TestReport.xlsx”).
The derivation is based on references in Excel: Each test case in Excel has a cell containing a unique identification number (id). These ids will be mapped to the corresponding ids in the test results table. In addition to the mapping of the identifiers, the resource names of both Excel files are also getting mapped to ensure that the test cases belong to the right test results.
Links of this link type will never become suspicious.
Actually, the example above is a special case only, and the attribute mapping adapter has much broader capabilities. The values to find matches for are not restricted to the mere attribute values, although they are still based on them, and matching is not restricted to string equality.
The functions fA(a, i) and fB(b, j) as well as the matching conditions have to be formulated as a derivation rule in a link type configuration.
Please note: A derivation rule considers only a single attribute on each side. If you want to take multiple attributes into account, you can do this by defining a new custom attribute in the artifact type and deriving this attribute’s value by combining the values of the attributes you are actually interested in. Then use the new custom attribute in the attribute mapping’s derivation rule.
itemis AG
Am Brambusch 15
Lünen NRW 44536
+49 231 9860-606
info@itemis.com