Preface to the First Edition

To date tests are still the best solution mankind has found to deliver working software. This book is the sum of four years of research and practice in the testing field. The practice comes from my IT consulting background, first at Octo Technology and then at Pivolis; the research comes from my involvement with open source development at night and on weekends.

Since my early programming days in 1982, I’ve been interested in writing tools to help developers write better code and develop more quickly. This interest has led me into domains such as software mentoring and quality improvement. These days, I’m setting up continuous-build platforms and working on development best practices, both of which require strong suites of tests. The closer these tests are to the coding activity, the faster you get feedback on your code—hence my interest in unit testing, which is so close to coding that it’s now as much a part of development as the code that’s being written.

This background led to my involvement in open source projects related to software quality:

JUnit in Action is the logical conclusion to this involvement.

Nobody wants to write sloppy code. We all want to write code that works—code that we can be proud of. But we’re often distracted from our good intentions. How often have you heard this: “We wanted to write tests, but we were under pressure and didn’t have enough time to do it”; or, “We started writing unit tests, but after two weeks our momentum dropped, and over time we stopped writing them.”

This book will give you the tools and techniques you need to write quality code. It demonstrates hands-on how to use the tools in an effective way, avoiding common pitfalls. It will empower you to write code that works. It will help you introduce unit testing in your day-to-day development activity and develop a rhythm for writing robust code.

Most of all, this book will show you how to control the entropy of your software instead of being controlled by it. I’m reminded of some verses from the Latin writer Lucretius, who, in 94 –55 BC wrote in his On the Nature of Things (I’ll spare you the original Latin text):

It is lovely to gaze out at the churning sea from the safety of the shore when someone else is out there fighting the waves, not because you’re enjoying their troubles, but because you yourself are being spared.

This is exactly the feeling you’ll experience when you know you’re armed with a good suite of tests. You’ll see others struggling, and you’ll be thankful that you have tests to prevent anyone (including yourself) from wreaking havoc in your application.

VINCENT MASSOL

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.110.155