Skip to Content
Test Driven Development: By Example
book

Test Driven Development: By Example

by Kent Beck
November 2002
Intermediate to advanced
240 pages
5h 9m
English
Addison-Wesley Professional
Content preview from Test Driven Development: By Example

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Refactoring: Improving the Design of Existing Code

Refactoring: Improving the Design of Existing Code

Martin Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts

Publisher Resources

ISBN: 0321146530Purchase book