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/NonchalantFossa Mar 10 '25

Cool, thanks for the clarification. I'm working in Python and actually the Mock object in the standard lib is very flexible (maybe too much), it can actually be several things in your list. I'm very weary about re-implementing logic so I usually don't do it.

Right now my usage is more along those lines, (in Python-like pseudo-code).

def test_take_func_handles_strange_value(tmp_path):
    obj = Mock()
    obj.path = tmp_path  # A path fixture, required
    obj.value = 11  # Specific value that happens rarely in regular code
    take(obj) == expected   # actual behavior test for the take func

But this Mock object from the stdlib can also record calls, calls parameters, number of times it's been called, etc. You can also freely attach functions to that object to emulate some behavior. It all falls under the name Mock though.

But I see the differences from your explanation in any case.

2

u/flavius-as Mar 10 '25

Yeah, it's probably the cause of confusion throughout the industry. Other languages and ecosystems have a similar problem.

A better name might be UniversalTestDouble since it can do everything.

1

u/NonchalantFossa Mar 10 '25

Thanks for taking the time. I 100% agree with what you wrote earlier then. The biggest issue is convincing my colleagues (we have plenty of projects with no tests).