Introducing TDD on Page 169 of Agile Web Development with Rails

Walk before you run. So even in a TDD framework approach like Rails the concept of TDD is only approached and explained on page 169 of Agile Web Development with Rails. And even in a chapter on testing we begin with writing functional database style unit tests, and then functional style tests against the controllers. Finally, on page 169, we’re introduced to test driven development.

I don’t fault the writers of Agile Web Development with Rails for the approach and certainly not Mike Clark who has made important contributions to TDD and is extremely lucid technical writer. I fault the current level of adoption of TDD.

I think the authors made a reasonable assumption that many of their reader base wouldn’t be familiar with TDD. Thus you get through building the example application before you bring up the subject of testing. Since many readers come from backgrounds like PHP it is unlikely they’ve ever touched a unit test framework or tool before.

I still would have enjoyed if they blazed a trail and started out doing TDD. Just gone ahead and explained the approach in chapter one and then used it to build the example application. This would have forced a title change like Test Driven Development with Rails since the only books that cover the TDD approach up front have TDD somewhere in the title like Test Driven Development: A Practical Guide.

Maybe in the next few years we’ll see technical books that aren’t on TDD, that just use TDD in the examples by default.