February 2018
Intermediate to advanced
406 pages
9h 52m
English
Dependencies are the most challenging issue in legacy testing. Perhaps the greatest virtue of 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 you need to test be separate enough to enable the tests you must write.
Perhaps the easiest way to keep your new code from being dependent on legacy code is to ...