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/bluemage-loves-tacos Oct 17 '25

red flag: if you have to change tests when you change implementation details, you have a wrong definition of unit and a wrong design and architecture due to that

This is really, really important. For most of my career, when TDD has been used or talked about, it's not been focused on behaviour, but code. It's only more recently that the discussion of WHAT the test is for has really come up, and it's really changed my perspective. TDD has gone from kind of a chore, to a useful tool. I can start with a test, and that test should fail, because when I post to https://www.example.com/api/foo/bar, it's a 404. I don't have anything there. But the test will try and get that page, and it will check to see if all of the actions that should happen when I go there are triggered.

That means my next goal is to get that resource to exist, to accept a post, and to do something useful. When my test passes, I iterate and make the test expect the view do more things, and it fails again, because I've not implemented it yet.

And when I want to change the underlying architecture, the test doesn't change. The test tells me if I screwed up, or that I didn't.

TDD to help create outcomes, not implementations, is by far a more productive use IMO.