The Bug Story
Brian Harry, a.k.a. the "bug guy," talks at length about bugs in a java.sun.com article by yours truly, Getting the Bugs Out: A Conversation With Bug Fixer Brian Harry. Harry, winner of a Duke's Choice Award, fixed Java SE 6 bugs numbering into the hundreds. His method: he scanned Sun's openly available bug database for intriguing bugs, primarily in the Swing user interface code, printed them out, and put the bug reports on a stack beside his computer. Then, he fixed them one by one, submitting them through the standard JDK Community contribution process.
The interview gives the details:
* He points out that fixing bugs is a great way to understand
how the code works. To James Gosling's bug rule, â€œIf you don't
see the bug where you're looking, perhaps you're looking in the
wrong place.â€ Brian adds: "The place where you find bugs may not
be the right place to put a fix in".
* His basic advice: â€œFirst, always acquire the test thatâ€™s attached
to the bug report... Next, ask yourself if itâ€™s really a bug... Also,
consider writing different solutions... As to writing unit tests, look
at what the patched code interacts with.â€
* Swing tip 1: "Try to be comprehensive in testing the patch with different
LAFs (Look and Feels)."
* Swing tip 2: "Make sure that the test case is running on the EDT
(event dispatch thread). If it isn't, you may not have a bug, but
instead just have bad programming."
* "If youâ€™re doing a Java code fix, don't just look at the current version of
the platform. Iâ€™ve routinely tested out bug tests on 4, 5, and 6 to investigate
when a problem started and stopped. See if you can find why something started."
IMHO, there's lots more of value. Have a look please and tell me what you think...