January 2019
Intermediate to advanced
376 pages
8h 49m
English
The single most helpful thing we can do to make our testing experience easier is to design a system that is inherently testable. To do this well, thinking in terms of what are 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 carefully. To prevent the test scope from being too large, mocking[26] and dependency injection[27] represent a good way to wall things off.
In the case of Erlang and Elixir, these practices can and will make sense when testing specific actors, although this may bring us closer to integration testing. For most cases though, since we’re doing ...