Elliott C. Back: Internet & Technology

Fixing Bugs with Genetic Algorithms

Posted in Code, Errors by Elliott Back on September 28th, 2009.

Wow, check out this preprint: A Genetic Programming Approach to Automated Software Repair. Essentially, the researchers used a suit of positive and negative unit tests as the distance scoring function for a genetic algorithm which operated on code to mutate branches. More interestingly, they did this on off-the-shelf legacy C programs.

Genetic programming is combined with program analysis methods to repair bugs in off-the-shelf legacy C programs. Fitness is defined using negative test cases that exercise the bug to be repaired and positive test cases that encode program requirements. Once a successful repair is discovered, structural differencing algorithms and delta debugging methods are used to minimize its size. Several modifications to the GP technique contribute to its success: (1) genetic operations are localized to the nodes along the execution path of the negative test case; (2) high-level statements are represented as single nodes in the program tree; (3) genetic operators use existing code in other parts of the program, so new code does not need to be invented. The paper describes the method, reviews earlier experiments that repaired 11 bugs in over 60,000 lines of code, reports results on new bug repairs, and describes experiments that analyze the performance and efficacy of the evolutionary components of the algorithm.

Literally, they wrote some small samples of code that said “here’s what I want this buggy program to do” and then their genetic algorithm actually went off and hacked away at the code (much like many of us flesh-and-blood programmers) and made it work. They have several nice examples, including one on automatically fixing the infamous Zune date bug.

The dream of automatic programming has eluded computer scientists for at least 50 years. Although the methods described in this paper do not evolve new programs from scratch, they do show how to evolve legacy software to repair existing faults.

iPhone 3GS Too Hot Temperature?

Posted in Apple, Errors, iPhone by Elliott Back on July 3rd, 2009.

After report surfaced that Apple’s new iPhone 3GS had problems with overheating, followup articles point to the batteries being the source of the problems:

Vronko said the iPhone 3GS’s heat problem is evidently tied to the battery, because the pictures of discolored white iPhones reveal the outline of the battery. He noted that although thousands of iPhone 3GS users probably own defective handsets, the risk of causing fire or explosion is low because the iPhone’s battery cell is extremely small.

I decided to do a small test and played two rounds of Star Defense on the phone while on Battery power. Here’s what I found using an infrared thermometer. Initially, ambient temperature of the room was 80°F and the iPhone measured 83°F on the back. After playing the game, the room temperature had dropped 2° to 78°F while the iPhone 3GS measured 102°F on the back. More interestingly, there was a temperature gradient:

iphone-3gs-heating

I’ve also felt the phone get much hotter than this quick test, probably proportional to how much load you put on its battery. There’s an Apple support document called Keeping iPhone 3G and iPhone 3GS within acceptable operating temperatures which documents some obvious “leaving your phone in the sun” cases which can cause overheating:

- Leaving the device in a car on a hot day.
- Leaving it in direct sunlight for extended amounts of time.
- Using certain applications in hot conditions or direct sunlight for long periods of time, such as GPS tracking in a car on a sunny day or listening to music while in direct sunlight.

NYC MTA Subway LED Glitch

Posted in Errors, NYC by Elliott Back on January 24th, 2009.

Saw this error on the NYC N-Train line the other day–the LCD display, which indicates upcoming stops and route information was totally in error. Waves of pixels just washed across the screen, it was surreal and beautiful.

« Previous PageNext Page »