By Roy Osherove
The paintings of Unit checking out, moment Edition publications you step-by-step from writing your first uncomplicated exams to constructing strong try units which are maintainable, readable, and reliable. You'll grasp the foundational principles and speedy circulation to high-value matters like mocks, stubs, and isolation, together with frameworks similar to Moq, FakeItEasy, and Typemock Isolator. You'll discover attempt styles and association, operating with legacy code, or even "untestable" code. alongside the way in which, you'll know about integration trying out and methods and instruments for trying out databases and different technologies.
About this Book
You be aware of you need to be unit checking out, so why aren't you doing it? If you're new to unit checking out, in case you locate unit trying out tedious, or if you're simply no longer getting sufficient payoff for the trouble you set into it, hold reading.
The paintings of Unit trying out, moment Edition publications you step-by-step from writing your first uncomplicated unit checks to development whole try out units which are maintainable, readable, and reliable. You'll circulate quick to extra advanced topics like mocks and stubs, whereas studying to exploit isolation (mocking) frameworks like Moq, FakeItEasy, and Typemock Isolator. You'll discover attempt styles and association, refactor code functions, and easy methods to try "untestable" code. alongside the way in which, you'll find out about integration checking out and methods for checking out with databases.
The examples within the publication use C#, yet will profit someone utilizing a statically typed language comparable to Java or C++.
• Create readable, maintainable, reliable tests
• Fakes, stubs, mock gadgets, and isolation (mocking) frameworks
• easy dependency injection techniques
• Refactoring legacy code
About the Author
Roy Osherove has been coding for over 15 years, and he consults and trains groups around the world at the mild paintings of unit checking out and test-driven improvement. His web publication is at ArtOfUnitTesting.com.
Table of Contents
PART 1: GETTING STARTED
1. the fundamentals of unit testing
2. a primary unit test
PART 2: center TECHNIQUES
3. utilizing stubs to wreck dependencies
4. interplay trying out utilizing mock objects
5. Isolation (mocking) frameworks
6. Digging deeper into isolation frameworks
PART three: THE try CODE
7. attempt hierarchies and organization
8. The pillars of excellent unit tests
PART four: layout AND PROCESS
9. Integrating unit trying out into the organization
10. operating with legacy code
11. layout and testability