Code coverage
Sunday, 21 July 2013 06:24Code coverage is a good metric that influences the way I write code (TDD does that as well). I've had sleeper thread and its variables coupled with the other parts of the system, and didn't think much of it, but now I'm glad I've looked at code coverage (it was 30% and I decided to improve it), the resulting code is better!
What I did - I've moved sleeper thread defined within the main class into a separate class, and all of the interaction with the thread is made via new class. Makes code cleaner. A side-effect of that is that I no longer have @sleeperMutex - a mutex for the sleeper thread, now it's SleeperNotifier.mutex.
You can use Coveralls, an online service providing a coveralls badge for your project. Though it has ongoing problems as of now.
Badges like this:
What I did - I've moved sleeper thread defined within the main class into a separate class, and all of the interaction with the thread is made via new class. Makes code cleaner. A side-effect of that is that I no longer have @sleeperMutex - a mutex for the sleeper thread, now it's SleeperNotifier.mutex.
You can use Coveralls, an online service providing a coveralls badge for your project. Though it has ongoing problems as of now.
Badges like this:

Tags: