Free Downloads
The Art Of Unit Testing: With Examples In C#

Summary The Art of Unit Testing, Second Edition guides you step by step from writing your first simple tests to developing robust test sets that are maintainable, readable, and trustworthy. You'll master the foundational ideas and quickly move to high-value subjects like mocks, stubs, and isolation, including frameworks such as Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, working with legacy code, and even "untestable" code. Along the way, you'll learn about integration testing and techniques and tools for testing databases and other technologies. About this Book You know you should be unit testing, so why aren't you doing it? If you're new to unit testing, if you find unit testing tedious, or if you're just not getting enough payoff for the effort you put into it, keep reading. The Art of Unit Testing, Second Edition guides you step by step from writing your first simple unit tests to building complete test sets that are maintainable, readable, and trustworthy. You'll move quickly to more complicated subjects like mocks and stubs, while learning to use isolation (mocking) frameworks like Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, refactor code applications, and learn how to test "untestable" code. Along the way, you'll learn about integration testing and techniques for testing with databases. The examples in the book use C#, but will benefit anyone using a statically typed language such as Java or C++. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. What's InsideCreate readable, maintainable, trustworthy tests Fakes, stubs, mock objects, and isolation (mocking) frameworks Simple dependency injection techniques Refactoring legacy codeAbout the Author Roy Osherove has been coding for over 15 years, and he consults and trains teams worldwide on the gentle art of unit testing and test-driven development. His blog is at ArtOfUnitTesting.com. Table of ContentsPART 1 GETTING STARTEDThe basics of unit testing A first unit testPART 2 CORE TECHNIQUES Using stubs to break dependenciesInteraction testing using mock objectsIsolation (mocking) frameworksDigging deeper into isolation frameworksPART 3 THE TEST CODE Test hierarchies and organizationThe pillars of good unit testsPART 4 DESIGN AND PROCESS Integrating unit testing into the organizationWorking with legacy code Design and testability

Paperback: 296 pages

Publisher: Manning Publications; 2 edition (December 7, 2013)

Language: English

ISBN-10: 1617290890

ISBN-13: 978-1617290893

Product Dimensions: 7.4 x 0.7 x 9.2 inches

Shipping Weight: 1.1 pounds (View shipping rates and policies)

Average Customer Review: 4.5 out of 5 stars  See all reviews (24 customer reviews)

Best Sellers Rank: #60,687 in Books (See Top 100 in Books) #14 in Books > Computers & Technology > Programming > Languages & Tools > C# #24 in Books > Computers & Technology > Programming > Microsoft Programming > C & C++ Windows Programming #25 in Books > Computers & Technology > Programming > Software Design, Testing & Engineering > Testing

This is an impressive book about the ins-and-outs of unit testing. It managed to break down the big picture of unit testing that all other resources failed to explain.Yes, examples are in C#, but the art of writing good tests goes beyond the language you use. The C# example code is highly readable, and even the usage of specific .NET mocking frameworks is acceptable since it stays light on the more language-specific details (e.g. parameterized tests, InternalsVisibleTo).Here's what I found most useful:* The definition of what a unit test is actually testing (a unit of work, i.e. the sum of actions from a public method call that produces a single noticeable end result)* How to verify that single noticeable end result, and why certain types of verification (return values, public state/behavior change) are preferable to others (testing for interaction between objects)* Using stubs to decouple your code from external dependencies* Refactoring your code to create seams, inject new behavior, and ultimately make your code more testable and change-proof* When it's appropriate to perform interaction testing with mocks* The dangers of overspecifying tests - testing internal implementation vs. external behavior* Detecting when your test is telling you that your production code sucks* Smart ways to test event-related codeI enjoyed the author's balanced perspective on testing. He clearly lays out the pros and cons of each technique. This is important because it serves as a fair reminder that fancy design patterns and clever ways to mock and stub your code can hurt the readability and maintainability of your tests. Even when the author expresses an opinion, he makes it clear that it's only his opinion and not gospel.

The Art of Unit Testing: with examples in C# Edexcel A2 Chemistry Student Unit Guide (New Edition): Unit 5 Transition Metals and Organic Nitrogen Chemistry A Unit of Water, a Unit of Time Hacking: How to Hack Computers, Basic Security and Penetration Testing (Hacking, How to Hack, Hacking for Dummies, Computer Hacking, penetration testing, basic security, arduino, python) Hacking: Basic Security, Penetration Testing and How to Hack (hacking, how to hack, penetration testing, basic security, arduino, python, engineering) Hacking: How to Computer Hack: An Ultimate Beginner's Guide to Hacking (Programming, Penetration Testing, Network Security) (Cyber Hacking with Virus, Malware and Trojan Testing) The Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy Hacking: Beginner's Guide to Computer Hacking, Basic Security, Penetration Testing (Hacking, How to Hack, Penetration Testing, Basic security, Computer Hacking) The Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy (Syngress Basics Series) Delay Fault Testing for VLSI Circuits (Frontiers in Electronic Testing) Daniels and Worthingham's Muscle Testing: Techniques of Manual Examination, 8e (Daniels & Worthington's Muscle Testing (Hislop)) Guide to DNA Testing: How to Identify Ancestors, Confirm Relationships, and Measure Ethnic Ancestry through DNA Testing Bankruptcy and Debtor/Creditor: Examples and Explanations (Examples & Explanations) Examples & Explanation: Criminal Procedure Constitution & Police, Seventh Edition (Examples & Explanations) Examples & Explanations: Legal Writing, Second Edition (Examples and Explanations) Examples and Explanations: Remedies, 2nd Edition (Examples & Explanations) The Art of Self Muscle Testing: For Health, Life and Enlightenment TB 9-1300-279-12, UNIT LEVEL MAINTENANCE INFORMATION ON CARTRIDGE, 40MM: DUMMY, M922A1, 1993 OPERATOR'S AND UNIT MAINTENANCE MANUAL FOR LAUNCHER AND CARTRIDGE, 84 MILLIMETER: M136 (AT4) MC68851 Paged Memory Management Unit User's Manual