About the Code

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 last chapter, Chapter 7, Property-Based Testing, won’t follow a particular application in order to focus on different concepts related to property-based testing.

We’ll have to continuously “escape” these applications over and over again. We made this choice because our focus is testing, and many times we would have had to come up with artificial and forced features for these applications in order to talk about some testing topic. In those cases, we’ll just go with self-contained examples that allow us to directly address some testing topics without making our main application a total mess.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.25.32