Writing Property Tests with ExUnit

Elixir makes testing a breeze using it’s testing framework ExUnit. ExUnit is a framework for writing unit tests that’s built in to every Elixir project. Every time you create a new project using mix new, Elixir will automatically create a test directory for you and populate it with a skeleton for writing unit tests for your project. ExUnit is already packaged with Elixir, so you don’t need to install any dependencies.

StreamData is an Elixir library for writing property-based tests. Property-based tests test the properties of a function to ensure your code meets some specified properties every time. Property-based tests are especially useful when your functions contain randomness, because you can write tests ...

Get Genetic Algorithms in Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.