Tutorial: Your First Dependable Element

This tutorial walks you through building a minimal Safety Element out of Context (SEooC) step by step. All examples are taken from the standalone module at bazel/rules/rules_score/examples/minimal/ (standalone module) — you can run each step there with bazel build //:my_element.

By the end you will have a fully validated SEooC with requirements, a static architecture diagram, a unit design, and a passing build.

Workflow

The tutorial follows the S-CORE development flow top-down: specify what the element must do, design how it is structured, implement and verify it, and let the build check that every artefact stays consistent.

Step 1              Step 2                 Step 3            Step 4          Step 5
Requirements   →    SW Architectural   →   Unit Design  →   Validation  →   Build
                    Design
───────────         ───────────────        ───────────      ──────────      ─────────
AssumedSystemReq    static diagram         class/sequence   unit &          bazel build
FeatReq             (components + units)    diagram per      component       (runs every
CompReq             →  Bazel targets        unit  →  code    tests +         consistency
(.trlc records)     modelled after it       it validates    lobster-        check)
                                            against          tracing

Each step builds on the previous one, and each has an automatic check:

  1. Requirements — write AssumedSystemReq / FeatReq / CompReq TRLC records and wire their Bazel targets. Traceability is type-checked by trlc --verify. → Step 1 — Requirements

  2. SW Architectural Design — draw the static PlantUML diagram naming every component and unit, then model it 1:1 as dependable_element / component / unit targets. The diagram is the design; the Bazel model follows it, and the architecture-consistency check enforces the match. → Step 2 — SW Architectural Design

  3. Unit Design — add a class/sequence diagram for each unit; it is validated against the real C++ implementation. → Step 3 — Unit Design

  4. Validation — attach unit/component/system tests and annotate them with lobster-tracing to link test cases back to requirements. → Step 4 — Validation

  5. Build — run bazel build //:my_element to execute all checks at once and assemble the documentation. → Step 5 — Build

Note

The Examples are setup as a standalone Bazel module, this means you have to run it from within the example folder, e.g. cd bazel/rules/rules_score/examples/minimal and then run bazel build //:my_element.