Skip to content

Commit 2255276

Browse files
committed
process: add checks safety analysis
Ref: closes #54
1 parent 909a125 commit 2255276

File tree

4 files changed

+302
-77
lines changed

4 files changed

+302
-77
lines changed

src/extensions/score_metamodel/metamodel.yaml

Lines changed: 76 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -505,73 +505,77 @@ needs_types:
505505
status: ^(valid|invalid)$
506506

507507
# Safety Analysis DFA
508-
feat_plat_saf_dfa:
509-
title: DFA
510-
prefix: feat_plat_saf_dfa__
511-
mandatory_options:
512-
verifies: ^feat_arc_sta__[0-9a-z_]*$
513-
id: ^gd_guidl__dfa_failure_initiators__[0-9a-z_]*$
514-
violation_id: ^.*$
515-
violation_cause: ^.*$
516-
mitigates: ^(feat_req__[0-9a-z_]*|aou_req_[0-9a-z]*|)$
517-
mitigation_issue: ^https://github.com/.*$
518-
sufficient: ^(yes|no)$
519-
status: ^(valid|invalid)$
520-
521-
feat_saf_dfa:
522-
title: DFA
523-
prefix: feat_saf_dfa__
524-
mandatory_options:
525-
verifies: ^feat_arc_sta__[0-9a-z_]*$
526-
id: ^gd_guidl__dfa_failure_initiators__[0-9a-z_]*$
527-
violation_id: ^.*$
528-
violation_cause: ^.*$
529-
mitigation_issue: ^https://github.com/.*$
530-
sufficient: ^(yes|no)$
531-
status: ^(valid|invalid)$
532-
mandatory_links:
533-
mitigates: ^feat_req__.*$
534-
535-
comp_saf_dfa:
536-
title: DFA
537-
prefix: comp_saf_dfa__
538-
mandatory_options:
539-
verifies: ^comp_arc_sta__[0-9a-z_]*$
540-
id: ^gd_guidl__dfa_failure_initiators__[0-9a-z_]*$
541-
violation_id: ^.*$
542-
violation_cause: ^.*$
543-
mitigates: ^(feat_req__[0-9a-z_]*|aou_req_[0-9a-z]*|)$
544-
mitigation_issue: ^https://github.com/.*$
545-
sufficient: ^(yes|no)$
546-
status: ^(valid|invalid)$
547-
548-
# Safety Analysis FMEA
549-
feat_saf_fmea:
550-
title: FMEA
551-
prefix: feat_saf_fmea__
552-
mandatory_options:
553-
verifies: ^feat_arc_dyn__[0-9a-z_]*$
554-
id: ^gd_guidl__fault_models__[0-9a-z_]*$
555-
violation_id: ^.*$
556-
violation_cause: ^.*$
557-
mitigates: ^(feat_req__[0-9a-z_]*|aou_req_[0-9a-z]*|)$
558-
mitigation_issue: ^https://github.com/.*$
559-
sufficient: ^(yes|no)$
560-
status: ^(valid|invalid)$
561-
562-
comp_saf_fmea:
563-
title: FMEA
564-
prefix: comp_saf_fmea__
565-
mandatory_options:
566-
verifies: ^comp_arc_dyn__[0-9a-z_]*$
567-
id: ^gd_guidl__fault_models__[0-9a-z_]*$
568-
violation_id: ^.*$
569-
violation_cause: ^.*$
570-
mitigates: ^(comp_req__[0-9a-z_]*|aou_req_[0-9a-z]*|)$
571-
mitigation_issue: ^https://github.com/.*$
572-
sufficient: ^(yes|no)$
573-
argument: ^.+$
574-
status: ^(valid|invalid)$
508+
feat_plat_saf_dfa:
509+
title: DFA
510+
prefix: feat_plat_saf_dfa__
511+
mandatory_options:
512+
id: ^gd_guidl__dfa_failure_initiators__[0-9a-z_]*$
513+
violation_id: ^.*$
514+
violation_cause: ^.*$
515+
mitigation_issue: ^https://github.com/.*$
516+
sufficient: ^(yes|no)$
517+
status: ^(valid|invalid)$
518+
mandatory_links:
519+
mitigates: ^(feat_req__.*|aou_req__.*|)$
520+
verifies: ^feat_arc_sta__[0-9a-z_]*$
521+
522+
feat_saf_dfa:
523+
title: DFA
524+
prefix: feat_saf_dfa__
525+
mandatory_options:
526+
id: ^feat_saf_dfa__[0-9a-z_]+$
527+
violation_id: ^.*$
528+
violation_cause: ^.*$
529+
mitigation_issue: ^https://github.com/.*$
530+
sufficient: ^(yes|no)$
531+
status: ^(valid|invalid)$
532+
mandatory_links:
533+
mitigates: ^(feat_req__.*|aou_req__.*|)$
534+
verifies: ^feat_arc_sta__[0-9a-z_]*$
535+
536+
comp_saf_dfa:
537+
title: DFA
538+
prefix: comp_saf_dfa__
539+
mandatory_options:
540+
id: ^gd_guidl__dfa_failure_initiators__[0-9a-z_]*$
541+
violation_id: ^.*$
542+
violation_cause: ^.*$
543+
mitigation_issue: ^https://github.com/.*$
544+
sufficient: ^(yes|no)$
545+
status: ^(valid|invalid)$
546+
mandatory_links:
547+
mitigates: ^(comp_req__.*|aou_req__.*|)$
548+
verifies: ^comp_arc_sta__[0-9a-z_]*$
549+
550+
# # Safety Analysis FMEA
551+
feat_saf_fmea:
552+
title: FMEA
553+
prefix: feat_saf_fmea__
554+
mandatory_options:
555+
id: ^gd_guidl__fault_models__[0-9a-z_]*$
556+
violation_id: ^.*$
557+
violation_cause: ^.*$
558+
mitigation_issue: ^https://github.com/.*$
559+
sufficient: ^(yes|no)$
560+
status: ^(valid|invalid)$
561+
mandatory_links:
562+
mitigates: ^(feat_req__.*|aou_req__.*|)$
563+
verifies: ^feat_arc_dyn__[0-9a-z_]*$
564+
565+
comp_saf_fmea:
566+
title: FMEA
567+
prefix: comp_saf_fmea__
568+
mandatory_options:
569+
id: ^gd_guidl__fault_models__[0-9a-z_]*$
570+
violation_id: ^.*$
571+
violation_cause: ^.*$
572+
mitigation_issue: ^https://github.com/.*$
573+
sufficient: ^(yes|no)$
574+
argument: ^.+$
575+
status: ^(valid|invalid)$
576+
mandatory_links:
577+
mitigates: ^(comp_req__.*|aou_req__.*|)$
578+
verifies: ^comp_arc_dyn__[0-9a-z_]*$
575579

576580
# Extra link types, which shall be available and allow need types to be linked to each other.
577581
# We use a dedicated linked type for each type of a connection, for instance from
@@ -647,8 +651,8 @@ needs_extra_links:
647651
outgoing: included by
648652

649653
mitigates:
650-
incoming: mitigates by
651-
outgoing: mitigated
654+
incoming: mitigated by
655+
outgoing: mitigates
652656
##############################################################
653657
# Graph Checks
654658
# The graph checks focus on the relation of the needs and their attributes.
@@ -693,7 +697,8 @@ graph_checks:
693697
# as the corresponding ASIL of the Feature or Component that is analyzed.
694698
saf_linkage_safety:
695699
needs:
696-
include: feat_saf_fmea, comp_saf_fmea, feat_plat_saf_dfa, feat_saf_dfa, comp_saf_dfa, aou_req
700+
include: feat_saf_fmea, comp_saf_fmea, feat_plat_saf_dfa, feat_saf_dfa, comp_saf_dfa
697701
condition: safety == ASIL_B
698702
check:
699-
mitigates: safety == QM
703+
mitigates: safety != QM
704+

src/extensions/score_metamodel/tests/rst/graph/test_metamodel_graph.rst

Lines changed: 132 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,138 @@
117117
:satisfies: feat_req__parent0__abcd
118118

119119

120+
.. Mitigation of Safety Analysis (FMEA and DFA) shall be checked. Mitigation shall have the same or higher safety level than the analysed item.
121+
.. Negative Test: Linked to a mitigation that is lower than the safety level of the analysed item.
122+
#EXPECT: feat_saf_dfa__child__10: parent need `feat_req__parent__QM` does not fulfill condition `safety != QM`.
120123

124+
.. feat_saf_dfa:: Child requirement 10
125+
:id: feat_saf_dfa__child__10
126+
:safety: ASIL_B
127+
:status: valid
128+
:mitigates: feat_req__parent__QM
129+
130+
.. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item.
131+
#EXPECT-NOT: feat_saf_dfa__child__11: parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`.
132+
133+
.. feat_saf_dfa:: Child requirement 11
134+
:id: feat_saf_dfa__child__11
135+
:safety: ASIL_B
136+
:status: valid
137+
:mitigates: feat_req__parent__ASIL_B
138+
139+
.. Positive Test: Linked to a mitigation that is higher to the safety level of the analysed item.
140+
#EXPECT-NOT: feat_saf_dfa__child__12: parent need `feat_req__parent__ASIL_D` does not fulfill condition `safety != QM`.
141+
142+
.. feat_saf_dfa:: Child requirement 12
143+
:id: feat_saf_dfa__child__12
144+
:safety: ASIL_B
145+
:status: valid
146+
:mitigates: feat_req__parent__ASIL_D
147+
148+
.. Negative Test: Linked to a mitigation that is lower than the safety level of the analysed item.
149+
#EXPECT: comp_saf_dfa__child__13: parent need `feat_req__parent__QM` does not fulfill condition `safety != QM`.
150+
151+
.. comp_saf_dfa:: Child requirement 13
152+
:id: comp_saf_dfa__child__13
153+
:safety: ASIL_B
154+
:status: valid
155+
:mitigates: feat_req__parent__QM
156+
157+
.. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item.
158+
#EXPECT-NOT: comp_saf_dfa__child__14: parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`.
159+
160+
.. comp_saf_dfa:: Child requirement 14
161+
:id: comp_saf_dfa__child__14
162+
:safety: ASIL_B
163+
:status: valid
164+
:mitigates: feat_req__parent__ASIL_B
165+
166+
.. Positive Test: Linked to a mitigation that is higher to the safety level of the analysed item.
167+
#EXPECT-NOT: comp_saf_dfa__child__15: parent need `feat_req__parent__ASIL_D` does not fulfill condition `safety != QM`.
168+
169+
.. comp_saf_dfa:: Child requirement 15
170+
:id: comp_saf_dfa__child__15
171+
:safety: ASIL_B
172+
:status: valid
173+
:mitigates: feat_req__parent__ASIL_D
174+
175+
.. Negative Test: Linked to a mitigation that is lower than the safety level of the analysed item.
176+
#EXPECT: feat_plat_saf_dfa__child__16: parent need `feat_req__parent__QM` does not fulfill condition `safety != QM`.
177+
178+
.. feat_plat_saf_dfa:: Child requirement 16
179+
:id: feat_plat_saf_dfa__child__16
180+
:safety: ASIL_B
181+
:status: valid
182+
:mitigates: feat_req__parent__QM
183+
184+
.. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item.
185+
#EXPECT-NOT: feat_plat_saf_dfa__child__17: parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`.
186+
187+
.. feat_plat_saf_dfa:: Child requirement 17
188+
:id: feat_plat_saf_dfa__child__17
189+
:safety: ASIL_B
190+
:status: valid
191+
:mitigates: feat_req__parent__ASIL_B
192+
193+
.. Positive Test: Linked to a mitigation that is higher to the safety level of the analysed item.
194+
#EXPECT-NOT: feat_plat_saf_dfa__child__18: parent need `feat_req__parent__ASIL_D` does not fulfill condition `safety != QM`.
195+
196+
.. feat_plat_saf_dfa:: Child requirement 18
197+
:id: feat_plat_saf_dfa__child__15
198+
:safety: ASIL_B
199+
:status: valid
200+
:mitigates: feat_req__parent__ASIL_D
201+
202+
.. Negative Test: Linked to a mitigation that is lower than the safety level of the analysed item.
203+
#EXPECT: feat_saf_fmea__child__19: parent need `feat_req__parent__QM` does not fulfill condition `safety != QM`.
204+
205+
.. feat_saf_fmea:: Child requirement 19
206+
:id: feat_saf_fmea__child__19
207+
:safety: ASIL_B
208+
:status: valid
209+
:mitigates: feat_req__parent__QM
210+
211+
.. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item.
212+
#EXPECT-NOT: feat_saf_fmea__child__20: parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`.
213+
214+
.. feat_saf_fmea:: Child requirement 20
215+
:id: feat_saf_fmea__child__20
216+
:safety: ASIL_B
217+
:status: valid
218+
:mitigates: feat_req__parent__ASIL_B
121219

122-
.. .. Parent requirement does not exist
123-
.. .. #EXPECT: feat_saf_dfa__child__10: Parent need `feat_req__parent__QM` does not fulfill the condition `safety != QM`.
220+
.. Positive Test: Linked to a mitigation that is higher to the safety level of the analysed item.
221+
#EXPECT-NOT: feat_saf_fmea__child__21: parent need `feat_req__parent__ASIL_D` does not fulfill condition `safety != QM`.
124222

125-
.. .. feat_req:: Child requirement 10
126-
.. .. :id: feat_saf_dfa__child__10
127-
.. .. :safety: ASIL_B
128-
.. .. :mitigates: feat_req__parent__QM
223+
.. feat_saf_fmea:: Child requirement 21
224+
:id: feat_saf_fmea__child__21
225+
:safety: ASIL_B
226+
:status: valid
227+
:mitigates: feat_req__parent__ASIL_D
228+
229+
.. Negative Test: Linked to a mitigation that is lower than the safety level of the analysed item.
230+
#EXPECT: comp_saf_fmea__child__22: parent need `feat_req__parent__QM` does not fulfill condition `safety != QM`.
231+
232+
.. comp_saf_fmea:: Child requirement 22
233+
:id: comp_saf_fmea__child__22
234+
:safety: ASIL_B
235+
:status: valid
236+
:mitigates: feat_req__parent__QM
237+
238+
.. Positive Test: Linked to a mitigation that is equal to the safety level of the analysed item.
239+
#EXPECT-NOT: comp_saf_fmea__child__23: parent need `feat_req__parent__ASIL_B` does not fulfill condition `safety != QM`.
240+
241+
.. comp_saf_fmea:: Child requirement 23
242+
:id: comp_saf_fmea__child__23
243+
:safety: ASIL_B
244+
:status: valid
245+
:mitigates: feat_req__parent__ASIL_B
246+
247+
.. Positive Test: Linked to a mitigation that is higher to the safety level of the analysed item.
248+
#EXPECT-NOT: comp_saf_fmea__child__24: parent need `feat_req__parent__ASIL_D` does not fulfill condition `safety != QM`.
249+
250+
.. comp_saf_fmea:: Child requirement 24
251+
:id: comp_saf_fmea__child__24
252+
:safety: ASIL_B
253+
:status: valid
254+
:mitigates: feat_req__parent__ASIL_D

src/extensions/score_metamodel/tests/rst/options/test_options_extra_option.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@
2525

2626
.. std_wp:: This is a test
2727
:id: std_wp__test__abce
28+
29+

0 commit comments

Comments
 (0)