Jump to ratings and reviews
Rate this book

Testing Elixir

Rate this book
Elixir offers new paradigms, and challenges you to test in unconventional ways. Start with almost everything you need to write tests covering all levels of detail, from unit to integration, but only if you know how to use it to the fullest - we'll show you how. Explore testing Elixir-specific challenges such as OTP-based modules, asynchronous code, Ecto-based applications, and Phoenix applications. Explore new tools like Mox for mocks and StreamData for property-based testing. Armed with this knowledge, you can create test suites that add value to your production cycle and guard you from regressions. 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. What You To get the most out of this book, you will need to have installed Elixir 1.8 or later and Erlang/OTP 21 or later. In order to complete the relevant chapters, you will also need Ecto 3.1 or later, EctoSQL 3.1 or later and Phoenix 1.3 or later.

264 pages, Paperback

Published August 17, 2021

19 people are currently reading
46 people want to read

About the author

Andrea Leopardi

2 books1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
8 (40%)
4 stars
8 (40%)
3 stars
4 (20%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 2 of 2 reviews
Profile Image for John.
40 reviews2 followers
May 4, 2023
I knew most of the information already from experience, but the book served as a good way to refresh and structure my knowledge. I didn't quite agree on some points, for example, I wouldn't directly and exhaustively test the field configurations for the Ecto schemas, another example, I think using live code for setting up tests isn't necessarily a bad idea.
My favorite chapters were about property testing, that's something I learned anew, and the appendix about the lifecycle of ExUnit tests.
Profile Image for Mike Zornek.
62 reviews8 followers
February 22, 2023
I read this book a second time this year as part of a book club. I think the book provides a good introduction to the various testing tools of the Elixir ecosystem though I disagree with the author's perspective of what should be tested day-to-day.

For a book that better guided me toward my current perspective, I'd recommend Unit Testing Principles, Practices, and Patterns.

https://www.manning.com/books/unit-te...
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.