Shop now Shop now Shop now Shop All Amazon Fashion Summer Savings Up to 25% Off Cloud Drive Photos Shop now Learn More Shop now Shop now Shop Fire Shop Kindle Oasis Listen in Prime Shop now Learn more

Customer Reviews

3.1 out of 5 stars7
3.1 out of 5 stars
Format: Hardcover|Change
Price:£38.39+ Free shipping with Amazon Prime
Your rating(Clear)Rate this item

There was a problem filtering reviews right now. Please try again later.

on 4 August 2007
Let me start by stating the obvious: this is a patterns book about the organisation of tests and the workings of the xUnit family of unit testing frameworks. It is _not_ a book about Test Driven Development, although there is material that is pertinent to that. Given that the use of JUnit and TDD is pretty intertwined in the minds of many Java developers, it's worth making this distinction, so you know what sort of book you're getting. Speaking of JUnit, most of the code examples uses Java, although there are some examples in C#, VB and Ruby.

Like Martin Fowler's Patterns of Enterprise Application Architecture, the book is split into two main sections, a narrative that weaves together a lot of the patterns and strategies, and then a catalogue of individual patterns. Between the two, there is a catalogue of 'test smells', similar to the 'code smells' discussed by Fowler in Refactoring, which I would suggest can be read profitably with the narrative section, rather than used as reference material.

There are a lot of patterns here on the mechanics of xUnit, such as 'Test Runner', 'Garbage-Collected Teardown' and 'Named Test Suite'. I was a bit confused about who this material is aimed at -- maybe someone looking at porting xUnit to a new programming language would find it useful, but a lot of it is fairly obvious to anyone who's used an xUnit in a non-trivial fashion (and certainly, if you haven't done so, this book is not a format that makes for a good introduction), or requires playing against xUnit's strengths (e.g. not putting setup and teardown code in their eponymous methods), although there is good reason for doing so in some of the examples provided, such as databases.

Beyond this, there is some good stuff on design-for-testability patterns (e.g. dependency injection versus dependency lookup), value patterns to replace magic constants, custom assertions and custom creation and other utility methods to make the intent of tests more clear. This material, along with the test smells chapter, is where the real value of the book lies. It encourages the application of the same software engineering principles you would apply to your applications (encapsulation, intent-revealing names, Don't Repeat Yourself) as you would to your testing code, something that's surprisingly easy to overlook, at least in my experience.

Also, the material on 'Test Doubles' (mocks, stubs, dummies and their ilk) is extremely useful. It touches on designing with mocks only superficially, but it does provide a helpful taxonomy of what different classes of doubles do. Now, if only everyone would standardise on this nomenclature, it would make life a lot easier. I suggest we brandish this enormous book threateningly at anyone who refuses to toe the line, and that should do the trick.

Because, boy, this book is big (about 900 pages). To be honest, it's too big. I rarely complain about getting too much book for my money, but the likes of the original GoF Design Patterns book, PoEAA and Patterns of Software Architecture Volume 1 manage to come in between 400-500ish pages, so there's no reason XTP couldn't. The advantage is that the patterns in the catalogue, which take up most of the space, stand alone, without requiring too much flicking backwards and forwards between patterns.

The disadvantage is that there is a lot of repetition, so unlike the three design patterns books I mentioned above, which I suspect most people read cover to cover (or maybe that was just me and I'm a complete freak), I would suggest only dipping into the catalogue as necessary. For instance, how much difference is there between the 'Testcase Class per Class', 'Testcase Class per Feature' and the 'Testcase Class per Fixture' patterns? Not a lot, as you might expect.

I definitely liked this book. I would have liked it even more if it came in at about half its size and I would have preferred more emphasis on test and assertion organisation than the mechanics of the xUnit framework, but maybe that would have been a different type of book to the one Gerard Meszaros intended. This is nonetheless a must buy for anyone who cares about unit testing.
0Comment|22 people found this helpful. Was this review helpful to you?YesNoReport abuse
on 11 July 2008
The central problem of this book is that in order to justify the 'Patterns' part of the title the author has to abstract the material almost beyond the point of usefulness. Unless you have already discovered most of the techniques the author describes you will be hard pressed to understand his description of them, which does take away the point of buying the book. There is a lot of valuable material hiding in this book, in particular the taxonomy of Mocks / Test Doubles, but you have to work to find it. At over 800 pages the very size of the book is intimidating. Its hard not to contrast this book unfavorably with Next Generation Java Testing: TestNG and Advanced Concepts which explores the same material in a much more practical, focused and helpful manner.
0Comment|5 people found this helpful. Was this review helpful to you?YesNoReport abuse
on 27 February 2013
I read this book a number of years ago and it was interesting but I have to admit that I did not finish it. I probably read about 2 thirds of it. By the time I was reading the pros & cons of building the test context in the possible different ways for the fourth or fifth time I'm afraid I gave up on it. There is some extremely useful information in here but it is pretty badly buried in unstructured and repetitive writing style. The book's editor appears to have sleep walked through this one.
0Comment|2 people found this helpful. Was this review helpful to you?YesNoReport abuse
on 26 November 2010
About me, 23 years commercial IT, 14 years Java.

I was hoping/expecting a GOF (Design Patterns) for the Test world. There is no comparison to the clarity and structure of GOF.

I tried to read all the book but simply couldn't, gave up on page 76.

There is a reason for its many many pages, the author does not use 1 word where 10 will do. He just whitters on endlessly, making the same point again and again.

There is probably some good stuff in the book, but it is surrounded by so much boring verbiage that I am unwilling to take the mental and time hit.

Sorry to be negative, this book might be just right for you, but maybe check out the book preview ("look inside")
0Comment|6 people found this helpful. Was this review helpful to you?YesNoReport abuse
on 8 May 2010
This is a true reference for unit tests. It really covers unit testing in depth.
Highly recommended.
0Comment|Was this review helpful to you?YesNoReport abuse
on 31 March 2013
The formatting of the code examples in the kindle version are terrible. Completely devalues the book.

The book itself is great, just buy it from iBooks instead or get the hard copy because amazon make it very difficult to get at the actual file once you have purchased it for kindle
0Comment|Was this review helpful to you?YesNoReport abuse
on 3 September 2010
Quizás uno de los libros más densos y meticulosos sobre como testear aplicaciones orientadas a objetos. A mi me parece una obra de arte.
0Comment|Was this review helpful to you?YesNoReport abuse

Sponsored Links

  (What is this?)