Chapter 12Writing Tests First

images/tdd/intro.png

Knowing what to test can be a real challenge. There is no magic line in the sand that tells you when you’ve tested enough. There is a lot of complexity—even dealing with simple tasks. And there’s no guarantee that whatever you produce will be of good design. In short, there are a lot of things to master.

But one technique, if properly applied, can help unlock these and other mysteries of the universe. By learning the technique of test-driven development (TDD), you’ll learn how to keep your code clean and your solutions simple.

To be sure, writing your tests first is no guarantee of either great code or perfect tests—but ...

Get The Way of the Web Tester now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.