Documentation and specification testing framework
Project description
nydok is a combined specification writing and testing framework, for producing consistent and traceable specification documents. It is developed for Computerized Systems Validation in a GAMP 5 / GxP context, but is applicable to any software development process where traceability is important.
Write your requirements and risk assessment alongside your Python code, ensuring 1:1 mapping between requirements and the code you're writing.
It is implemented as a plugin for py.test for running the tests, combined with a CLI for creating reports.
Features
Some notable features are:
- Lets you write specification documents including requirements as normal Markdown.
- Keeps track of which requirements are missing test cases.
- Supports a risk assessment process where you can link mitigations to your requirements.
- Can generate several types of reports in Markdown format for use in a Computerized System Validation process, such as:
- Traceability matrix
- Code review reports (Gitlab)
- Risk assessment report
- Test summary report
- CI pipeline logs report (Gitlab)
Installation
Note! nydok is still under development and hasn't yet had a v1.0.0 release, so expect breaking changes.
To install nydok using pip:
pip install nydok
or using Poetry:
poetry add nydok --group dev
Usage
See documentation for details on how to use nydok, the following is just meant as a quick glimpse of how it works. nydok has a lot more features than what is shown here.
Create a cowsay.spec.md specification file:
# Cowsay functional specification
## Functional requirements
- REQ001: The program must take as input a text string
- REQ002: The program must return a string with a cow in ASCII art, displaying the input text as a speech bubble
and a test_cowsay.py file:
from nydok import testcase
import cowsay
@testcase(["REQ001", "REQ002"])
def test_cowsay():
assert cowsay("Hello world") == """
_____________
< Hello world >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
"""
Next, run py.test to check the specification:
$ py.test --nydok-output nydok.json cowsay/
========================= test session starts =========================
platform linux -- Python 3.10.6, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /project
plugins: nydok-0.8.0
collected 3 items
cowsay/test_cowsay.py::test_cowsay PASSED [ 33%]
cowsay/cowsay.spec.md::REQ001 PASSED [ 66%]
cowsay/cowsay.spec.md::REQ002 PASSED [100%]
========================== 3 passed in 0.01s ==========================
Each requirement listed in the specification file is counted as a test item, and will pass or fail depending on it's test case.
Finally, run nydok report to generate reports.
As an example, to create a traceability matrix, run:
$ nydok report traceability-matrix nydok.json
to generate the following Markdown table:
| ID | Description | References | Test case |
|---|---|---|---|
| REQ001 | The program must take as input a text string | TC001 | |
| REQ002 | The program must return a string with a cow in ASCII art, displaying the input text as a speech bubble | TC001 |
License
nydok is released under the MIT license. See LICENSE for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nydok-0.8.4.tar.gz.
File metadata
- Download URL: nydok-0.8.4.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfc65439380c1e2d55eca6891ffa5f272b1361950dc5c605cb7637619c3d037d
|
|
| MD5 |
3fec3854830018e0904b63ae77bf9fb9
|
|
| BLAKE2b-256 |
18aced03731b130afb6280bbafd927b11dae44ad815e1809023962848eb08326
|
Provenance
The following attestation bundles were made for nydok-0.8.4.tar.gz:
Publisher:
main.yml on nykodetherapeutics/nydok
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nydok-0.8.4.tar.gz -
Subject digest:
bfc65439380c1e2d55eca6891ffa5f272b1361950dc5c605cb7637619c3d037d - Sigstore transparency entry: 212923835
- Sigstore integration time:
-
Permalink:
nykodetherapeutics/nydok@ab978d2908c04b113d6b807ad9b5a14a8292c7f9 -
Branch / Tag:
refs/tags/v0.8.4 - Owner: https://github.com/nykodetherapeutics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@ab978d2908c04b113d6b807ad9b5a14a8292c7f9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nydok-0.8.4-py3-none-any.whl.
File metadata
- Download URL: nydok-0.8.4-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03dde83b901681fbc714a5ba666bb19c067790204f90b273615c38f4f00db691
|
|
| MD5 |
1751e3c8b6741d6fb69a90e5cad095bd
|
|
| BLAKE2b-256 |
541b515a67763278ad7e89bb2461ea5b187f0cb856ff22a914925ac40a308dae
|
Provenance
The following attestation bundles were made for nydok-0.8.4-py3-none-any.whl:
Publisher:
main.yml on nykodetherapeutics/nydok
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nydok-0.8.4-py3-none-any.whl -
Subject digest:
03dde83b901681fbc714a5ba666bb19c067790204f90b273615c38f4f00db691 - Sigstore transparency entry: 212923837
- Sigstore integration time:
-
Permalink:
nykodetherapeutics/nydok@ab978d2908c04b113d6b807ad9b5a14a8292c7f9 -
Branch / Tag:
refs/tags/v0.8.4 - Owner: https://github.com/nykodetherapeutics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@ab978d2908c04b113d6b807ad9b5a14a8292c7f9 -
Trigger Event:
push
-
Statement type: