r/SoftwareEngineering • u/Aer93 • 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!
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.
Concrete examples might help but yes this is a tough question: repeated and spread validation.
You can be creative here: code generation, wasm, ...