So I started wondering if Test-Driven Development was a worthwhile practice, since our company had not adopted it yet, but we were thinking about doing so in the future. I started searching in google, when I came across the “is TTD dead?” video and decided to watch it. It’s fascinating stuff.
The creator of Ruby on Rails, DAVID HEINEMEIER HANSSON, wrote a blog entry “TDD is Dead, Long Live Testing.” This blog caused controversy and the people on opposite sides of the discussion, the originator of TDD, Kent Beck and noted author Martin Fowler, and David Henemeier Hansson, came together to talk about it. If you haven’t checked out the video, I highly recommend it.
Even though I don’t have a lot of personal experience with TDD, I really connected with David’s points. Programmers often take what starts out as a good practice and turn it into self-serving religious dogma, a point David makes in his article. It’s so true. In our rush to adopt best practices, we end up with a rigidity that doesn’t allow for asking the pertinent questions.
I’ve always been a loose cannon, loyal to what I think is the truth, as oppossed to what I think is expected of me. I felt that TDD added an unnecessary layer of complexity, especially when you are dealing with frameworks like Yii 2. The framework carries so much of the burden, that designing tests that take into account the full framework becomes cumbersome. So the workaround are mocks, which as David pointed out, are likely to cause problems and really fail to achieve the promise of a fully tested implementaiton that can be tested in seconds.
David doesn’t suggest abandoning testing, just the TDD method of writing the test first. I really think he’s on to something. I’ve never been a fan of what I can best describe as a speedbump to creativity. Writing the test first strikes me as a speed bump. You can force yourself to slow down for the bump, but it really impacts momentum.
The funny thing is though, is that I did a quick meeting with our 4 progrmamers, and each one of them expressed interest in us adopting TDD, the exact opposite of what I expected. Most felt it would save time over the life of a project. Codeception was brought up and that is integrated into Yii 2, our framework of choice.
I remember the old television commercials where 3 out 4 dentists recommend something, and you certainly did it, otherwise you could expect one heck of a toothache. Here I have 4 out 4 programmers in agreement, fairly compelling. So we decided to review our options and revist before we start our next project. I have a feeling we will adopt a solution that incorporates Codeception, even if we don’t write the tests first.
My intuition also tells me that an influential person like David Heinemeir Hansson coming out against TDD probably marks the end of that trend. It will be interesting to see where this discussion goes. In the meantime, take the poll at the top and let us know what you think of the future of TDD. Thanks!