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

Chapter 27

Testing Patterns

These patterns are more-detailed techniques for writing tests.

Child Test

How do you get a test case running that turns out to be too big? Write a smaller test case that represents the broken part of the bigger test case. Get the smaller test case running. Reintroduce the larger test case.

The red/green/refactor rhythm is so important for continuous success that when you are at risk of losing it, it is worth extra effort to maintain it. This commonly happens to me when I write a test that accidentally requires several changes in order to work. Even ten minutes with a red bar gives me the willies.

When I write a test that is too big, I first try to learn the lesson. Why was it too big? What could I have done differently ...

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
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