I discovered the Cobertura code coverage tool the other day. It is an elegantly simple tool, which produces simple, easy to read reports. My current project is using Apache Maven for its build system, and with the Cobertura Maven plugin provided, I simply added a couple of lines to my project file, and ran a build. From start to finish, I spent less than five minutes to go from nothing to having some really useful code coverage data. The report even includes a code complexity metric to help you identify the more complex areas of code.
I’m impressed by the simplicity of this tool – quite a few years ago, I spent months and months getting code coverage data for a large project (code coverage was relatively new then), and it’s great to see how easy it has become to use this technology. I’ve previously used Emma for code coverage, which is also a great tool, but I think Cobertura has the edge when it comes to reporting.