Overview
This proposal is about providing a first implementation of the traceability matrix based on the most simple way to gather the link between tests and executions.
If we look at the problem based on Requirements, it can be tricky to identify clearly in which context a Requirement can be considered as "covered" and when it's not. In order to do that, we need to have another information: the test campaign. At the moment, there is no easy way to have this information at tracker level. We could make use of Test Plan but that's a slightly different strategy (see story #23462).
However, another way to get the information would be to look at the test_executions
. We are already able to filter test_executions by campaigns to get a consistent set of test results (via cross reference field, that's a bit of a hack and will be the subject of a dedicated enhancement). Once we have the test_executions, it's easy to find the associated Test Case and from the Test Case, the "covered" item (Story, Requirement, etc).
The idea is to add a "Traceability Matrix" section when one exports a report from a Test Execution tracker.
Proposal
When at least one test_execution
is associated to test_case
that is itself linked to an artifact via _covered_by
link type.
Then a new section with top level heading that appears right after the "Tracker report"
For each test that covers an artifact, we look for all executions and display title, results, who and when it was executed.
The result would be something like:
<h1>Table of content</h1>
<h1>Tracker report</h1>
<h1>Traceability Matrix</h1>
<table border="1">
<thead>
<tr>
<th>User stories</th>
<th>Tests</th>
<th>Campaigns</th>
<th>Results</th>
<th>Executed by</th>
<th>Executed on</th>
</tr>
</thead>
<tbody>
<tr>
<td>user story title (anchor to go to artifact)</td>
<td>test one stuff</td>
<td>Release 1.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td>user story title (anchor to go to artifact)</td>
<td>test one stuff</td>
<td>Release 2.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td>a story with 2 tests (anchor to go to artifact)</td>
<td>First test title</td>
<td>Release 1.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td>a story with 2 tests (anchor to go to artifact)</td>
<td>First test title</td>
<td>Release 2.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td>a story with 2 tests (anchor to go to artifact)</td>
<td>Second test title</td>
<td>Release 1.0</td>
<td style="background-color: red;">Failed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td colspan="7">...</td>
</tr>
</tbody>
</table>
<h1>Artifacts</h1>
Bonus
Ideally we would have "rowspan" to have a better looking table like:
In details:
<h1>Table of content</h1>
<h1>Tracker report</h1>
<h1>Traceability Matrix</h1>
<table>
<thead>
<tr>
<th>User stories</th>
<th>Tests</th>
<th>Campaigns</th>
<th>Results</th>
<th>Executed by</th>
<th>Executed on</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" valign="top">user story title (anchor to go to artifact)</td>
<td rowspan="2" valign="top">test one stuff</td>
<td>Release 1.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td>Release 2.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td rowspan="3" valign="top">a story with 2 tests (anchor to go to artifact)</td>
<td rowspan="2" valign="top">First test title</td>
<td>Release 1.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td>Release 2.0</td>
<td style="background-color: green;">Passed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td>Second test title</td>
<td>Release 1.0</td>
<td style="background-color: red;">Failed</td>
<th>John Doe</th>
<th>2021-10-25 10:48...</th>
</tr>
<tr>
<td colspan="7">...</td>
</tr>
</tbody>
</table>
<h1>Artifacts</h1>