login
Blurts on the Art of Software Development

Today | RSS | RDF | Atom | Other Tags
Categories : All | All | CI | .NET | General | Humour | Java | Personal | Reviews | Ruby | SW Eng

Aslak Hellesoy revealed a new toy from the CodeHaus crew: Guantanamo.

It's a tool that takes your code and simply deletes any code that isn't being used by your tests. Yes, you heard me correctly. It deletes code that isn't being tested.

Whether this is a good idea or not, I'll let you decide for yourself. Personally, while I am intrigued by the idea, I'll probably wait until others have tried it out...


Hi Lasse, Guantanamo doesn't modify your original sources. It writes a modified copy to a location of your choice. See the 1st question in the (updated) FAQ.
Thanks. I confess that I didn't spot the FAQ down there. I've got a question, though: how is the tool supposed to enforce anything unless the destination is the source folder itself? Wouldn't it make more sense to specify a destination for the backup of the current code instead and let the cleaned-up source code remain in the main project directory?
That's a good idea! Until I add that feature it can be handled quite easily with Ant's copy task. 1) Copy src to backup 2) Run Clover over backup 3) Run Guantanamo and specify dest to be src

That would be cool. But then, a question arises whether the physical size of all the backups should become a problem at some point?

I guess a "diff" would do for backup (with each execution of Guantanamo making a new subdirectory for the latest diff).

Something like this perhaps:

/src/java/com/foo/bar/...
/src/backups
/src/backups/1/com/foo/bar/Whiz.java.diff (this changed)
/src/backups/1/com/foo/bar/Bang.java.diff (me too)
/src/backups/2/com/foo/bar/Bang.java.diff (just 1 this time)
/src/backups/3/com/foo/bar/Bang.java.diff (me again)
...

Of course, this kind of functionality might lead to reinventing CVS and it might very well be better to just stick with the simple solution (write over the previous backup or let the backup directories pile up) until the size of the backups really becomes a problem.



Add a comment

Title
Body
HTML : b, i, blockquote, br, p, pre, a href="", ul, ol, li
Math Quiz 6 + 7 = (Helps stop blog spam)
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

TrackBack to http://radio.javaranch.com/lasse/addTrackBack.action?entry=1096761781000