~/talk

Avoiding Mockageddon

Talkat PHP fwdays'20 | Special edition · on Saturday, 2020-06-06· [php]
slides:none on file

Argues that excessive mocking makes refactoring slow and tests brittle, notes real cases with 50 or 60 stubs/mocks in one test suite, and shows concrete techniques that work: use PHPUnit createStub/createMock for simple stubs and mocks, write a fake invoice repository for fast in-memory behavior, and employ test proxies to run real code while asserting interactions. Demonstrates that fakes and proxies simplify tests and that overmocking causes false confidence and maintenance pain.

AI-written summary · about

  1. 0:00Introduction
  2. 2:15What are test doubles
  3. 4:00Test stubs
  4. 7:47Mock objects
  5. 11:55Excessive
  6. 13:53Disguising dependencies
  7. 17:36Test code
  8. 19:26Excessive use of marks
  9. 20:31Giving up on unit tests
  10. 21:50Immutable state
  11. 25:48Explicit dependencies
  12. 29:35Fake objects
  13. 32:40Testing
  14. 35:52Uncle Bob
  15. 37:13Test Proxy
  16. 43:30QA Session
~/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.