Optivem Journal

Optivem Journal

Share this post

Optivem Journal
Optivem Journal
TDD in Legacy Code - Acceptance Testable Architecture
Copy link
Facebook
Email
Notes
More
Test Driven Development

TDD in Legacy Code - Acceptance Testable Architecture

Legacy Code is often statically coupled to External Systems, making it impossible to write Acceptance Tests. That's why we need Acceptance Testable Architecture.

Valentina Jemuović's avatar
Valentina Jemuović
Nov 15, 2024
∙ Paid
9

Share this post

Optivem Journal
Optivem Journal
TDD in Legacy Code - Acceptance Testable Architecture
Copy link
Facebook
Email
Notes
More
13
3
Share

🔒Hello, this is Valentina with a premium issue of the Optivem Journal. I help Engineering Leaders & Senior Software Developers apply TDD in Legacy Code. This article is part of the TDD in Legacy Code series. To get these articles in your inbox every week, subscribe:


Legacy Code might not be Acceptance Testable

Legacy Code might have the following problem - it might be statically coupled to External Systems:

  • Hard-coded connections to External HTTP APIs

  • Static calls to the System Clock and static calls to other sources of non-determinism

  • Static calls to complex external libraries, where the input-output mapping of the external library is beyond our knowledge

We can’t introduce Acceptance Tests

In order to write Acceptance Tests, we need to have External System Stubs. This enables us to fully test any Acceptance Criteria relating to our System, by targeting our System and setting up the External System Stubs.

However, in order to be able to communicate with the External System Stubs, we’d need to ensure External System Configurability.

So we need to ensure Acceptance Testable Architecture

That’s why we need to do some changes to our source code to ensure External System Configurability.

But how do these changes… without risking the whole system?

Here are the steps for achieving E2E Testable Architecture in Legacy Code. You’ll get tasks to implement in your GitHub Sandbox Project. ⬇️⬇️⬇️

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Valentina Jemuović, Optivem
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More