If you are using agile, the idea is to always be doing incremental refactoring and never build up large technical debt. that being said, if you have an agile team that is taking over software that has a decent amount of technical debt, you have to fit it in somewhere.
Do you go and create developer user stories . .for example .
- As a developer, i have 50% test coverage over the business logic module so i have confidence in delivery
- As a developer, the application supports dependency injection so we can swap out concretions and be more agile in the future.
or is there another best practice for cleaning up this code technical debt
Is your application internal or do you have an external customer? If a client is paying for your work on and support of the application, it may be difficult to get them to sign off on cards like the ones you suggest.
Also, with your second card idea, it might be hard to say what ‘Done’ is.
A specific approach to your issue could be Defect Driven Testing – the idea is that when you get a bug report and estimate the card that says to fix it, see what test(s) you can add in at the same time that are similar but increase coverage.
And you don’t specifically ask for technical details about how to get your project under test, but this book is very helpful once you start actually doing it:Working Effectively with Legacy Code