Skip to Main Content
Property-Based Testing with PropEr, Erlang, and Elixir
book

Property-Based Testing with PropEr, Erlang, and Elixir

by Fred Hebert
January 2019
Intermediate to advanced content levelIntermediate to advanced
376 pages
8h 49m
English
Pragmatic Bookshelf
Content preview from Property-Based Testing with PropEr, Erlang, and Elixir

Testing Specials

Alright, before moving further, let’s reevaluate our TODO list:

  • Items are identified by unique names (nonempty strings).

  • The list of items has no set length (though it appears nonempty), and the items it contains are in no specific order.

  • The unit prices appear to be integers. (Not a bad idea, since floating point numbers lose precision; we can assume values are written in cents, for example.)

  • The special prices are triggered only once the right number of items of the proper type can match a given special.

  • All items have a unit price.

  • It is not mandatory for a given item to have a special price.

That’s decent coverage in terms of features and requirements we extracted, with few lines of tests! It may not feel like we’ve accomplished ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Erlang and OTP in Action

Erlang and OTP in Action

Eric Merritt, Richard Carlsson, Martin Logan
Testing Elixir

Testing Elixir

Andrea Leopardi, Jeffrey Matthias

Publisher Resources

ISBN: 9781680506556Errata Page