Pragmatic Unit Testing in C# with NUnit
Home > Computing and Information Technology > Computer programming / software engineering > Programming and scripting languages: general > Pragmatic Unit Testing in C# with NUnit
Pragmatic Unit Testing in C# with NUnit

Pragmatic Unit Testing in C# with NUnit

|
     0     
5
4
3
2
1




Out of Stock


Notify me when this book is in stock
About the Book

Learn how to improve your C# coding skills using unit testing. Despite it's name, unit testing is really a coding technique, not a testing technique. Unit testing is done by programmers, for programmers. It's primarily for our benefit: we get improved confidence in our code, better ability to make deadlines, less time spent in the debugger, and less time beating on the code to make it work correctly. This book shows how to write tests, but more importantly, it goes where other books fear to tread and gives you concrete advice and examples of what to test--the common things that go wrong in all of our programs. Discover the tricky hiding places where bugs breed, and how to catch them using the freely available NUnit framework. It's easy to learn how to think of all the things in your code that are likely to break. We'll show you how with helpful mnemonics, summarized in a handy tip sheet. With this book you will: write better code, and take less time to write it; discover the tricky places where bugs breed; learn how to think of all the things that could go wrong; test individual pieces of code without having to include the whole project; and test effectively with the whole team. We'll also cover how to use Mock Objects for testing, how to write high quality test code, and how to use unit testing to improve your design skills. We'll show you frequent "gotchas" - along with the fixes - to save you time when problems come up. But the best part is that you don't need a sweeping mandate to change your whole team or your whole company. You don't need to adopt Extreme Programming, or Test-Driven Development, or change your development process in order to reap the proven benefits of unit testing. You can start unit testing, the pragmatic way, right away.

Table of Contents:
About the Starter Kit Preface 1 Introduction 1.1 Coding With Confidence 1.2 What is Unit Testing? 1.3 Why Should I Bother with Unit Testing? 1.4 What Do I Want to Accomplish? 1.5 How Do I Do Unit Testing? 1.6 Excuses For Not Testing 1.7 Roadmap 2 Your First Unit Tests 2.1 Planning Tests 2.2 Testing a Simple Method 2.3 Running Tests with NUnit 2.4 Running the Example 2.5 More Tests 3 Writing Tests in NUnit 3.1 Structuring Unit Tests 3.2 NUnit Asserts 3.3 NUnit Framework 3.4 NUnit Test Selection 3.5 NUnit Custom Asserts 3.6 NUnit and Exceptions 3.7 Temporarily Ignoring Tests 4 What to Test: The Right-BICEP 4.1 Are the Results Right? 4.2 Boundary Conditions 4.3 Check Inverse Relationships 4.4 Cross-check Using Other Means 4.5 Force Error Conditions 4.6 Performance Characteristics 5 CORRECT Boundary Conditions 5.1 Conformance 5.2 Ordering 5.3 Range 5.4 Reference 5.5 Existence 5.6 Cardinality 5.7 Time 5.8 Try It Yourself 6 Using Mock Objects 6.1 Simple Stubs 6.2 Mock Objects 6.3 Formalizing Mock Objects 6.4 When Not To Mock 7 Properties of Good Tests 7.1 Automatic 7.2 Thorough 7.3 Repeatable 7.4 Independent 7.5 Professional 7.6 Testing the Tests 8 Testing on a Project 8.1 Where to Put Test Code 8.2 Test Courtesy 8.3 Test Frequency 8.4 Tests and Legacy Code 8.5 Tests and Reviews. 9 Design Issues 9.1 Designing for Testability 9.2 Refactoring for Testing 9.3 Testing the Class Invariant 9.4 Test-Driven Design 9.5 Testing Invalid Parameters A Gotchas A.1 As Long As The Code Works A.2 "Smoke" Tests A.3 "Works On My Machine" A.4 Floating-Point Problems A.5 Tests Take Too Long A.6 Tests Keep Breaking A.7 Tests Fail on Some Machines B Resources B.1 On The Web B.2 Bibliography C Summary: Pragmatic Unit Testing D Answers to Exercises


Best Sellers


Product Details
  • ISBN-13: 9780974514024
  • Publisher: The Pragmatic Programmers
  • Publisher Imprint: The Pragmatic Programmers
  • Height: 226 mm
  • Returnable: N
  • Width: 194 mm
  • ISBN-10: 0974514020
  • Publisher Date: 11 May 2004
  • Binding: Paperback
  • Language: English
  • Weight: 368 gr


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Pragmatic Unit Testing in C# with NUnit
The Pragmatic Programmers -
Pragmatic Unit Testing in C# with NUnit
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Pragmatic Unit Testing in C# with NUnit

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!