Giter Site home page Giter Site logo

bmw-software-engineering / lobster Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 4.0 754 KB

Lightweight Open BMW Software Traceability Evidence Report

License: GNU Affero General Public License v3.0

Makefile 3.06% Python 95.47% Starlark 0.40% C++ 0.35% C 0.59% MATLAB 0.13%
requirements traceability

lobster's Introduction

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 repository contains the prototype for LOBSTER, which is a key ingredient to make TRCL more useful.

It has tools to extract tracing tags from a variety of sources combine them and produce a tracing report. The TRLC tracing report from the TRLC Project is a reasonable example of what is possible.

Installing

All tools can be installed separately from PyPI, but there is a convenient meta-package bmw-lobster which installs everything.

$ pip3 install bmw-lobster

Supported inputs

The following requirements frameworks are supported:

  • TRLC (only some use cases supported right now)
  • Codebeamer (only some use cases supported right now)

The following programming languages are supported:

The following verification and miscellaneous frameworks are supported:

Documentation

(More to come...)

Installing individual packages

The individual packages that bmw-lobster depends on are:

  • bmw-lobster-core the core API and various report generators. All other tools depend on this.
  • bmw-lobster-tool-cpp (for C/C++ code)
  • bmw-lobster-tool-gtest (for GoogleTest tests)
  • bmw-lobster-tool-python (for Python3 code)
  • bmw-lobster-tool-beamer (for requirements in Codebeamer)
  • bmw-lobster-tool-json (for activities in JSON)
  • miss_hit (for MATLAB/Octave code or Simulink models)

Planned inputs

The following inputs are planned but not implemeted yet:

  • lobster-java: Java code
  • lobster-kotlin: Kotlin code
  • lobster-ada: Ada and SPARK code (via libadalang)
  • lobster-latex: Requirements written in LaTeX
  • lobster-markdown: Requirements written in Markdown

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.

lobster's People

Contributors

christophkloeffel avatar florianschanda avatar paulboege avatar phiwuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lobster's Issues

Support using graphviz with explicit path

Problem:

When using Lobster with Bazel, it clears the PATH variable (to make sure all inputs are exactly known),
But lobster-html-report calls graphviz by looking up the location of the graphviz executible in PATH. Hence it is not possible to generate an image of the tracing policy in the HTML report.

Request:

Add a feature to specify the path to the graphviz executable.

unified entry point

One entry point with commands, e.g.

  • lobster trace cpp <stuff...>
  • lobster trace matlab <stuf...>
  • lobster report [ --html | --ci ]
    etc.

plugin system

Especially the lobster trace stuff should support plugins, so that you can add/install modules with a magic name and things just work.

Vanilla Example

Please create a "vanilla example" that demonstrates how to do the following:

  • extract one requirement from a TRLC file with lobster-trlc
  • extract one function from a Python file with lobster-python
  • extract one test from a Python file with lobster-python --activity
  • extract one function from a C++ file with lobster-cpp
  • extract one requirement from codebeamer with lobster-codebeamer

and put it all together in a tracing policy, and generate an HTML lobster report.

Please think about the best way to publish the vanilla example. Maybe it is a good idea to provide a zip file, so that it easy extremely easy to download it.

The goal is to train interested users quickly how to use lobster.

lobster-python: false positive on duplicate function definition

lobster-python reports a duplicated function definition for severity() in the following example:

import dataclasses

@dataclasses.dataclass
class Diagnostic: 
    _severity: int = dataclasses.field()

    @property
    def severity(self):
        return self._severity

    @severity.setter
    def severity(self, value: int):
        self._severity = value

These are clearly not duplicate functions but separate ones which can both be called on the same instance if Diagnostic. Hence, this case should be fixed within lobster.

The problem might originate from here

l_item = Implementation(tag = Tracing_Tag("python",
self.fqn()),
since the function tag is built only using self.fqn(), which is probably the function name. A solution might be to consider the entire function signature as the tag.

allow internal trees in one level

Requirement A that inside one level is decomposed into B and C, would be OK if B and C are themselves OK.

Policy example:

requirements "Requirements" {
   source: "potato.lobster";
}

implementation "Code" {
   source: "code.lobster";
   trace to: "Requirements" with internal_links;
}

activity "Test" {
   source: "test.lobster";
   trace to: "Requirements";
}

OR perhaps allow self-references:

requirements "Requirements" {
   source: "potato.lobster";
   requires: "Code" or self_reference;
   requires: "Test";
}

implementation "Code" {
   source: "code.lobster";
   trace to: "Requirements"
}

activity "Test" {
   source: "test.lobster";
   trace to: "Requirements";
}

Would allow for example:

      R1
     / \
    R2  R3
    |   |
    C2  C3

As long as all requirements are individually tested.

Side-note: We now need to worry about cycles, i.e. R1 -> R2, R2 -> R1 and should make sure that these do not count.

This check only needs to be done for levels that allow self_references.

Improve visual appearance of HTML report with respect to accessibility

Feedback from users with read-green weakness is that, they cannot distinguish the background coloring of the lobster HTML report. For some red and gray look very similar, for others it is red and green.

  1. use different colors
  2. use icons additionally to indicate "error", "justified exemption" and "ok".

lobster-python duplicates tests if using unittest

If lobster-python runs over a Python project where unittest is used instead of pytest, then each test is also interpreted as a regular function.
This leads to the result that the final lobster report shows each unit test twice (as a function and as a test).

We need to check if this happens only for unittest, or also for pytest.

Handling duplicate function definitions

Current Behaviour

If a Python file contains several function definitions with the same name, then the output of lobster-python cannot be forwarded to lobster-report.

Consider the following Python file (call it code.py):

value = False

if value:
    def compute():
        return 42
else:
    def compute():
        return 43

print(compute())

Now run lobster-python:

> lobster-python code.py --out="python.lobster"

The result of python.lobster is the following:

{
  "data": [
    {
      "tag": "python code.compute",
      "location": {
        "kind": "file",
        "file": "code.py",
        "line": 4,
        "column": null
      },
      "name": "code.compute",
      "messages": [],
      "just_up": [],
      "just_down": [],
      "just_global": [],
      "language": "Python",
      "kind": "Function"
    },
    {
      "tag": "python code.compute",
      "location": {
        "kind": "file",
        "file": "code.py",
        "line": 8,
        "column": null
      },
      "name": "code.compute",
      "messages": [],
      "just_up": [],
      "just_down": [],
      "just_global": [],
      "language": "Python",
      "kind": "Function"
    }
  ],
  "generator": "lobster_python",
  "schema": "lobster-imp-trace",
  "version": 3
}

Now lobster-report cannot handle this input, as it detects a duplicate definition of "code.compute".
The error is raised here:

"duplicate definition of %s, "

Expected Behaviour

Now the question is: What is the expected behaviour?
For sure the above Python code is valid and needs to be supported by lobster.
On the other hand, duplicate definitions shall be detected, too.

Any ideas how to handle this best?

HTML output too large

The HTML output is too large. If 800 items are added to 3 levels, then users complain about long loading times.

Furthermore, it is not possible to find e.g. "ok items". The usability of the HTML file is low. Users want to click on the numbers in the summary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.