Compute and report coverage over a modeled test universe
Project description
Coverage Universe
Compute and report coverage over a modeled test universe. Turn a domain model (UDL) into atomic coverage targets, ingest test runs, compute coverage (including pairwise and numeric boundaries), and render reports.
Features
- UDL normalization for enum/number parameters with partitions and optional boundaries
- Atom generation: partitions, numeric boundary atoms, and t2/t3 (pairwise/3-wise) atoms with simple constraints filtering
- Coverage mapping per test, totals by kind, and weighted metrics
- Optional filters: only passing or only failing tests
- Configurable numeric boundary epsilon
- Per-parameter and per-tag breakdowns
- HTML report and JSON output
- Optional JSON Schema validation for UDL and run inputs
Installation
- Editable install (recommended for development):
pip install -e .
- Optional (enables schema validation):
pip install jsonschema
Quick Start
- Build atoms from a UDL JSON
coverage-universe build-universe --udl examples/udl_example.json --out examples/atoms.json --validate
- Ingest a test run
coverage-universe ingest --run examples/run_example.json --out examples/run.norm.json --validate
- Compute coverage
coverage-universe compute --atoms examples/atoms.json --evidence examples/run.norm.json --out examples/coverage.json --only-passing
- Render report
coverage-universe report --coverage examples/coverage.json --html examples/coverage.html
Open examples/coverage.html in a browser.
CLI Reference
-
build-universe--udl PATH(required): UDL JSON--out PATH(required): Output atoms bundle JSON--validate(optional): Validate UDL against schema (needsjsonschema)
-
ingest--run PATH(required): Test run JSON--out PATH(required): Output normalized run JSON--validate(optional): Validate run against schema (needsjsonschema)
-
compute--atoms PATH(required): Atoms bundle frombuild-universe--evidence PATH(required): Ingested run JSON--out PATH(required): Coverage JSON output--only-passing(optional): Use only passing tests--only-failing(optional): Use only failing tests (mutually exclusive with--only-passing)--boundary-eps FLOAT(optional): Epsilon for numeric boundary hits (default1e-9)
-
report--coverage PATH(required): Coverage JSON--html PATH(optional): Write HTML report to this path; if omitted, prints JSON to stdout
Data Formats
-
UDL JSON (see example
examples/udl_example.jsonand schemaschemas/udl.schema.json)- Parameters:
enum:{ "name": ..., "type": "enum", "partitions": [{"value": ... , "weight": 1.0}] }number:{ "name": ..., "type": "number", "partitions": [{"range": [min, max], "class": "label", "weight": 1.0}], "boundary": {"include": ["min","max","just-inside","just-outside"]}}
- Optional:
constraints: basicif/thenobjects (MVP equality / not-equals)
- Parameters:
-
coverage:{ "t_wise": 0|2|3, "include_boundary": true|false } -
Run JSON (see example
examples/run_example.jsonand schemaschemas/run.schema.json){ "run_id": "...", "tests": [{ "test_id": "...", "outcome": "passed|failed|skipped|...", "inputs": { param: value, ... } }] }
Coverage Output (JSON)
Top-level keys include:
totals: by kind (partition,t2,boundary) with covered/total and weighted sumscovered_count,total_atoms,top_uncoveredper_test: mapping per test with covered atoms and chosen partitionsby_parameter: per-parameter partition and boundary summaries and uncovered partition atomsby_tag: partition summaries aggregated by parameter tagoutcomes: counts per outcome category;tests_total,tests_considered,filter,boundary_eps
Examples
- Example UDL:
examples/udl_example.json - Example runs:
examples/run_example.json,examples/run_example_eps.json - Generated outputs: coverage JSON/HTML variants under
examples/
Development
- Code lives under the
coverage_universepackage (this directory) - Optional validators:
pip install jsonschema - Packaging:
pyproject.tomldefines an entry pointcoverage-universe - Ignored artifacts: see
.gitignore
Notes
- Numeric boundary hits are exact by default. Use
--boundary-epsto match values within ±epsilon of min/max and their just-inside/outside heuristics. - Pairwise atoms (T2) consider simple constraints to drop contradictory combinations.
License
Apache-2.0. 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 coverage_universe-0.1.6.tar.gz.
File metadata
- Download URL: coverage_universe-0.1.6.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b60b9d264fc75baa6137e0fb17160ae93b2d2c1bbaf5e293fcec16a9f200dd2
|
|
| MD5 |
0c8770da52e603f1e5394fdbd28d2717
|
|
| BLAKE2b-256 |
d2075afc6f7785f72c178bdb5e9c8ed85b884159eb703e7f996fa1c8e6156c2e
|
File details
Details for the file coverage_universe-0.1.6-py3-none-any.whl.
File metadata
- Download URL: coverage_universe-0.1.6-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83f00cc466b194f4e3c9812bd0684a99613b3408194e7a9ea92c5d00f3a01d65
|
|
| MD5 |
fa8344313a4cd3faa41c612a9dd016d8
|
|
| BLAKE2b-256 |
a6b200c7bc4caf42aa7990f8f7551ead094dfd9de1206c0df2b6794ac57b2d87
|