Skip to content

Commit

Permalink
Merge pull request #233 from melexis/hybrid_matrix
Browse files Browse the repository at this point in the history
Add options to list attributes in item-matrix
  • Loading branch information
JasperCraeghs authored Jul 19, 2021
2 parents ddbcf85 + 18876fa commit 22e1618
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 148 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _build/
doc/_build
tests/docs/basic/_build
tests/docs/autodoc/docs/_build
.vscode
.tox/
.cache
.pytest_cache
Expand Down
5 changes: 5 additions & 0 deletions doc/_static/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
.wy-nav-content {
max-width: 1250px;
}


.rst-content table.docutils td:first-child {
border-left-width: 1px;
}
78 changes: 77 additions & 1 deletion doc/integration_test_report.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Other requirements
Yes, a note

.. item:: r002
:ext_toolname: namespace:group:another
:class: critical
:status: Reviewed
:asil: C
Expand Down Expand Up @@ -284,6 +285,15 @@ All relationships with items having ASIL-C/D attribute

.. item-matrix:: All ASIL-C/D (with captions)
:asil: [CD]
:splittargets:
:group: bottom
:stats:

.. item-matrix:: All targets of sources with ASIL-C/D (with captions)
:asil: [CD]
:hidesource:
:splittargets:
:group: bottom
:stats:

Traceability from SRS to SSS
Expand Down Expand Up @@ -336,7 +346,19 @@ Traceability from external sources
:sourcetitle: external items
:targettitle: internal items
:type: ext_toolname
:targetattributes: asil aspice
:onlycaptions:
:stats:

.. item-matrix:: Some attributes of items with external links
:source: namespace
:sourcetitle: external items
:targettitle: internal items
:type: ext_toolname
:targetattributes: asil aspice
:onlycaptions:
:stats:
:hidesource:

Traceability from integration tests to requirements
---------------------------------------------------
Expand Down Expand Up @@ -395,6 +417,33 @@ Traceability via intermediate items
:stats:
:splitintermediates:

.. item-matrix:: Design to test via shown requirements with targets split up
:source: DESIGN-
:intermediate: RQT-
:target: UTEST ITEST
:sourcetitle: design items
:intermediatetitle: requirements
:targettitle: unit tests, integration tests
:type: fulfills | validated_by
:group: top
:nocaptions:
:stats:
:splittargets:

.. item-matrix:: Design to test via shown requirements, all split up
:source: DESIGN-
:intermediate: RQT-
:target: UTEST ITEST
:sourcetitle: design items
:intermediatetitle: requirements
:targettitle: unit tests, integration tests
:type: fulfills | validated_by
:group: top
:nocaptions:
:stats:
:splitintermediates:
:splittargets:

.. item-matrix:: Fully covered design items
:source: DESIGN-
:intermediate: RQT-
Expand All @@ -403,11 +452,38 @@ Traceability via intermediate items
:intermediatetitle: requirements
:targettitle: unit tests, integration tests
:type: fulfills | validated_by
:group: bottom
:group: top
:nocaptions:
:stats:
:coveredintermediates:

Source and target attributes
----------------------------

.. item-matrix:: Basic item matrix with attributes of source and target
:sourcetitle: requirements
:type: trace ext_toolname
:sourceattributes: asil aspice
:targetattributes: status asil aspice
:onlycovered:
:nocaptions:
:stats:

.. item-matrix:: Integration test results for requirements
:source: RQT-
:intermediate: ITEST-
:target: ITEST_REP-
:hidetarget:
:type: validated_by | impacts_on
:sourcetitle: requirements
:intermediatetitle: integration tests
:targettitle: integration tests results
:nocaptions:
:stats:
:targetattributes: result
:splitintermediates:
:onlycovered:

Item attribute matrix
=====================

Expand Down
2 changes: 1 addition & 1 deletion doc/unit_test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Unit Tests for mlx.traceability
:validates: RQT-ATTRIBUTES RQT-ATTRIBUTES_MATRIX

.. item:: UTEST_TRACEABLE_COLLECTION-GET_ITEMS_SORTATTRIBUTES
:validates: RQT-ATTRIBUTE_SORT
:validates: RQT-ATTRIBUTE_SORT RQT-ATTRIBUTES_MATRIX

.. item:: UTEST_TRACEABLE_COLLECTION-RELATED
:validates: RQT-RELATIONS
Expand Down
32 changes: 28 additions & 4 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ A traceability matrix of documentation items can be generated using:
:type: validated_by
:sourcetype: fulfilled_by
:status: Appr
:sourceattributes: asil status
:targetattributes: result
:hidetarget:
:group: bottom
:onlycovered:
:nocaptions:
:onlycaptions:
:stats:
Documentation items matching their ID to the given *source* regular expression end up in the leftmost column of the
Expand Down Expand Up @@ -320,6 +321,30 @@ limitations in doing so:
The attribute value is **not** used as a filter on the *target* part.
When omitted, no filtering is done on the source item attributes

:sourceattributes: *optional*, *multiple arguments (space-separated)*

A list of attributes. For each attribute, the value for each source item gets added to the matrix in a new column,
after the column that contains the source items.

:targetattributes: *optional*, *multiple arguments (space-separated)*

A list of attributes. For each attribute, the value for each target item gets added to the matrix in a new column,
after the column that contains the target items. This option cannot be enabled when the ``:target:`` contains
more than one regex. Note that this option implies ``:splittargets:``.

:splittargets: *optional*, *flag*

Split up every target item in a separate cell. By default, they are listed in a single cell per source
(and per ``:target:`` regex).

:hidesource: *optional*, *flag*

When enabled, the column with the source items is hidden.

:hidetarget: *optional*, *flag*

When enabled, all columns with target items are hidden.

:group: *optional*, *choice: top/bottom*

The *group* argument can be used to group source items that don't have any target items. You can explicitly specify
Expand Down Expand Up @@ -403,8 +428,7 @@ linked via the ``:intermediate:`` RQT-items:
:splitintermediates: *optional*, *flag*
When enabled, a row will be created for every intermediate item instead of grouping them together in the same
row for the source item. This can be useful if you want to group target items per intermediate item *instead of
per source item*. This also means that the source column may contain cells with the same source item. The
statistics generated by the ``:stats:`` option is not affected by this flag.
per source item*.

.. _traceability_usage_2d_matrix:

Expand Down
Loading

0 comments on commit 22e1618

Please sign in to comment.