eclipse-score/communication/score-testing
Claude Code and agent skill by eclipse-score/communication
- community
Checking that the SKILL.md file is still in the repository.
Testing and test-coverage traceability for S-CORE SEooCs using the rules_score Bazel rules. USE FOR: attaching tests to unit/component/dependable_element targets, annotating GoogleTest cases with lobster-tracing and Given-When-Then RecordProperty calls, requirement-to-test traceability, the test_case_coverage.lock.yaml workflow (bazel run .update vs bazel test drift check), maturity-driven enforcement, and running rules_score tests. Use when writing tests, wiring test targets, annotating tests for traceability, or measuring test-case coverage.
Install
npx vskill@latest install eclipse-score/communication/score-testingSKILL.md
S-CORE Testing Skill
Testing and test-case-coverage traceability for a Safety Element out of Context (SEooC) built with the rules_score Bazel rules. Tests are attached to architectural elements, annotated for requirement traceability, and their coverage is locked and verified automatically at build time.
Source of truth: the rule macros underbazel/rules/rules_score/private/(unit.bzl,component.bzl,dependable_element.bzl), the test-case-coverage tooling underand the runnable examples inWhen source and documentation disagree, the source wins.
When to use
- Attaching tests to
unit,component, ordependable_elementvia thetestsattribute - Annotating GoogleTest cases with
lobster-tracing+ Given-When-Then - Writing formal RST test specifications (
test_specification) for complex tests - Setting up and maintaining
test_case_coverage.lock.yaml - Running
rules_scoretests and interpreting coverage-drift failures
Not for
- Requirement records and traceability model → score-requirements
- Architecture structure and diagrams → score-architecture
- FMEA / safety analysis → score-safety-analysis
- End-to-end SEooC assembly / choosing which skill to use → rules-score
Where Tests Attach
Test targets are attached at three architectural levels through the tests attribute. Match the test scope to the level:
| Level | Attribute | Test focus | |
|---|---|---|---|
unit | unit(tests = [...]) | Unit tests — the smallest verifiable element | |
component | component(tests = [...]) | Integration tests across the component's units | |
dependable_element | dependable_element(tests = [...]) | System / integration tests for the whole SEooC |
rules_score does not require a separate test-specification document. Test intent is captured as a Given-When-Then description right next to the code, then rendered in the traceability report together with the test results and coverage. For complex or higher-order tests, a test case can instead reference a formal RST test specification (see Formal Test Specification).
Annotating Tests (GoogleTest + lobster-tracing)
Unit tests are written with GoogleTest and built with cc_test. A test case that covers a requirement carries RecordProperty annotations inside its body:
| Property | Required | Description | |
|---|---|---|---|
lobster-tracing | yes | One or more requirement IDs (Package.RecordId), linking the test to CompReq records. Multiple IDs are separated by whitespace (the docs also describe comma-separated). | |
given | with coverage lock | Initial state / precondition | |
when | no | Action or event under test | |
then | with coverage lock | Expected outcome | |
test-spec | no | Bazel label of a test_specification; replaces given/when/then |
- A test without
lobster-tracinghas no traceability and is excluded from coverage tracking. - The referenced IDs must resolve to
CompReqrecords exposed through the component's
requirements targets.
- A test case in a coverage lock needs a Given and a Then, or a
test-spec; When is always optional.
Given/When/Then from the test name
A test named [<Prefix>_]Given<X>[_When<Y>]_(Expect|Then)<Z> needs no given/when/then properties; its name provides them. <Prefix> is alphanumeric; <X>, <Y>, <Z> are CamelCase and become lowercase words separated by spaces:
_When<Y>is optional;GivenEmptyStack_ExpectErrorhas no When.- A test that sets any of the three properties to a non-blank value ignores its name completely, so
missing parts are not filled in from the name. If the name also matches, lobster prints a warning. Set all needed parts, or none.
- Needs a
lobsterversion that provides--derive-gwt-from-test-name. It is not available in
lobster 1.0.6 and earlier, where only the properties are used.
- After a
lobsterupgrade that provides the option, the lock entries of pattern-named tests without
properties become stale; run bazel run //<pkg>:<component>.update and review the diff.
Formal Test Specification (RST)
For complex scenarios, write one test specification per RST file and reference it by its Bazel label instead of Given/When/Then. Several test cases may reference the same specification.
- Exactly one title section; below it only
Test Goal(mandatory),Test Focus(optional) and
Test Steps (mandatory, ≥ 1 step subsection). Each step has one field list with :Precondition: (optional), :Action: and :Expected: (mandatory). Anything else is a build error.
bazel buildvalidates the RST (actionTestSpecificationCheck), independent ofmaturity.- Reference the spec with its label spelled as in the unit's
test_specs(":name"in//pkg
→ //pkg:name; another repository as @spec_repo//specs:name). The macro records that spelling, so it works regardless of canonical repo names (e.g. a SEooC built as a dependency of another module). Fallback: the spec's repo-relative label //pkg:name or //pkg:name.rst, unless ambiguous. A reference that does not resolve is reported like a missing Given/Then.
- Cross-package specs need
visibilitygranted to the unit's package. - A spec replaces Given/When/Then completely; GWT from properties or the test name is ignored with
a warning.
Test-Case Coverage (test_case_coverage.lock.yaml)
Coverage is declared through a committed lock file that lists, per requirement, every test case (uid + Given-When-Then) that covers it. Committing the file is the coverage claim. Link it to the component rule:
Lock file format
requirements[].id— matches thelobster-tracingvalue; extracted from the requirements targets.test_cases[].uid—//bazel_package/SuiteName:TestName, a package-scoped gtest tag.given/when/then— the GWT fields fromRecordPropertyor the test name; any change
makes the lock stale. given and then must be non-blank; when may be empty and is stored as ''.
spec— optional; replacesgiven/when/thenfor a test case with atest-spec. Holds the
parsed ref, goal, focus and steps; any change to the RST makes the lock stale.
Two workflows keep the lock in sync
- `bazel run //<pkg>:<component>.update` — reads current test results and rewrites
test_case_coverage.lock.yaml in the source tree. Review git diff, then commit to approve.
- `bazel test //...` — a build action recomputes coverage from the same test results and
compares it against the committed lock. Any drift (new/removed test, changed GWT text or test specification, version bump) fails the build until the lock is refreshed and re-committed.
The .update target is only generated when test_case_coverage_lock is set on the component.
Enforcement stringency follows dependable_element.maturity
The coverage check runs inside the enclosing dependable_element, and its maturity attribute controls how strict it is:
maturity | Behavior | |
|---|---|---|
"development" | --allow-check-failures: lock-drift and missing-Given/Then errors are downgraded to warnings; the .lobster artifact is always produced. | |
"release" | A drift or a missing Given/Then fails the Bazel build action directly. |
Switch back to "release" before certification.
Running Tests
Useful options: --test_output=errors (default), --test_output=all, --nocache_test_results (force re-run).
Traceability Flow (how it fits together)
Requirement → test coverage is complete when every CompReq in the component's requirements appears in the lock file with at least one covering test case.
References
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/score-testing/SKILL.md
Popularity
- Repository stars
- 60
- Repository forks
- 94
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/eclipse-score/communication/score-testing)