Retrospective

Specify Behaviors with Tests to create living specifications. We walked through an example of building some basic functionality test-first and saw how to use tests to specify behavior. When developers see the benefit of doing test-first development, they can become test infected and want to do all their development test-first.

In this chapter, we discovered…

  • How to use your test suite to not only verify behavior but also to specify it.

  • By instrumenting tests, you can clearly state their purpose and they become a form of living specifications.

  • Tests provide a “safety net,” allowing you to refactor code and instantly know if you’ve made a mistake.

  • By writing tests to specify behaviors, you’ll always know the right kind and number ...

Get Beyond Legacy Code 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.