An Automatic Software Defect Repair Method Based on Multi-Objective Genetic Programming

被引:0
作者
Han, Tiantian [1 ]
Chu, Yonghe [1 ]
Liu, Fangzheng [1 ]
机构
[1] Henan Univ Technol, Coll Informat Sci & Engn, Zhengzhou 450001, Peoples R China
来源
APPLIED SCIENCES-BASEL | 2024年 / 14卷 / 18期
关键词
genetic programming; automatic software repair; multi-objective optimization; context analysis;
D O I
10.3390/app14188550
中图分类号
O6 [化学];
学科分类号
0703 ;
摘要
Due to the explosive growth of software quantity and the mixed ability of software developers, a large number of software defects emerge during the later stages of software maintenance. The search method based on genetic programming is one of the most popular in search algorithms, but it also has some issues. The single-objective approach to validate and select offspring patches without considering other constraints can affect the efficiency of patch generation. To address this issue, this paper proposes an automatic software repair method based on Multi-objective Genetic Programming (MGPRepair). Firstly, the method adopts a lightweight context analysis strategy to find suitable repair materials. Secondly, it decouples the replacement statements and insertion statements in the repair materials, using a lower-granularity patch representation method to encode the patches in the search space. Then, the automatic software defect repair is treated as a multi-objective search problem, and the NSGA-II multi-objective optimization algorithm is used to find simpler repair patches. Finally, the test case filtering technique is used to accelerate the patch validation process and generate correct patches. MGPRepair was experimentally evaluated on 395 real Java software defects from the Defects4J dataset. The experimental results show that MGPRepair can generate test case-passing patches for 51 defects, of which 35 defect patches are equivalent to manually generated patches. Its repair the efficiency and success rate are higher to other excellent automatic software defect repair methods such as jGenProg, RSRepair, ARJA, Nopol, Capgen, and SequenceR.
引用
收藏
页数:17
相关论文
共 32 条
[1]   On the accuracy of spectrum-based fault localization [J].
Abreu, Rui ;
Zoeteweij, Peter ;
van Gemund, Arjan J. C. .
TAIC PART 2007 - TESTING: ACADEMIC AND INDUSTRIAL CONFERENCE - PRACTICE AND RESEARCH TECHNIQUES, PROCEEDINGS: CO-LOCATED WITH MUTATION 2007, 2007, :89-+
[2]  
Abreu R, 2006, 12TH PACIFIC RIM INTERNATIONAL SYMPOSIUM ON DEPENDABLE COMPUTING, PROCEEDINGS, P39
[3]  
Augusto Oscar Brito, 2012, Pesqui. Oper., V32, P331
[4]  
Britton T, 2013, Tech. Rep
[5]   Inconsistency indices for pairwise comparisons and the Pareto dominance principle [J].
Brunelli, Matteo ;
Fedrizzi, Michele .
EUROPEAN JOURNAL OF OPERATIONAL RESEARCH, 2024, 312 (01) :273-282
[6]   Random Search and Code Similarity-Based Automatic Program Repair; [基于随机搜索和代码相似性的自动程序修复] [J].
Cao H. ;
Liu F. ;
Shi J. ;
Chu Y. ;
Deng M. .
Journal of Shanghai Jiaotong University (Science), 2023, 28 (06) :738-752
[7]   SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair [J].
Chen, Zimin ;
Kommrusch, Steve ;
Tufano, Michele ;
Pouchet, Louis-Noel ;
Poshyvanyk, Denys ;
Monperrus, Martin .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2021, 47 (09) :1943-1959
[8]   A fast and elitist multiobjective genetic algorithm: NSGA-II [J].
Deb, K ;
Pratap, A ;
Agarwal, S ;
Meyarivan, T .
IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, 2002, 6 (02) :182-197
[9]   Crash-Avoiding Program Repair [J].
Gao, Xiang ;
Mechtaev, Sergey ;
Roychoudhury, Abhik .
PROCEEDINGS OF THE 28TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS (ISSTA '19), 2019, :8-18
[10]   PraPR: Practical Program Repair via Bytecode Mutation [J].
Ghanbari, Ali ;
Zhang, Lingming .
34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, :1118-1121