Daniel Irvine on building software
TDD for the web is both hard and easy
5 August 2014
Test-driven development for the web is both hard and easy.
It’s hard because the mental model of a website we hold is hazy. There are numerous moving parts, each vastly different from the others. Take for example the web browsers (plural--since there’s not just one), which act as the runtime hosts for our code. A web browser is a mature and complex piece of software that evolves at a blistering rate. Competing web browsers have subtle differences which developers must be aware of and guard against. In contrast, test frameworks like Teaspoon are immature and suffer teething problems--not surprising, since the idea of having automated tests for web front ends is still seen as revolutionary.
Our brains struggle to understand this bazaar-style architecture. We panic when we think about all the dozens of ways it could go wrong.