Chapter 3 Testing OTP

Testing Elixir — by Andrea Leopardi, Jeffrey Matthias (30 / 80)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Wrapping Up | TOC | Testing a GenServer 👉

In the previous two chapters, we established a mental framework to think and work with different levels of testing. We now have the tools to test isolated pieces of code through unit testing, test parts of the system that interact together through integration testing, and test the whole system through end-to-end testing. We covered many patterns that are specific to Elixir but also talked about testing practices in general. In this chapter, we’re going to focus on something that’s specific to Elixir: the OTP set of abstractions. We’re going to dive deeper into testing a few OTP abstractions, such as GenServers and supervisors, as well as talk about some patterns and things to pay attention to when testing asynchronous code.

We’re going to start this chapter by discussing how to test GenServers, which are usually considered the fundamental abstraction in OTP.

👈 Wrapping Up | TOC | Testing a GenServer 👉

Testing Elixir by Andrea Leopardi, Jeffrey Matthias can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.