Filtering Records

We have a module to convert CSV to maps, and we know that we’ll need employee records and a way to filter them to move the project forward. We could start by defining the records’ specific fields, but since we know they’ll be implemented using maps, and that maps are a fairly dynamic data structure, then nothing prevents us from jumping directly to the filtering step.

In this section, we’ll see a case where even though the problem space is large, we can explore it better with example tests than with properties. The reason for this is that the type of data we can get is very regular and easy to enumerate, such that a brute force strategy pretty much guarantees a more exhaustive and reliable testing approach than a probabilistic ...

Get Property-Based Testing with PropEr, Erlang, and Elixir now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.