You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Scope:** This guideline applies to both QM (Quality Management) and ASIL B components. Where specific requirements differ between QM and ASIL B (e.g., complexity thresholds, design principles), they are explicitly noted.
39
+
31
40
Workflow for Implementation
32
41
===========================
33
42
@@ -36,12 +45,13 @@ Detailed description which steps are need for implementation.
36
45
#. Consult which programming languages, design/coding guidelines and tools are used for Software
37
46
development according the rules given in the project specific :need:`SW development Plan <wp__sw_development_plan>`.
38
47
#. Create a Detailed Design by using the template :need:`gd_temp__detailed_design`.
39
-
In this step, the components are broken down into smaller, independent units that can be tested
40
-
separately during the unit testing phase. The detailed design shall be so exact, that test and
41
-
implementation can be run simultaneously.
48
+
Based on the :need:`Component Requirements <wp__requirements_comp>` and the
49
+
:need:`Component Architecture <wp__component_arch>`, the components are broken down into smaller,
50
+
independent units that can be tested separately during the unit testing phase.
51
+
The detailed design shall be so exact that test and implementation can be run simultaneously.
42
52
#. Implement the source code, by using the coding guidelines given within the project specific :need:`SW development Plan <wp__sw_development_plan>` for the programming languages in your project.
43
53
#. Create a pull request for your change.
44
-
#. Detail Design and Code Inspection is done to review the code of the software and detect errors in it.
54
+
#. Detail Design and Code Inspection is done to review the code of the software and detect errors in it. See the detailed design and code :need:`inspection checklist <doc__feature_name_req_inspection>` for evaluation criteria.
45
55
#. Check the results of the static and dynamic code analysis (this includes compiler warnings). Acceptance criteria are defined in the Verification Plan :need:`gd_temp__verification_plan`.
46
56
#. Fix or justify the errors.
47
57
#. Merge the pull request.
@@ -54,6 +64,12 @@ Traceability
54
64
The detailed design is created by using the template :need:`gd_temp__detailed_design`. In the template
55
65
the static and the dynamic view for unit interactions is described.
56
66
67
+
Traceability from requirements to units is established implicitly through the verification work products:
68
+
:need:`unit tests <wf__verification_unit_test>` and :need:`component integration tests <wf__verification_comp_int_test>` reference specific requirement IDs and exercise
69
+
the units that implement those requirements. This creates the necessary requirement-to-unit link for compliance
70
+
and audit purposes. See the :ref:`verification process area <process_verification>` for details on how requirements
71
+
are verified through tests that exercise specific units.
72
+
57
73
.. figure:: _assets/static_view.drawio.svg
58
74
:align:center
59
75
:width:30%
@@ -75,3 +91,138 @@ The dynamic diagram satisfies the architecture and implements the requirements o
75
91
:name:dd_traceability_fig
76
92
77
93
The unit description will be generated automatically based on the comments in the source code and from the interface description.
94
+
95
+
Detailed Design Guidance
96
+
========================
97
+
98
+
Definition of a Unit
99
+
--------------------
100
+
101
+
A **unit** is a **granular, independent entity** of a component that can be **tested separately**
102
+
during the unit testing phase. Each unit represents a **self-contained functionality** and is
103
+
derived from the decomposition of a component.
104
+
105
+
**Characteristics of a Unit**
106
+
107
+
- **Independent** - Can be tested in isolation.
108
+
- **Granular** - Represents a small, well-defined part of the system.
109
+
- **Relational** - Has associations with other units, defined using **UML 2.0 notations** such as
110
+
aggregation, composition, and generalization.
111
+
112
+
**Examples:**
113
+
The definition of a unit depends on the used programming language. Examples for a unit are
114
+
a source file, a definition file (e.g. c++ header), classes, structs, and functions.
115
+
This list is not complete or exclusive.
116
+
117
+
**Units in UML Diagrams**
118
+
119
+
- **C++ development** - Each **class** can be considered a **unit** in the design.
120
+
- **Rust development** - A **unit** is modeled using a **combination of ``struct`` and ``trait``**,
121
+
as Rust does not have traditional classes.
122
+
123
+
Units within the Component
124
+
--------------------------
125
+
126
+
The relationship between a unit and its parent component is established implicitly through the
127
+
**file path** - each component has its own directory, and units residing within that directory
128
+
belong to it and therefore align with the architecture. A separate static diagram per unit is
129
+
**not required**; the unit's attributes and behaviour are documented in the source code itself,
130
+
as the source code is sufficiently self-explanatory and adheres to the design principles outlined
131
+
in the development plan.
132
+
133
+
However, for components with complex interactions or a large number of units, a textual description,
134
+
a static or dynamic view can be beneficial for understanding the overall structure and relationships
135
+
between units. The developer may choose to add an additional unit-level description, static and dynamic
136
+
view if this helps explain the source code better.
137
+
138
+
It is important that the naming of the units, their interfaces and functions in any diagrams or
139
+
descriptions matches the naming in the source code to ensure traceability. This means the diagrams
140
+
and descriptions should not be outdated, should stay consistent with the source code, and should not
141
+
introduce new terminology or concepts that are not present in the code.
142
+
143
+
Design Principles of the Units
144
+
``````````````````````````````
145
+
146
+
The unit design and implementation should target quality attributes like simplicity, modularity and encapsulation,
147
+
using project-defined coding guidelines and static analysis tooling appropriate for the language
148
+
in use as specified in the software development plan.
149
+
150
+
For ASIL B components, the software development plan shall mandate compliance with the design principles
151
+
specified in ISO 26262-6 §8.4.5 Table 6. These principles shall be enforced through project-specific
152
+
coding guidelines and automated static analysis tooling.
153
+
154
+
The **source code** itself should be self-documenting with meaningful naming and structure.
155
+
**Code comments** may be used where the logic is not self-evident and to provide rationale.
156
+
These comments, along with commit messages, and any additional documentation accompanying the
157
+
source code should use natural language.
158
+
159
+
The interface documentation of a software unit is part of the source code (e.g. public API headers,
160
+
trait definitions, or documented function signatures). If interfaces of the units are also interfaces
161
+
of the component, they should follow the same documentation rules as the component interfaces
162
+
(see :need:`gd_guidl__arch_design`).
163
+
164
+
Especially for public interfaces, the interface naming should follow the naming of the logical
165
+
interface in the feature and component architecture to ensure traceability. The interface
166
+
documentation should be clear and comprehensive so users of the unit can understand how to interact
167
+
with it without needing to read implementation details. The documentation should be maintained and
168
+
updated as the implementation evolves.
169
+
170
+
Diagrams
171
+
--------
172
+
173
+
Developers may add optional diagrams at the unit level if they believe it helps to explain the
174
+
source code better. These are supplementary documentation and are not mandatory. Details are
175
+
described in the following sections.
176
+
177
+
Static View
178
+
```````````
179
+
180
+
If a static view is used, it should provide an overview of the **units** and their relationships
181
+
using **UML 2.0 notations**, such as **aggregation, composition, and generalization**. It is depicted
0 commit comments