Skip to main content

LOBSTER Tool for TRLC

Project description

LOBSTER

The Lightweight Open BMW Software Traceability Evidence Report allows you to demonstrate software traceability and requirements coverage, which is essential for meeting standards such as ISO 26262.

Configuration

This tool requires a few parameters in a configuration file. They describe how to convert a TRLC record type to a LOBSTER item.

For example, your TRLC input files may contain a Requirement type, which has a summary field, and you want to use this field as text in the LOBSTER item. Such a mapping can be defined in the configuration file.

Example:

inputs:
  - carrot.rsl
  - carrot1.trlc
  - carrot2.trlc
  - potato.rsl
  - potato.trlc

conversion-rules:
  - package: vegetables
    record-type: Requirement
    namespace: req
    description-fields:
      - summary
      - other_summary
    justification-up-fields:
      - justification1
      - justification2
    justification-down-fields:
      - justification3
    justification-global-fields:
      - justification4
    tags:
      - derived_from
    applies-to-derived-types: true
  - package: vegetables
    record-type: Security_Requirement
    namespace: req
    description-fields:
      - summary
      - extra_text
    tags:
      - field: trace
        namespace: act

to-string-rules:
  - package: vegetables
    tuple-type: External_Id
    to-string:
      - "$(item)@$(version)"
      - "$(item)"

By default none of the objects are traced, but adding a declaration like this marks this type (and all its extensions) as things to trace.

The description-fields specify which fields carry the description text that can be optionally included in LOBSTER.

Version parameter (version-field)

Use version-field inside a conversion-rules entry to select which TRLC record field is written as the generated LOBSTER item version.

Some teams call this a "version flag" in prose, but the exact configuration key is version-field.

Example:

conversion-rules:
  - package: vegetables
    record-type: Requirement
    namespace: req
    version-field: p_version

Behavior:

  • Configured and field exists: If version-field is configured and the record object contains a field with that name, the tool sets the tag version to that field's value.
  • Configured but field missing: If version-field is configured but the record object does not contain a field with that name, the tool sets the tag version to None.
  • Not configured: If no version-field entry is present in the conversion rule, the tool sets the tag version to None regardless of the record object.

When to-string-rules contain expressions like $(item)@$(version), the version value (whether set or None) is used to build versioned tags or their fallback alternatives.

Complete example (versioned tag preferred, fallback without version):

to-string-rules:
  - package: vegetables
    tuple-type: External_Id
    to-string:
      - "$(item)@$(version)"
      - "$(item)"

conversion-rules:
  - package: vegetables
    record-type: Requirement
    namespace: req
    version-field: p_version
    tags:
      - external_id

In this example, if p_version exists in the TRLC record, $(item)@$(version) is used. If p_version is missing, the first expansion cannot be fully applied and the fallback $(item) is used.

Generated output example:

{
  "data": [
    {
      "tag": "req test_reqs.req_with_version@1234",
      "location": {
        "kind": "file",
        "file": "reqs.trlc",
        "line": 3,
        "column": 9
      },
      "name": "test_reqs.req_with_version",
      "messages": [],
      "just_up": [],
      "just_down": [],
      "just_global": [],
      "framework": "TRLC",
      "kind": "featReq",
      "text": "Feature requirement with an explicit version",
      "status": null
    }
  ],
  "generator": "lobster-trlc",
  "schema": "lobster-req-trace",
  "version": 4
}

If no version is available, the generated tag falls back to req test_reqs.req_with_version.

The tags field identifies the field carrying tags. In LOBSTER all tags are namespaced, and by default the namespace is "req" as that is generally what you want to do with TRLC. But you can change this by including the namespace, see the example above.

Three namespaces are supported:

  • req for "requirement"
  • act for "activity"
  • imp for "implementation"

For tuple types like this one:

trlc_config: |
  tuple Codebeamer_Id {
    item Integer
    separator @
    version optional Integer
  }

You need to provide a series of text expansions so that the lobster-trlc tool can build lobster tags from it. You can do this via the to-string-rules configuration entry.

These to-string functions are applied in order, and the tool picks the first one that fully manages to apply. If a value is null and required for the the expansion (as in the first to-string function above), the current function is skipped, and the next one is attempted. If none of the functions can be applied, an error is raised.

If you need to justify requirements not being linked or implemented, then you can also define up to three extra fields (using justification_up, justification_down, and justification_global) that should carry this information. See the example above.

The meaning of "up" is along the usual direction of tracing tags. For example putting this in a software requirement means it is not linked to a system requirement. The meaning of "down" is against the usual direction of tracing tags. For example putting this in a software requirement means it is either not implemented or not tested.

As you can see the down justification is much more imprecise than an up justification. You should only use them if there is no other way to attach this justification on the actual offending object.

Finally the "global" justification is a catch all: it just means no tracing policy will be validated at all when considering this object.

Executing lobster-trlc tool

lobster-trlc takes the following command line arguments:

  • --config - YAML based config file path in which the following parameters can be mentioned.
    • inputs: A list of input file paths (can include directories).
    • inputs-from-file: A file containing paths to input files or directories.
  • DIR|FILE (optional positional arguments): Additional input directories or files.
  • --out: The name of the output file where results will be stored.

Command

> lobster-trlc --config "path/to/the/config/file.yaml" --out "output/path.lobster"

Tools

lobster-trlc: Extract requirements from TRLC.

Copyright & License information

The copyright holder of LOBSTER is the Bayerische Motoren Werke Aktiengesellschaft (BMW AG), and LOBSTER is published under the GNU Affero General Public License, Version 3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bmw_lobster_tool_trlc-1.0.3-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file bmw_lobster_tool_trlc-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bmw_lobster_tool_trlc-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b3ac7a7b9194846e0ce8128b773816b19b3bc12e75cc8d72bdef69aaca6b54db
MD5 37193a6d7b411e96aebd551a26b64ff1
BLAKE2b-256 5a4bc12108433593bf36c6aacea29c51cd543fdf8cab43ba3dce9213ec2a8f1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bmw_lobster_tool_trlc-1.0.3-py3-none-any.whl:

Publisher: package.yml on bmw-software-engineering/lobster

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page