04.23.07

idea: source code coloring based on profiling

Posted in Hacking, programmer productivity, Technology trends at 1:31 pm by ducky

I recently watched some people debugging, and it seemed like a much harder task than it should have been. It seems like inside an IDE, you ought to be able to click START LOGGING, fiddle some with the program of interest, click STOP LOGGING, and have it capture information about how many times each method was hit.

Then, to communicate that information to the programmer, change the presentation of the source code. If a routine was never executed, don’t show it in the source (or color it white). If none of a class’ methods or fields were executed, don’t show that class/file. If a method was called over and over again, make it black. If it was hit once, make it grey.

It doesn’t need to be color. You could make frequent classes/methods bigger and infrequent ones smaller. If the classes/methods that were never changed were just not displayed — not visible in the Package Explorer in Eclipse, for example — that would be a big help.

Comments »

  1. knapjack said,

    April 24, 2007 at 6:33 pm

    Shouldn’t this be pretty easy to tinker with in an environment like Squeak?

  2. ducky said,

    April 24, 2007 at 8:42 pm

    Yeah, I’ve actually been toying with the idea of doing something in Eclipse. My lab has a lot of experience with Eclipse, so I think it would actually be r-e-l-a-t-i-v-e-l-y easy to pull this off. Now, can I justify the time to myself and my supervisor? I’m already siphoning off some attention units to work on a hobby project on the side…

  3. Best Webfoot Forward » idea: debugging tool said,

    May 3, 2007 at 10:38 am

    […] As a followup to my previous post about debugging tools, I realized that you could pretty easily add a feature to an IDE that could automatically and very quickly find where hangs were taking place for a certain class of hangs. […]

  4. Best Webfoot Forward » software tools: EclEmma said,

    May 21, 2007 at 8:09 pm

    […] In a previous post, I said that I thought it would be handy to have your source editor color code based on which lines were executed in the prior execution of the code.  I mused about merging Eclipse with a profiler in that post, but later realized that I could also use a code completion tool… and then discovered someone had already done it.  EclEmma is a fine code coverage tool that is nicely integrated with Eclipse and does exactly what I want. […]

  5. Best Webfoot Forward » Wish list: wonder-code-coverage tool said,

    May 6, 2008 at 4:06 pm

    […] previous posts, I talked about wanting a code-coverage tool to use while debugging, and how EclEmma did most of what I wanted. After my user study, where I dissected in detail how […]

Leave a Comment

Powered by WP Hashcash

Comment moderation is enabled. Your comment may take some time to appear.