Abstract

Bugs may be present in various places in a program. Bugs contained in loops (hereafter buggy loops) are challenging to fix using existing bug fixing techniques. In this work, we propose LoopFix, an approach that aims to repair buggy loops automatically. LoopFix takes a program and a test suite including at least one failed test case as inputs, and generates a patch to fix the bug. LoopFix first leverages on existing bug localization techniques to obtain ranked buggy statements. After that, LoopFix exploits a component based program synthesis approach to synthesize a patch based on the runtime information obtained through symbolic execution. Finally, LoopFix validates the patch with the given test suite. We have implemented LoopFix in a prototype tool and compared the performance of LoopFix with Angelix, S3 and JFix on three widely adopted datasets, i.e., IntroClass, Defects4J and Loops. Our experiments show that LoopFix fixes about 30% of buggy loops and performs more effective than the other tools on buggy loops.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call