Now suppose my initial test no longer covers the extracted code, because the source code now disables its dependencies, as is the case for Unit test.
Often arising dependencies depend on what needs to be done, but not always, and I would not say that it is "right for the unit test" to make fun of all the dependencies.
In the TDD refactoring phase, you must make a difference in the production code, which does not affect the passing of the tests. And you should not change tests at the same time.
You may want to modify your tests later so that the extracted code is tested independently of the source code and mocked the source tests.
source
share