SOLID principles through tests
summary
Argues that concrete examples show tests driving SOLID: using TDD with Ruby RSpec and wishful testing leads to extracting responsibilities into classes like ShippingRate and shipping distance, adding an Order method nondigital_items, and writing contract tests with RSpec’s share_examples. Tests reveal design smells, prevent regressions when adding express or same-day methods, and let shipping code become open for extension without modifying existing classes so the approach proves practical.
AI-written summary · about
chapters (11)
- 0:00Introduction to SOLID
- 1:50TDD vs good design
- 3:35SOLID principles
- 4:38Shipping cost example
- 8:51Single responsibility
- 13:26Liskov substitution
- 17:03Open/closed shipping
- 18:49Dependency inversion
- 20:55Interface segregation
- 22:46SOLID in testing
- 24:54Q&A on ActiveRecord








