基于异常检查点植入的软件缺陷定位方法
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

国家重点研发计划课题(2024YFF0908003); 国家自然科学基金面上项目(62472326); CCF-智谱大模型创新基金(CCF-Zhipu202408)


Exception Trigger Stream-based Fault Localization with Automated Try Block Injection
Author:
Affiliation:

Fund Project:

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

    软件缺陷定位任务以程序表层的执行错误为入口,通过分析程序运行过程中异常的内部状态,定位到底层代码级的缺陷根因.目前主流的基于频谱和基于突变的缺陷定位,以及当前最先进的SmartFL技术分别采用覆盖信息、突变信息及以程序语义为代表的信息,作为观测程序内部状态的窗口,所用信息过于宽泛、针对性不足,且三类(项)技术分别受限于语句风险值捆绑、突变成本过高及信息规模庞大等瓶颈.为此,最近一项新的基于异常触发信息的缺陷定位技术EXPECT提出通过程序自带的异常处理语句(Try-catch块)对程序错误的执行状态进行监控,以更低的成本实现了超越上述主流技术的缺陷定位效果,该方法的运行前提是错误程序中必须含有足量的异常处理语句.然而,在真实的开源环境中,许多软件程序并没有设置良好的异常处理机制,导致其代码仅包含十分稀疏甚至不包含异常处理语句,这直接影响EXPECT技术赖以运行的基础.为此,提出基于异常检查点植入的软件缺陷定位方法INSPECT.通过为错误程序自动植入临时的异常处理语句作为对运行时内部状态的检查点、设计更加先进的程序语句风险值计算方法,将EXPECT方法的适用范围拓展到不包含异常处理语句的更普遍程序,有效将异常触发信息这一缺陷定位高效源数据的应用场景进行了拓展,实现了泛化性的提升.实验结果表明,INSPECT比现有最先进技术实现了更好的缺陷定位效果:在最好、平均、最差EXAM指标上的提升幅度分别为95.25%、55.92%和16.65%(模拟缺陷),以及93.39%、57.54%和13.92%(真实缺陷);在MRR指标上的提升为311.47%(模拟缺陷)和283.31%(真实缺陷).

    Abstract:

    Software fault localization tasks begin with the failure of program execution, and locate the root cause of the failure at the code level by analyzing the abnormal internal state during the program execution. The current mainstream spectrum-based and mutation-based fault localization techniques, as well as the most advanced technique SmartFL, utilize coverage information, mutation information, and information represented by program semantics, respectively, as windows to observe the internal state of the program while running. These three types of information are too broad and not targeted enough, and are limited by bottlenecks such as the tie of statement risk values, high mutation cost, and large information scale, respectively. EXPECT, a fault localization technique using exception trigger stream (a new source of information), was recently proposed to monitor the abnormal internal state of the program through the exception handling statements (Try-catch blocks), and achieved promising effectiveness that surpasses the aforementioned mainstream methods. The premise of EXPECT is that the faulty program must contain enough exception-handling statements. However, in the real open-source community, many software programs do not have a good exception handling mechanism, resulting in their codes containing only very sparse or even no exception handling statements, which directly affects the basis on which EXPECT runs. To this end, a software fault localization method based on exception handling statements injection, INSPECT, is proposed in this paper. By automatically injecting temporary exception handling statements into the faulty program as checkpoints for the internal state, designing a more sophisticated algorithm of the calculation for program statements’ risk value, the running scope of EXPECT is expanded to more general programs that do not contain exception handling statements. In other words, INSPECT effectively expands the application scenario of the exception trigger information, which is an efficient source of data for fault localization, and thus delivers higher generalization. Experimental results show that INSPECT obtains better fault localization effectiveness than the state-of-the-art technique with improvements of 95.25%, 55.92%, and 16.65%(simulated faults) as well as 93.39%, 57.54%, and 13.92%(real-world faults) in the best, average, and worst EXAM metrics, respectively, and 311.47%(simulated faults) and 283.31%(real-world faults) in the MRR metric.

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

宋壹,谢晓园,张熙灏,辛奇,邢宸亮.基于异常检查点植入的软件缺陷定位方法.软件学报,2026,37(7):

复制
相关视频

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

京公网安备 11040202500063号