~/talk

Faking It - The Art of Testing Using Verified Fakes

Talkat EuroPython 2015 · 2015-07-20..07-26· [testing]
links:none on file
slides:none on file

Claims that shipping verified fakes lets unit tests run quickly while guaranteeing behavior with the real API; evidence includes a working fake for docker-py that initially fails because its keywords and return shapes diverge from the real client but is tightened by zope.interface verifyObject checks and a dynamic test-factory that runs the same test mixin under trial against both fake and integration setups. Real-world examples used: Flocker’s Block Device Backend, Eliot’s memory logger, LibCloud DummyNodeDriver and suggested improvements for Boto; the built fake ends up passing both fake and real tests.

AI-written summary · about

  1. 0:00Intro
  2. 1:00Introduction • Problems (5) • Solution (15) . Questions (5)
  3. 3:51Problem 2: Inaccurate mocks
  4. 4:31Nova Docker (for example)
  5. 7:37Can we do better?
  6. 7:48A "verified" fake A class that
  7. 9:44So let's make a start
  8. 10:04Where is the docker-py API defined?
  9. 15:14A public testtools module
  10. 15:55A Tests Mixin
  11. 18:58And now we can start fleshing out the interface
  12. 19:22Starting with a test for empty list of containers.
  13. 20:54Test, write code, refactor, repeat
  14. 21:58Complications
  15. 23:36Test public APIs not implementation details
  16. 24:11Further Reading
  17. 26:08Mimic
  18. 27:20Eliot
  19. 28:51Summary
~/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.