~/talk

Stop mocking everything

Talkat sfday 2020 · on Friday, 2020-11-27· [php, testing]
slides:none on file

Claim: stop mocking everything and prefer real implementations where possible. Live PHP code using PHPUnit and PHPSpec builds an overdue invoices calculator with three test invoices, applies 10% interest after 7 days, and shows how mocks force brittle one-to-one coupling: added interactions, nullable due dates, and repo method changes break unrelated tests. A real-memory repo catches a real bug instead of hiding it. Mocks remain recommended for file system database network legacy or costly object-creation scenarios.

AI-written summary · about

  1. 0:00Start
  2. 9:16Php Spec Test
  3. 12:56Test Code with the Real Implementation
  4. 23:32New Test Code and New Behavior of Calculator
  5. 49:06Summary
  6. 53:24How Do You Come Up with a Talk
~/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.