23

My Take on Property-Based Testing

 4 years ago
source link: https://www.tuicool.com/articles/hit/eQzUFjZ
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

My Take on Property-Based Testing

…for Erlang & Elixir

A few months ago, Fred gave me a copy of his latest book ( Property-Based Testing with PropEr, Erlang, and Elixir ) so I could review it. So, here I am, returning the favor. But I’ll also use this chance to express some of my feelings and opinions about Property-Based Testing in general, since reading the book elicited quite a few of them. This will not be one of the usual articles on this blog, but I hope you’ll enjoy it anyway.

jQZreaJ.jpg!web2Ajqmee.jpg!web

The Book

In a nutshell, this book is a very extensive and detailed manual/hands-on-tutorial with which you’ll first learn the general concepts behind Property-Based Testing (e.g. properties, generators, shrinking, etc.), then you’ll learn the basics of the methodology and tools and finally some of the more advanced techniques like custom generators, stateful properties and more.

Fred does a great job of walking you step by step and as you read the book, each chapter builds on the previous ones. But each chapter is just a tiny step that you can tackle easily. Suddenly, you reach the end of the book and you realize you learned a lot .

You should be aware of one thing, tho: It’s based on PropEr . You’ll find both Erlang and Elixir code samples, but all of them will use this framework. Same thing for the exercises. So, if you’re planning to practice what you read (which is something the book encourages you to do), you’ll be using it. Luckily, it’s an open-source framework so you can do that for free! :muscle: That’s not to say that you can’t extrapolate what you learn to other frameworks, but it won’t be as easy.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK