About the Code

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 How to Read This Book | TOC | Online Resources 👉

A testing book is a strange beast. Most programming books show “application code” when discussing examples and often omit or give little attention to tests. In this book, we want to focus on testing, but we need application code since there’s no point in testing if you don’t have anything to test. At the same time, we don’t want to focus on the application code since it would take away from what we want to talk about, which is testing. As we said, it’s a strange beast.

Throughout the book we’ll work on two main applications. In the first three chapters, Chapter 1, Unit Tests, Chapter 2, Integration and End-to-End Tests, and Chapter 3, Testing OTP, we’ll work on Soggy Waffle. Soggy Waffle is an application that reads the weather forecast for a given area off the Internet and can send SMS alerts in case rain is expected in the next few hours. It’s not a broadly useful application, but it helps illustrate many Elixir testing concepts.

In the next two chapters, Chapter 4, Testing Ecto Schemas, and Chapter 5, Testing Ecto Queries, we’ll use a very basic application, called Testing Ecto, to illustrate how to test applications that use the Ecto framework.

Chapter 6, Testing Phoenix, will have a single application with examples covering the different interfaces provided in the standard Phoenix library.

--

--

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.