You are previewing Growing Object-Oriented Software, Guided by Tests.

Growing Object-Oriented Software, Guided by Tests

Cover of Growing Object-Oriented Software, Guided by Tests by Steve Freeman... Published by Addison-Wesley Professional

Chapter 24. Test Flexibility

Living plants are flexible and tender;the dead are brittle and dry.[...]The rigid and stiff will be broken.The soft and yielding will overcome.

—Lao Tzu (c.604—531 B.C.)


As the system and its associated test suite grows, maintaining the tests can become a burden if they have not been written carefully. We’ve described how we can reduce the ongoing cost of tests by making them easy to read and generating helpful diagnostics on failure. We also want to make sure that each test fails only when its relevant code is broken. Otherwise, we end up with brittle tests that slow down development and inhibit refactoring. Common causes of test brittleness include:

• The tests are too tightly coupled to unrelated ...

The best content for your career. Discover unlimited learning on demand for around $1/day.