TDD as a Pre-requesite for Professionalism
Ignaz Semmelweis in 1847 achieved a six-fold drop in his maternity ward’s mortality rate by simply having doctors wash their hands before examining pregnant women. Semmelwies tried to convince his peers to adopt hand-washing as a discipline. They resisted for over 60 years. The reasons for their resistance sounded much like the articles we’ve seen of late claiming that TDD is dead.
Doctors at that time did not wash their hands. They saw no reason to wash their hands. To them, cleanliness and disease were utterly unrelated. To us, in the 21st century, that’s difficult to believe; but just 167 years ago it was just as hard to believe that washing hands was anything but a fools errand.
Were these doctors unprofessional? Of course not! They were doing the best they could with what they knew. Their distrust of Semmelweis seems unreasonable now, because Semmelweis was right. But it’s hard to fault those doctors for not following every fool fad that came along. It took time, and unfortunately it took a lot of misery and death, before hand-washing was adopted as a medical discipline.
If any doctors today failed to wash their hands, we’d call them unprofessional and drum them out of the profession. Such actions would be intolerable. But back then, those doctors who rejected Semmelweis where honorable, respectable, and professional. They weren’t evil. They weren’t even stupid. Their only fault was that they were human.
Something Must Change
Software casualties are mounting at an accelerating rate. Our society as a whole is becoming more and more dependent on the software we produce; and the failures grow in significance with every passing year.
Something must change … or we are headed for a catastrophe of existential magnitude.
If I am right… If TDD is as significant to software as hand-washing was to medicine and is instrumental in pulling us back from the brink of that looming catastrophe, then Kent Beck will be hailed a hero, and TDD will carry the full weight of professionalism. After that, those who refuse to practice TDD will be excused from the ranks of professional programmers. It would not surprise me if, one day, TDD had the force of law behind it.
Testing in Node.js: “A test driven development cycle simplifies the thought process of writing code, makes it easier, and quicker in the long run. But just writing tests is not enough by itself, knowing the kinds of tests to write and how to structure code to conform to this pattern is what it’s all about. In this article we will take a look at building a small app in Node.js following a TDD pattern. This article uses Mocha and Chari.