|
1 | 1 | # sphinx-traceability-example
|
2 |
| -example implementation of requirements and test cases using [sphinx-traceability-extension](https://github.com/ociu/sphinx-traceability-extension) |
| 2 | +example implementation of requirements and test cases using |
| 3 | +[sphinx-traceability-extension](https://github.com/ociu/sphinx-traceability-extension) |
3 | 4 |
|
4 | 5 | ## motivation
|
5 |
| -The sphinx traceability extension contains the required building blockst to document requirements and associate test cases with them. |
6 |
| -The example included in the project showcases how these blocks work, but I needed an example that showed how documentation of a real project with formal requirements, implementation if those requirements and tests work. |
| 6 | +The sphinx traceability extension contains the required building blockst to document requirements |
| 7 | +and associate test cases with them. The example included in the project showcases how these blocks |
| 8 | +work, but I needed an example that showed how documentation of a real project with formal |
| 9 | +requirements, implementation if those requirements and tests work. |
7 | 10 |
|
8 | 11 | ## the example project
|
9 |
| -This project contains the fictional `exemplum` package. The package is tested in `exemplum_test` and its documentation resides in the `doc` directory. The requirements are defined in `requirements.rst` in the documenation folder. The test cases are documentend in their docstrings; the test cases are linked to the requirement using the `tests` relationship. |
| 12 | +This project contains the fictional `exemplum` package. The package is tested in `exemplum_test` |
| 13 | +and its documentation resides in the `doc` directory. The requirements are defined in |
| 14 | +`requirements.rst` in the documenation folder. The test cases are documentend in their docstrings; |
| 15 | +the test cases are linked to the requirement using the `tests` relationship. |
10 | 16 |
|
11 |
| -The requirement chapter uses a item-list and item-matrix to create overviews of all requirements, but also show which requirements are covered by test cases. |
| 17 | +The requirement chapter uses a item-list and item-matrix to create overviews of all requirements, |
| 18 | +but also show which requirements are covered by test cases. |
12 | 19 |
|
13 | 20 | ## how it works
|
14 |
| -All configuration is done in the `conf.py` of your sphinx documenation: we define two new `ItemDirective`: `requirement` and `testcase`. Additionally we add a new relationship `tests`/`tested_by` to link test cases to requirements. |
| 21 | +All configuration is done in the `conf.py` of your sphinx documenation: we define two new |
| 22 | +`ItemDirective`: `requirement` and `testcase`. Additionally we add a new relationship |
| 23 | +`tests`/`tested_by` to link test cases to requirements. |
15 | 24 |
|
16 |
| -We also use the config value `traceability_item_template` to modify how `requirement` and `testcase` items are rendered: they now all get their own small traceability matrix; we filter for the id in source to only get the linked items for that requrement or testcase. We also check if a caption is given to insert a prettier caption for requirements. |
| 25 | +We also use the config value `traceability_item_template` to modify how `requirement` and `testcase` |
| 26 | +items are rendered: they now all get their own small traceability matrix; we filter for the id in |
| 27 | +source to only get the linked items for that requrement or testcase. We also check if a caption |
| 28 | +is given to insert a prettier caption for requirements. |
17 | 29 |
|
18 | 30 |
|
19 | 31 | ## prerequisites
|
20 |
| -To build the example you need to have a working sphinx installation and the [sphinx-traceability-extension](https://github.com/ociu/sphinx-traceability-extension) has to be installed. You may also need to adapt the `'sphinxcontrib.traceability'` value in `doc/config.py` to adapt to match the location where the extension is installed on your system. |
| 32 | +To build the example you need to have a working sphinx installation and the |
| 33 | +[sphinx-traceability-extension](https://github.com/ociu/sphinx-traceability-extension) has to be |
| 34 | +installed. You may also need to adapt the `'sphinxcontrib.traceability'` value in `doc/config.py` |
| 35 | +to adapt to match the location where the extension is installed on your system. |
21 | 36 |
|
22 | 37 | ## known issues / missing features
|
23 | 38 | There are several issues that I was not able to solve quickly:
|
24 | 39 |
|
25 |
| -* customize the format of the item-matrix tables: I want the table to have a better heading than "source" and "target". It would be nice if there was something like traceability_matrix_template similar to traceability_item_template. With this feature we could have tables labeled "requirement", "tested by" to make more sense to the reader. This feature is planned in a future version of original extensions. |
26 |
| -* permit items without an explicit identifier when inside a docstring. Reasoning: when documenting test cases or implementation you constantly have to come up with an identifier when the method name could be used automatically instead. |
| 40 | +* customize the format of the item-matrix tables: I want the table to have a better heading than |
| 41 | +"source" and "target". It would be nice if there was something like traceability_matrix_template |
| 42 | +similar to traceability_item_template. With this feature we could have tables labeled "requirement", |
| 43 | +"tested by" to make more sense to the reader. This feature is planned in a future version of |
| 44 | +original extensions. |
| 45 | +* permit items without an explicit identifier when inside a docstring. Reasoning: when documenting |
| 46 | +test cases or implementation you constantly have to come up with an identifier when the method name |
| 47 | +could be used automatically instead. |
0 commit comments