基于多智能体协同的动态程序切片方法
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:


Dynamic Program Slicing Method Based on Multi-agent Collaboration
Author:
Affiliation:

Fund Project:

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

    动态程序切片是一种重要的程序分析技术, 能够在给定程序输入与执行轨迹的情况下提取实际影响切片准则的代码语句, 在程序调试、缺陷定位和程序理解等任务中具有重要应用价值. 然而, 现有动态程序切片方法在大规模软件系统中仍面临分析成本高、依赖关系建模复杂以及跨过程依赖分析困难等问题. 近年来, 研究者尝试利用大语言模型生成动态程序切片, 但现有方法多针对小规模程序设计, 且由于缺乏执行信息约束, 切片准确率仍然有限. 针对上述问题, 提出一种面向动态程序切片生成的多智能体协同框架 AgentDSlicer. 该方法通过程序执行推理、切片生成、结果验证与切片精化等多个智能体的协同工作, 在不依赖真实程序执行信息的前提下实现执行相关的动态程序切片. 为支持系统化评估, 进一步构建人工标注的动态程序切片数据集 DySliceBench, 该数据集包含来自 CodeNet 与 GitHub 开源项目的2 543 个动态切片实例, 覆盖 Java 与 Python 两种编程语言. 实验结果表明, 在 DySliceBench 数据集上, AgentDSlicer 的切片准确率相较现有方法平均提升30.4%, 相较于当前最先进的 LLM 动态切片方法ND-Slicer 提升32.1%; 在大规模程序场景下, 准确率提升可达 60.1%. 此外, 在程序调试与缺陷定位等应用场景中的实验进一步验证了该方法的有效性. 研究结果表明, AgentDSlicer 能够在保证分析准确性的同时有效提升动态程序切片在真实软件项目中的适用性.

    Abstract:

    Dynamic program slicing is an important program analysis technique that extracts code statements that actually influence a given slicing criterion under specific program inputs and execution traces. It has important practical value in tasks such as program debugging, fault localization, and program comprehension. However, existing dynamic program slicing approaches still face challenges when applied to large-scale software systems, including high analysis costs, complex dependency modeling, and difficulties with interprocedural dependency analysis. Recent studies have explored the use of large language models to generate dynamic program slices, but most existing approaches focus on small-scale programs and lack execution information constraints, resulting in limited slicing accuracy. To address these issues, this study proposes AgentDSlicer, a multi-agent collaborative framework for dynamic program slicing generation. Through collaboration among multiple agents, including agents for program execution reasoning, slice generation, result verification, and slice refinement, the proposed method generates execution-aware dynamic program slices without relying on real program execution information. To support systematic evaluation, this study further constructs DySliceBench, a manually annotated dynamic program slicing dataset that contains 2 543 dynamic slicing instances collected from CodeNet and open-source GitHub projects and covers two programming languages, Java and Python. Experimental results show that, on the DySliceBench dataset, AgentDSlicer improves slicing accuracy by 30.4% on average compared with existing methods and by 32.1% compared with the current state-of-the-art LLM-based dynamic slicing method ND-Slicer. In large-scale program scenarios, the accuracy improvement reaches 60.1%. In addition, experiments in application scenarios such as program debugging and fault localization further validate the effectiveness of the proposed method. The results show that AgentDSlicer can effectively improve the applicability of dynamic program slicing to real-world software projects while ensuring analysis accuracy.

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

常建明,徐晨杰,叶祁超,王璐璐,李必信.基于多智能体协同的动态程序切片方法.软件学报,,():1-28

复制
相关视频

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

京公网安备 11040202500063号