节点文献

基于约束机制的程序语义缺陷自动修复研究

Research of Automatic Repair of Semantic Defects Using Restraint Mechanisms

【作者】 张莉

【导师】 庞善臣;

【作者基本信息】 中国石油大学(华东) , 计算机科学与技术, 2021, 硕士

【摘要】 随着信息技术的不断发展,人们对软件的需求与依赖越来越多,软件规模与复杂度也日益增长。程序缺陷作为软件开发产品的衍生品,在一定条件下会引发运行错误,产生异常的结果或行为,严重情况下甚至会造成不可挽回的巨大损失。程序缺陷的修复是一项复杂而且耗时的工作,相关研究与调查表明,软件公司每年都需要为程序缺陷的修复投入大量金钱和时间。因此,程序自动修复成为程序开发过程中必不可少的重要环节。开发人员面对大量缺陷报告无从入手时,程序自动修复方法能够帮助开发人员修复程序缺陷,有效减少修复时间,目前研究者已研究了许多程序自动修复方法。针对现有的程序自动修复方法中存在的盲目性大、搜索空间过大、补丁程序过拟合等问题,本文首先对当前程序自动修复技术和补丁修复位置确定方法的研究现状进行了分析,而后分析了目前程序自动修复技术和补丁修复位置确定方法存在的问题,重点关注了提高程序自动修复技术准确率和效率可行的方法。然后,分析特定语义缺陷类型的修复方案,总结出不同缺陷模式的修复模板。本文通过分析开源代码的历史修复补丁,发现缺陷发生前对相关变量进行区间约束的修复准确率更高,更可行,并提出了基于约束机制的程序自动修复方法。本文提出了基于定义-使用链的修复位置确定方法,借助静态分析对程序进行缺陷定位后,分析相邻缺陷模式的缺陷相关变量的定义和使用位置之间的关系,提高了修复后补丁程序的可读性,进一步提高修复位置的准确率。针对候选补丁,我们还提出了一种基于语法距离的补丁质量评价方法,对补丁质量进行量化评价。基于以上理论,本文设计和实现了基于约束机制的程序自动修复系统DTSFix,即在自动修复工具中实现了基于约束机制的程序修复方法,并对6个Java开源工程进行实验研究,并与基于人工修复模板的PAR的实验结果进行比较,结果表明本文方法能够有效地提高程序自动修复的准确率和效率。程序自动修复技术可以有效帮助软件维护人员进行软件调试,因此程序自动修复技术的准确率和效率的提高可以缩短程序缺陷修复时间,减少软件缺陷带来的损失。本文提出了基于约束机制的程序自动修复方法,可以有效提高程序自动修复的效率。

【Abstract】 With the continuous development of information technology,people’s demand and dependence on software are increasing,and the software scale and complexity are also growing.software defects as derivatives of software development products,can cause operation error,abnormal results or behavior under certain conditions,and also can cause irreparable huge losses in severs cases.Program defect repair is a complex and time-consuming work,and the related research and survey suggest that software companies need to spend a lot of money and time for program defect repair every year.Therefore,automatic program repair(APR)has become an essential link in the process of program development.When developers have no way to start with a large number of defect reports,APR method can help developers repair program defects and effectively reduce the repair time.At present,researchers have studied many automatic program repair methods.Aiming at the problems of blindness,large search space and over-fitting of patches in the existing methods of automatic program repair,this article first analyzes the research status of the current automatic program repair technology and patch repair position determination method,and then analyzes the existing problems of automatic program repair technology and patch repair position determination method,focusing on the feasible methods to improve the accuracy and efficiency of automatic program repair technology.Then,we analyze the repair schemes of specific semantic defect types,and summarize the repair templates for different defect modes.This article analyzes the historical repair patches of the open source code and finds that the interval constraint repair of related variables before the defect occurs has a higher accuracy and is more feasible,and proposes a program automatic repair method based on the constraint mechanism.In this article,a method based on definition-use chain is proposed to determine the repair location.The relationship between the definition of defects related variables of adjacent defect modes and the use location is analyzed after the program is located by static analysis,so as to improve the readability of the patch program after repair and further improve the accuracy of repair location.For candidate patches,we also propose a patch quality evaluation method based on grammatical distance to quantitatively evaluate the patch quality.Based on the above theory,this article designs and implements a automatic program repair system DTSFix based on a constraint mechanism,and conducts experimental research on six Java open-source projects.Our result compares them with the repair results of the PAR based on repair template and shows that this method can effectively improve the accuracy and efficiency of automatic program repair.Automatic program repair technology can effectively help software maintenance personnel to debug software,so the improvement of accuracy and efficiency of automatic program repair technology can shorten the time of program defect repair and reduce the loss caused by software defects.This paper proposes a method of automatic program repair based on constraint mechanism,which can effectively improve the efficiency of automatic program repair.

  • 【分类号】TP311.53
节点文献中: 

本文链接的文献网络图示:

本文的引文网络