Welcome to the repository for the book Test-Driven Development by Example by Kent Beck. This repo contains a step-by-step walkthrough of the concepts, exercises, and code examples presented in the book.
Read article for further details here.
The TDD cycle is:
|
|
A minimal, terminal-based setup guide to help you follow along with the book. This guide walks you through creating a clean development environment to fully focus on TDD fundamentals.
These directories contain step-by-step coding examples inspired by the book’s exercises, organized chapter by chapter. Each folder includes:
- ✅ The final version of the code for that chapter
- 🧪 Tests you can run yourself
- 🔍 A clear progression between chapters to observe what changed and why
This structure helps you compare versions and understand the evolution of the code, providing insight into the TDD thought process.
Note: The xUnit/
directory also includes solutions for the following tasks:
- Catch and report setUp errors [source code] [article]
- Invoke tearDown even if the test method fails [source code] [article]
- Create TestSuite from a TestCase class [source code] [article]
These examples demonstrate how to apply Test-Driven Development (TDD) principles in practice—step by step. They also served as a way for me to better understand the entire process and train myself through hands-on exercises.