External Dependencies and Their Challenges
Learn what dependencies are and why they are a challenge to unit testing.
Introduction
A dependency is a class or object that another class or object relies on. In object-oriented languages, the application code consists of classes where some classes rely on other classes. In this context, relying means that one class is referenced in the other class code. It could be included in any of its method parameters, its method return types, or even in any of its method implementations. This concept is shown below where Class A depends on Class B. In this context, Class B is a dependency.
Get hands-on with 1400+ tech skills courses.