Chapter 8. Test-driven development and more

 

This chapter covers

  • Introduction to unit-testing Clojure
  • Writing test-driven Clojure code
  • Mocking and stubbing code in Clojure
  • Improving test organization

 

Test-driven development (TDD) has become something of the norm on most software development projects. It’s easy to understand why, because TDD has several advantages. It allows the programmer to look at code being developed from the point of view of a consumer, which results in a more useful design when compared with a library that might be designed in relative isolation. Further, because code developed using TDD must be testable (by definition), the resulting design is often better in terms of low coupling as well. Finally, the suite of ...

Get Clojure in Action 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.