Unit testing is the art of designing your program in such a way that you can easily test each function as isolated units and such verify its correctness. Unit testing is not only a tool for verification of functionality, but also mostly a tool for designing that functionality in a testable way. What you gain is the means of finding problems early, facilitating change, documentation, and design.
In this chapter, we will dive into how to write good unit tests using F#:
Structuring your tests
Testing in isolation
Finding the abstraction level
Dealing with databases
After reading this chapter, you will be able to write high-quality unit tests that will require little maintenance and stand the test of refactoring, interface changes, and maintenance.