Skip to content

Commit 158bd57

Browse files
add documentation examples (#58)
Co-authored-by: Alexander Lanin <Alexander.Lanin@etas.com>
1 parent e4c7dff commit 158bd57

54 files changed

Lines changed: 6089 additions & 258 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BUILD

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ setup_starpls(
2323
copyright_checker(
2424
name = "copyright",
2525
srcs = [
26-
"src",
26+
"score",
2727
"tests",
2828
"//:BUILD",
2929
"//:MODULE.bazel",
@@ -44,5 +44,8 @@ dash_license_checker(
4444
use_format_targets()
4545

4646
docs(
47-
source_dir = "docs",
47+
data = [
48+
"@score_process//:needs_json",
49+
],
50+
source_dir = ".",
4851
)

MODULE.bazel

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module(
1515
version = "1.0",
1616
)
1717

18-
bazel_dep(name = "rules_python", version = "1.4.1", dev_dependency = True)
18+
bazel_dep(name = "rules_python", version = "1.8.3", dev_dependency = True)
1919

2020
# Python 3.12: Required for testing infrastructure and code generation tools
2121
PYTHON_VERSION = "3.12"
@@ -30,6 +30,20 @@ python.toolchain(
3030
python_version = PYTHON_VERSION,
3131
)
3232

33+
pip = use_extension(
34+
"@rules_python//python/extensions:pip.bzl",
35+
"pip",
36+
dev_dependency = True,
37+
)
38+
pip.parse(
39+
envsubst = ["PIP_INDEX_URL"],
40+
extra_pip_args = ["--index-url=${PIP_INDEX_URL:-https://pypi.org/simple/}"],
41+
hub_name = "module_template_docs_hub_env",
42+
python_version = PYTHON_VERSION,
43+
requirements_lock = "@score_docs_as_code//src:requirements.txt",
44+
)
45+
use_repo(pip, "module_template_docs_hub_env")
46+
3347
# Add GoogleTest dependency
3448
bazel_dep(name = "googletest", version = "1.17.0", dev_dependency = True)
3549

@@ -57,9 +71,16 @@ use_repo(llvm, "llvm_toolchain_llvm")
5771
register_toolchains("@llvm_toolchain//:all")
5872

5973
# tooling
60-
bazel_dep(name = "score_tooling", version = "1.0.4", dev_dependency = True)
74+
bazel_dep(name = "score_tooling", version = "1.2.0", dev_dependency = True)
6175
bazel_dep(name = "aspect_rules_lint", version = "1.10.2", dev_dependency = True)
6276
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = True)
6377

6478
#docs-as-code
65-
bazel_dep(name = "score_docs_as_code", version = "2.3.0", dev_dependency = True)
79+
bazel_dep(name = "score_docs_as_code", version = "3.1.0", dev_dependency = True)
80+
bazel_dep(name = "score_process", version = "1.5.1", dev_dependency = True)
81+
82+
git_override(
83+
module_name = "score_docs_as_code",
84+
commit = "817080b1f184618a3ecb5bb9029e453ebc5fe806",
85+
remote = "https://github.com/eclipse-score/docs-as-code.git",
86+
)

MODULE.bazel.lock

Lines changed: 998 additions & 153 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ It provides a **standardized project structure**, ensuring best practices for:
3131
| File/Folder | Description |
3232
| ----------------------------------- | ------------------------------------------------- |
3333
| `README.md` | Short description & build instructions |
34-
| `src/` | Source files and Unit Tests for the module |
34+
| `score/` | Source files and Unit Tests for the module |
3535
| `tests/` | Component and Feature Integration Tests (CIT&FIT) |
3636
| `examples/` | Example files used for guidance |
3737
| `docs/` | Documentation (Doxygen for C++ / mdBook for Rust) |
@@ -61,15 +61,15 @@ cd YOUR_PROJECT
6161
To build all targets of the module the following command can be used:
6262

6363
```sh
64-
bazel build //src/...
64+
bazel build //score/...
6565
```
6666

6767
This command will instruct Bazel to build all targets that are under Bazel
68-
package `src/`. The ideal solution is to provide single target that builds
68+
package `score/`. The ideal solution is to provide single target that builds
6969
artifacts, for example:
7070

7171
```sh
72-
bazel build //src/<module_name>:release_artifacts
72+
bazel build //score/<module_name>:release_artifacts
7373
```
7474

7575
where `:release_artifacts` is filegroup target that collects all release
@@ -89,7 +89,7 @@ bazel test //...
8989
Unit tests:
9090

9191
```sh
92-
bazel test //src/...
92+
bazel test //score/...
9393
```
9494

9595
Component / Feature integration tests:
@@ -113,6 +113,14 @@ The template integrates **tools and linters** from **centralized repositories**
113113
## 📖 Documentation
114114

115115
- A **centralized docs structure** is planned.
116+
- This template builds Sphinx from the repository root. The configuration stays in
117+
`conf.py`, the main document is `docs/index.rst`, and the root `BUILD` target uses
118+
a repository-local `docs.bzl` wrapper because the upstream SCORE docs macro does not
119+
currently support `source_dir = "."`.
120+
121+
```sh
122+
bazel run //:docs
123+
```
116124

117125
---
118126

docs/conf.py renamed to conf.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,29 @@
4141
"score_layout",
4242
]
4343

44+
# Collect documentation from the module-level docs folder and from each
45+
# component's docs folder. Using include_patterns (added in Sphinx 7.1) avoids
46+
# the need for symlinks inside the docs/ folder.
47+
include_patterns = [
48+
"index.rst",
49+
"docs/**",
50+
"examples/docs/**",
51+
"score/component_example/docs/**",
52+
]
53+
4454
exclude_patterns = [
4555
# The following entries are not required when building the documentation via 'bazel
4656
# build //docs:docs', as that command runs in a sandboxed environment. However, when
4757
# building the documentation via 'bazel run //docs:incremental' or esbonio, these
4858
# entries are required to prevent the build from failing.
59+
"_build",
4960
"bazel-*",
5061
".venv_docs",
5162
]
5263

53-
templates_path = ["templates"]
64+
root_doc = "index"
65+
66+
templates_path = ["docs/templates"]
5467

5568
# Enable numref
5669
numfig = True
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
..
2+
# *******************************************************************************
3+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
4+
#
5+
# See the NOTICE file(s) distributed with this work for additional
6+
# information regarding copyright ownership.
7+
#
8+
# This program and the accompanying materials are made available under the
9+
# terms of the Apache License Version 2.0 which is available at
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
15+
16+
.. document:: [Your Feature Name] Architecture Inspection Checklist
17+
:id: doc__feature_example_arc_inspection
18+
:status: draft
19+
:safety: ASIL_B
20+
:security: YES
21+
:realizes: wp__sw_arch_verification
22+
:tags: template
23+
24+
.. attention::
25+
The above directive must be updated according to your Feature.
26+
27+
- Modify ``Your Feature Name`` to be your Feature Name
28+
- Modify ``id`` to be your Feature Name in lower snake case preceded by ``doc__`` and followed by ``_arc_inspection``
29+
- Adjust ``status`` to be ``valid``
30+
- Adjust ``safety``, ``security`` and ``tags`` according to your needs
31+
32+
Architecture Inspection Checklist
33+
=================================
34+
35+
Purpose
36+
-------
37+
38+
The purpose of the software architecture checklist is to ensure that the design meets the criteria and quality as
39+
defined per project processes and guidelines for feature and component architectural design elements.
40+
It helps to check the compliance with requirements, identify errors or inconsistencies, and ensure adherence to best
41+
practices.
42+
The checklist guides evaluation of the architecture design, identifies potential problems, and aids in
43+
communication and documentation of architectural decisions to stakeholders.
44+
45+
Conduct
46+
-------
47+
48+
As described in the concept :need:`doc_concept__wp_inspections` the following "inspection roles" are expected to be filled:
49+
50+
- content responsible (author): <contributor/committer explicitly named here, who is the main author, as can be seen in config mgt tooling>
51+
- reviewer: <contributor/committer explicitly named here, who is the main content reviewer, must be different from content responsible>
52+
- moderator: <committer explicitly named here, who is is the safety manager, security manager or quality manager initiating the inspection>
53+
54+
Checklist
55+
---------
56+
57+
It is mandatory to fill in the "passed" column with "yes" or "no" for each checklist item and additionally to add in the remarks why it is passed or not passed.
58+
In case of "no" an issue link to the issue tracking system has to be added in the last column (if not solved in the same issue).
59+
See also :need:`doc_concept__wp_inspections` for further information about reviews in general and inspection in particular.
60+
61+
.. list-table:: Architecture Design Review Checklist
62+
:header-rows: 1
63+
64+
* - Review Id
65+
- Acceptance criteria
66+
- Guidance
67+
- passed
68+
- Remarks
69+
- Issue link
70+
* - ARC_01_01
71+
- Is the traceability from software architectural elements to requirements, and other level architectural elements (e.g. component to interface) established according to the "Relations between the architectural elements" as described in :need:`doc_concept__arch_process`?
72+
- Trace should be checked automatically by tool support in the future. It will be removed from the checklist once the requirement (:need:`Correlations of the architectural building blocks <gd_req__arch_build_blocks_corr>`) is implemented. Refer to `Tool Requirements <https://eclipse-score.github.io/docs-as-code/main/internals/requirements/requirements.html>`_ for the current status.
73+
-
74+
-
75+
-
76+
* - ARC_01_02
77+
- Does the software architecture design consider all the requirements allocated to the architectural element, including functional, non-functional, safety, and security requirements and all related design decisions?
78+
- manual
79+
- Check if all requirements allocated to the architectural element are considered in the design. This includes functional requirements (e.g. functional safety requirements), non-functional requirements (e.g. performance, reliability), and security requirements (e.g. confidentiality, integrity). Additionally, ensure that all related design decisions are taken into account and documented in the architectural design.
80+
-
81+
-
82+
* - ARC_01_03
83+
- If the architectural element is related to any supplier manuals (including safety and security), are the relevant parts covered?
84+
- If the architecture makes use of supplied elements, their manuals (like safety) have to be considered (i.e. its provided functionality matches the expectation and assumptions are fulfilled). Note that in case of safety component this means that assumed Technical Safety Requirements and AoUs of the safety manual are covered.
85+
-
86+
-
87+
-
88+
* - ARC_01_04
89+
- Is the architectural element traceable to the lower-level artifacts as defined by the work product traceability?
90+
-
91+
-
92+
-
93+
-
94+
* - ARC_02_01
95+
- Is the software architecture design compliant with the overall feature architecture?
96+
- On component level check against the feature architecture, on feature level check other features with common components used.
97+
-
98+
-
99+
-
100+
* - ARC_02_02
101+
- Is appropriate and comprehensible operation and interface naming present in the architectural design?
102+
- Check :need:`gd_guidl__arch_design`
103+
-
104+
-
105+
-
106+
* - ARC_02_03
107+
- Are the correctness of data flow and control flow within the architectural elements considered?
108+
- For example, examine definitions, transformations, integrity, and interaction of data; check error handling, data exchange between elements, correct response to inputs, and documented decision making.
109+
Note: Consistency is ensured by the process/tooling, by defining each interface only once.
110+
-
111+
-
112+
-
113+
* - ARC_02_04
114+
- Are the interfaces between the software architectural element and other architectural elements well defined?
115+
- Check if the interface handles undefined behaviour or errors; can established protocols be used; are the interfaces for inputs, outputs, and error codes documented; is loose coupling considered and only limited exposure; can unit or integration tests be written against the interface; data amount transferred; ensure no sensitive data is exposed;
116+
-
117+
-
118+
-
119+
* - ARC_02_05
120+
- Does the software architectural element consider the timing constraints (from the parent requirement)?
121+
- If there are strict timing requirements, a programming time estimation should be performed and deadline supervision should be considered.
122+
-
123+
-
124+
-
125+
* - ARC_02_06
126+
- Is the documentation of the software architectural element, including textual and graphical descriptions (e.g., UML diagrams), clear and complete?
127+
- Use of semi-formal notation is expected for architectural elements with an allocated ASIL level. Is the architecture template correctly filled?
128+
-
129+
-
130+
-
131+
* - ARC_03_01
132+
- Is the architectural element modular and encapsulated?
133+
- Check, for example, that only minimal interfaces are used. The design should be object oriented. Interfaces and interactions are clearly defined. Usage of access types (private, protected) is properly set. Limited global variables.
134+
-
135+
-
136+
-
137+
* - ARC_03_02
138+
- Is the suitability of the software architecture for future modifications and maintainability considered?
139+
- Check for, for example, loose coupling, separation of concerns, high cohesion, versioning strategy for interfaces, decision records, and use of established design patterns.
140+
-
141+
-
142+
-
143+
* - ARC_03_03
144+
- Are simplicity and avoidance of unnecessary complexity present in the software architecture?
145+
- Indicators of complexity include: the number of use cases (corresponding to dynamic diagrams) allocated to a single design element, the number of interfaces and operations in an interface, function parameters, global variables, complex types, and limited comprehensibility.
146+
147+
Notes:
148+
149+
If the "number of use cases" or "number of interfaces" above exceeds "3" or "number of function parameters" exceeds "5" or the "number of operations" exceeds "20" or global variables are used, a design rationale is mandatory.
150+
-
151+
-
152+
-
153+
* - ARC_03_04
154+
- Is the software architecture design following best practices and design principles?
155+
- Refer to architectural guidelines and recommendations within the project documentation.
156+
-
157+
-
158+
-
159+
* - ARC_04_01
160+
- If your software architectural design includes processes with different safety ratings (QM/ASIL), is freedom from interference for shared resources (CPU time, shared memory, etc.) ensured? See also ARC_04_03.
161+
162+
Note: see :need:`std_req__iso26262__software_7411` and :need:`std_req__iso26262__software_749` with Annex D for partitioning to ensure freedom from interference.
163+
Note: Modules should not mix ASIL and QM processes unless justified otherwise; therefore, this question is only relevant on the feature level.
164+
-
165+
Check whether your architecture design complies with project guidelines to establish freedom from interference between components. This can be achieved, for example, by using a hypervisor or an OS that supports partitioning with an MMU or specific scheduling mechanisms, as well as safety mechanisms like watchdogs or program flow monitoring.
166+
Also check if the operating system supports freedom from interference between the processes and make sure an "Assumption of Use requirement" for this exists in your project. For example, see `score aou_req__platform__process_isolation <https://eclipse-score.github.io/score/main/requirements/platform_assumptions/index.html#aou_req__platform__process_isolation>`_.
167+
-
168+
-
169+
-
170+
* - ARC_04_02
171+
- Does the software architectural design consider its feasibility with respect to the required resources for the embedded software, especially for time-critical aspects like startup time, but also including RAM, ROM, non-volatile memory, communication bandwidth, and processing time limits according to the requirements or foreseeable customer needs? See also ARC_02_05.
172+
173+
Note: see :need:`std_req__iso26262__software_7413`
174+
-
175+
Check if there are any limits for resource consumption or timing aspects in your project, such as startup time, communication bandwidth, or memory usage. If such limits exist, ensure that your architecture takes these limits into account, especially with respect to scalability. For this, make an estimation of the required resources based on the architectural design and a prototypical implementation or a measurement of an existing implementation, and compare it to the defined limits or planned scalability. Check if any bottlenecks are present in the architecture that could lead to resource overuse or timing violations.
176+
-
177+
-
178+
-
179+
* - ARC_04_03
180+
- If your software architectural design includes processes and tasks, are their scheduling policies and priorities (at least the necessary relationships between them) defined to ensure that timing requirements are met? Please note that the particular priorities or priority ranges will probably be defined by the project handbook or the software development plan.
181+
182+
Note: see :need:`std_req__iso26262__software_743`
183+
- Provide a rationale for these scheduling policies and priorities, or explain why they are not needed.
184+
-
185+
-
186+
-
187+
188+
189+
.. attention::
190+
The above checklist entries must be filled according to your feature architecture in scope.
191+
192+
Note: If a Review ID is not applicable for your architecture, then state ""n/a" in status and comment accordingly in remarks.
193+
194+
The following static views in "valid" state and with "inspected" tag set are in the scope of this inspection:
195+
196+
.. needtable::
197+
:filter: "feature_name" in docname and "architecture" in docname and docname is not None and status == "valid"
198+
:style: table
199+
:types: feat_arc_sta
200+
:tags: feature_name
201+
:columns: id;status;tags
202+
:colwidths: 25,25,25
203+
:sort: title
204+
205+
and the following dynamic views:
206+
207+
.. needtable::
208+
:filter: "feature_name" in docname and "architecture" in docname and docname is not None and status == "valid"
209+
:style: table
210+
:types: feat_arc_dyn
211+
:tags: feature_name
212+
:columns: id;status;tags
213+
:colwidths: 25,25,25
214+
:sort: title
215+
216+
.. attention::
217+
The above tables filtering must be updated according to your Feature.
218+
219+
- Modify ``feature_name`` to be your Feature Name in lower snake case

0 commit comments

Comments
 (0)