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:
Requirements — write
AssumedSystemReq/FeatReq/CompReqTRLC records and wire their Bazel targets. Traceability is type-checked bytrlc --verify. → Step 1 — RequirementsSW Architectural Design — draw the static PlantUML diagram naming every component and unit, then model it 1:1 as
dependable_element/component/unittargets. The diagram is the design; the Bazel model follows it, and the architecture-consistency check enforces the match. → Step 2 — SW Architectural DesignUnit Design — add a class/sequence diagram for each unit; it is validated against the real C++ implementation. → Step 3 — Unit Design
Validation — attach unit/component/system tests and annotate them with
lobster-tracingto link test cases back to requirements. → Step 4 — ValidationBuild — run
bazel build //:my_elementto 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.