September 2024
Intermediate to advanced
743 pages
27h 48m
English
Earlier, I mentioned that individual tests should be able to run in isolation and that they should not have any external dependencies if possible. In real life, however, this isolation cannot always be achieved.
Let’s suppose you want to test a class that is responsible for saving and loading data into a database. How should the test run if the external dependency (the database) is not available while the tests are running?
In the context of TDD, dependencies that are required to execute a particular component are referred to as depended-on components.
Dependencies make it difficult to test a component in isolation for several reasons: First, these dependencies must be available ...
Read now
Unlock full access