基于源代码扩展信息的细粒度缺陷定位方法
作者:
作者单位:

作者简介:

李晓卓(1992-),女,硕士,主要研究领域为程序分析及缺陷定位;贺也平(1962-),男,博士,研究员,博士生导师,主要研究领域为系统安全,隐私保护;卿笃军(1993-),男,硕士,主要研究领域为程序分析;马恒太(1972-),男,博士,副研究员,主要研究领域为程序分析,系统安全.

通讯作者:

贺也平,E-mail:yeping@iscas.ac.cn;马恒太,E-mail:hengtai@iscas.ac.cn

中图分类号:

TP311

基金项目:

核高基国家科技重大专项(2014ZX01029101);中国科学院战略性先导科技专项(XDA-Y01-01)


Fine-grained Bug Location Method Based on Source Code Extension Information
Author:
Affiliation:

Fund Project:

CHB National Science and Technology Major Project of China (2014ZX01029101); Strategic Priority Research Program of Chinese Academy of Sciences (XDA-Y01-01)

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    基于信息检索的缺陷定位技术,利用跨语言的语义相似性构造检索模型,通过缺陷报告定位源代码错误,具有方法直观、通用性强的特点.但是由于传统基于信息检索的缺陷定位方法将代码作为纯文本进行处理,只利用了源代码的词汇语义信息,导致在细粒度缺陷定位中面临候选代码语义匮乏产生的准确性低的问题,其结果有用性还有待改进.通过分析程序演化场景下代码改动与缺陷产生间的关系,提出一种基于源代码扩展信息的细粒度缺陷定位方法,以代码词汇语义显性信息及代码执行隐性信息共同丰富源代码语义实现细粒度缺陷定位.利用定位候选点的语义相关上下文丰富代码量,以代码执行中间形式的结构语义实现细粒度代码的可区分,同时以自然语言语义指导基于注意力机制的代码语言表征生成,实现细粒度代码与自然语言间的语义映射,从而实现细粒度缺陷定位方法FlowLocator.实验分析结果表明:与经典的IR缺陷定位方法相比,该方法定位准确性在Top-N排名、平均准确率及平均倒数排名上都有显著提高.

    Abstract:

    Bug location based on information retrieval (IR) uses cross language semantic similarity to construct a retrieval model to locate source code errors through bug report. However, the traditional method of bug location based on IR treats the code as pure text and only uses the lexical semantic information of source code, which leads to the problem of low accuracy caused by the lack of candidate code semantics in fine-grained bug location, and the usefulness of the results needs to be improved. By analyzing the relationship between code change and bug generation in the scenario of program evolution, this study proposes a fine-grained bug location method based on source code extension information, the explicit semantic information of code vocabulary and implicit information of code execution are used to enrich source code semantics to realize fine-grained bug location. Based on the location candidate points, the semantic context is used to enrich the code quantity, and the structural semantics of code execution intermediate language is used to realize fine-grained code distinguishability. Meanwhile, natural language semantics is used to guide the generation of code language representation based on attention mechanism, the semantic mapping between fine-grained code and natural language is implemented to implement fine-grained bug location method FlowLocator. The experimental results show that compared with the classical IR bug location method, the location accuracy of this method is significantly improved in the Top-N rank, mean average precision (MAP) and mean reciprocal rank (MRR).

    参考文献
    相似文献
    引证文献
引用本文

李晓卓,卿笃军,贺也平,马恒太.基于源代码扩展信息的细粒度缺陷定位方法.软件学报,2022,33(11):4008-4026

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2020-09-30
  • 最后修改日期:2021-03-02
  • 录用日期:
  • 在线发布日期: 2021-04-21
  • 出版日期: 2022-11-06
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号