Book
Test-Driven Development
Kent Beck
Summary
Kent Beck builds this book around two worked, hands-on examples: a multi-currency exercise developed entirely test-first through the Red-Green-Refactor cycle, and a small xUnit testing framework built from scratch so you see how the tools you rely on actually work underneath. A closing catalog then names the patterns scattered through both examples, covering the red-green-refactor rhythm itself, how to write the tests, and how design patterns emerge once a test forces a decision. Chapters stay short and deliberately narrow, favoring practice you can follow along with over abstract argument, which is why it reads better as a book to type through than one to read cover to cover. It treats tests not as a check added after the code but as the mechanism that drives each design decision at the moment it's made. The book is available in Japanese translation from Ohmsha.
Editor's Note
For those who want to learn TDD hands-on by working through examples. It favors practice over theory, making it a solid first step toward habituating quality; its examples are small, so supplement with other books for production-scale use.
Target Readers
- Developers who have read about TDD but have never actually worked through the Red-Green-Refactor cycle line by line
- Intermediate engineers who want tests to drive design decisions rather than just verify code after it's written
- Programmers curious how a testing framework works internally, who want to build a small one from scratch as a learning exercise
Tags
Colophon
- Publisher
- Ohmsha
- ISBN
- 978-4274217883
- Published
- Oct 2017
- List price
- ¥3,080incl. taxMay differ from the actual selling price on Amazon
Get this book
* The link above is an advertisement via Amazon Associates.Related Books
Prerequisites
- Recommended
Clean Code
A Handbook of Agile Software Craftsmanship
Robert C. Martin
Reason: To keep writing clean code, you need a foundation that lets you change it without fear. Test-driven development instills the discipline of growing clean, working code in small cycles, turning quality into a habit.
Next Books
- Recommended
Unit Testing Principles, Practices, and Patterns
Vladimir Khorikov
Reason: Once the small TDD cycle makes writing working tests second nature, you advance to principles of what and at what granularity to test. Good tests are resistant to refactoring, do not get in its way, and reliably catch regressions.
- Recommended
Growing Object-Oriented Software, Guided by Tests
Steve Freeman, Nat Pryce
Reason: After getting comfortable with unit-level TDD, you move to outside-in TDD—driving from acceptance tests down to units—to design the collaboration between objects itself. Mocks become a tool for expressing collaboration, not just a stand-in for implementations.
- Recommended
xUnit Test Patterns
Refactoring Test Code
Gerard Meszaros
Reason: Test-Driven Development: By Example builds the habit of writing tests first, through a multi-currency exercise and a small xUnit framework written from scratch. xUnit Test Patterns takes the resulting test code as its subject: it organizes fixture setup and teardown, result verification and test doubles as patterns, and uses a catalog of 18 test smells to trace problems to their causes. It belongs after the habit is in place, when the tests have to be kept maintainable.