The Art of Unit Testing
eBook - ePub

The Art of Unit Testing

with examples in C#

  1. 292 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

The Art of Unit Testing

with examples in C#

About this book

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 Inside

  • Create readable, maintainable, trustworthy tests
  • Fakes, stubs, mock objects, and isolation (mocking) frameworks
  • Simple dependency injection techniques
  • Refactoring legacy code


About 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 Contents
PART 1 GETTING STARTED

  • The basics of unit testing
  • A first unit test
  • PART 2 CORE TECHNIQUES
  • Using stubs to break dependencies
  • Interaction testing using mock objects
  • Isolation (mocking) frameworks
  • Digging deeper into isolation frameworks
  • PART 3 THE TEST CODE
  • Test hierarchies and organization
  • The pillars of good unit tests
  • PART 4 DESIGN AND PROCESS
  • Integrating unit testing into the organization
  • Working with legacy code
  • Design and testability

Trusted by 375,005 students

Access to over 1.5 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Publisher
Manning
Year
2013
Print ISBN
9781617290893
eBook ISBN
9781638353058

Table of contents

  1. Copyright
  2. Brief Table of Contents
  3. Table of Contents
  4. Foreword to the Second Edition
  5. Foreword to the First Edition
  6. Preface
  7. Acknowledgments
  8. About this Book
  9. About the Cover Illustration
  10. Part 1. Getting started
  11. Part 2. Core techniques
  12. Part 3. The test code
  13. Part 4. Design and process
  14. Appendix. Tools and frameworks
  15. Index
  16. List of Figures
  17. List of Tables
  18. List of Listings

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.5M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1.5 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access The Art of Unit Testing by Roy Osherove in PDF and/or ePUB format, as well as other popular books in Informatik & Programmierung in C#. We have over 1.5 million books available in our catalogue for you to explore.