Abstract

Automatic program repair (APR) is an active research area, in which the problem is to discover a solution for a given faulty program that fixes the fault. As yet, a myriad of APR techniques has been proposed in the literature even though the research should go a long way toward establishing APR techniques that are industrially-viable. A current issue is to deal with multiple-fault (MF) programs. Although they are prevalent in real-world settings, automatic repair of MF programs has received less attention in the literature. In this paper, we propose SituRepair, a new APR technique which is developed to fix MF programs; that is, it is intended to discover a solution that fixes multiple faults at a time for a given faulty program. The significance of SituRepair for Critical Infrastructure Protection (CIP) is to provide extensive empirical evidence that APR is viable in CIP software systems. First, we compute 50 static features for each faulty program in a training benchmark where the type and situation of the fault(s) are known. We have considered 151 types of different faults, which have been manually elicited from the training benchmark. The fault types include various single-fault (SF) and MF cases. Then, we use the faulty programs’ static data to build a machine-learning model. Next, for a new faulty program, the model receives as input the values of its static features and predicts the types and situations of the fault(s). Finally, we apply various modifications to the faulty program, according to the types and situations of the fault(s), so that every fault is fixed. SituRepair employs a program's test suite to evaluate the modified variants, as test suites are often readily-available. To investigate the effectiveness of SituRepair, we have conducted extensive experiments on 25,619 C programs within Code4Bench, including 16,274 SF and 9345 MF programs. In the experiments, SituRepair could successfully repair 17,195 programs of which 13,347 cases are SF and 3848 cases are MF programs. We conclude that SituRepair seems to have the potential to be used for multiple fault APR. In addition, SituRepair could repair each program in 9.24 min on average, which is of practical importance. The impact of this work on researchers is to incentivize them to apply further static code features and sophisticated machine-learning models. For practitioners, it can facilitate the debugging tasks yielding higher quality software systems for CIP settings.

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