itsallcode / openfasttrace

Open source requirement tracing suite
GNU General Public License v3.0
101 stars 21 forks source link

Multi artifact-type forwarding broken #223

Open redcatbear opened 5 years ago

redcatbear commented 5 years ago

Description

When trying to forward a req artifact to an imp and a utest artifact from a Markdown file, the according implicit dsn artifact is not created.

If I forward to one type only, it works as expected.

Strangely there is a unit test that should cover this kind of situation. Looks like it does not completely:

https://github.com/itsallcode/openfasttrace/blob/develop/importer/markdown/src/test/java/org/itsallcode/openfasttrace/importer/markdown/TestMarkdownImporter.java

Steps to Reproduce

  1. Create requirement spec item req~boolean-operators~1 that needs dsn coverage
  2. Forward it throut dsn like this dsn --> impl, utest: req~boolean-operators~1
  3. Create coverage in impl and utest
  4. Run trace

Expected behavior

Trace is green

Environment

kaklakariada commented 8 months ago

The problem is probably caused by the Markdown state machine. It recognizes FORWARD patterns only in states START and OUTSIDE. When adding a forwarding in the middle (see below) it won't detect the forwarding:

req~boolean-operators~1
Needs: dsn
dsn --> impl, utest: req~boolean-operators~1

A workaround would be to force the state machine into the OUTSIDE state by prefixing the forwarding line with a header and some text:

req~boolean-operators~1
Needs: dsn
# Separator
ignore
dsn --> impl, utest: req~boolean-operators~1

Fixing this will require updating the state machine to allow forwarding also in SPEC_ITEM state.