In this post, I want to discuss how to measure our module’s external complexity with our test suite.
To demonstrate that:
- I used StreamData to write a property-based test for a Fibonacci function.
- I wrote two different implementations for the Fibonacci function, to explain the differences between internal and external complexity.
Finally, I reached a conclusion that different test styles are just different perspectives of understanding our code, and this idea aligns with the idea of complexity measurement pretty well.
Read next Elixir's If and Elixir's Do