Search⌘ K

Testing Our Code

Explore how to test Elixir applications using ExUnit by writing unit tests for core business logic and boundary APIs. Understand the benefits of layered project design for easier and more thorough testing, and learn techniques to ensure code reliability before integration.

Importance of testing

One of the benefits of structuring our project into core and boundary layers is that our code organization will simplify testing. With a basic API layer that does most of the business logic, we’ll be able to write tests to exercise our business code thoroughly should we choose to do so. We’ll be able to represent our testing concepts in any way we choose, and we’ll discuss a few strategies as the course progresses.

Commencing our tests

We will focus on unit testing here with ExUnit—a unit testing framework bundled ...