Why Do We Need a Book for Testing in Elixir?

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Introduction | TOC | Who This Book Is For 👉

Elixir is an interesting and fairly unique programming language. It provides features and concepts that can be hard to test if you’ve never dealt with anything like them. Some of those features are common in other programming languages but are more prominent in Elixir (and Erlang), such as concurrency and immutability. Other features, such as resiliency or the OTP framework, are more unique to Erlang and Elixir and can be challenging to test effectively.

From a more practical perspective, Elixir is a great language to write a testing book about because the tools and patterns we use when testing Elixir code are pretty consolidated in the Elixir community. One reason for this is that Elixir comes equipped with its own testing framework, ExUnit. We’ll explore ExUnit inside and out and we’ll learn how to use it in many different situations in order to test our applications on different levels.

Elixir is closely tied to its “parent” language, Erlang. As you likely know, Elixir compiles to the same bytecode as Erlang and runs on the Erlang virtual machine (commonly known as the BEAM). Elixir code often seamlessly calls out to Erlang code, and Elixir applications almost always depend on a few Erlang libraries. However, testing seems to be an area where the two languages have a bit less in common. The sets of tools…

--

--

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.