There are a number of property testing frameworks available for the Elixir ecosystem.
PropEr is the obvious one from the book.
StreamData is the custom build Elixir version that was almost added to ex_unit.
Of late I have found StreamData to be very useful. Add some property tests and your bugs become very easy to find.
I have even started to experiment with minimal property tests.
Call the function with all possible inputs and assert that the output is valid.
This is what Typecheck is trying to do, but that requires you to add annotations to all of your types, which does not yet work well with some other libraries.