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

Structure of Properties

Even though this chapter will focus on stateless properties, do know that all properties will share a common basic structure. Fancier stateful properties will only add content and special calls, but the core will remain the same. All properties go into files that contain an Erlang (or Elixir) test module, and must respect a specific format. What we’ll be looking for here is the structure we’ll use within these modules to let PropEr know what the rules to test are, and to let it know how to generate the data it should use to test them.

File Structure

Let’s start by taking another look at the code generated within an existing project when using the templates provided by rebar3’s PropEr plugin, so that you get a feel for ...

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