Skip to main content
QUICK REVIEW

[论文解读] Rethinking Basis Path Testing: Mixed Integer Programming Approach for Test Path Set Generation

Chao Wei, Xinyi Peng|arXiv (Cornell University)|Jan 9, 2026
Software Testing and Debugging Techniques被引用 0
一句话总结

该论文将基础路径生成重新表述为混合整数规划优化问题,并引入全局(Holistic)与增量(Incremental)MIP 策略,以为 CFG 生成完整、最小且独立的基础路径集合,在真实与合成图上的经验结果显著。

ABSTRACT

Basis path testing is a cornerstone of structural testing, yet traditional automated methods, relying on greedy graph-traversal algorithms (e.g., DFS/BFS), often generate sub-optimal paths. This structural inferiority is not a trivial issue; it directly impedes downstream testing activities by complicating automated test data generation and increasing the cognitive load for human engineers. This paper reframes basis path generation from a procedural search task into a declarative optimization problem. We introduce a Mixed Integer Programming (MIP) framework designed to produce a complete basis path set that is globally optimal in its structural simplicity. Our framework includes two complementary strategies: a Holistic MIP model that guarantees a theoretically optimal path set, and a scalable Incremental MIP strategy for large, complex topologies. The incremental approach features a multi-objective function that prioritizes path simplicity and incorporates a novelty penalty to maximize the successful generation of linearly independent paths. Empirical evaluations on both real-code and large-scale synthetic Control Flow Graphs demonstrate that our Incremental MIP strategy achieves a 100\% success rate in generating complete basis sets, while remaining computationally efficient. Our work provides a foundational method for generating a high-quality structural "scaffold" that can enhance the efficiency and effectiveness of subsequent test generation efforts.

研究动机与目标

  • 需要高质量的基础路径集合,超越贪心的 DFS/BFS 方法的动机。
  • 将基础路径生成表述为一个声明性优化问题。
  • 开发一个全局 Holistic MIP 模型,保证全局最优、简单的基础集。
  • 提出一个可扩展的带新颖性惩罚的增量 MIP 策略,确保独立性和可扩展性。
  • 通过对真实代码和大规模合成 CFG 的经验评估,展示鲁棒性与可扩展性。

提出的方法

  • 将 CFG 基础路径生成形式化为一个 MIP,变量捕捉边使用、节点访问和路径连通性。
  • 通过约束(包括基于网络流的子环消除)来强制路径有效性、连通性和基础性质(完备性和线性无关性)。
  • 最小化所有路径的总长度以促进简洁性,并在增量 MIP 公式中加入新颖性惩罚以鼓励对现有边的重复使用。
  • 提供一个全局 Holistic MIP 模型,采用子环消除约束同时解决所有 k 条路径。
  • 开发一个增量 MIP 策略,逐条构建基础路径集,利用对偶目标在长度与新颖性(新边)之间取得平衡。
  • 描述一个迭代算法,更新覆盖边集合并通过约束确保每条新路径至少包含一条此前未使用的边以实现独立性。

实验结果

研究问题

  • RQ1基础路径生成是否可以作为全局优化问题来有效实现,而非过程性搜索?
  • RQ2全局 Holistic MIP 模型是否能保证全局最优的完整基础路径集?
  • RQ3带新颖性惩罚的增量 MIP 策略在大规模 CFG 上是否能可靠生成完整的基础路径集合并保持可扩展性?
  • RQ4与传统基于 BFS 的基线相比,在真实数据与合成数据上的成功率、路径覆盖率和运行时间表现如何?
  • RQ5在全局最优性与计算可扩展性之间,在此情境下的权衡是什么?

主要发现

  • 带新颖性驱动目标的增量 MIP 能在多样化拓扑中实现生成完整基础集的 100% 成功率。
  • 基线 BFS 在生成完整基础集方面不可靠,特别是随着环路复杂度的增加。
  • 全局 Holistic MIP 能保证全局最优性,但在大图上可能超时;增量 MIP 可扩展并避免超时。
  • Incremental MIP2(新颖性驱动)保持鲁棒性和高效性,在几十秒内解决最复杂实例。
  • 新颖性惩罚保留未覆盖的边,便于后续路径使用,降低贪婪陷阱,实现完整的基础集。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。