Skip to content

Test coverage gaps and weak assertions in privacy and integration paths #12

@cursor

Description

@cursor

Summary

Unit tests cover privacy primitives and basic simulation smoke tests well (~43 tests), but several important paths lack coverage or use weak assertions that can pass without validating intended behavior.

Gaps

  • No CLI / app.py integration tests
  • No test asserting full token → threshold → dilution → broadcast → response → detection pipeline
  • Attack CLI flags (e.g. --enable-deanon) not validated in simulation context
  • plot_metrics() and _classify_detection() largely untested
  • NetworkAggregator.evaluate_and_broadcast() full path untested in simulation

Weak assertions

  • test_multiple_queries_still_noisy asserts error is not None but does not bound error (comment suggests ~200m intent)
  • Spatial dilution tests use if sparse_cell is not None and may skip assertions silently

Impact

  • Integration bugs (e.g. zone ID mismatch) can slip through
  • Regressions in protocol behavior may go undetected

Suggested fix

  • Add integration test for end-to-end privacy protocol
  • Strengthen privacy test bounds where statistically stable
  • Remove conditional skips or use fixtures that guarantee sparse/dense cells

Acceptance criteria

  • Integration test covers anomaly clustering → broadcast → agent response
  • Weak assertions replaced with meaningful bounds or marked as flaky with rationale
  • Optional coverage reporting in CI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions