Property-Based Testing with PropEr, Erlang, and Elixir (Pragmatic Bookshelf)

PragmaticBookshelf
Property-based testing helps you create better, more solid tests with little code. Use the PropEr framework in both Erlang and Elixir, to automatically generate test cases, test stateful programs, and change your software designs for more reliable approaches.

Fred Hebert @ferd

edited by Jacquelyn Carter @jkcarter

Property-based testing helps you create better, more solid tests with little code. Use the PropEr framework in both Erlang and Elixir, to automatically generate test cases, test stateful programs, and change your software designs for more reliable approaches. Explore the problem space better, validate your assumptions about program behavior, and expose unexpected weaknesses in your design.

Write stateless properties, and use default generators to generate test cases automatically. Write custom data generators and discover what your code can or cannot do. Learn when to use property tests and when to stick with example tests. Shrink failing test cases to their simpler expression, and generate relevant data through targeted properties. Uncover bugs with nearly no code at all with properties based on state transitions and finite state machines.

Write Erlang and Elixir properties that generate the most effective tests you’ll see, whether tests or complex integration and system tests.


“Property-based testing through PropEr and QuickCheck is one of the most powerful, yet underutilized, testing approaches of the Erlang Ecosystem. Fred has reduced the barrier to entry, making property-based testing accessible to everyone. This book is unarguably a must-have if you are serious about Erlang and Elixir. A long time coming!”

–Francesco Cesarini, Director, Erlang Solutions Ltd.


  • 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:

Latest Threads About This Book Top

CoderDennis
PropCheck supports TargetedPBT now – PropCheck.TargetedPBT — PropCheck v1.4.1 Is the Elixir code for Chapter 8 Targeted Properties avail...
New
rustkas
@ferd Link to the paragraph of the Erlang documentation “7.3 Type Declarations of User-Defined Types” is out of date. Current link is ...
New
rustkas
@ferd It would be great to run a sample code that would show how the cache regsiter works. I’ve made it(link). I implement this tests. ...
New
axler8r
proper_gen:pick ( → 1 proper_types:non_empty ( → 2 proper_types:list ( → 3 proper_types:number ( → 4 ) → 4 ) → 3 ) → 2 ...
New
New
rustkas
I noticed that the author uses sequences of the same letters for testing. ​rfc_record_per_line_test​() -> ?​assertEqual​([​#​{​"aaa"​...
New
New
rustkas
I noticed that the necessary inconsistence, which describes in an example PropEr framework does not find a discrepancy in the RFC 4180 s...
New
New
rustkas
Chapter 4 Question 6 I implemented property and even tried to make an example more interesting and I would like to improve my realizati...
New

Most Active This Week Top

Most Active This Month Top

Most Active This Year Top

Most Active Last Three Years Top

rustkas
To be a more productive reader when rereading a book, it is very convenient to create small rebar3 projects based on books’ samples and i...
New
rustkas
@ferd It would be great to run a sample code that would show how the cache regsiter works. I’ve made it(link). I implement this tests. ...
New
rustkas
@ferd Link to the paragraph of the Erlang documentation “7.3 Type Declarations of User-Defined Types” is out of date. Current link is ...
New
CoderDennis
PropCheck supports TargetedPBT now – PropCheck.TargetedPBT — PropCheck v1.4.1 Is the Elixir code for Chapter 8 Targeted Properties avail...
New

Most Active Over Three Years Top

PragmaticBookshelf
Property-based testing helps you create better, more solid tests with little code. Use the PropEr framework in both Erlang and Elixir, to...
New
New
rustkas
It would be very convenient if the source code would be distributed into folders, where the root would contain folders with the ordinal n...
New
New
rustkas
I’m wondering why you chose the following sequence in your expression: Function under test =:= reference expression prop_biggest() -&gt...
New
New
rustkas
In the 5th Question of the third chapter, it was proposed to create a function, as well as a testing property to test its work. In your a...
New
rustkas
Appendix 4 Generator Reference (page 452) The table has description about utf8() generator: Generates to utf8-encoded text as a bina...
New
New
rustkas
Chapter 4 Question 6 I implemented property and even tried to make an example more interesting and I would like to improve my realizati...
New
New
rustkas
I noticed that the author uses sequences of the same letters for testing. ​rfc_record_per_line_test​() -> ?​assertEqual​([​#​{​"aaa"​...
New
rustkas
I noticed that the necessary inconsistence, which describes in an example PropEr framework does not find a discrepancy in the RFC 4180 s...
New
axler8r
proper_gen:pick ( → 1 proper_types:non_empty ( → 2 proper_types:list ( → 3 proper_types:number ( → 4 ) → 4 ) → 3 ) → 2 ...
New
rustkas
Exercise 2 I add output and then run it to see it execute. There is peace of my code with output: increments([Head | Tail]) -> incre...
New

Get money off!

The Pragmatic Bookshelf

35% off any eBook

Simply use coupon code "devtalk.com" at checkout. See full details here.