I learned test-driven development (TDD) from this book. The book does a good job of doing this via just what the title says “by example”.