Requirements
With Embedded Engineer, you can link requirements to classes and operations.
That way the generated code contains a link to the requirement, enabling you to maintain the traceability of your requirements down to the source code.
Links can be a Trace
or Realization
connectors and can be linked to the class or to a specific function.
To link to a specific function in Enterprise Architect use the Link to Element Feature
option.
- Create a connector between the Class and the Requirement
-
Open the context menu in the first third of the connector (near the Class) and select the
Link to Element Feature
menu entry -
Select the Feature Type:
Operation
and the operation itself
Info
Since Requirements are not specified within the UML superstructure, Embedded Engineer will check if an element is a Requirement by checking if the stereotype contains the string requirement
.
This check is case insensitive
Since we found models containing Trace
links with other connectors than Abstract
, we opted to also only check for a trace Stereotype linking a Classifier to a Requirement.
Generated Code
/* ****************************************************
* Model File: Model.EmbeddedEngineer_Components.AnsiC.Structural_Elements.Classes.ClassTest
* Author: rdeininger
* Notes:
* ****************************************************
* */
#include "ClassTest.h"
/* Implements REQ:Requirement1:{0D7E6FB2-758C-401a-A50D-847C06495979} */
/* Implements REQ:Requirement2:{087E09D4-ED59-49f4-8F34-6E2207DCAF87} */
/* Implements REQ:Requirement3:{8D9E7FFB-D5C3-4d56-8A2C-DB4594EA7E9F} */
/* Implements REQ:NonfunctionalRequirement1:{EEEBFF6C-367C-4114-B38C-1DE464DA2E5A} */
void ClassTest_FncConstrutor(ClassTest* const me)
{ /* Start of implementation REQ:Requirement2:{087E09D4-ED59-49f4-8F34-6E2207DCAF87} */
me->AttRef = 9;
me->AttPrivate = 3;
me->AttProtected = 2;
me->AttPublic = 1;
/* UserCode{574B4F4C-7ED8-49d3-99DC-63E666995A6B}:Nbrlk8aPUZ */
/* UserCode{574B4F4C-7ED8-49d3-99DC-63E666995A6B} */
/* End of implementation REQ:Requirement2:{087E09D4-ED59-49f4-8F34-6E2207DCAF87} */
}