November 17, 2004

Blog has been moved

This post has been moved to blogspot. No further posts will be made to this location.

Coverage while I write code

I was going to rant tonight about code coverage. It's a good thing in that it helps you strengthen your test suite and points out places where you have missed. Now the focus of my rant was going to be that it sucks to have to do all this in an Ant file instead of your IDE like Eclipse. You can run tests, sync with your repository, just about anything in Eclipse, but you can't run a coverage report. Now, this really pisses me off. I don't want to find out how good my coverage is tomorrow after the nightly build. I want it now. I want to be able to see in my java editor what lines of code have not been hit while I am developing the code and making tests.

I thought that this was a big break through because I have not seen this anywhere else. I was looking at EMMA today, and I had not seen it at all. Now, I have looked at other "free" coverage tools before, but I have not seen anything that would do what I wanted. This is a big itch to scratch, so I knew that I was not the only one who wished for something like this. So I looked and I found that jcoverage has a eclipse plugin that seems to do everything that I want. But there's a catch (as always): it's not free. Well, it's free for 30 days...

The other problem is that it's for Eclipse 3, and I am using WSAD 5.1 at work which is based on Eclipse 2.1. If I remember correctly, the plugin arch. has changed from 2.1 to 3 the plugins are not compatible. *sigh*

It'll be good when this sort of thing is more common. Does anyone else have any suggestions for something like this?

Posted by jim at November 17, 2004 08:05 PM
Comments

Yeah. I like for the most part when things are built into the IDE. However IDEs can become a little too big sometimes. When they try to make the IDE too big, it becomes clunky and slow to use. I don't like to wait around for stuff to happen. Sometimes it's really nice just to code in vi.

Posted by: Kibbee at November 18, 2004 07:15 AM

vi. Shut up.

Posted by: Aleks at November 18, 2004 08:47 AM

I know you like VI kibbee... but I still think that vim is a better choice if you are doing something like that.

But if I am doing dev work on my workstation for "big apps", I like having a nice IDE running where I can do things that I consider essential to my workflow like using: source control, with something to show the merges; run tests; have other "views" open at the same time so I can easily move around in the code; and the n other things that something like Eclipse / WSAD or other big editors provide.

Posted by: Jim at November 18, 2004 10:23 AM

I found EMMA a few months ago and it's definitely superior to jcoverage. Not only does it report coverage better but it's also *more free* than jcoverage. It's just a better tool.

I agree that it would be nice if EMMA had an Eclipse plugin. I've seen some coverage plugins (if I recall correctly Clover, a commercial product, has a nice one) that actually highlight uncovered lines IN THE SOURCE CODE EDITOR after you run coverage. How neat is that??

I don't mind that I need Ant to see coverage right now, since Ant is the main way to build my project(s) anyway. I have to check the Ant build every once in a while (and not just how it runs from the Eclipse IDE). Eventually Eclipse might integrate Ant better and make it a first class citizen instead of just an "external build" tool.

Posted by: Ryan at November 18, 2004 10:38 AM

That's makes me think of something else: it would be much nicer if Eclipse could *generate* your build file for you. You have to set up the project etc. in the IDE anyways, so why not have it create the whole thing?

I know for WSAD they extended Ant and put in a bunch of Websphere specific ant calls like "build project", but it would be nice to not be tied to any vendor... just more random thoughts.

Maybe there IS a way to do this. It's nice to make your own Ant script, but it's just more of that boring code that I don't really like... why not have the computer do it?

Posted by: Jim at November 18, 2004 11:16 AM

On the Plugin Development Environment (PDE) side of things in Eclipse 3.0, you can apparently already generate Ant build files for plugins (and thus Rich Client Platform (RCP) too). I've never used this feature but I'm looking further into it...

Posted by: Ryan at November 18, 2004 12:06 PM

I'm not sure about ant scripts, but i know the NetBeans IDE lets you create "JAR Recipes" ha ha, that let you specify the kind of files you want going into your Jar files, so that they can be automatically generated. Definitely a nice feature

Posted by: Kibbee at November 18, 2004 01:35 PM

Interesting read (but I am only like one page into it...):
http://www4.ncsu.edu/~nnagapp/papers/ETX_ACM_Nagappan.pdf

Posted by: Jim at November 18, 2004 01:39 PM

I think that I will check out the EMMA code package for "plugins". It would be cool to help with something that I would consider really "essential".

After taking a look at jcoverage's plugin, I would guess that you'd need to make a new java editor (extend the existing one) as well as add views. I would guess that it's a lot of work. Is anyone else interested?

http://sourceforge.net/tracker/index.php?func=detail&aid=962001&group_id=108932&atid=651900

Posted by: Jim at November 18, 2004 02:28 PM

Yes you would probably extend the existing Java editor so that you have all of the existing Java editor features. There are probably "extension points" for that.

I agree, it would be a lot of work. It would also be ongoing work, since EMMA would be changing underneath you.

Posted by: Ryan at November 18, 2004 02:53 PM

BTW, if you are thinking about doing this, I could give you a hand. I've been learning a lot lately about plugins and such ... but I'm not sure how much time I could give to it.

Posted by: Ryan at November 18, 2004 06:16 PM

I'd be interested in working on this, but like you, I don't know how much time I'd be able to spend on it at all.

It would be a ton of work, but interesting I think. ;-)

Posted by: Jim at November 19, 2004 01:04 PM

EMMA already outputs parse-able XML files of its results, so it might not be that hard...

Posted by: Ryan at November 19, 2004 01:36 PM

Actually, there's a free eclipse plugin that runs junit and jcoverage simultaneously :

http://works.dgic.co.jp/djunit/

Give it a try !

Sebastien

Posted by: Sebastien Brunot at January 27, 2005 04:29 AM

I tried djunit and it is best-of-breed. Really worth to check.

Posted by: Jukka at April 5, 2005 05:03 PM

Do you see any progress in developing Eclipse plugin for Emma?

Posted by: Kwang Yul Seo at December 2, 2005 05:57 PM

I have not really been keeping up on it at all. I think that in sf there is a some checked in code for plug-ins for different IDE's. You'll have to check out their site (sorry).

Posted by: Jim at December 5, 2005 09:18 AM
Due to the proliferation of comment spam, I’ve had to close comments on this entry. If you would like to leave comment, please use one of my recent entries. Thank you and sorry for any inconvience caused.