Skip to main content

Coverage Universe

CI Release PyPI Codecov Conventional Commits Changelog License

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 .
    • To enable JSON Schema validation: pip install -e .[validate]
  • From PyPI (when using the published package):
    • pip install coverage-universe
    • With validation extra: pip install coverage-universe[validate]

Quick Start

  1. Build atoms from a UDL JSON
  • coverage-universe build-universe --udl examples/udl_example.json --out examples/atoms.json --validate
  1. Ingest a test run
  • coverage-universe ingest --run examples/run_example.json --out examples/run.norm.json --validate
  1. Compute coverage
  • coverage-universe compute --atoms examples/atoms.json --evidence examples/run.norm.json --out examples/coverage.json --only-passing
  1. 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 (needs jsonschema)
    • --strict (optional): Treat UDL warnings (like touching numeric ranges) as errors and abort
  • ingest

    • --run PATH (required): Test run JSON
    • --out PATH (required): Output normalized run JSON
    • --validate (optional): Validate run against schema (needs jsonschema)
  • compute

    • --atoms PATH (required): Atoms bundle from build-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 (default 1e-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.json and schema schemas/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: basic if/then objects (MVP equality / not-equals)
  • coverage: { "t_wise": 0|2|3, "include_boundary": true|false }

    • Numeric partition mapping uses half-open intervals: each range is [lo, hi) except the highest-hi range, which is [lo, hi]. Shared boundaries map to the upper partition.
  • Run JSON (see example examples/run_example.json and schema schemas/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 sums
  • covered_count, total_atoms, top_uncovered
  • per_test: mapping per test with covered atoms and chosen partitions
  • by_parameter: per-parameter partition and boundary summaries and uncovered partition atoms
  • by_tag: partition summaries aggregated by parameter tag
  • outcomes: 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_universe package (this directory)
  • Optional validators: pip install jsonschema
  • Packaging: pyproject.toml defines an entry point coverage-universe
  • Ignored artifacts: see .gitignore
  • Commits: follow Conventional Commits for automated releases

Docs

  • Coverage walkthrough and t-wise primer: see docs/coverage_walkthrough.md

Branch Protection (Recommended)

Configure these in GitHub Settings → Branches → Branch protection rules (main):

  • Require a pull request before merging (at least 1 review)
  • Require status checks to pass before merging
    • Select checks from latest runs (e.g., CI matrix jobs, Codecov)
    • Enable “Require branches to be up to date”
  • Require linear history (optional)
  • Include administrators (optional)

Notes

  • Numeric boundary hits are exact by default. Use --boundary-eps to 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.

Metadata

Release files for coverage-universe 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coverage-universe 0.1.8
File Size Uploaded Provenance
coverage_universe-0.1.8.tar.gz 23.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for coverage-universe 0.1.8
File Interpreter ABI Platform
coverage_universe-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 44.1 kB

Release files / coverage_universe-0.1.8.tar.gz

Download URL coverage_universe-0.1.8.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
043b3e9efe5a58c10d28305a5e81bdff81b2814e0ea2be8826329a5008390719
BLAKE2b-256 checksum
How to use checksums
f4bd6e584cc392ef12b2bac79f0f3b16573ae380997a2af70245f4a28e0c118c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / coverage_universe-0.1.8-py3-none-any.whl

Download URL coverage_universe-0.1.8-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abd4699d09d0db555cca2bb076293026dbfcbf98fac8b6c257ffa93947d08574
BLAKE2b-256 checksum
How to use checksums
af9e8741aaf912e55e317ea7c7e92da9d23a8769d50a5ef55b419a1b45dce240
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for coverage-universe 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page