Introduction

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Jeffrey Matthias | TOC | Why Do We Need a Book for Testing in Elixir? 👉

Charles Kettering, an American inventor and the longtime head of research for General Motors, has a quote that applies well to our approach to software tests:

A problem well stated is a problem half-solved.

Think of your tests as stating the problem that your code solves. Once that’s done, writing that code becomes easier. Moreover, tests not only state the problem, but they also verify that the solution is correct. They’re an almost indispensable part of software engineering, and we believe it’s important to understand why and how to use them.

Some developers write tests for their software. Some developers don’t. There is code running all over the world that doesn’t have a single test behind it. So, why do we test? We do it for a plethora of reasons, but they fit into just a few categories.

First of all, we test to increase confidence that our software does what it’s supposed to do. Testing gives us confidence that our code works as expected. This is true for all kinds of testing, whether for automated tests performed by a machine or for manual tests performed by a human.

The other main reason for testing is to prevent breaking changes (also called regressions). Imagine you have an existing codebase that you have to work on in order to add a new feature…

--

--

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.