SW-Requirements

trlcdoc

This file contains the software requirements for trlcdoc, the configurable documentation tooling for TRLC based projects.

Tool Operation Overview

Tool Operation Overview

Software Requirements

General

sw_req_cli

Attribute Name

Attribute Value

Description

The software shall provide its functionality as a command-line interface (CLI) tool named trlcdoc.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Every feature shall be accessible via the command line. Therefore it is verified by CLI tests.

sw_req_cli_help

Attribute Name

Attribute Value

Description

The software shall show usage help information when called with the command line argument -h or --help. The help shall end with the copyright and the link to the source repository.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Call trlcdoc with -h and --help and check that the usage help with copyright and repository link is shown.

sw_req_cli_version

Attribute Name

Attribute Value

Description

The software shall show its version and exit successfully when called with the command line argument --version.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Call trlcdoc with --version and check that the version is shown and the exit code is 0.

sw_req_steps

Attribute Name

Attribute Value

Description

Build steps

The software shall organize the documentation build using the steps:

  • clean

  • check

  • plantuml

  • tests

  • convert

  • trace

  • html

  • show

The user shall be able to select the steps to execute. Without a selection, all steps except clean and show shall be executed. Steps without the needed configuration sections shall be skipped..

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Call trlcdoc without step, with single steps and with combinations of steps. Check that exactly the selected steps are executed.

sw_req_step_order

Attribute Name

Attribute Value

Description

The software shall execute the selected steps in a fixed order, independent of the order given on the command line, and internally add steps a selected step depends on.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Call trlcdoc with steps in reverse order and with a step that needs PlantUML. Check the execution order and that PlantUML is provided.

sw_req_exit_code

Attribute Name

Attribute Value

Description

Exit codes

The software shall terminate with exit code:

  • 0 on success

  • 1 if the project content has findings (failed tests, missing trace links)

  • 2 if the documentation could not be built, e.g. the program of a configured command is missing

  • 130 if it was interrupted (Ctrl+C), with a message instead of a traceback

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run trlcdoc on a project without findings, with a failing test, with an invalid configuration, with a missing program in a configured command and with an interrupt. Check the exit codes.

sw_req_verbose_output

Attribute Name

Attribute Value

Description

Verbose output

On request, the software shall show additional output to aid debugging. With -v (--verbose), it shall show

  • its decisions

  • the working folder, input size, exit code and duration of each external tool

  • the environment variables it sets for an external tool

With -vv, it shall also show per-item details, e.g. the rewritten links, and the full environment.

trlcdoc’s own verbose lines shall start with their level name. The output of tools, also of Sphinx, shall be passed through unchanged. Without -v, the output shall not change. Errors and warnings shall go to the standard error output, all other output to the standard output. The verbose output shall not change the results, and it shall not show the values of environment variables named like secrets or the user info of URLs.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run a step without -v, with -v and with -vv. Check the output, that the results are the same, and that secrets of environment variables and URLs are not shown.

sw_req_external_tools

Attribute Name

Attribute Value

Description

External tools

Before a step uses an external tool that is not installed with the software, the software shall check that the tool is available. If it is missing, the software shall stop with a build error that names the tool and what needs it. The checked tools are:

  • Java and Graphviz in the plantuml step, unless PlantUML is a server

  • Graphviz in the trace step, for the tracing policy diagram

  • Graphviz in the html step, if the site uses the Sphinx graphviz extension

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the plantuml, trace and html steps without Java and Graphviz, and the plantuml step with a PlantUML server. Check the exit codes and the error messages.

Configuration

sw_req_config_file

Attribute Name

Attribute Value

Description

Configuration file

The software shall read all project specific settings from a YAML configuration file. Without a file given on the command line, it shall use the file trlcdoc.yaml of the current folder or its nearest parent folder.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Call trlcdoc from the project root, from a subfolder and with an explicit configuration file. Check that the expected configuration is used.

sw_req_config_validation

Attribute Name

Attribute Value

Description

Configuration validation

Before a step is executed, the software shall

  • validate the configuration against a defined schema

  • check the references between its entries

An invalid configuration shall be reported with the location of each error in the configuration and the line of the entry in the configuration file. An error about a missing entry shall be reported with the line of its parent entry. A configuration file that is no valid YAML shall be reported with the position of the syntax error.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Call trlcdoc with configurations violating the schema and with unresolved references. Check the error messages and that no step is executed.

sw_req_toctree_check

Attribute Name

Attribute Value

Description

Table of contents check

With a project start page, the check step shall compare the table of contents entries of the start page and of the reStructuredText and Markdown documents with the page names of the documents. It shall report as finding

  • an entry which is no page, with the page name of the document of a similar name and its reason

  • a document which is in no table of contents

Entries in folders that belong to no document shall be accepted, e.g. pages of Sphinx extensions.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Check start pages with wrong entries, a missing document and a page of a Sphinx extension, with both tracing report formats, a correct start page and a Markdown toctree. Check the findings and the exit code. Read the entries of reStructuredText and Markdown toctrees.

sw_req_project_settings

Attribute Name

Attribute Value

Description

The software shall take project metadata (name, optional version, author, copyright, repository, logo) from the configuration. A configured version shall follow the project name in the HTML title.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Build the documentation with different project metadata and check the generated site.

Documents

sw_req_documents

Attribute Name

Attribute Value

Description

Document list

The software shall build the documentation from a configurable, ordered list of documents. Each document has a unique id and a title. A TRLC document may take its title from its converted content. A reStructuredText or Markdown document takes its title from its first heading, unless a title is configured.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Configure documents in different orders and check the table of contents of the generated site. Check the title of Markdown documents with and without configured title.

sw_req_document_types

Attribute Name

Attribute Value

Description

Document types

The software shall support these document types:

  • TRLC documents

  • test results

  • LOBSTER tracing report

  • existing HTML sites

  • reStructuredText, Markdown and plain text files

  • HTML sites generated by a configured command

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Build a documentation containing every document type and check the generated pages.

sw_req_trlc_conversion

Attribute Name

Attribute Value

Description

TRLC conversion

The software shall convert TRLC documents with pyTRLCConverter into reStructuredText or Markdown, using the converter, translation and render configuration of the pyTRLCConverter options of each document. Records of included documents shall be available for resolving references, without being part of the output.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Convert a document referencing records of an included document into both formats. Check the output and that the included records are not part of it.

sw_req_builtin_converters

Attribute Name

Attribute Value

Description

Built-in converters

The software shall provide built-in converters for

  • requirements

  • architecture

  • test cases

  • test results

which projects can reference instead of requiring their own converter files. The reStructuredText converter for test results shall give every result an anchor, so links can lead to it.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Convert documents of each kind using the built-in converters and check the output, also the anchors of the test results.

sw_req_plantuml

Attribute Name

Attribute Value

Description

PlantUML renderer

The software shall provide a PlantUML renderer for the diagrams of the documents. It shall use

  1. a jar or a PlantUML server given by the environment,

  2. otherwise a jar given by the configuration,

  3. otherwise a download of the configured PlantUML version.

A PlantUML jar shall run headless, without the graphical user interface support of the system.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the plantuml step

  • with a jar and a server URL in the PLANTUML environment variable

  • with a configured jar

  • without both

Check the used jar or server. Check that the convert and html steps run the PlantUML jar headless on every system.

sw_req_plantuml_picoweb

Attribute Name

Attribute Value

Description

Local PlantUML server

Starting Java takes seconds, rendering a diagram milliseconds. If PlantUML is a jar and the configuration doesn’t disable it, the software shall start the jar once as local PlantUML server (picoweb) and render all diagrams of the run with it.

  • The server shall only be reachable from the local computer, on a free port.

  • The server shall stop when the software ends, also after an error, an interrupt or a termination.

If the server doesn’t render a diagram within a time limit, the software shall stop it, print a warning and render each diagram with the jar.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the plantuml step with a jar, with the server disabled and with a server URL in the PLANTUML environment variable. Render a diagram with the exported server URL in the html step. Stop the server at the end of a run, after a build error and on an interrupt. Run the plantuml step with a jar that cannot start a server and with a server that doesn’t answer in time. Check the exported URL or jar, the warning and that no server process is left.

Tests

sw_req_test_run

Attribute Name

Attribute Value

Description

The software shall run the project tests with pytest or a configured command and read their results from a JUnit XML file. If configured, it shall create a code coverage report. Results and coverage reports of a previous run shall not be reported as the results of a test command that does not create them.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the tests step with pytest, with coverage and with a custom command. Check the result file and the coverage report. Run a custom command that writes neither of them after a successful run, and check the error.

sw_req_test_results

Attribute Name

Attribute Value

Description

Test result records

The software shall convert the test results into TRLC test result records, which reference their TRLC test cases.

  • A test shall be linked by a property, else by an output pattern, else by a name mapping.

  • Unity output lines of a test suite shall be assigned to the test they name.

  • A test may record several test cases.

  • A test that cannot be linked shall be reported as error.

  • The test result records shall be written into the package of the linked test cases.

  • Test cases of several packages or without package shall be reported as error.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the tests step with tests

  • linked by property

  • linked by test case output and by Unity suite output

  • linked to several test cases

  • linked by name mapping

  • not linked

and with test cases of another package, of several packages and without package. Check the generated records and the errors.

Tracing

sw_req_trace_levels

Attribute Name

Attribute Value

Description

Trace levels

The software shall derive the LOBSTER tracing configuration from configured trace levels. Each level names

  • its document

  • its record types and tags

  • the levels it traces to or that must trace to it

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Configure trace levels for requirements, architecture, tests and test results and check the generated tracing report.

sw_req_trace_report

Attribute Name

Attribute Value

Description

The software shall create an HTML tracing report. On request, the report shall link the items to their sources in the project repository, also for a project in a subfolder of the repository. On request, the report shall render the item descriptions as Markdown.

Test results are generated into the output folder, which neither the repository nor the site contains. Their items shall link to their result on the site page of their test results document instead.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Create the tracing report offline and online, online also for a project in a subfolder of the repository and with an output folder outside the repository. Check the item links of the reports, also of the test results. Create the report with and without Markdown rendering and check the descriptions.

sw_req_trace_report_rst

Attribute Name

Attribute Value

Description

Tracing report as site pages

On request, the software shall include the tracing report as pages of the HTML site, one page per trace level, instead of embedding the HTML tracing report. The links to the item sources shall work from the site pages. Test result items shall link to their result on the site page of their test results document.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Build a site with the tracing report as site pages. Check the start page with its title, the level pages with their items, the page header, the links to the item sources and to the test results.

sw_req_trace_findings

Attribute Name

Attribute Value

Description

The software shall list the items with missing trace links and report them as findings. Items justified in LOBSTER (e.g. by lobster-exclude) count as traced, their number is shown.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the trace step on a project with an untraced requirement. Check the listed item and the exit code. Run it on a project with a justified function. Check that it is counted as justified and the exit code is 0.

sw_req_trace_doxygen

Attribute Name

Attribute Value

Description

C/C++ code tracing

The software shall extract the trace links of C/C++ code from the doxygen @implements tags with lobster-doxygen. A Doxyfile per trace level selects the sources. The items shall refer to their source files by absolute path, wherever the Doxyfile is. Doxygen shall be needed only for such trace levels.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Trace a C function through a Doxyfile outside and above its source folder, check the traced item and its source file. Run the trace step without doxygen with and without such a level and check the error.

HTML Site

sw_req_html_site

Attribute Name

Attribute Value

Description

The software shall build a static HTML site with Sphinx, containing a start page with the table of contents and one page per configured document.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Build the site and check the start page, the table of contents and every document page.

sw_req_html_version_info

Attribute Name

Attribute Value

Description

The software shall show the version control state the documentation was built from on every page: the output of git describe --tags --always --dirty and the branch, if HEAD is on a branch.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Build the site in a git working copy and check the version control state on the pages. Check it outside of git, with a tag, after a commit, with uncommitted changes and with a detached HEAD.

sw_req_html_customization

Attribute Name

Attribute Value

Description

HTML site customization

The software shall allow the project to customize the HTML site with

  • its own start page

  • a header on every generated page

  • a project specific Sphinx configuration

Project pages shall be able to refer to files of the project independent of their location in the site. A project page shall be able to disable this, to show the placeholder text itself.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Build a site with

  • a project start page

  • a page header

  • a Sphinx configuration

  • project pages referring to project files

  • a project page with disabled placeholder replacement

Check the pages and the applied configuration.

sw_req_page_placeholders

Attribute Name

Attribute Value

Description

Page placeholders

The software shall replace these placeholders in the project start page, the page header and the reStructuredText and Markdown documents:

  • {page:<id>} by the page name of the document, relative to the page

  • {documents} by the page names of all documents in configuration order, one per line

{documents} leaves out the documents that a toctree of the start page or of a reStructuredText or Markdown document lists explicitly.

A placeholder naming no document shall be reported as configuration error.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Replace the placeholders for pages at different depths and both tracing report formats. Build sites with both tracing report formats whose start page and pages use the placeholders, and check the table of contents and the links. Check that {documents} leaves out explicitly listed documents. Check the error for an unknown document id.

Output

sw_req_output_folder

Attribute Name

Attribute Value

Description

Output folder

The software shall write all generated files into a configurable output folder. The output folder shall not be

  • inside the trlcdoc package

  • the project root or one of its parents

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Build the documentation and check that no file outside the output folder was created or changed. Configure forbidden output folders and check the errors.

sw_req_output_option

Attribute Name

Attribute Value

Description

Output folder option

The software shall accept an output folder on the command line, which replaces the configured output folder for this run. A relative folder shall be relative to the current folder. The same location rules as for the configured output folder shall apply.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run steps with a relative and an absolute output folder on the command line. Check the used folder, that the configured folder is not used, and the errors for forbidden folders.

sw_req_clean

Attribute Name

Attribute Value

Description

The software shall remove all build artifacts with the clean step.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the clean step after a build and check that the output folder is removed.

sw_req_show

Attribute Name

Attribute Value

Description

The software shall open the start page of the built HTML site in the web browser with the show step, under Linux, Windows and the Windows Subsystem for Linux. If the site is not built or no web browser is available, the software shall report the problem as build error.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Run the show step with a built site, without a site and without web browser. Check the opened page, the error messages and the exit code.

sw_req_delete_protection

Attribute Name

Attribute Value

Description

The software shall delete only folders it created itself. It shall refuse to delete an existing folder with other content and report an error.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

Verification Criteria

Configure an existing source folder as output folder and run the clean and build steps. Check the error and that the folder content is unchanged.

Software Constraints

sw_constraint_python

Attribute Name

Attribute Value

Description

The software shall be implemented in Python and run with Python 3.10 or higher.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

sw_constraint_os_win

Attribute Name

Attribute Value

Description

The software shall support the Windows operating system.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

sw_constraint_os_linux

Attribute Name

Attribute Value

Description

The software shall support the Linux operating system.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

sw_constraint_os_macos

Attribute Name

Attribute Value

Description

The software shall support the macOS operating system.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

sw_constraint_project_independent

Attribute Name

Attribute Value

Description

The software shall contain no project specific content, so a single copy can be shared between projects, e.g. as git submodule.

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A

sw_constraint_toolchain

Attribute Name

Attribute Value

Description

Toolchain

The software shall use

  • TRLC for parsing

  • pyTRLCConverter for converting

  • LOBSTER for tracing

  • PlantUML for rendering

  • Sphinx for publishing

Valid Status

VALID_STATUS.valid

Note

N/A

Derived

N/A