The Program Structure
Explore strategies for designing inherently testable Erlang programs by classifying actions into side effects and functional core. Understand how decoupling components supports easier unit and integration testing, and learn to build modular parts for robust property-based testing.
We'll cover the following...
Design strategy
The most important thing we can do to make our testing experience easier is to design an inherently testable system. To do this well, thinking about the observable effects we want to test against is crucial. In object-oriented code, the traditional approach asks us to limit ourselves to specific objects and to observe their behavior and side effects. Mocking and dependency injection help keep the test scope from growing too large.
In the case of Erlang, these practices can and will make sense when testing specific actors, although this may bring us ...