If you work with Eclipse 3.1 or higher and you have a lot of source files in the workspace you have to give Mylar a try. Mylar (named after the material you supposed to look through while watching a solar eclipse) attempts to reduce clutter in the user interface, showing only the relevant files for the task you are working on. It does this by gathering how “interesting” some parts of your code are while you are working. Methods you change, XML files you look at, editors you click on all generate some interest and brings the file into view. Other files that are never used are not interesting and removed from view.
I have been using this plug-in for a few weeks now on a pretty big codebase. It’s great! The filtering works very intuitive (once you find out that you really need to keep holding “Alt” down while clicking to show filtered files). It is also seems pretty robust when you refactor or otherwise change stuff. It’s like a “magic working set”, because it does everything a normal working set does, only without me having to click on a zillion check boxes over and over again: it works pretty much automagically. 🙂
The “interesting” monitoring is, well, interesting. 🙂 The most interesting methods and classes according to Mylar are marked with bold text. The accuracy of this is pretty impressive and it is a great way to keep track of the big picture. It would be interesting to integrate the interest with stuff like code coverage (interesting methods require a higher coverage) or a class diagram generator which could quickly generate a diagram based on a specific task, but that is not possible (yet).
Mylar has integration features for Bugzilla and JIRA but also works stand-alone. The Bugzilla integration allows you to share the task context (the “interesting” filter) of a task in the Bugzilla repository. Imagine this: I could look at some code and spot a bug. I don’t want to fix it myself for some reason and submit a bug in Bugzilla with the “interesting” info automatically gathered by Mylar. Another developer picks up this bug and the context and immediately sees only the files relevant to the problem. He fixes the bug, generating interest in some other files as well, and updates the bug (and the task context). A year and a half later I pick up the bug again because of some regression. I immediately can see what was interesting for this bug before, giving me a great head-start while dealing with the code. It seems a really useful (and effortless) extra. Too bad we don’t use Bugzilla at my current project…