rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780974514024

Pragmatic Unit Testing in C# with NUnit

by
  • ISBN13:

    9780974514024

  • ISBN10:

    0974514020

  • Format: Paperback
  • Copyright: 2004-05-01
  • Publisher: Oreilly & Associates Inc
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $29.95

Summary

All over the world, software teams are using unit testing both to verify their code and as a way of helping them design better code. This book is unique in the way it covers two aspects: showing developers both how to test and helping them determine what to test. This book gives teams straightforward and proven ways to introduce unit testing into their process, resulting in higher quality and fewer bugs.

Author Biography

Andy Hunt and Dave Thomas, partners in The Pragmatic Programmers LLC

Table of Contents

About the Starter Kitp. xi
Prefacep. xiii
Introductionp. 1
Coding With Confidencep. 2
What is Unit Testing?p. 3
Why Should I Bother with Unit Testing?p. 4
What Do I Want to Accomplish?p. 5
How Do I Do Unit Testing?p. 7
Excuses For Not Testingp. 7
Roadmapp. 12
Your First Unit Testsp. 13
Planning Testsp. 14
Testing a Simple Methodp. 15
Running Tests with NUnitp. 16
Running the Examplep. 22
More Testsp. 26
Writing Tests in NUnitp. 27
Structuring Unit Testsp. 27
NUnit Assertsp. 29
NUnit Frameworkp. 31
NUnit Test Selectionp. 33
NUnit Custom Assertsp. 40
NUnit and Exceptionsp. 41
Temporarily Ignoring Testsp. 42
What to Test: The Right-BICEPp. 45
Are the Results Right?p. 46
Boundary Conditionsp. 49
Check Inverse Relationshipsp. 50
Cross-check Using Other Meansp. 50
Force Error Conditionsp. 51
Performance Characteristicsp. 52
Correct Boundary Conditionsp. 55
Conformancep. 56
Orderingp. 57
Rangep. 59
Referencep. 62
Existencep. 63
Cardinalityp. 64
Timep. 66
Try It Yourselfp. 68
Using Mock Objectsp. 73
Simple Stubsp. 74
Mock Objectsp. 75
Formalizing Mock Objectsp. 79
When Not To Mockp. 93
Properties of Good Testsp. 95
Automaticp. 96
Thoroughp. 97
Repeatablep. 99
Independentp. 99
Professionalp. 100
Testing the Testsp. 102
Testing on a Projectp. 105
Where to Put Test Codep. 105
Test Courtesyp. 108
Test Frequencyp. 109
Tests and Legacy Codep. 110
Tests and Reviewsp. 113
Design Issuesp. 117
Designing for Testabilityp. 117
Refactoring for Testingp. 119
Testing the Class Invariantp. 130
Test-Driven Designp. 132
Testing Invalid Parametersp. 134
Gotchasp. 137
As Long As The Code Worksp. 137
"Smoke" Testsp. 137
"Works On My Machine"p. 138
Floating-Point Problemsp. 138
Tests Take Too Longp. 139
Tests Keep Breakingp. 139
Tests Fail on Some Machinesp. 140
Resourcesp. 141
On The Webp. 141
Bibliographyp. 143
Summary: Pragmatic Unit Testingp. 145
Answers to Exercisesp. 147
Table of Contents provided by Rittenhouse. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program