~/talk

Introduction to Property-Based Testing

Talkat PyCon US 2021 · 2021-05-14..05-15· [testing, python]
slides:none on file

Introduction teaches Hypothesis with concrete code, not just theory: it runs the @given decorator, uses st.integers().filter(lambda b: b != 0) and pytest integration, and demonstrates finding both the obvious ZeroDivisionError and a subtler floating point counterexample where assert a == b * result fails. It shows shrinking to minimal examples, how to build strategies for lists, strings and JSON, and practical tips for settings, databases and ghostwriting tests so you can reproduce and fix real bugs quickly.

AI-written summary · about

  1. 0:00Introduction
  2. 2:43What is testing
  3. 13:50Summary
  4. 14:59Exercises
  5. 16:45Overview
  6. 18:24Scale
  7. 21:28Methods
  8. 22:58Map and Filter
  9. 24:05Just and sampled from
  10. 25:21One and nothing
  11. 26:45Build strategy
  12. 27:46Recursive
  13. 31:15Inferring strategies
  14. 33:40Special strategies
  15. 36:29Inner composite trick
  16. 37:57Data strategies
  17. 38:58Where to find them
  18. 43:37Recap
  19. 44:01Test Tactics
  20. 44:31Common Properties
  21. 46:42Round Trips
  22. 47:57Equivalent Functions
  23. 48:46Validate Output
  24. 49:57Local assertions
  25. 50:27Hypothesis
  26. 51:02Metamorphic Relations
  27. 53:09Metamorphic Functions
  28. 53:59Conclusion
  29. 54:25Live Demo
~/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.