Chapter 10. Testing Your Code

Testing is an integral part of developing software. Alongside implementing functionality in our software, it is imperative to simultaneously define tests to verify several aspects of it. The Clojure standard library provides several constructs to define tests and mock data. There are also several community libraries that allow us to verify different aspects of the code being tested.

The main advantage of using tests is that they allow us to identify the overall impact of a particular change in a program's code. If we have tests to check the functionality of a program, we can refactor the program with confidence and without the fear of losing any functionality. If there's something that we unavoidably missed while refactoring ...

Get Clojure: High Performance JVM Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.