Suppose you are tasked with adding a testing framework to an existing code base that has very very little unit testing coverage. The code base isn't insanely large yet, however, it does have areas where it's not super clean, or not very OOP or testable.
I've read a couple of good answers:
- Adding unit tests to legacy code
- How to approach unit testing in a large project
- Best Option for Retrospective application of TDD into C# codebase
But the project I'm working on is an Android app, so it's slightly different (given lots more UI components).
I have some questions that all relate to the same issue:
- What's the best way to do go back and put a bunch of tests in place?
- How do I prioritize which parts to test first?
- do I start with areas where it's getting called a lot (and is there a tool for code analysis like this)?
- or do I go back and look at classes which in the past have had the most number of bugs?
- Should I write integration tests first (given this is an Android app and also integration tests may prevent broken unit tests/refactorings) and then work in the unit tests?
Sorry for all the questions, just really looking for a good approach, more specifically geared towards retrospectively testing an Android app.
P.S. I'm curious if people know of good tools they can use for code analysis that can help bring to attention the areas in a code base in which unit testing would be most helpful.