r/SoftwareEngineering • • Mar 10 '25

TDD on Trial: Does Test-Driven Development Really Work?

I've been exploring Test-Driven Development (TDD) and its practical impact for quite some time, especially in challenging domains such as 3D software or game development. One thing I've noticed is the significant lack of clear, real-world examples demonstrating TDD’s effectiveness in these fields.

Apart from the well-documented experiences shared by the developers of Sea of Thieves, it's difficult to find detailed industry examples showcasing successful TDD practices (please share if you know more well documented cases!).

On the contrary, influential developers and content creators often openly question or criticize TDD, shaping perceptions—particularly among new developers.

Having personally experimented with TDD and observed substantial benefits, I'm curious about the community's experiences:

  • Have you successfully applied TDD in complex areas like game development or 3D software?
  • How do you view or respond to the common criticisms of TDD voiced by prominent figures?

I'm currently working on a humorous, Phoenix Wright-inspired parody addressing popular misconceptions about TDD, where the different popular criticism are brought to trial. Your input on common misconceptions, critiques, and arguments against TDD would be extremely valuable to me!

Thanks for sharing your insights!

45 Upvotes

126 comments sorted by

View all comments

Show parent comment

2

u/flavius-as Mar 20 '25 edited Mar 20 '25

Architecture doesn't mean you throw away good design practices or common sense. A port is in that sense a collection of interfaces sharing a goal (interface segregation principle).

When you think or communicate ideas, you do so at different levels of abstractions based on context. When your focus is a single use case, which requires a single interface for storage (among the many), you call that "the storage port". When you talk about whole components, you can call the whole component containing only (and all) interfaces responsible for storage "the storage port".

An anemic domain model is a code smell. So for crud operations, just don't forward the request further into the domain model and process them only within framework code (MVC).

But beware: https://www.linkedin.com/posts/flavius-a-0b9136b4_where-do-you-hide-your-ifs-some-examples-activity-7275783735109693441-0LSA?utm_source=share&utm_medium=member_android&rcm=ACoAABg5aA0B9xSOb2Ogc9NRHoto5TwGnqObhQg

The moment you type an "if" you are likely introducing domain rules, so then refactor that to shift into use case modelling.

The only business logic applied to these use cases would be the permissions we apply on top of those actions, but that’s currently handled in another service.

We then have issues with the DB adapter also applying business logic via the form of check constraints. This makes sense so as to avoid issues where records might be inserted from outside the application such as from the shell itself. In this case, should we “double up” on the logic to also apply it within the Application itself? This is similar to front end validation that might occur, but you also validate it in the Application layer.

Concrete examples might help but yes this is a tough question: repeated and spread validation.

You can be creative here: code generation, wasm, ...

Sorry, this ended up longer than I thought, but thanks for your time. If it’s acceptable, I could shoot you a DM to continue the conversation further, but I completely understand if you don’t have capacity for that. Either way, thank you!