基于代码变更语义分析的缺陷隔离方法
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

国家自然科学基金(62172099)


Defect Isolation Method Based on Semantic Analysis of Code Changes
Author:
Affiliation:

Fund Project:

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

    在现代软件开发中, 频繁的代码提交和更新已成为常态, 虽然加速了功能实现, 但更可能会引入新的缺陷, 进而威胁软件的稳定性和可靠性. 一旦缺陷导致程序错误或故障, 开发团队必须迅速采取行动隔离缺陷以确保系统持续正常运行. 缺陷隔离是快速定位问题并恢复系统稳定性的关键技术手段, 但传统的增量调试(delta debugging, DD)方法依赖大量测试尝试, 导致在变更集合较大时性能瓶颈明显, 且缺乏对代码变更语义的有效利用, 无法精准定位与缺陷相关的代码变更. 提出了一种基于代码变更语义拆解的缺陷隔离方法——DISAC. 该方法通过将缺陷引入的复合提交拆解为具有单一功能语义的原子提交, 并通过建模提交之间的顺序依赖关系, 确保隔离过程中不破坏变更间的前置依赖. 与传统的DD方法相比, DISAC不仅能够返回最小的功能语义变更, 还能保留必要的上下文和依赖信息, 从而为开发人员提供更完整、精确的缺陷修复支持. 实验结果表明, 与DD方法相比, DISAC在缺陷隔离效率和精度上均有显著提升. 具体而言, DISAC在Defects4J数据集上的隔离效率提高了633.65%, 在回归缺陷集上的效率提升了733.75%. 此外, 当DISAC与DD结合使用时, 约减率分别提高了2.36%和8.66%, 显著提高了隔离效果. 用户实验显示, DISAC能提高根因确定效率约59.90%, 准确率提升12%. 这些结果表明, DISAC在提高缺陷隔离精度的同时减少了不必要的变更组合尝试, 从而在复杂代码提交的缺陷隔离任务中表现出更高的效率和稳定性.

    Abstract:

    In modern software development, frequent code commits and updates have become the norm, which accelerates feature implementation but may introduce new defects, thus threatening software stability and reliability. Once a defect causes program errors or failures, the development team should take quick action to isolate the defect to ensure the continuous operation of the system. Defect isolation is a key technique for rapidly locating the problem and restoring system stability. However, the traditional delta debugging (DD) methods rely on numerous testing attempts, resulting in significant performance bottlenecks under a large change set. Additionally, they fail to effectively utilize the semantics of code changes, making it difficult to accurately locate defect-related code changes. This study proposes a defect isolation method based on code change semantic decomposition—DISAC. The method decomposes composite commits introduced by the defect into atomic commits with single functional semantics. It then models the sequential dependency between commits to ensure that the dependency chain will not be broken during the isolation process. Compared to the traditional DD methods, DISAC not only returns the smallest functional semantic changes but also preserves necessary context and dependency information, thereby providing developers with more complete and accurate support for defect repair. Experimental results show that compared to the DD method, DISAC significantly improves defect isolation efficiency and accuracy. Specifically, the isolation efficiency is increased by 633.65% on the Defects4J dataset and by 733.75% on the regression defect set. Additionally, when DISAC is combined with DD, the isolation reduction rate improves by 2.36% and 8.66% respectively, significantly enhancing isolation effectiveness. User experiments show that DISAC increases root cause determination efficiency by approximately 59.90% and improves accuracy by 12%. These results demonstrate that DISAC not only improves defect isolation accuracy but also reduces unnecessary change combination attempts, thus showing higher efficiency and stability in defect isolation tasks committed by complex codes.

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

刘书宁,吴毅坚,宋学志,陈碧欢,彭鑫,赵文耘.基于代码变更语义分析的缺陷隔离方法.软件学报,,():1-16

复制
相关视频

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

京公网安备 11040202500063号