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
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
app.pyintegration tests--enable-deanon) not validated in simulation contextplot_metrics()and_classify_detection()largely untestedNetworkAggregator.evaluate_and_broadcast()full path untested in simulationWeak assertions
test_multiple_queries_still_noisyassertserror is not Nonebut does not bound error (comment suggests ~200m intent)if sparse_cell is not Noneand may skip assertions silentlyImpact
Suggested fix
Acceptance criteria