Skip to main content

Tool to create a traceability matrix

Project description

tracematrix

A Python tool to create a traceability matrix.

Scope

This package focuses on generating the traceability matrix itself. As the APIs and export formats of different test management and/or requirement management tools can be very different, the data acquisition and conversion is not in the scope of this package. However, it aims to provide a convenient way to create the individual items (e.g. requirements, testcases or any other traceable item) and traces between them.

How to use this package

Currently it is only possible to use this package programmatically in your own script.

You start by creating an instance of TraceabilityMatrix. The output format is controlled by the reporter parameter. By default CsvReporter is used, but you can also generate HTML output by passing HtmlReporter.

from tracematrix.matrix import TraceabilityMatrix
from tracematrix.reporters import HtmlReporter

matrix = TraceabilityMatrix(reporter=HtmlReporter)

In the next step you add rows and columns to the matrix. Rows and columns can represent anything which may be traced against each other. Let's assume that we want to see traces between requirements and test cases. This is where your own logic comes into play - the way you determine which items exist and what is traced against each other is up to you and what the source of your data is. For this example, we just use some hardcoded values.

for testcase_id in ("TC_1", "TC_2", "TC_3"):
    matrix.add_row(testcase_id)
for requirement_id in ("REQ_1", "REQ_2", "REQ_3", "REQ_4"):
    matrix.add_column(requirement_id)

matrix.add_trace("TC_1", "REQ_1")
matrix.add_trace("TC_2", "REQ_2")
matrix.add_trace("TC_2", "REQ_3")

Note that rows and columns must be unique - you cannot have two rows or two columns with the same id. When you add a trace between a row and a column, the TraceabilityMatrix will look up the corresponding TraceItem instances itself.

Finally, you can save the output to disk:

matrix.write_matrix("traceability_matrix.html)

Changelog

V1.0.1

Fixes

  • Remove empty lines in CSV output on windows Closes #2

V1.0.0

API changes:

  • TraceItem has been degraded to a simple dataclass. The methods get_by_id and add_trace have been removed. Adding items (rows or columns) to a TraceabilityMatrix is now done by using TraceabilityMatrix.add_row(row_id) and TraceabilityMatrix.add_column(column_id). Traces between rows and columns are created by calling TraceabilityMatrix.add_trace(row_id, column_id). To all these methods, the id is passed as a string. The end user does not need to work with the TraceItem class any more.

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

tracematrix-1.0.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

tracematrix-1.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file tracematrix-1.0.1.tar.gz.

File metadata

  • Download URL: tracematrix-1.0.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.6 Linux/5.8.0-1040-azure

File hashes

Hashes for tracematrix-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9304ae14dd04e4de7dd71c6cc0cf0371e9f2bdf8e52cb6e993211aac53f7a169
MD5 3529578211c9eff1e967e19bc07547ff
BLAKE2b-256 00db1043953b6d2e080178ed4d3c068439c257a508f63bff1cf6b9ea9ddb5f68

See more details on using hashes here.

File details

Details for the file tracematrix-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: tracematrix-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.6 Linux/5.8.0-1040-azure

File hashes

Hashes for tracematrix-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc6a6d643967f8c858f7d06e5afd8927c89a0f2af0dbc93fab9d68fbb1dfd81a
MD5 23022deb7184ceb8890e0f79cae10cc1
BLAKE2b-256 fa861abc1d8c0376491a29d3871d034ad74a418667b8adf0ab98e62a1aba4e71

See more details on using hashes here.

Supported by

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