Preface

 

The story behind this book is personal. A few years ago, I came to the realization that what I had done in my professional life until then was not quite up to my own expectations. Though not dramatic enough to qualify as a midlife crisis, this realization got me thinking in new ways.

I was doing web programming in PHP at the time. I was in an isolated position in the company I was working for, so I decided to put my own work under the microscope. I asked myself, “How can I boost myself to a higher level of performance?” One idea that occurred to me was to review my own work at the end of every day. What did I do that was most successful? How could I do more of that? What was less successful? How could I do less of that?

The task that stood out like a sore thumb was debugging. It was obviously taking up a major part of my time, and anything that would make debugging more efficient or diminish the need for it should make me more productive. I looked around for ways to catch bugs earlier. I tried defensive programming, with limited success. Then I stumbled across agile processes and test-driven development, Extreme Programming, and refactoring. It seemed like what my colleagues and I had been doing for some years, only better. I took up the methodology first in my own, individual work. At this point, there was little recognition of it in the PHP community. I was early; I worked test-first with the very first alpha version of PHPUnit that appeared in March 2002.