Abstract
Automating repair of programs is a practically important but extremely challenging task. In this paper, we present MintHint, a novel technique for semi-automated program repair that is a departure from most of today's program-repair techniques. Instead of trying to find an actual repair, which is often practically impossible, MintHint performs statistical correlation analysis to identify expressions that are likely to occur in the repaired code and synthesizes repair hints from these expressions. Intuitively, these repair hints give suggestions to developers on how to modify faulty statements to obtain a repaired version of the code. To synthesize repair hints, MintHint requires a test suite of the faulty program, containing at least one test that triggers the fault. Unlike most approaches that search for an actual repair, MintHint can perform well in the common case in which (1) the search space for repairs does not contain the actual repair or (2) operational specifications obtained from test cases are incomplete or even imperfect. In addition, MintHint can address a number of different types of faults, including incorrect, spurious, and missing expressions. The results of our empirical evaluation of MintHint are promising and provide initial evidence of its effectiveness. When run on five programs and a large number of faults, MintHint was able to produce useful hints for 48 out of the 56 faults considered.