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?
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.
ReplyDeletevi. Shut up.
ReplyDeleteI know you like VI kibbee... but I still think that vim is a better choice if you are doing something like that.
ReplyDeleteBut 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.
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.
ReplyDeleteI 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.
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?
ReplyDeleteI 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?
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...
ReplyDeleteI'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
ReplyDeleteInteresting read (but I am only like one page into it...):
ReplyDeletehttp://www4.ncsu.edu/~nnagapp/papers/ETX_ACM_Nagappan.pdf
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".
ReplyDeleteAfter 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
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.
ReplyDeleteI agree, it would be a lot of work. It would also be ongoing work, since EMMA would be changing underneath you.
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.
ReplyDeleteI'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.
ReplyDeleteIt would be a ton of work, but interesting I think. ;-)
EMMA already outputs parse-able XML files of its results, so it might not be that hard...
ReplyDeleteActually, there's a free eclipse plugin that runs junit and jcoverage simultaneously :
ReplyDeletehttp://works.dgic.co.jp/djunit/
Give it a try !
Sebastien
I tried djunit and it is best-of-breed. Really worth to check.
ReplyDeleteDo you see any progress in developing Eclipse plugin for Emma?
ReplyDeleteI 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).
ReplyDelete