~/talk

Property Based Testing with Hypothesis: Stronger Tests, Less Work

Talkat PyCon Israel 2022 · 2022-06-28..06-29· [testing, developer-experience]
slides:none on file

Shows how Python’s Hypothesis generates hundreds of randomized cases, shrinking failures to minimal examples, and finds real bugs in a small CRUD app by running random sequences of HTTP actions against a simple state model. Demonstrates a sorting property (output ordered and same multiset), then a stateful testing setup that caught an ID/override bug where adding a book with the same title replaces the old one and a delete-then-update sequence that resurrects a record. Tests are compact (dozens of lines), runnable with a few hours’ setup, and reliably expose whole categories of lifecycle bugs.

AI-written summary · about

  1. 0:00Introduction to property based testing
  2. 2:13Testing a sorting function
  3. 11:31Stateful API testing with state machine
  4. 27:47Bug categories and testing ROI
  5. 30:38Challenges in property based testing
  6. 37:19Getting started with Hypothesis
~/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.