438: Writing abstractions in tests
Episode
49 min
Read time
2 min
Topics
Design & UX, Crypto & Web3, Psychology & Behavior
AI-Generated Summary
Key Takeaways
- ✓Test abstractions: Good test abstractions shouldn't require jumping to definitions - readers should understand functionality from method names like "login_as_admin" without checking implementation details.
- ✓Custom matchers over shared examples: Custom matchers provide better composition than shared examples, which couple behaviors like inheritance and force unwanted dependencies between test cases.
- ✓Helper method design: Helper methods should return values rather than set state, be called inline within test examples, and have descriptive names indicating setup conditions.
- ✓Abstraction frequency: Test abstractions that require frequent changes indicate poor abstraction choices - stable abstractions suggest you've correctly identified truly similar rather than coincidentally similar code.
What It Covers
Joelle and Steph explore when and how to use abstractions in test code, comparing helper methods, custom matchers, and shared examples for better test readability.
Key Questions Answered
- •Test abstractions: Good test abstractions shouldn't require jumping to definitions - readers should understand functionality from method names like "login_as_admin" without checking implementation details.
- •Custom matchers over shared examples: Custom matchers provide better composition than shared examples, which couple behaviors like inheritance and force unwanted dependencies between test cases.
- •Helper method design: Helper methods should return values rather than set state, be called inline within test examples, and have descriptive names indicating setup conditions.
- •Abstraction frequency: Test abstractions that require frequent changes indicate poor abstraction choices - stable abstractions suggest you've correctly identified truly similar rather than coincidentally similar code.
Notable Moment
Steph suggests creating a game where developers read random test examples from their codebase to practice understanding code, turning test comprehension into team learning.
You just read a 3-minute summary of a 46-minute episode.
Get The Bike Shed summarized like this every Monday — plus up to 2 more podcasts, free.
Pick Your Podcasts — FreeKeep Reading
More from The Bike Shed
We summarize every new episode. Want them in your inbox?
Similar Episodes
Related episodes from other podcasts
Software Engineering Daily
May 5
SmartBear and Multi-Agent QA
How I AI
Apr 23
GPT 5.5 just did what no other model could
The Changelog
Nov 14
Retreat to attack (Friends)
How I AI
May 28
Claude Opus 4.8 is here. Is it as good as they say?
10% Happier with Dan Harris
May 27
Stop Being Hijacked By Anxiety, Grief, and Anger — A Buddhist Approach | Sebene Selassie & Jeff Warren
Explore Related Topics
This podcast is featured in Best Cybersecurity Podcasts (2026) — ranked and reviewed with AI summaries.
You're clearly into The Bike Shed.
Every Monday, we deliver AI summaries of the latest episodes from The Bike Shed and 192+ other podcasts. Free for up to 3 shows.
Start My Monday DigestNo credit card · Unsubscribe anytime