静态缺陷定位通常采用信息检索的方法,现有的信息检索方法一般采用源代码与缺陷报告的文本相似性的排序方法,但是这种基于文本相似性的方法没能充分利用源代码结构信息,缺陷定位的准确率较低.为了解决这个问题,提出了一种基于源代码结构信息(如类名、方法名、变量名、注释等)和历史缺陷报告信息进行缺陷定位的方法.对于源代码结构的不同部分,在与缺陷报告进行词语匹配时,赋予它们不同的权重,同时充分利用历史缺陷报告信息,提高缺陷定位的精度.最后为了验证基于代码结构信息的缺陷定位技术的有效性,与以前提出的BugLocator、BugScout等方法进行了比较,结果表明基于代码结构信息的软件缺陷定位方法比BugLocator和BugScout方法准确度有明显提高.%Static bug localization method commonly uses information retrieval method to locate bug.Existing information retrieval methods generally use text similarity between the source codes and bug reports,but the text similarity method fails to make full use of the source code structure information,and has low accuracy.In order to solve this problem,this paper presents a bug localization method using source code structure (such as the class name,method names,variable names,comment etc.) and historical bug report information.When different parts of the source code structure match the bug report,they are given different weights.The paper also makes full use of the historical bug report information to improve the accuracy of bug localization.Finally in order to validate the method,this paper is compared the proposed method with BugLocator and BugScout,the results show that software bug localization method based on source code structure has significant advantage than the BugLocator and the BugScout.
展开▼