-
-
Notifications
You must be signed in to change notification settings - Fork 20
Focus 3: Test Coverage #33
Copy link
Copy link
Open
Labels
p1high priorityhigh priority
Description
Focus 3: Test Coverage
Current State
The codebase has growing test coverage, but there's room for improvement:
| Category | Current | Target |
|---|---|---|
| Unit tests | Partial | 80%+ line coverage |
| Integration tests | 28 test files | Comprehensive scenarios |
| Interop tests | Chrome, Firefox | All major browsers |
| Fuzz tests | Limited | Critical parsers |
Unit Test Expansion
Priority areas for unit testing:
- SDP parsing and generation — Complex edge cases in offer/answer
- ICE state machine — All state transitions and error conditions
- DTLS handshake — Certificate validation, cipher negotiation
- SCTP association — Stream management, congestion control
- Interceptor logic — NACK timing, RTCP report generation
Example test structure:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_ice_state_transitions() {
// Test all valid state transitions
// Test invalid transition handling
// Test event emission
}
#[test]
fn test_nack_timing_accuracy() {
// Verify NACK generation timing
// Test RTT-based retransmit intervals
}
}Integration Test Expansion
Planned integration test scenarios:
- Multi-party conferencing (3+ peers)
- Renegotiation (adding/removing tracks mid-session)
- Network condition simulation (packet loss, delay, reordering)
- Long-running sessions (stability over hours)
- ICE restart scenarios
- TURN relay failover
- Simulcast layer switching
- DataChannel flow control under load
Fuzz Testing
Critical parsers should be fuzz-tested:
// Using cargo-fuzz or libfuzzer
fuzz_target!(|data: &[u8]| {
let _ = RtpPacket::unmarshal(data);
});
fuzz_target!(|data: &[u8]| {
let _ = StunMessage::unmarshal(data);
});Priority fuzz targets:
- RTP/RTCP packet parsing
- STUN message parsing
- SDP parsing
- SCTP chunk parsing
- DTLS record parsing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p1high priorityhigh priority