Skip to content

Add C++ Unit Testing for telemetry and boundaries verification #9

Description

@tw89Coder

Objective

Implement a lightweight C++ automated testing harness (or integrate a header-only framework like Catch2/Google Test) to verify the internal logic of the state-machine pre-filter, telemetry normalization, and action-clamping boundaries.

Scope & Key Tasks

  • Telemetry Scaling Verification: Assert that simulated packet sizes and F2 sliding window sum-of-squares are normalized correctly to the [0.0, 1.0] float interval before calling ONNX inference.
  • Safety Boundary Enforcement: Assert that extreme values output by the neural network (e.g., SQ threshold > 700, penalty multiplier < 10) are successfully clamped to the configured safety parameters (e.g., 650 and 20.0).
  • Action Space Dynamic Routing: Test that both 3D and 4D output tensors from dummy Ort models are correctly parsed, and S0 sampling rate is calculated accurately for the 3D case.
  • FSM State Transitions: Validate that mock virtual CPU budgets trigger state transitions (S0 -> S1 -> S2 -> S3) in a deterministic fashion.

Definition of Done (DoD)

  • Running tests (e.g., via ./manage_build.sh --test or ./run_tests.sh) successfully evaluates all assertions.
  • Test coverage covers 100% of the boundary clamping conditions and telemetry scaling equations inside rl_bridge.cpp and pre_filter.cpp.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfutureFuture works

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions