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 18 '25 edited Mar 18 '25
Glad you asked!
Most people are bastardizing whatever original authors say.
At the same time, authors are forced to synthesize their explanations in order to get 1 or 2 points across (say: per chapter). You would do the same because you don't have the time to write 12k pages like it's intel manuals. But people don't usually read carefully or engage with authors directly, they'd rather use proxies: like we are about to do.
So rambling off.
Architectural styles like P&A are not meant to be mutually exclusive. They are mental toolboxes. From these mental toolboxes you pick the tools you need to craft your architecture for the specific requirements of the project at hand.
I default to a mixture of:
MVC is usually an implementation detail of the web adapter. Nevertheless architecturally relevant (especially for clarifications during architectural discussions).
There are also various views of architecture: the physical view, deployment view, logical view, etc.
In my logical view, all use cases jointly form the outer layer of the domain model (I like this term more than "Application"). The same outer layer also contains other elements like value objects or pure fabrications like repository interfaces.
You might have another architectural structure in there like
These are synonyms in my default go-to combination of styles and when that it the case, I call that a modulith (modular monolith) because in the logical view, each of those are like a microservice. Extracting one vertical slice and turning it into a microservice (for "scale") is an almost mechanical and risk free process.
If anything, a vertical slice / bounded context / microservice is in itself a hexagon.
What I just described is IMO the right balance of minimalistic design and future extensability. Making this structure requires about 1 click per element, because I'm not saying anything complicated: a directory here, a package there, a compilation unit somewhere else... all light and easy.
The single elephant in the room left is DDD. How is THAT light you might ask.
For me, DDD is the strategic patterns when we're talking about architecture. The tactical patterns are design, they're implementation details - mostly.
So the "only" thing I absolutely need to do to get DDD rolling is developing the ubiquitous language - that's it. If necessary, at some point I can introduce bounded contexts, but I like doing that rather mechanically: did I mention use cases? Well I just draw a big use case diagram and run a layout algorithm on it to quickly identify clusters of use cases. Those fall most likely within the same boundary. Sure, for 100-200 use cases you might need 1-2 weeks to untangle them, but traceability matrices in tools like Sparx EA help. The point is: it's a risk-free and mechanical process.
I hope this is enough information for you to start sailing in the right direction.
Good luck!