Test automation has turned unit testing into a standard practice in software development. Too often, unit testing doesn’t deliver the project quality and feedback speed developers expect. The right unit test suite gives great outcomes and is vital to delivering quality software; the wrong tests can break your code, drag on with bugs and upkeep costs, and take more time to fix than they save. Ensuring your testing suite maximizes its potential isn’t about writing more tests — it’s about implementing the best practices that give real value and minimise upkeep costs.
If you’re an experienced programmer, you most likely already get at the intuitive level some of the ideas taught in this book. This book will help you articulate why the techniques and best practices you've been using all along are so helpful. And don't underestimate this skill: the ability to clearly communicate your ideas to colleagues is priceless. You don’t need to be an expert in unit testing, though you’ll get more out of this book if you have some unit testing skills. If you don't have much experience with unit testing techniques and best practices, you’ll learn a lot. In addition to the frame of reference, which you can use to analyze any test in a test suite, the book teaches:
• How to refactor the test suite along with the production code it covers.
• How to apply different styles of unit testing.
• Using integration tests to verify the behavior of the system as a whole.
• Identifying and avoiding anti-patterns in unit tests.
In addition to unit tests, this book covers the entire topic of automated testing, so you’ll also learn about integration and end-to-end tests.
Unit Testing Principles, Practices and Patterns is a practical guide to modern unit testing best practices. Microsoft MVP Vladimir Khorikov takes you hands-on with examples of the ideal unit test and unit testing practices, building your skills step by step on a solid foundation. You’ll explore how to design and write tests that check the right aspects of your applications, develop effective and maintainable test suites, automate your testing process safely, and learn how to write code that’s best suited for testing. When you are done, you will have a best practice testing suite that ensures your projects are easier to maintain, easier to scale, and easier to adapt to changing needs.
• A universal frame of reference by which to assess any unit test
• Common anti-patterns to identify and avoid
• Guidelines on how to refactor a test suite along with the production code it covers
• Using integration tests to verify the behavior of the system as a whole
About the reader:
For readers who know the basics of unit testing and want to improve their techniques to get the best return on their efforts. Examples are in C# but apply in any language.