Bootstrap DD3 Rust port workspace with host-first compatibility tests
This commit is contained in:
63
docs/TEST_STRATEGY.md
Normal file
63
docs/TEST_STRATEGY.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Test Strategy
|
||||
|
||||
This repository uses four host-side test pillars to preserve compatibility and deterministic behavior.
|
||||
|
||||
## 1) Byte-exact protocol compatibility
|
||||
- Crate: `dd3_protocol`
|
||||
- Scope:
|
||||
- CRC16-CCITT vectors
|
||||
- Frame encode/decode byte identity
|
||||
- ACK payload byte identity
|
||||
- Chunk reassembly deterministic reset semantics
|
||||
- Payload schema v3 decode/re-encode golden vectors
|
||||
- Fixtures:
|
||||
- `fixtures/protocol/frames/*.bin`
|
||||
- `fixtures/protocol/chunks/*.bin`
|
||||
- `fixtures/protocol/payload_v3/*.bin`
|
||||
|
||||
## 2) Contract stability
|
||||
- Crate: `dd3_contracts`
|
||||
- Scope:
|
||||
- Home Assistant discovery JSON contract
|
||||
- MQTT state JSON key/semantic stability
|
||||
- CSV header and line format stability
|
||||
- sanitize/html/url behavior including adversarial inputs
|
||||
- manufacturer drift guard
|
||||
- Fixtures:
|
||||
- `fixtures/contracts/ha_discovery/*.json`
|
||||
- `fixtures/contracts/mqtt_state/*.json`
|
||||
- `fixtures/contracts/sd_csv/*.csv`
|
||||
|
||||
## 3) Deterministic state machine behavior
|
||||
- Crates: `dd3_core`, `dd3_sim`
|
||||
- Scope:
|
||||
- unsynced sender sync-request cadence
|
||||
- time bootstrap unlock via valid ACK
|
||||
- stop-and-wait retry behavior under loss/backpressure
|
||||
- ACK mismatch handling
|
||||
- duplicate-batch suppression on receiver publish/log paths
|
||||
|
||||
## 4) Robustness fuzz/property checks
|
||||
- `fuzz/` targets:
|
||||
- `frame_decode`
|
||||
- `chunk_stream_ingest`
|
||||
- `payload_decode_v3`
|
||||
- `sanitize_device_id`
|
||||
- `url_encode_component`
|
||||
|
||||
## Running Tests (host only)
|
||||
Prerequisite: install Rust toolchain (`rustup`, `cargo`, `rustfmt`, `clippy`).
|
||||
|
||||
- Workspace tests:
|
||||
- `make test`
|
||||
- or `cargo test --workspace`
|
||||
- Lint:
|
||||
- `make lint`
|
||||
- Fuzz smoke (optional, skipped when `cargo-fuzz` missing):
|
||||
- `make fuzz-smoke`
|
||||
|
||||
## Fixture Refresh
|
||||
- Ensure baseline subtree exists at `vendor/dd3-cpp` pinned to baseline commit.
|
||||
- Run:
|
||||
- `cargo run -p xtask -- sync-fixtures`
|
||||
- `cargo run -p xtask -- verify-fixture-sources`
|
||||
Reference in New Issue
Block a user