Enhancing Testability Through Isolation
About the Course
Promoting testability of your software requires isolation of the System Under Test (SUT) to ensure that each test verifies only the intended condition. To achieve this isolation, you must replace internal and external dependencies with objects that serve as substitutes for these production resources.
This course examines the five different types of test doubles that serve as substitutes, explains their use cases, and shows how to inject them as proxies for these dependencies. Polymorphic Dispatch is reviewed as a method of providing isolation during testing while the Dependency Inversion Principle is explained as a way of making polymorphic calls to those production resources.
Utilizing test doubles fosters defect localization and supports repeatable tests, while minimizing overlap and dependencies between tests. Paired with good design principles, test doubles will make your software easy to test, while helping to track down defects quicker than ever.