Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Property-based testing: The lazy programmer's guide to writing thousands of tests

Property-based testing: The lazy programmer's guide to writing thousands of tests

Pierre GOUDJO

January 20, 2022
Tweet

More Decks by Pierre GOUDJO

Other Decks in Programming

Transcript

  1. for any (x, y, …) such as precondition(x, y, …)

    holds property(x, y, …) is true
  2. Avg • for any number (a and b ) •

    such a <= b • a <= avg(a, b) and avg(a, b) <= b • for any number (a and b ) • such a <= b • avg(a, b) == avg(a, b)
  3. Zip/Unzip • for any string (x) • such as x

    not “” • unzip(zip(x)) == x is true