TBC
summary
Live coding shows refactoring an Invitations class that parses a CSV of name/email pairs, sends mail via a Mailer, and has a private recipients method moved into a new Parser class. Tests drive the work: unit specs for Parser, a component spec for Invitations, then stubbing Parser with a parser double (allow Parser.new to return the fake). Final step uses dependency injection to invert control by passing a Parser in instead of a CSV, simplifying tests and clarifying tradeoffs of this extract class refactor.
AI-written summary · about
chapters (11)
- 0:00Talk overview
- 1:06Programming fundamentals
- 3:36Email invitation code example
- 5:23Single responsibility refactor
- 8:30Extracting CSV parser class
- 13:20Moving methods between classes
- 18:16Test doubles for collaborators
- 24:15Stubs and test smells
- 26:00Dependency injection
- 32:22Inversion of control trade-offs
- 34:07Closing takeaway








