There are plenty of discussions, articles, and blogs round the subject of code quality. People say – use Test Driven techniques! Exams are a “must have” to begin any refactoring! That’s all awesome, but it’s 2016 and there’s an enormous amount of items and code bases still being produced which were produced ten, 15, or perhaps two decades ago. I know full well that many app developer have legacy code with low test coverage.
While I’d enjoy being always in the leading, or perhaps bleeding, fringe of we’ve got the technology world – engaged with new awesome projects and technologies – regrettably it isn’t always possible and frequently I suffer from old systems. I love to state that whenever you develop on your own, you behave as a creator, mastering new matter. However when you’re focusing on legacy code, you’re a lot more like a surgeon – you are aware how the machine works generally, but who knows without a doubt if the patient can survive your “operation”. And also, since it’s legacy code, there are hardly any current tests that you should depend on. Which means that often one of the steps would be to pay for it with tests. More precisely, not just to supply coverage, but to build up an evaluation coverage strategy.
Coupling and Cyclomatic Complexity: Metrics for Wiser Test Coverage
Forget 100% coverage. Test wiser by determining classes that are more inclined to break.
Essentially, things i required to determine was what parts (classes / packages) from the system we wanted to pay for with tests to begin with, where we wanted unit tests, where integration tests could be more useful etc. You will find of course many different ways to approach this kind of analysis and the one which I’ve used might not be the very best, but app developer type of a computerized approach. Once my approach is implemented, it requires minimal time for you to really perform the analysis itself and, furthermore important, it brings a chuckle into legacy code analysis.