Elixir Umbrella Applications and Testing with Mox Elixir's If and Elixir's Do

Test Suite as a Complexity Measuring Tool

In this post, I want to discuss how to measure our module’s external complexity with our test suite.

To demonstrate that:

  1. I used StreamData to write a property-based test for a Fibonacci function.
  2. 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.


Shameless plug: Check out @elixirstatus' other community project:

Credo, a new static code analysis tool that acts as a code linter, but also focusses on teaching coding practices and code consistency.