codelord.net

Code, Angular, iOS and more by Aviv Ben-Yosef

Every Coder Should Read TDD By Example

| Comments

I’ve just finished reading Kent Beck’s TDD by Example, and man, what a great reading that was. It was so good, I’m gonna put it in my top 10 books list (accompanied by other classics, like The Pragmatic Programmer and Beck’s probably most known book, Extreme Programming Explained).

I’ve been doing TDD (to an extent, say at least half of my production code) for the past 4 years or so. I was pretty sure I knew what the deal is, and there’s no doubt it’s paying off. I didn’t think there’s a lot more for me to learn. I thought to myself, “how much better can it get?”

Lately, a lot of anti-TDD posts have been popping up on the interweb, which made me ponder a bit more about it. Furthermore, I’ve been exposed to more casts and the likes regarding TDD that made me think I just might be able to squeeze some more fun from my TDD.

That’s when I realized my work place has a copy of the “TDD by Example” book. I’m a sucker for books, and having liked Kent’s writing so far, decided to add it to my book queue, and actually pushed it all the way to the top.

It’s a very light and fun reading. The style is a lot to my taste, and easy to follow (even for someone whose mother tongue isn’t English). But other than the pure writing style, there are just so many gold nuggets in that book. Just about every page has something golden.

Most coders will never have access to such a super-star-coder, that literally changed the way we work. This book is a great way to rub off some of that genius. The simplicity in which design decisions are explained is astonishing. I myself typed along all the code in the book as I read it. Sometimes I tried writing ahead, comparing my results to Kent’s, and every time I was surprised. The cleanliness he shows, the delicate thinking, truly amazing stuff.

Other than that, given all the critisicm that’s been direct at TDD lately, the book explains in great detail what are TDD’s objectives, how it can be used productively, and what should you expect of it.

And now, the really good stuff. The major pay-off I’m seeing currently, is that I found out a few ways to make TDD even better for me. Yes, the bug count is already low, but you can get it even lower. Not just that, picking up a few tips from Beck makes me think about the design of my code better, and simply make you a better coder.

Actually, most of my TDD ”education” is informal. Someone once explained the concept to me, and with time I refined my ways a bit using experience gained and knowledge found on the web. Reading the book on TDD, you find there are names for things you’ve already been doing, but never given much thought to. Moreover, there’s just that thing about naming things – sometimes it simply makes you understand them better.

I think I’ll stop writing any further, before this will make me look like I’m stalking Beck. But really, you should read this book. It’s so good, I’m going to order my own copy simply to have it around. Yes, that good.

You should follow me on twitter here.

Comments