Dependency Removal

Learn about dependencies' performance and legacy code testing methods and classes.

Dependencies’ performance

Dependencies are the most challenging issue in legacy testing. Perhaps the greatest virtue of a well-done TDD code is that the tests force individual pieces of the code to be maximally independent of each other.

Without tests, legacy code tends to be highly interdependent. This makes adding tests difficult in several ways. Multiple objects might need to be created to test a single method. It might be hard to limit a test to a true functional unit if that unit is hard to reach or encased in a massive 300-line method. There are ways to have the code we need to ...