Skip to main content

Sensoria: High-fidelity coverage impact analysis for Python.

Project description

Stellar Engineering Command Banner

PyPI Build Status Python Versions License

PyPI Build Status Python Versions License

Captain's Log: ML-powered Sensor Telemetry Analysis module for pytest that identifies high-impact, low-complexity areas to test first.

Scanning the planetary surface (codebase) to determine sensor coverage (test coverage) and identify critical impact zones for the fleet.

Features

  • Coverage Impact Analysis: Builds call graphs to identify high-impact functions
  • ML Complexity Estimation: Predicts test complexity with confidence intervals
  • Prioritization: Suggests what to test first based on impact and complexity
  • Refitted Out of the Box: Includes pre-trained model, no console calibration required
  • Warp Speed Performance: Optimized for speed (analyzes 1700+ functions in ~1.5 seconds)
  • Real-time Telemetry: Visual progress bars and step-by-step timing

Docking Procedures

pip install pytest-coverage-impact

Flight Manual

# Run sensor telemetry analysis (--cov-report=json automatically added)
pytest --cov=your_project --coverage-impact

# Show top 10 functions by priority
pytest --cov=your_project --coverage-impact --coverage-impact-top=10

# Generate Telemetry Data (JSON report)
pytest --cov=your_project --coverage-impact --coverage-impact-json=report.json

Example Telemetry Output

Top Functions by Priority (Impact / Complexity)
┏━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Priority ┃ Score ┃ Impact ┃ Complexity ┃ Function   ┃
┡━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│        1 │  2.45 │   12.5 │  0.65 [±0.15] │ module.py │

How It Works

  1. Call Graph Analysis: Parses AST to build function call relationships
  2. Impact Calculation: impact = call_frequency × (1 - coverage_pct)
  3. Complexity Estimation: Uses Random Forest ML model (0-1 scale)
  4. Prioritization: priority = (impact × confidence) / (complexity × effort)
  5. Reporting: Generates formatted sensor reports showing what to test first

Model Training (Optional)

Module includes pre-trained model - no training required. To recalibrate:

# Combined command - collects telemetry and recalibrates model
pytest --coverage-impact-train

See docs/TRAINING_COMMANDS.md for details.

Requirements

  • Python 3.8+
  • pytest 7.0+
  • coverage 6.0+
  • scikit-learn 1.0+
  • numpy 1.20+
  • rich 13.0+ (terminal formatting)

Mission Log

Documentation

Development

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest tests/

# Format code
black pytest_coverage_impact tests/
ruff check pytest_coverage_impact tests/

License

MIT License

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

pytest_coverage_impact-1.5.0.tar.gz (249.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_coverage_impact-1.5.0-py3-none-any.whl (251.8 kB view details)

Uploaded Python 3

File details

Details for the file pytest_coverage_impact-1.5.0.tar.gz.

File metadata

  • Download URL: pytest_coverage_impact-1.5.0.tar.gz
  • Upload date:
  • Size: 249.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytest_coverage_impact-1.5.0.tar.gz
Algorithm Hash digest
SHA256 944304c19bc474a7374cf06f0e0df153cba4b7780052038cf30767beb8797638
MD5 157e786c8d78d62dd0865e0f11bace43
BLAKE2b-256 afd0d6fb054ade1ae6c8bc55f67d22122a52156cb8b00a406e63cf8fa30902be

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_coverage_impact-1.5.0.tar.gz:

Publisher: publish.yml on noah-goodrich/pytest-coverage-impact

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_coverage_impact-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_coverage_impact-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de2b541bc531acae1f6faf27e831817ee8c794689f083b5c4e0c73f8808363b3
MD5 44c7ab0f512c7275a376df2fe3339971
BLAKE2b-256 b4ebc92acea8c603e6f615ed708698d4f7f1e11cde5b987b560608e758b78bb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_coverage_impact-1.5.0-py3-none-any.whl:

Publisher: publish.yml on noah-goodrich/pytest-coverage-impact

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page