Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] Want to know what your unit test are really doing? Try this...


For a little while I was looking for a good line level code coverage tool. It had to integrate seamlessly with the JDT and JUnit as well as do its work without an instrumentation pass. A few months back when I last looked TPTP www.eclipse.org/tptp did provide a method level code coverage feature. While better than nothing, it was not really precise enough for methods with more than one code path. So I decided to wait.

Recently I had time to check again and voila: TPTP provides a decent line level code coverage feature as a technical preview. I found that the feature is very lightweight and easy to install. The level of integration with the JDT is pretty good.

To get the LLC feature go here: http://www.eclipse.org/downloads/download.php?file=/tptp/4.2.1/TPTP-4.2.1-200609071820D/org.eclipse.tptp.platform.coverage.core-TPTP-4.2.1.zip. In a strange but good way it seems it does not require the entire TPTP platform. Also, spend a few minutes and watch this: http://www.eclipse.org/tptp/home/documents/tutorials/viewlets/v4.2/LLC/LineCoverage_viewlet_swf.html

Here's a sample report produced on the component I'm primarily working on - the WSDL EMF model. As my component lead said when he saw it, it seems we've got some holes here and there... :-)



Here's how the decorated package explorer looks like (you can turn off these decorations):



And here's a sample annotated Java editor (the various annotations can be turned off)



I hope you find this as helpful as I did.

Regards,
Valentin

Back to the top