~/talk

Property-based testing - let your testing library work for you

Talkat Scala Love in the City 2021 · on Saturday, 2021-02-13· [testing]
slides:none on file

Shows property-based testing on a concrete discount calculator example (customer join date + birthday → BigDecimal discount) using ScalaCheck and ScalaTest generators, finding a real leap year bug when random dates include Feb 29. Tests run hundreds-to-thousands of generated cases with shrinking to minimal failing examples, explains custom domain generators, the use of assumptions/whenever, flaky-seed recording, and a practical workflow: write example tests first, then add properties for key components.

AI-written summary · about

  1. 0:00Introduction
  2. 1:55What is property-based testing
  3. 3:18Example-based testing demo
  4. 6:50Defining properties for testing
  5. 9:39History of property-based testing
  6. 10:44Scala testing libraries
  7. 13:13Property-based test example
  8. 15:58How libraries generate data
  9. 17:02Custom domain generators
  10. 19:09Using assumptions in tests
  11. 20:35Challenges of property-based testing
  12. 21:59Coming up with properties
  13. 24:26Handling non-determinism
  14. 25:10Documenting with tests
  15. 26:14Two testing strategies
  16. 28:45Benefits and costs
  17. 30:10Further learning resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.