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
1
u/violated_dog Mar 19 '25
Thank you for the response, and for being a willing proxy!
I can definitely appreciate content creators needing to narrow the scope of their content, and it probably highlights my need for a more senior engineer to bounce ideas off.
In response:
My initial approach is to try and understand how to structure the software to achieve that (hence these questions), and understand the business outside the current implementation. The documented use cases are… not valuable. So I’ve started identifying those with customer groups, and will also pull out a ubiquitous language while we’re there. Thank you for outlining your process and I feel like I’m on the right path!
My next goal is to wrap the current system with tests so we can refactor safely as we incrementally absorb the existing microservices. The system heavily automates virtual infrastructure (eg cloud resources), so many use cases seem to only align with CRUD actions on those resources, and updating metadata to track those resources in a DB. I am now getting resistance about the benefit of writing unit tests for those behaviours. EG a primary port would be triggered to create a virtual machine. This would update the cloud as well as the DB, and return a result with a representation of the created resource, implying a success. A unit test would plug in test doubles for the “cloud” and “DB” adapters, and all we’d assert on is data we’ve told our test doubles to return is returned. Is there any value in this or should I skip this and move to integration/functional tests to assert resources are modified on the platform as expected?
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.
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!