Property-Based Testing in a Project
Explore how to integrate the PropEr property-based testing framework into Elixir projects. Understand setting up dependencies with mix, running tests alongside ExUnit, and managing GPLv3 licensing concerns while enhancing your testing workflow.
We'll cover the following...
What we need now is a framework. As opposed to many testing practices that require a tiny bit of scaffolding and a lot of care, property-based testing is a practice that requires heavy tool assistance. Without a framework, we have no way to generate data, and all we’re left with are encoded rules that don’t get validated. If we use a framework that doesn’t generate great data or doesn’t let us express the ideas we need, it will be very difficult to generate tests of the same quality that we could using a functional framework.
As the course title implies, we will use PropEr. It can be used by both Erlang and Elixir projects and integrate with the usual build tools used in both languages. There are other frameworks available, namely QuickCheck framework by Quviq and Triq. These two frameworks and PropEr are similar enough that if our team is using any of them, we’ll be ...