Preface

 

If you have ever met me, either online or in person, then perhaps you have heard me tell this story.

I was working on a large project at the IBM labs in Toronto. It was in the middle of the year 2000, long after the Y2K craze had ended, and I had spent nearly three months working on a component scheduled for delivery in about one month. The defects were coming in steadily from our testing department, and each fix was just another patch on top of an increasingly disgusting Big Ball of Mud. It was around that time that I read a draft of Extreme Programming Installed, by Ron Jeffries, Ann Anderson, and Chet Hendrickson. With the help of the Internet, this draft led me to www.junit.org, where I learned about this great new tool for testing Java code, called JUnit. Within minutes I knew this would help my cause.

Soon after this, I marched into my manager’s office and announced that there was no way I would be able to patch the existing code to fix the remaining defects in time to deliver. The code had become too complicated to understand. I could not predict how many new defects I would inject while fixing the ones we knew about. We simply were not getting feedback quickly enough. “Send me home,” I told him, “and let me write it all again from scratch. I’ll use JUnit to test it as I go. It will work.” He did. When it came down to it, what choice did he have?