Skip to Main Content
Property-Based Testing with PropEr, Erlang, and Elixir
book

Property-Based Testing with PropEr, Erlang, and Elixir

by Fred Hebert
January 2019
Intermediate to advanced content levelIntermediate to advanced
376 pages
8h 49m
English
Pragmatic Bookshelf
Content preview from Property-Based Testing with PropEr, Erlang, and Elixir

Thinking About Program Structure

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Erlang and OTP in Action

Erlang and OTP in Action

Eric Merritt, Richard Carlsson, Martin Logan
Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781680506556Errata Page