
Average Reviews:

(More customer reviews)Are you looking to buy xUnit Test Patterns: Refactoring Test Code? Here is the right place to find the great deals. we can offer discounts of up to 90% on xUnit Test Patterns: Refactoring Test Code. Check out the link below:
>> Click Here to See Compare Prices and Get the Best Offers
xUnit Test Patterns: Refactoring Test Code ReviewLet 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 GoF, PoEAA and PoSA 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.xUnit Test Patterns: Refactoring Test Code OverviewAutomated testing is a cornerstone of agiledevelopment. An effective testing strategy will deliver newfunctionality more aggressively, accelerate user feedback, and improvequality. However, for many developers, creating effective automatedtests is a unique and unfamiliar challenge.
xUnit Test Patternsis the definitive guide to writing automated tests using xUnit, themost popular unit testing framework in use today. Agile coach and testautomation expert Gerard Meszaros describes 68 proven patterns formaking tests easier to write, understand, and maintain. He then showsyou how to make them more robust and repeatable--and far morecost-effective.
Loaded with information,this book feels like three books in one. The first part is a detailedtutorial on test automation that covers everything from test strategyto in-depth test coding. The second part, a catalog of 18 frequentlyencountered "test smells," provides trouble-shooting guidelines to helpyou determine the root cause of problems and the most applicablepatterns. The third part contains detailed descriptions of eachpattern, including refactoring instructions illustrated by extensivecode samples in multiple programming languages.
Topics covered include
Writing better tests--and writing them faster
The four phases of automated tests: fixture setup, exercising the system under test, result verification, and fixture teardown
Improving test coverage by isolating software from its environment using Test Stubs and Mock Objects
Designing software for greater testability
Usingtest "smells" (including code smells, behavior smells, and projectsmells) to spot problems and know when and how to eliminate them
Refactoring tests for greater simplicity, robustness, and execution speed
Thisbook will benefit developers, managers, and testers working with anyagile or conventional development process, whether doing test-drivendevelopment or writing the tests last. While the patterns and smellsare especially applicable to all members of the xUnit family, they alsoapply to next-generation behavior-driven development frameworks such asRSpec and JBehave and to other kinds of test automation tools,including recorded test tools and data-driven test tools such as Fitand FitNesse.
Visual Summary of the Pattern Language Foreword Preface Acknowledgments Introduction Refactoring a Test PART I: The Narratives Chapter 1 A Brief Tour Chapter 2 Test Smells Chapter 3 Goals of Test Automation Chapter 4 Philosophy of Test Automation Chapter 5 Principles of Test Automation Chapter 6 Test Automation Strategy Chapter 7 xUnit Basics Chapter 8 Transient Fixture Management Chapter 9 Persistent Fixture Management Chapter 10 Result Verification Chapter 11 Using Test Doubles Chapter 12 Organizing Our Tests Chapter 13 Testing with Databases Chapter 14 A Roadmap to Effective Test Automation PART II: The Test Smells Chapter 15 Code Smells Chapter 16 Behavior Smells Chapter 17 Project Smells PART III: The Patterns Chapter 18 Test Strategy Patterns Chapter 19 xUnit Basics Patterns Chapter 20 Fixture Setup Patterns Chapter 21 Result Verification Patterns Chapter 22 Fixture Teardown Patterns Chapter 23 Test Double Patterns Chapter 24 Test Organization Patterns Chapter 25 Database Patterns Chapter 26 Design-for-Testability Patterns Chapter 27 Value Patterns PART IV: Appendixes Appendix A Test Refactorings Appendix B xUnit Terminology Appendix C xUnit Family Members Appendix D Tools Appendix E Goals and Principles Appendix F Smells, Aliases, and Causes Appendix G Patterns, Aliases, and Variations Glossary References Index
Want to learn more information about xUnit Test Patterns: Refactoring Test Code?
>> Click Here to See All Customer Reviews & Ratings Now