Chapter 10. Test-driven development and more

 

This chapter covers

  • An 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 lower coupling as well. Finally, the suite of tests that results from the process is a good way to ensure that functionality doesn’t regress in the face of enhancements and bug fixes.

10.1. Getting started with TDD: Manipulating dates in strings

 
 

10.2. Improving tests through mocking and stubbing

 
 

10.3. Organizing tests

 

10.4. Summary

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest