How do companies clean up test cases? If I have 5000 tests in my library and 1000 of them are deprecated because we have cleaned up the code associated originally, how do we ensure that the tests are removed?
Some of the factors that can affect how aggressively automated test cases are deprecated include:
- Mission-critical - regression tests that cover essential functionality of an application are much less likely to be retired than regression tests covering optional functions.
- Frequently used - regression tests of frequently used features are less likely to be retired than regression tests of rarely used features.
- Fragile - regression tests that cover areas of the application known to be prone to breakage are less likely to be retired than tests of areas known to be stable.
- Retired/deprecated functionality - regression tests that cover deprecated or retired functionality get removed as soon as is feasible.
- Regulated - tests used to verify or validate regulated functionality will not be retired unless the regulation involved changes.
Ultimately, it depends on the business and the team: if the tests continue to pass and don't overload available resources, many organizations are likely to have no issues with retaining them. Tests that fail because functionality has changed will be either rewritten or replaced so that they cover current functionality.
What matters is that the method you are using works for you and your team.