What Makes CRC Code Testable?
Learn how testing should be done in a Phoenix application.
We'll cover the following...
Why testing is important
Think of a test as a scientific experiment. The experiment’s target is a bit of code, and the thesis is that the code is working. Logically, each test is an experiment that does three things:
- Sets up preconditions
- Provides a stimulus
- Compares an actual response to expectations
That definition is pretty broad and covers a wide range of testing strategies and frameworks. We’re going to write three tests of two specific types. Both types of tests will follow this broad pattern. One of the tests will be a unit test. We’ll write it to verify the behavior of the independent ...