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

Precise Stateful Modeling

It’s time we use a model to dig deeper into what the system can or can’t do. Once again, a critical property of models is that they are simpler but sufficient to represent the real thing. For our database, a map will prove sufficient to track all changes. But first, before we start to add postconditions, we may want to make an inventory of all kinds of operations we will want to check:

  • Adding a book that is not yet in the system is expected to succeed.

  • Adding a book that is already in the system is expected to fail.

  • Adding a copy of a book that is already in the system is expected to succeed (and make one more copy available right away).

  • Adding a copy of a book that isn’t yet in the system should return an error.

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