Search⌘ K
AI Features

Property Structure

Explore the core structure of properties in property-based testing by understanding how type generators produce test data that feeds into property expressions. This lesson helps you write properties using the forall macro syntax, enabling you to create tests that evaluate complex behaviors effectively.

We'll cover the following...

General property structure

A property has 3 parts for both Erlang and Elixir:

  1. Type generator
  2. Instance of type
  3. Property expression
%0 node_1 Property Structure node_2 Type Generator node_1->node_2 node_3 Instance of Type node_1->node_3 node_4 Property Expression node_1->node_4
Property Structure

The generator functions help the date enter into the type_generator position. The framework will take these generators, ...