Skip to main content

LOBSTER Tool for JSON

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.

This package contains a tool extract tracing tags from JSON files. The tool expects a json file with a list of objects, for which you can specify members to extract by name. It is extremely simplistic but it may be good enough to support some use-cases.

If you have a more complex file format you will likely need to provide your own tool for your own files.

Tools

  • lobster-json: Extract activities from JSON files

Usage

Some projects store their test vectors in JSON files. This tool can be used to expose these to LOBSTER. Consider this example:

[
    {"name"        : "XOR Test 1",
     "values"      : [false, false],
     "expectation" : false,
     "tags"        : "example.req_xor"},

    {"name"        : "XOR Test 2",
     "values"      : [false, true],
     "expectation" : true,
     "tags"        : "example.req_xor"},

    {"name"          : "Potato Test 1",
     "values"        : [false, false],
     "expectation"   : true,
     "tags"          : null,
     "justification" : "Unlinked on purpose"}
]

Here we have a list of three tests. You can configure the lobster-json tool to extract the relevant information:

$ lobster-json --name-attribute "name" \
               --tag-attribute "tags" \
               --justification-attribute "justification" \
               FILENAME

The name attribute is optional. If your test files do not contain names for the tests then a name is synthesised using the filename and the index of the test (e.g. foo_1, foo_2, foo_3, etc.).

The justification attribute is also optional.

The tag attribute is not, and it needs to be present in each test object.

The specification of these attributes can be nested, for example if your test objects instead look like this:

[
    {"meta" : {"name" : "XOR Test 1",
               "asil" : "B",
               "req"  : "example.req_xor"},
     "test" : {"inputs" : [false, false],
               "expect" : false}
    },

    ...

Then you can get to the data like so:

$ lobster-json --name-attribute "meta.name" \
               --tag-attribute "meta.req" \
               --justification-attribute "meta.just" \
               FILENAME

Finally, if your list of tests is nested more deeply in an object, you can use the --test-list flag to identify where it is. For example:

{ "kind"    : "tests",
  "vectors" : [
    {"meta" : {"name" : "XOR Test 1",
               "asil" : "B",
               "req"  : "example.req_xor"},
     "test" : {"inputs" : [false, false],
               "expect" : false}
    },

    ...

Then you can use --test-list=vectors to identify the correct list.

Note: This tool is pretty limited. For the obvious cases it works pretty well, but if you have a more complex test definition in JSON then you will need to write your own adaptor using the documented schema.

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 Distribution

bmw-lobster-tool-json-0.9.13.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

bmw_lobster_tool_json-0.9.13-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file bmw-lobster-tool-json-0.9.13.tar.gz.

File metadata

  • Download URL: bmw-lobster-tool-json-0.9.13.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for bmw-lobster-tool-json-0.9.13.tar.gz
Algorithm Hash digest
SHA256 db508158edbbfd9ddfd9ca622b521d7711a460eb9da3383e2fc117a0320c162e
MD5 6bb99519959ab7ef6c48d07414ed145b
BLAKE2b-256 ed0a86cb223a371a2589c055b87f18a8a7d5d59686495cf2975438b224d04a4b

See more details on using hashes here.

File details

Details for the file bmw_lobster_tool_json-0.9.13-py3-none-any.whl.

File metadata

File hashes

Hashes for bmw_lobster_tool_json-0.9.13-py3-none-any.whl
Algorithm Hash digest
SHA256 5ac3fe1f9c50a4cca1ab0a50cf25b38994a62fa631dc35edbf4feb9b0299bd07
MD5 60fa9e2442602cbc2c3da28fda9de28a
BLAKE2b-256 38e9dc22fa7eea3d30f49f8000416de36d7178142e4a4d486efe9d8b76851bd3

See more details on using hashes here.

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