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

Modeling the Circuit Breaker

For stateful properties, we’d initially started our test suite by defining generators. We then needed to refine them when it came to writing the command generation, and ended up writing a shim module. This time around, we’re going to start directly with the shim module. It’s a good opportunity to revisit all kinds of possibile calls that can take place.

Since we’re testing the circuit breaker itself, we’ll want to cover these:

  • Successful calls and their effect on the internal state of the breaker
  • Calls ending in errors
  • Calls ending in errors that are whitelisted, and therefore seen as successful
  • Calls timing out
  • Manual operations to trip and untrip the circuit breaker

Our first step is to ensure the libraries we need ...

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