Foreword


Frank Westphal

Do you remember your first programming experience? I don't mean the details of the computer or language used; I mean how did you feel?

I remember typing in a few statements from the programming handbook, eager to see the program run. It was amazing to watch how the code sprang to life. Within a few hours I had grown the book example into what seemed an impressive program. I had made additions here and there and after every change I would rerun the program to see how it was doing. In the evening I showed it to my parents. They could tell by the look in my eyes how proud I was.

How things have changed. I enjoy programming more than ever, but now and then I realize that some of the original fun is gone. It's in these moments that I reflect back on my first experience. Why can't programming always be like that?

Actually, it was in one of those moments that I came across the techniques described in this book. Automated tests and continuous refactoring applied in tandem brought me a bit closer to the beginning of my programming career. More often than not since then, I have been able to act like the only thing I have to do is write a few lines of code. But don't be fooled; these techniques are not only applicable to small programs. The larger the scale, the more valuable these techniques became to me.

I was glad when Johannes asked me to write a second foreword for two reasons. First, this book brings together the knowledge that a number of pioneering extreme programmers wish they had when they started applying test-first programming five years ago. If you follow down that route, you will invariably run into testing problems. Even though you are writing your tests first, you will come to halt because you won't see how to test your code. That's natural. Actually, that's the perfect time to reflect. Or to pick up this book and read what Johannes tells us.

Second, I was going to write a book just like this one. However, when Johannes shared with me the first few chapters for review, I could see that it was well written and even covering a large suite of tools to support testing code that is usually hard, if not impossible, to test. I wish I had written this book. Therefore, writing an accompanying foreword is a great pleasure.

There is but one danger in reading this book. You might come away with the impression that it's all about techniques and tools. When in fact, it's all about you.

Test-infected programmers will tell you how the tests changed their relationship to the code. There is a certain fascination in seeing a few hundred tests passing and checking all the innards of your software. Indeed, sometimes you will find yourself pressing the run button a few more times, just for the extra kick that everything's working fine.

Frank Westphal
Independent trainer and consultant




Unit Testing in Java. How Tests Drive the Code
Unit Testing in Java: How Tests Drive the Code (The Morgan Kaufmann Series in Software Engineering and Programming)
ISBN: 1558608680
EAN: 2147483647
Year: 2003
Pages: 144
Authors: Johannes Link

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net