Preface

 

On the night of June 10, 2009, I found an email in my inbox from Christina Rudloff from Manning, asking me if I knew anyone who might be a good candidate to write a Java edition of Roy Osherove’s book, The Art of Unit Testing in .NET. I told her I’d do it.

That was a long time ago and what you’re looking at right now has very little in common with Roy’s book. Let me explain.

The project started as a straight translation from .NET to Java, only rewriting where necessary to match the changing technology platform, its tooling, and its audience. I finished the first chapter, the second chapter, the third chapter, and suddenly I found myself rewriting not just short passages but entire chapters. The tone of voice wasn’t mine; sometimes I would disagree or have preferences incompatible with Roy’s, and sometimes I simply felt strongly about saying something, setting things straight, and putting a stake into the ground.

Eventually, I decided to start over.

It was clear that we were not in a translation project. This was a brand new title of its own—a book that helps a Java programmer improve his tests, gaining a deeper insight into what makes a test good and what kind of pitfalls to look out for. You can still see Roy’s thinking in many ways in this book. For instance, the chapter titles of the catalog in part 2 I’ve blatantly borrowed from Roy and chapter 7 was written largely thanks to Roy’s counterpart in The Art of Unit Testing in .NET.