A genetic programming approach to automated software repair

Stephanie Forrest, ThanhVu Nguyen, Westley Weimer, Claire Le Goues

2009 · 239 citations · 22 references

Concepts

TL;DR

The authors employ genetic programming guided by program analysis, defining fitness with negative and positive test cases, and then use structural differencing and delta debugging to produce minimal, localized repairs in legacy C code. Experiments show the approach can repair 11 bugs in over 60,000 lines of code, and further tests demonstrate its effectiveness and analyze the performance of its evolutionary components.

Abstract

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.

References

22