Skip to main content
Test Double company logo
Services
Services Overview
Holistic software investment consulting
Software Delivery
Accelerate quality software development
Product Management
Launch modern product orgs
Legacy Modernization
Renovate legacy software systems
DevOps
Scale infrastructure smoothly
Upgrade Rails
Update Rails versions seamlessly
Technical Recruitment
Build tech & product teams
Technical Assessments
Uncover root causes & improvements
Case Studies
Solutions
Accelerate Quality Software
Software Delivery, DevOps, & Product Delivery
Maximize Software Investments
Product Performance, Product Scaling, & Technical Assessments
Future-Proof Innovative Software
Legacy Modernization, Product Transformation, Upgrade Rails, Technical Recruitment
About
About
What's a test double?
Approach
Meeting you where you are
Founder's Story
The origin of our mission
Culture
Culture & Careers
Double Agents decoded
Great Causes
Great code for great causes
EDI
Equity, diversity & inclusion
Insights
All Insights
Hot takes and tips for all things software
Leadership
Bold opinions and insights for tech leaders
Developer
Essential coding tutorials and tools
Product Manager
Practical advice for real-world challenges
Say Hello
Test Double logo
Menu
Services
BackGrid of dots icon
Services Overview
Holistic software investment consulting
Software Delivery
Accelerate quality software development
Product Management
Launch modern product orgs
Legacy Modernization
Renovate legacy software systems
Cycle icon
DevOps
Scale infrastructure smoothly
Upgrade Rails
Update Rails versions seamlessly
Technical Recruitment
Build tech & product teams
Technical Assessments
Uncover root causes & improvements
Case Studies
Solutions
Solutions
Accelerate Quality Software
Software Delivery, DevOps, & Product Delivery
Maximize Software Investments
Product Performance, Product Scaling, & Technical Assessments
Future-Proof Innovative Software
Legacy Modernization, Product Transformation, Upgrade Rails, Technical Recruitment
About
About
About
What's a test double?
Approach
Meeting you where you are
Founder's Story
The origin of our mission
Culture
Culture
Culture & Careers
Double Agents decoded
Great Causes
Great code for great causes
EDI
Equity, diversity & inclusion
Insights
Insights
All Insights
Hot takes and tips for all things software
Leadership
Bold opinions and insights for tech leaders
Developer
Essential coding tutorials and tools
Product Manager
Practical advice for real-world challenges
Say hello
Developers
Developers
Developers
Legacy rescue

Code boundaries vs seams

Ever wondered about the difference between a seam and a boundary in coding? Dive into how these concepts can elevate your coding practices and software quality!
Eve Ragins
|
March 20, 2023
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

I recently found myself in a design discussion where I talked about how our code lacked seams, and another developer talked about boundaries. A third developer asked, "What's a seam?" And this got me thinking.

What IS the difference between a code boundary vs. coding seam?

wasn't sure, so I did some research. And it turns out that the answer I gave was really about separation of concerns. Related, but different.

What are coding boundaries?

If you Google this, you get 535 million results.

A boundary is the line between your code and the code that you don't control. Further, an external boundary is more literally code that you didn't write and a third-party API, whether that's a web API, a third-party package, something another team wrote, the file system, etc. And an internal boundary exists between different components within a system.

It's helpful to think of a boundary as something you don't immediately control. External boundaries are always well-defined because they're impossible for you to modify. Internal boundaries, by contrast, can end up being poorly defined and are more about separation of concerns and much of what makes "clean code."

When differentiating between seams and boundaries, it's easiest to just focus on external boundaries. And those boundaries exist whether you wrap it in an interface or not.

What are coding seams?

If you Google this, you get 37.6 million results. And it doesn't take long before you start getting references to sewing.

Coined by Micheal Feathers in Working Effectively with Legacy Code (one of our must read books), a seam is a place where you can change behavior without changing the target code.

More practically, it's the things we do to make our code easily unit-testable, such as injecting mockable interfaces or other fakes where we can control behavior without executing the "real" code.

So, when working with a third-party we don't control, the seam is the interface wrapping it that we created so that we could mock its behavior for tests. Also, some third-party packages, like popular logging libraries, will provide their own seams which allow you to use their offering directly without sacrificing unit-testability of your code.

So what's the takeaway?

They're related but different.

Best practice is typically to have seams along your boundaries.

But semantically speaking:

  • You can have boundaries without seams by using the third-party directly.
  • You can have seams without boundaries by creating seams between pieces of your own code, even within the same component.
  • You can have seams which cross boundaries by using a third-party provided seam.

Good to know!

Related Insights

🔗
Best books and resources for software developers

Explore our insights

See all insights
Developers
Developers
Developers
You’re holding it wrong! The double loop model for agentic coding

Joé Dupuis has noticed an influx of videos and blog posts about the "correct" way of working with AI agents. Joé thinks most of it is bad advice, and has a better approach he wants to show you.

by
Joé Dupuis
Leadership
Leadership
Leadership
Don't play it safe: Improve your continuous discovery process to reduce risk

We often front-load discovery to feel confident before building—but that’s not real agility. This post explores how continuous learning reduces risk better than perfect plans ever could.

by
Doc Norton
Leadership
Leadership
Leadership
How an early-stage startup engineering team improved the bottom line fast

A fast-growing startup was burning cash faster than it could scale. Here’s how smart engineering decisions helped them improve the bottom line.

by
Jonathon Baugh
Letter art spelling out NEAT

Join the conversation

Technology is a means to an end: answers to very human questions. That’s why we created a community for developers and product managers.

Explore the community
Test Double Executive Leadership Team

Learn about our team

Like what we have to say about building great software and great teams?

Get to know us
Test Double company logo
Improving the way the world builds software.
What we do
Services OverviewSoftware DeliveryProduct ManagementLegacy ModernizationDevOpsUpgrade RailsTechnical RecruitmentTechnical Assessments
Who WE ARE
About UsCulture & CareersGreat CausesEDIOur TeamContact UsNews & AwardsN.E.A.T.
Resources
Case StudiesAll InsightsLeadership InsightsDeveloper InsightsProduct InsightsPairing & Office Hours
NEWSLETTER
Sign up hear about our latest innovations.
Your email has been added!
Oops! Something went wrong while submitting the form.
Standard Ruby badge
614.349.4279hello@testdouble.com
Privacy Policy
© 2020 Test Double. All Rights Reserved.