Skip to content

Testing Guide

Running Tests

TQC includes a comprehensive test suite using pytest. Run tests with:

# Run all tests
pytest

# Run with coverage
pytest --cov=src/tqc

# Run specific test file
pytest tests/test_core.py

# Run with verbose output
pytest -v

Test Structure

flowchart TD
    subgraph "Test Categories"
        UNIT[Unit Tests]
        INTEGRATION[Integration Tests]
        PERFORMANCE[Performance Tests]
        REGRESSION[Regression Tests]
    end

    subgraph "Core Components"
        ANYONS[Anyon Tests]
        BRAIDS[Braid Tests]  
        COMPILER[Compiler Tests]
        SIM[Simulation Tests]
    end

    UNIT --> ANYONS
    UNIT --> BRAIDS
    INTEGRATION --> COMPILER
    INTEGRATION --> SIM
    PERFORMANCE --> COMPILER
    PERFORMANCE --> SIM

    classDef testClass fill:#4caf50,stroke:#2e7d32,color:#fff
    classDef compClass fill:#ff9800,stroke:#ef6c00,color:#fff

    class UNIT,INTEGRATION,PERFORMANCE,REGRESSION testClass
    class ANYONS,BRAIDS,COMPILER,SIM compClass

Test Coverage

Current test coverage targets:

  • Core functionality: 95%+ coverage
  • Edge cases: Comprehensive error handling
  • Performance: Benchmarks and regression tests
  • Integration: End-to-end compilation workflows