Junit is awesome and makes it possible to change DBvolution without endangering existing functionality. However I didn't start the project with enough knowledge of Junit or discipline to cover all of the functionality. So there might be lots of code that might not be tested. Subsequently I started getting better at writing tests, sometimes even doing Test Driven Development. Backfilling in the dark is a haphazard process though and daunting.
Obviously I am not the first person to face this issue. A bit of research discovered the concept of Code Coverage. Unfortunately the first tools I used resisted my efforts to use them and actual work got in the way.
Fortunately a current project had a special day set aside to frantic work on setting up multiple testing frameworks.By the end of the day we'd successfully investigated and set up 2 new frameworks, and I had a little spare time. Enthusiastic about testing I revisited code coverage and discovered EMMA.
EMMA is a code coverage framework that works with maven and unit tests, generating a report on the coverage at class, method, block, and line levels. It produces colour coded reports on the individual classes so you can see which lines are not covered by tests. That helps you work out how to write new test to complete the coverage.
I'm delighted to say that, despite having a haphazard start and several databases that are officially supported, DBvolution has still got 68% class coverage, 54% method coverage, 51% block coverage, and 55% line coverage. I think that impressive.
Obviously there is lots of scope for more tests but any particular line is more likely than not to be tested. With tests being added regular for new functionality and to clarify existing functions this can only get better.
So don't worry, Emma has got you covered and she making things better too :)
Anonymous