We tried TDD and it didn't work.
"We tried TDD and it didn't work" - what exactly does that mean?

I recently re-posted a post on LinkedIn about "We tried TDD and it didn't work." That sparked a lot of thoughts. Immediately it reminded me of someone saying "I tried exercising and it didn't work." Based solely on that statement we wouldn't immediately conclude from that exercise doesn't work. Nor can we conclude that TDD doesn't work simply because someone sways they tried it and it didn't work. Both of those statements should lead to a lot of questions.
What do you mean by TDD/exercise?
The immediate obvious question is: "What do you mean by TDD/exercise?" This is an important question to ask to make sure everyone is on the same page. Both of these words can mean a lot of different things to a lot of different people. For exercise: Were you doing cardio, weight-lifting, yoga, kickboxing, pilates, etc. For TDD: Were you following the full red-green-refactor cycle? Just writing the test(s) first? Were you writing a bunch of tests up front or were you going one test at a time?
What do you mean by "tried"?
The next question is "What do you mean by tried?" To go back to the previous question, what exactly did you try? More explicitly: How often did you do it? Did you run 1 day a week or 5 days a week? How far did you run? Did you try writing the tests first on a new project or a legacy project?
What do you mean by "didn't work"? What were your goals?
What were you expecting? In what ways did your results not match up to what you were expecting? Were you seeing results, but maybe not quick enough? Maybe you were expecting too much or not anticipating the learning curve. Most of us recognize that exercise takes several weeks or months to show results. Learning technical skills is similar.
Did you see any improvements? What other results did you see?
Sometimes we expect one thing but get different results. That's not always a bad thing. For example, someone might start weightlifting thinking they are going to lose weight (because it is exercise), but instead they gain muscle. Maybe they realize that the number on the scale isn't as important to them as body composition. Personally, I learned refactoring because I wanted to learn how to deal with Legacy Code. Refactoring is very good for that, and it has the added benefit that I no longer feel the need to focus as much energy on getting the design right up front for new code.
Did you have a coach or anyone to guide you?
I admit I am biased on this one, but if you are trying to learn something on your own, that is a lot harder than having someone to coach you along the way. When it comes to exercise, hiring a personal trainer is not strictly necessary, yet you will probably see better results if you do. The same holds true for learning technical skills. Also, to that point, not all coaches are equal. So if you hired a coach or personal trainer, maybe they weren't any good, or maybe their goals weren't aligned with yours, or it wasn't a good fit for some other reason.
Are there other factors at play that might account for your results?
It's also important to account for other variables. When it comes to exercise, how much rest you get and your diet also affect your results. Similarly, when it comes to software development, many of the better practices interact with each other. For example, if you are trying to do TDD, but don't know what good design looks like or aren't good at refactoring, you aren't going to get the same results as someone who has good design sense and is good at refactoring.
What else did you consider or try?
It's always worth asking what other solutions people have considered. Maybe one of those other solutions is better suited to the problem they are trying to solve. If you tried some other solution and it failed, why did it fail? Is there a pattern?
Need a Coach/Mentor?
Need a coach or mentor to help you or your team adopt new technical practices? We can help. Let's talk. Use the button below to reach out.