O'Reilly logo

Test Driven Development: By Example by Kent Beck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Part I: The Money Example

In Part I, we will develop typical model code driven completely by tests (except when we slip, purely for educational purposes). My goal is for you to see the rhythm of Test-Driven Development (TDD), which can be summed up as follows.

  1. Quickly add a test.

  2. Run all tests and see the new one fail.

  3. Make a little change.

  4. Run all tests and see them all succeed.

  5. Refactor to remove duplication.

The surprises are likely to include

  • How each test can cover a small increment of functionality

  • How small and ugly the changes can be to make the new tests run

  • How often the tests are run

  • How many teensy-weensy steps make up the refactorings

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required