Testing Elixir (PragProg)

Write Elixir tests that you can be proud of. Dive into Elixir’s test philosophy and gain mastery over the terminology and concepts that underlie good tests

Andrea Leopardi (@whatyouhide) and Jeffrey Matthias (@idlehands)

edited by Jacquelyn Carter @jkcarter

Write Elixir tests that you can be proud of. Dive into Elixir’s test philosophy and gain mastery over the terminology and concepts that underlie good tests. Create and structure a comprehensive ExUnit test suite, starting from the basics, and build comprehensive test coverage that will provide safety for refactoring and confidence that your code performs as designed. Use tests to make your software more reliable and fault tolerant.

Explore the basic tool set provided by ExUnit and Mix to write and organize your test suite. Test code built around different OTP functionality. Isolate your code through dependency injection and by using Mox. Write comprehensive tests for Ecto projects, covering Ecto as a database tool as well as a standalone data validation tool. Test Phoenix channels from end to end, including authentication and joining topics. Write Phoenix controller tests and understand the concepts of integration testing in Elixir. Learn property-based testing with StreamData from the author who wrote the library.

Code with high confidence that you are getting the most out of your test suite, with the right tools that make testing your code a pleasure and a valuable part of your development cycle.


  • Full details: Search
  • View this book’s portal and details on how to post errata and suggestions here.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

9 Likes

Nice to see another Elixir book!
(And what a great choice of colour! :nerd_face:)

3 Likes

Looks like the PragProg site has been updated and the above link no longer works.

2 Likes

I think it might be because it hasn’t been released in beta yet… hopefully one of the @PragmaticBookshelf crew will be able to shed some light on this :smiley:

1 Like

Yep, @AstonJ is right that it has to do with the book’s beta status, but there’s a bit more to it.

We were set to release Testing Elixir last week on our normal Wednesday release schedule, but we used that slot to do something we felt was even more important given recent events in the U.S. We put the book on hold momentarily, and sent out this very special Letter from the Publisher instead https://media.pragprog.com/newsletters/2020-06-03.html

Once the book is released in beta – which will be very, very soon – the link will take you to the book’s home on our new website.

6 Likes

Pardon the self-promotion, but, @tjstankus and anyone else who’s been waiting, the beta is now out.

5 Likes

Just got the beta. Will start reading from tomorrow. ToC looks good.

4 Likes

How is everyone finding it so far? I’ve got a free ebook from PragProg coming to me and this one’s pretty high on my list.

1 Like

Im still at ToC tho :rofl:. Will start reading this over the weekend. First impression as a beginner: I’ll definitely get lots and lots of nuggets, especially fuzz, integration & end-to-end tests.

2 Likes