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 a program, it will surely be brought to our attention when we run the program's tests. Thus, tests are indispensable tools for keeping code maintainable.
In this chapter, we will study the different ways in which...