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.0
API changes:
TraceItem
has been degraded to a simple dataclass. The methodsget_by_id
andadd_trace
have been removed. Adding items (rows or columns) to aTraceabilityMatrix
is now done by usingTraceabilityMatrix.add_row(row_id)
andTraceabilityMatrix.add_column(column_id)
. Traces between rows and columns are created by callingTraceabilityMatrix.add_trace(row_id, column_id)
. To all these methods, theid
is passed as a string. The end user does not need to work with theTraceItem
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
Built Distribution
File details
Details for the file tracematrix-1.0.0.tar.gz
.
File metadata
- Download URL: tracematrix-1.0.0.tar.gz
- Upload date:
- Size: 5.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b663518bd4cb7e430f73591d92770e7791776cdb52312bb2e3eff48c90c801a2 |
|
MD5 | b2c9437e9f0b952f22e3f482d40a9397 |
|
BLAKE2b-256 | 8800a7659dfadd2fa291e035b89f3d4ca8dc1a08e902ff40c4928b920c8323bb |
File details
Details for the file tracematrix-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: tracematrix-1.0.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19faafa2c24ee643ba1a108236d5a8e49ab7c7e7c80e0919e2c981e008a6f48f |
|
MD5 | 03f2d17fa4bd93001628f034bc9b1a90 |
|
BLAKE2b-256 | 7c2c0ee92f2179a544d42d1e3966661f2535cfe86d707ff098ca3e632906ef3e |