Testing strategies and pattern for efficient TDD in Rust
summary
Claims that TDD is doable in Rust despite lack of reflection and strict compiler checks and shows concrete patterns that make it efficient: microsteps following red‑green‑refactor, using cargo test plus examples and tests/ integration layout, preferring Result types and handling error paths early, extracting I/O to testable functions, splitting module tests into module_test files and using pub use for imports. Advice: keep tests small, avoid DRYing them with macros, expect large test-to-code ratios (e.g. hundreds LOC → ~2000 LOC tests) and it yields production confidence.
AI-written summary · about
chapters (14)
- 0:00Thomas Wickham Testing strategies and patterns for efficient TDD in Rust
- 0:12Efficient TDD in RUST RustFest 2017 Zurich
- 3:12Tests Driven Development
- 3:39Why do we test first ?
- 4:46Helps my design
- 5:18Test my understanding
- 6:56How does it works?
- 7:18Red Green 7 Refactor
- 8:37How to choose the next test ?
- 9:05A quick example
- 13:00General tips and remarks
- 14:28Unit tests in _test modules
- 15:16Functional tests in examples/ directory and Documentation exemples
- 17:31Think readability: Please Do Repeat Yourself in your tests








