Often, we’ll encounter someone on the internet who will say that they tried something and it didn’t work, and we’re tempted to say “You’re doing it wrong”. Sometimes, we even say it. Recently there was a thread on Twitter about TDD, where someone said they had tried it, and while to my recollection no one actually said they were doing it wrong, a number rather clearly thought it. Ultimately, OP said something about drinking the Kool-Aid, and stomped off.

I felt that they had missed an opportunity, and I still do.

Now, taking TDD as an example, I’ve done it long enough and across enough platforms and problems to be darn sure that it helps me with my programming. And, with more than a half-century of programming under my hat, I’m pretty sure that TDD will be helpful with any kind of programming I do, even the kinds where despite my efforts, I can’t figure out how to do it. And that makes me pretty sure that if you knew TDD as I do, you, too, would probably find it to be of value. I should emphasize “probably” here, because it’s certainly possible that there are kinds of programming where it just doesn’t help anyone, and it’s possible that there are kinds of programmers whom it just can’t help. I don’t believe that you are one of those programmers, and I suspect that your kind of programming isn’t one of those kinds, but it’s possible.

But let’s look at it from the viewpoint of someone who has “tried TDD”, or “tried” whatever the idea is, and found no benefit. It turns out there are hundreds of people who use TDD, use it well, and report real benefits in terms of fewer defects, higher code quality in their own terms of quality, and more steady progress. Hundreds. There are hundreds of us. And most of us are perfectly willing to share everything we do with anyone who’ll listen and, apparently, with those who don’t want to listen.

So if Joe or Jane Programmer feels inclined to say “I tried it and it didn’t work”, and call it a day, that’s a very different kind of claim than the claim of anyone of the “it” people saying “I use it and it works well for me”. When the it-people hear that it didn’t work, they feel quite sure that if they were over there where Joe or Jane is, “it” would work. And my money says they are right. Meanwhile, Joe or Jane, unless they plan to pull the Kool-Aid card out of the pack, is probably not prepared to say “I tried TDD and it doesn’t work for you”.

Now what are the possibilities? Well, they are infinite, but one of them is that Joe/Jane did what they thought was TDD but that any of us TDD proponents, watching them, would have said “no, do it like this”, and shown them something different. In that case, and it is actually pretty likely, Joe/Jane really was “doing it wrong”, or, more accurately, not doing it at all.

Now there are other possibilities. One is that Joe/Jane is working in a place where TDD really cannot work. I don’t know of such a place, and I know a lot of places, but it’s possible. (Yesterday I was thinking about how I could have done TDD in 6502 assembler and how it would have helped, so that one isn’t it.) Another possibility is that Joe/Jane is working in one of the areas where TDD is really hard to do. I find graphical programming to be very difficult to TDD. I can readily look at the screen and see whether the little sprite is moving as I intended, but it’s quite difficult for me to test whether it’s moving as I intended. Check this out:


I have not as yet found a useful way to use TDD with these little bugs. However, and this is an important however, I know enough about TDD, and feel enough about TDD, to be sure that if I could figure out how to do it here, I would proceed more smoothly. If Joe/Jane is working with this kind of app, and they don’t have the experience I have, it’s only natural that they’ll not know how to get the benefit of TDD, since “even I” don’t. And yet … when it comes to the bug creatures up above, I’m darn sure that I’m doing it wrong! So I am justly pretty certain that Joe/Jane is doing it wrong, and pretty certain that they have something to learn. In this case, “even I” have something to learn.

So it seems to me that when Joe/Jane find themselves saying they tried a thing and it didn’t work, and when the folks who support the thing say something that sounds like “you’re doing it wrong”, Joe/Jane would likely be able to get benefit from exploring what they’ve been doing that’s different from what a proponent of the idea would be doing, and, perhaps, to try to do the technique, well, “less wrongly”.

They don’t have to do that. But there’s an asymmetry here. If you say to me “TDD doesn’t work, because I tried it”, you’re talking to someone for whom it does work, someone who has spend over 20 years doing it and trying to figure out how and why it works, and who is quite adept at making it work. It’s like saying “there’s no way you can boil leaves to make a drink” in the middle of London.

But if a successful proponent of some practice says that it does work, and goes so far as to feel strongly that it would work where you are, it might behoove you to look into it further: I think the odds are good that you have more to learn.

Still, we all get to decide where to invest our time, between learning and doing, and we get to decide where to invest our precious learning time, and it’s OK to feel like “well, I’ve given this thing enough time, so I’m going to try some other thing now”. We might be right, we might be wrong, but so long as we’re learning, it’s probably all good.

However, I’d advise that person not to file the idea under Kool-Aid Not To Be Drunk, but instead to put it back into “I don’t know enough to be sure”. That advice, of course, is worth what you paid for it. But I hope you’ll think about it anyway.