Skip to main content
Unit tests cover every EMEP component in isolation. Each component has a coverage target, a list of critical test categories, and a defined mock strategy for external dependencies.

Coverage Table

Test Patterns

Lifecycle Transition Tests

For every component with state machines (ModelRegistry, ExperimentTracker), unit tests verify all valid transitions and reject invalid ones. Example: a model cannot transition from DISCOVERED directly to PROMOTED.

Error Path Tests

Every public method must have tests for:
  • Null or missing required arguments
  • Invalid enum values
  • Resource not found
  • Timeout or resource exhaustion
  • Concurrent modification

Determinism Tests

MergeStrategy and TensorEngine tests use fixed random seeds and compare outputs against golden values. Any nondeterminism is treated as a bug.

Mock Strategy

External dependencies are mocked at the interface boundary. Mocks are validated against the real implementation in integration tests. Mock contracts are documented in the component’s test directory.

Integration Points

  • CI: unit tests run on every commit.
  • Coverage: coverage reports are uploaded to ArtifactStore and tracked in ExperimentTracker.
  • Numerical Testing: unit tests for TensorEngine and MergeStrategy reference tolerance thresholds defined in Numerical Testing.