Step 1 — Requirements

A dependable_element starts with TRLC requirement files and their corresponding Bazel targets. Dependent on it´s size and complexity, a dependable element can have two or three levels of requirements. This means that a component requirement can be linked both to an assumed system and feature requirement.

Assumed System Requirements

requirements/asr.trlc captures the constraints imposed on this element by the surrounding system context:

package MinimalExample

import ScoreReq

ScoreReq.AssumedSystemReq ASR_001 {
    description = "The system shall support configurable key-value parameters accessible at runtime"
    safety      = ScoreReq.Asil.B
    rationale   = "Runtime configuration is required so the component can be adapted without recompilation"
    version     = 1
}

Feature Requirements

requirements/feature_requirements.trlc lists the functional and safety requirements for this element, each referencing its parent assumed system requirement via derived_from:

package MinimalExample

import ScoreReq

ScoreReq.FeatReq FEAT_001 {
    description  = "The component shall store configuration parameters persistently across restarts"
    safety       = ScoreReq.Asil.B
    derived_from = [MinimalExample.ASR_001@1]
    version      = 1
}

ScoreReq.FeatReq FEAT_002 {
    description  = "The component shall provide read access to all stored configuration parameters"
    safety       = ScoreReq.Asil.B
    derived_from = [MinimalExample.ASR_001@1]
    version      = 1
}

BUILD

load(
    "@score_tooling//bazel/rules/rules_score:rules_score.bzl",
    "assumed_system_requirements",
    "dependable_element",
    "feature_requirements",
)

assumed_system_requirements(
    name = "assumed_system_requirements",
    srcs = ["requirements/asr.trlc"],
)

feature_requirements(
    name = "feature_requirements",
    srcs = ["requirements/feature_requirements.trlc"],
    deps = [":assumed_system_requirements"],
)

dependable_element(
    name = "my_element",
    integrity_level = "B",
    requirements = [":feature_requirements"],
    assumptions_of_use = [],
    architectural_design = [],
    components = [],
    dependability_analysis = [],
    tests = [],
)

To validate TRLC syntax and Traceability within the requirements, each of the requirements Bazel targets exposes via a macro already a test target, which can be run from the “root” of the example itself (bazel/rules/rules_score/examples/seooc) via e.g.: bazel test //:assumed_system_requirements_test.

→ Full guide: Requirements