Skip to main content
OBJECT-ORIENTED-PROGRAMMING5 MIN READ

Commit to one explicit test seam

Commit to replacing one hidden concrete dependency with an explicit injectable role.

Replace one hidden concrete dependency with an explicit constructor-injected role and a test fake. object-oriented-programming dependency injection seam for external service, time, randomness, file system, queue, or API client I will change [class] so it receives [role/interface] instead of constructing [concrete dependency], wire the real implementation in [composition root/factory], and add a fake-based test for [failure or edge case]. A class that calls new SmtpClient, new PaymentClient, Date.now, System.currentTimeMillis, or random ID generation inside domain behavior. A flaky or slow object-oriented unit test that needs a sandbox API, real queue, real file system, or sleep-based timeout. A feature-flag, clock, payment,…

Read the full lesson

Sign up free — one personalized lesson every day, matched to your role and goals.

Already have an account? Sign in

← Back to library
Contact us