Search⌘ K
AI Features

Symbolic Calls

Explore symbolic calls to improve custom data generators in property-based testing using PropEr. Understand how representing function calls as data structures aids in debugging complex states and opaque data, making test failures easier to interpret and analyze.

We'll cover the following...

What are symbolic calls?

Some of the data structures or states that we need to generate for tests can be opaque and difficult to decipher. Think of debugging a binary protocol by looking at the individual bytes once the whole thing is encoded, or creating a process and sending it a bunch of messages to prime its state. The output of a failing property will be a lot of hard-to-read bits and bytes, or a term like <0.213.0>, which is not very helpful regardless of how much shrinking we may apply to them. The solution to this problem is a special category of generators built from symbolic calls.

A symbolic call is just a special notation for function calls so that they can be represented as data in generators. Rather than executing ...