Property Based Testing
Danwhy opened this issue · 3 comments
Property based tests are tests that assert certain properties are always satisfied by your code. Instead of just testing that your code works on one input, they provide a range of inputs, making sure the property is satisfied every time. This article is a good introduction to property based testing in general.
Property based testing is very popular among the functional language community, including Elixir.
Articles
- https://elixir-lang.org/blog/2017/10/31/stream-data-property-based-testing-and-data-generation-for-elixir/
- https://jeffkreeftmeijer.com/mix-proper/
- http://whatdidilearn.info/2018/04/22/property-based-testing.html
Books
Videos
- https://youtu.be/x2ckfhqB9nA?t=1964 - Keynote - José Valim - ElixirConf EU 2018
- https://www.youtube.com/watch?v=p84DMv8TQuo - Property-based Testing is a Mindset - Andrea Leopardi - ElixirConf EU 2018
Property based testing in JavaScript with JSVerify:
https://hackernoon.com/property-based-testing-4330e3e77381
I'm not recommending that anyone write JS long term,
this is relevant to anyone who is not yet fluent in Elixir/Elm
or people who are stuck in JS-land for whatever reason.
see: https://github.com/jsverify/jsverify
"Testing shows the presence, not the absence of bugs". ~ Edsger W. Dijkstra
Guide coming soon: https://github.com/dwyl/learn-property-based-testing