Skip to content

Health Software Common Practices

Open tests

25 tests · Code under the licence Apache 2.0

Download all tests (zip archive, with the example runner)

An open test is the executable validator of a recipe. It checks an evidence item: its form, its date, its consistency. It is not a scanner: it does not analyse the product and does not access the network. It answers a single question: is the evidence item the recipe asks for admissible?

What a test does

  • It reads an item produced by the team or by a tool: a component inventory, a register, a survey.
  • It returns a readable answer, line by line, and an exit code: 0 if the item is accepted, 1 if it is refused, 2 if the call is incorrect. --json gives the same answer in JSON, for continuous integration.
  • It says, in its README, what it does not say.

When a free tool already performs the check (axe-core for accessibility, an inventory generator, a secret scanner), the catalogue does not write a test in its place: the recipe names the tool and its command, and the open test checks only the item produced.

A recipe has a test only if one of its evidence items can be checked by a program. The rest is a matter of review.

Running a test

Each test fits in one file, verifier.py, in Python 3.10 or later, with no dependency other than the standard library:

python3 verifier.py <item> [options]

Each test folder contains an example of a valid item and an example of a refused item, with their command line in the commande file. python3 lancer.py runs every example: each valid example must be accepted, each refused example must be refused. The same runner checks that no test imports anything other than the standard library, nor a network module. It runs on every proposed change to the catalogue.

Organisation

One folder per test, named HSCP-T-NNN-words-of-the-title (in French):

  • verifier.py: the program;
  • exemples/valide/ and exemples/refuse/: the fabricated items and their command line;
  • LISEZ-MOI.md and LISEZ-MOI.en.md: what the test checks, how to run it, what it does not say; the header names the practices served and the recipe validated.

A test names the recipe it validates (recette:); the recipe cites it back in its preuves: entry (test:). Until the recipe is written, the test names the practices it serves and the title of the planned recipe (recette_prevue:).

The example items are fabricated: none comes from a real product. The tests reproduce the text of no framework; they cite a text by its identifier, for example for a deadline.

Licence

This folder, and it alone, is published under the Apache 2.0 licence (LICENSE file): a test can be reused in an integration pipeline, including a commercial one, provided the licence and the authors' notice are kept. The rest of the catalogue (practices, recipes, texts) remains under the CC BY-NC-SA 4.0 licence.