www.BrettDaniel.com

Eclipse JUnit Music Box

I wrote an Eclipse plugin that turns Eclipse's built-in JUnit runner into a music box. The following video demonstrates the plugin:

Each test class is assigned one of seven chords in the key of C major. The assignment is deterministic, so a particular sequence of tests will play the same "song". Passing test methods play a pleasing arpeggio, while failing tests play an ugly dissonant chord. The time each test method takes to execute determines the speed of the music. If more than one test class runs, then the music resolves to the tonic at the end of the session.

Here is the plugin (including source code). To try it out, simply save the .jar file in Eclipse's plugins directory and restart Eclipse. I tested it in Eclipse version 3.4.0 running on JDK 6. The plugin requires MIDI, so if you do not hear any sound when running JUnit tests, your computer probably lacks an appropriate MIDI device or it is configured incorrectly. Try running this simple class to test your MIDI setup.

I am not the first to think of making JUnit play music. There is a Musical JUnit project on SourceForge, but it has not been updated in three years. It also uses prewritten samples, while mine produces sound programmatically.

Update Thursday, February 25, 2010

I posted the code on BitBucket.

Cancer Update: Hair Edition

Chemotherapy causes hair loss by damaging fast-growing cells in the hair follicles. I lost the hair on my head very quickly after my first treatment back in September. My eyebrows and eyelashes followed midwinter. I joked with friends that I was constantly surprised throughout the day, but they would never know since I lacked eyebrows.

Guide to facial expressions on a face without eyebrows.

Some of the hair has returned since switching to a new set of drugs. Still no eyebrows, though, and the hair on my head is thin and patchy like a poorly-watered lawn. There is also a strange dark blotch of "normal" hair on the back of my head that a colleague said looked like the start of a Hare Krishna topknot.

Hair splotch

Weird, but no big deal. Baldness is a normal side-effect of chemotherapy, and I will likely keep my head shaved until I finish treatments.

Crunch Time

Every profession has deadlines, but the culture of crunch time is particularly prevalent in high-tech fields. The tendency toward late nights and last-minute sprints is one of the few things I dislike about computer science and programming. Nearly-perfect software takes time.

Even so, I have found myself buried in crunch time more often than I like to admit. Over the last month, for example, I spent many 10-plus-hour days writing my latest research paper. I was curious how this stretch of time compared to previous research papers'. Now that the deadline has passed, I can satisfy my curiosity by examining the papers' revision control system. It contains every edit made to each of the last five papers I was involved in.

The following chart shows how the papers grew as their deadlines approached.

Research paper growth as a deadline approaches

Vertical jumps represent lines added or removed from a paper. Horizontal plateaus represent the length of time between changes. Crunch time is obvious in this diagram: around ten days before a deadline, a paper's growth rate increases, and the length of time between edits decreases. For example, the last ten days of the most recent paper, shown in red, contained about 75% of the paper's total edits.

This number, the fraction of edits in the final ten days, creates an interesting "crunchiness" metric. The following chart shows the metric for each of the papers.

Fraction of edits in the final ten days before a deadline

This chart echoes how I would qualitatively rank the papers: "Automated Testing of Refactoring Engines" was easily the most crunchy and "Predicting Effectiveness of Automatic Testing Tools" was the least.

More research is needed to determine if crunchiness correlates with paper acceptance.

Wanted: eA Ligature

Do any typographers read this weblog? If so, I have a request: I would like an eA ligature for a paper I am writing in LaTeX. Something like the following but in the standard Computer Modern typeface. An italicized version would also be nice.

eA ligature

I need it for a word with InnerCaps that appears throughout the paper. As it is, the separate letters appear too far apart, and the tails do not line up nicely when I play with the kerning. LaTeX already has æ and Æ; why not the other six combinations? Or every two-letter combination? There are only (26 × 2)2 = 2,704 of them.

Related