SW-Architecture
trlcdoc SW Architecture
This file contains the high level software architecture of trlcdoc, a configurable documentation generator for NewTec TRLC based projects.
Context
sw_arch_trlcdoc_tool
Attribute Name |
Attribute Value |
|---|---|
Description |
trlcdoc documentation tool trlcdoc is a Python 3 package providing the console application
It contains no project specific content and orchestrates the external toolchain:
All generated files are written into the output folder. |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Build the documentation of a reference project with |
Context Diagram
Static View
Component overview
The software consists of eight components. The CLI runs the build steps, each step is realized by one component:
PlantUML Provider
Test Runner
TRLC Conversion
Trace Report
HTML Builder
All steps get their settings and paths from the Configuration component and use the Common Services for running external tools and managing the output folder.
Component Overview
Components
CLI
sw_arch_comp_cli
Attribute Name |
Attribute Value |
|---|---|
Description |
CLI component ( The CLI provides the application entry point. It
The clean step removes the output folder, the check step reports the valid configuration and
the table of contents findings of a project start page ( It maps the step results to the exit codes:
|
Note |
N/A |
Satisfies |
|
Verification Criteria |
Call |
CLI Component
Configuration
sw_arch_comp_config
Attribute Name |
Attribute Value |
|---|---|
Description |
Configuration component ( Finds and loads a YAML configuration, validates it against the JSON schema and checks
It provides the validated settings as a
It defines the page name of each document ( |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Load
Check the resolved paths and the error messages. |
Configuration Component
Common Services
sw_arch_comp_util
Attribute Name |
Attribute Value |
|---|---|
Description |
Common Services component ( Provides services shared by all steps:
All modules log with the standard Build errors are reported with the |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run commands with success and error results. Create, clean and remove output folders, and try to delete unmarked folders with content. Check the results and errors. |
Common Services Component
PlantUML Provider
sw_arch_comp_plantuml
Attribute Name |
Attribute Value |
|---|---|
Description |
PlantUML Provider component ( Realizes the plantuml step. It selects, in this order,
It exports the selection in the A PlantUML jar runs with the Java option
Java on Linux without a display and on Windows needs no option, on macOS every diagram would otherwise start the graphical user interface support of Java. With
The server is ready when it renders a probe diagram. If it doesn’t within 30 seconds, it is
stopped and the jar stays exported, with a warning. |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run the plantuml step with the environment variable set, with a configured jar and without both. Check the exported jar path. Check the Java command of Sphinx and the environment of pyTRLCConverter on each system. Run the plantuml step with picoweb, check the exported URL, a rendered diagram and the stopped server. Check the fallback to the jar. |
PlantUML Provider Component
Test Runner
sw_arch_comp_testrun
Attribute Name |
Attribute Value |
|---|---|
Description |
Test Runner component ( Realizes the tests step. It
It reports failed tests as findings and unlinked tests as error. |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run the tests step with passing, failing, linked and unlinked tests. Check
|
Test Runner Component
TRLC Conversion
sw_arch_comp_convert
Attribute Name |
Attribute Value |
|---|---|
Description |
TRLC Conversion component ( Realizes the convert step. It runs pyTRLCConverter per TRLC document with
The built-in converters extend the pyTRLCConverter reStructuredText and Markdown converters for
|
Note |
N/A |
Satisfies |
|
Verification Criteria |
Convert TRLC documents with built-in and project converters into both formats. Check the output files and the rendered diagrams. |
TRLC Conversion Component
Trace Report
sw_arch_comp_trace
Attribute Name |
Attribute Value |
|---|---|
Description |
Trace Report component ( Realizes the trace step. It
The test result records are generated into the output folder, so their items are found by their level and get a link relative to the report page, after the online conversion. The HTML report is embedded at the site root, the site pages are in a folder below it. The link ends with the anchor that the built-in test results converter gives every row, derived from the TRLC file and record name. The record name is the link text. It lists the items with missing trace links and reports them as findings. |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run the trace step offline and online on a project with complete and with missing trace links. Check the report, its links and the listed findings. |
Trace Report Component
HTML Builder
sw_arch_comp_html
Attribute Name |
Attribute Value |
|---|---|
Description |
HTML Builder component ( Realizes the html step. It generates the Sphinx source folder with
It builds the site with Sphinx. It adds the project page header to the generated pages. The module It also realizes the show step, which opens the start page of the built site in the web browser:
under WSL in the Windows default browser, otherwise with the Python The generic Sphinx configuration
The Sphinx extension |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Build the site from a configuration with every document type. Check
|
HTML Builder Component
Dynamic View
sw_arch_build_flow
Attribute Name |
Attribute Value |
|---|---|
Description |
Build flow A trlcdoc run loads and validates the configuration first and stops with exit code 2 if it is invalid. It then runs the selected steps in their fixed order.
So the site still documents the findings. |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run trlcdoc with an invalid configuration, a failing build step and a project with findings. Check the executed steps and the exit codes. |
trlcdoc Build Sequence
Output Folder States
sw_arch_output_folder_states
Attribute Name |
Attribute Value |
|---|---|
Description |
Output folder states Before deleting anything, trlcdoc classifies the configured output folder into one of the states Missing, Empty, Owned or Foreign.
|
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run the clean and build steps for an output folder in each state. Check the resulting state and the errors. |
Output Folder States
sw_arch_state_missing
Attribute Name |
Attribute Value |
|---|---|
Description |
State Missing The output folder does not exist. This is the initial state of a fresh project and the state after the clean step.
|
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run the clean step and a build step without output folder. Check the message and that the folder is created with the marker file. |
sw_arch_state_empty
Attribute Name |
Attribute Value |
|---|---|
Description |
State Empty The output folder exists without any content, e.g. created by the user. It contains nothing that could be lost, so it is treated like a missing folder and changes to Owned when output is written. |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run a build step with an empty output folder. Check that the marker file is written and the build succeeds. |
sw_arch_state_owned
Attribute Name |
Attribute Value |
|---|---|
Description |
State Owned The output folder contains the marker file, so trlcdoc created it.
|
Note |
N/A |
Satisfies |
|
Verification Criteria |
Run a build step twice and the clean step on a marked output folder. Check that the subfolders are recreated and the folder is removed. |
sw_arch_state_foreign
Attribute Name |
Attribute Value |
|---|---|
Description |
State Foreign The output folder has content but no marker file, e.g. because |
Note |
N/A |
Satisfies |
|
Verification Criteria |
Configure a folder with content as output folder and run the clean and build steps. Check the error, the exit code and that the content is unchanged. |