From da1eae9a75530ba63bd5d4265efca8b5de152e4c Mon Sep 17 00:00:00 2001 From: Andreas Zwinkau Date: Tue, 21 Jul 2026 16:52:58 +0200 Subject: [PATCH] feat: tool_req__docs_saf_attr_fmea_failure_effect implemented and tested --- docs/internals/requirements/requirements.rst | 2 +- src/extensions/score_metamodel/metamodel.yaml | 21 ++- .../options/test_options_failure_effect.rst | 166 ++++++++++++++++++ 3 files changed, 180 insertions(+), 9 deletions(-) create mode 100644 src/extensions/score_metamodel/tests/rst/options/test_options_failure_effect.rst diff --git a/docs/internals/requirements/requirements.rst b/docs/internals/requirements/requirements.rst index b99fbbd69..a49df7bf4 100644 --- a/docs/internals/requirements/requirements.rst +++ b/docs/internals/requirements/requirements.rst @@ -1125,7 +1125,7 @@ Testing .. tool_req:: Failure Effect :id: tool_req__docs_saf_attr_fmea_failure_effect - :implemented: NO + :implemented: YES :tags: Safety Analysis :version: 1 :satisfies: gd_req__saf_attr_feffect[version==1] diff --git a/src/extensions/score_metamodel/metamodel.yaml b/src/extensions/score_metamodel/metamodel.yaml index 984bc751c..9a6deb4ad 100644 --- a/src/extensions/score_metamodel/metamodel.yaml +++ b/src/extensions/score_metamodel/metamodel.yaml @@ -679,8 +679,9 @@ needs_types: plat_saf_dfa: title: Platform Dependent Failure Analysis mandatory_options: - failure_id: ^.*$ - failure_effect: ^.*$ + failure_id: ^.+$ + # req-Id: tool_req__docs_saf_attr_fmea_failure_effect + failure_effect: ^.+$ sufficient: ^(yes|no)$ status: ^(valid|invalid)$ # req-Id: tool_req__docs_common_attr_description @@ -699,8 +700,9 @@ needs_types: title: Feature DFA (Dependent Failure Analysis) mandatory_options: # req-Id: tool_req__docs_saf_attr_dfa_failure_id - failure_id: ^.*$ - failure_effect: ^.*$ + failure_id: ^.+$ + # req-Id: tool_req__docs_saf_attr_fmea_failure_effect + failure_effect: ^.+$ # req-Id: tool_req__docs_saf_attrs_sufficient sufficient: ^(yes|no)$ status: ^(valid|invalid)$ @@ -729,8 +731,9 @@ needs_types: title: Component DFA (Dependent Failure Analysis) mandatory_options: # req-Id: tool_req__docs_saf_attr_dfa_failure_id - failure_id: ^.*$ - failure_effect: ^.*$ + failure_id: ^.+$ + # req-Id: tool_req__docs_saf_attr_fmea_failure_effect + failure_effect: ^.+$ # req-Id: tool_req__docs_saf_attrs_sufficient sufficient: ^(yes|no)$ status: ^(valid|invalid)$ @@ -759,7 +762,8 @@ needs_types: mandatory_options: # req-Id: tool_req__docs_saf_attr_fmea_fault_id fault_id: ^.*$ - failure_effect: ^.*$ + # req-Id: tool_req__docs_saf_attr_fmea_failure_effect + failure_effect: ^.+$ # req-Id: tool_req__docs_saf_attrs_sufficient sufficient: ^(yes|no)$ status: ^(valid|invalid)$ @@ -790,7 +794,8 @@ needs_types: mandatory_options: # req-Id: tool_req__docs_saf_attr_fmea_fault_id fault_id: ^.*$ - failure_effect: ^.*$ + # req-Id: tool_req__docs_saf_attr_fmea_failure_effect + failure_effect: ^.+$ # req-Id: tool_req__docs_saf_attrs_sufficient sufficient: ^(yes|no)$ status: ^(valid|invalid)$ diff --git a/src/extensions/score_metamodel/tests/rst/options/test_options_failure_effect.rst b/src/extensions/score_metamodel/tests/rst/options/test_options_failure_effect.rst new file mode 100644 index 000000000..9d0b9a1fc --- /dev/null +++ b/src/extensions/score_metamodel/tests/rst/options/test_options_failure_effect.rst @@ -0,0 +1,166 @@ +.. + # ******************************************************************************* + # Copyright (c) 2026 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + + +.. test_metadata:: + :id: test_metadata__failure_effect + :partially_verifies_list: tool_req__docs_saf_attr_fmea_failure_effect + :test_type: requirements_based + :derivation_technique: requirements_based + + Tests that every Safety Analysis (FMEA and DFA) has a mandatory, + non-empty `failure_effect` attribute. + + +.. Negative: `feat_saf_fmea` without `failure_effect` — warning expected. + +.. feat_saf_fmea:: Missing failure_effect + :id: feat_saf_fmea__test__no_failure_effect + :fault_id: FMEA_01 + :sufficient: yes + :status: valid + :expect: feat_saf_fmea__test__no_failure_effect: is missing required attribute: `failure_effect`. + + Some content. + + +.. Positive: `feat_saf_fmea` with `failure_effect` — no warning expected. + +.. feat_saf_fmea:: With failure_effect + :id: feat_saf_fmea__test__with_fe + :fault_id: FMEA_02 + :failure_effect: Unintended actuation of the analysed element + :sufficient: yes + :status: valid + :version: 1 + :expect_not: required attribute: `failure_effect` + + Some content. + + +.. Negative: `comp_saf_fmea` without `failure_effect` — warning expected. + +.. comp_saf_fmea:: Missing failure_effect + :id: comp_saf_fmea__test__no_failure_effect + :fault_id: FMEA_03 + :sufficient: yes + :status: valid + :expect: comp_saf_fmea__test__no_failure_effect: is missing required attribute: `failure_effect`. + + Some content. + + +.. Positive: `comp_saf_fmea` with `failure_effect` — no warning expected. + +.. comp_saf_fmea:: With failure_effect + :id: comp_saf_fmea__test__with_fe + :fault_id: FMEA_04 + :failure_effect: Unintended actuation of the analysed element + :sufficient: yes + :status: valid + :version: 1 + :expect_not: required attribute: `failure_effect` + + Some content. + + +.. Negative: `feat_saf_dfa` without `failure_effect` — warning expected. + +.. feat_saf_dfa:: Missing failure_effect + :id: feat_saf_dfa__test__no_failure_effect + :failure_id: DFA_01 + :sufficient: yes + :status: valid + :expect: feat_saf_dfa__test__no_failure_effect: is missing required attribute: `failure_effect`. + + Some content. + + +.. Positive: `feat_saf_dfa` with `failure_effect` — no warning expected. + +.. feat_saf_dfa:: With failure_effect + :id: feat_saf_dfa__test__with_fe + :failure_id: DFA_02 + :failure_effect: Unintended actuation of the analysed element + :sufficient: yes + :status: valid + :version: 1 + :expect_not: required attribute: `failure_effect` + + Some content. + + +.. Negative: `comp_saf_dfa` without `failure_effect` — warning expected. + +.. comp_saf_dfa:: Missing failure_effect + :id: comp_saf_dfa__test__no_failure_effect + :failure_id: DFA_03 + :sufficient: yes + :status: valid + :expect: comp_saf_dfa__test__no_failure_effect: is missing required attribute: `failure_effect`. + + Some content. + + +.. Positive: `comp_saf_dfa` with `failure_effect` — no warning expected. + +.. comp_saf_dfa:: With failure_effect + :id: comp_saf_dfa__test__with_fe + :failure_id: DFA_04 + :failure_effect: Unintended actuation of the analysed element + :sufficient: yes + :status: valid + :version: 1 + :expect_not: required attribute: `failure_effect` + + Some content. + + +.. Negative: `plat_saf_dfa` without `failure_effect` — warning expected. + +.. plat_saf_dfa:: Missing failure_effect + :id: plat_saf_dfa__test__no_failure_effect + :failure_id: DFA_05 + :sufficient: yes + :status: valid + :expect: plat_saf_dfa__test__no_failure_effect: is missing required attribute: `failure_effect`. + + Some content. + + +.. Positive: `plat_saf_dfa` with `failure_effect` — no warning expected. + +.. plat_saf_dfa:: With failure_effect + :id: plat_saf_dfa__test__with_fe + :failure_id: DFA_06 + :failure_effect: Unintended actuation of the analysed element + :sufficient: yes + :status: valid + :version: 1 + :expect_not: required attribute: `failure_effect` + + Some content. + + +.. Negative: `failure_effect` is empty string — warning expected. + +.. feat_saf_fmea:: Empty failure_effect + :id: feat_saf_fmea__test__empty_failure_effect + :fault_id: FMEA_05 + :failure_effect: + :sufficient: yes + :status: valid + :expect: feat_saf_fmea__test__empty_failure_effect: is missing required attribute: `failure_effect`. + + Some content.