What's the best practice for deprecating a set of related methods?

Viewed 874

I want to deprecate a method. It calls some helper methods which are now obsolete, and is exercised in several places by tests which are also now obsolete. In other words, I have a set of related methods / classes / tests across the project which are all part of the same deprecation and should be removed at the same time.

When I come back later and try to delete the top-level method, how can I be sure I've found all the related stuff? Obviously, I can just keep my own notes somewhere that tell me what related methods to remove. Failing that, I can 1) delete the endpoint, 2) look for failing tests and remove them, and 3) rely on the IDE to find methods that are now unused and remove those too, but that seems error-prone to me.

Is there a standard practice for deprecating a set of related methods / classes / tests to ensure they will all be removed simultaneously at a later date?

3 Answers
Related