受限控制流图中边覆盖问题的计算复杂性
Computational Complexity of Edge Coverage Problem for Constrained Control Flow Graphs
AI总结:
本文研究了受限控制流图中边覆盖问题的计算复杂性,分析了不同约束类型对可行性及复杂性的影响,并提出针对负向约束的FPT算法。
摘要:
本文研究了带有显式约束的控制流图中的边覆盖问题。实现给定代码的白盒覆盖水平是软件测试中的经典问题。我们关注设计测试集以实现边覆盖,同时满足顶点之间的额外约束。本文分析了这些约束如何影响边覆盖的可行性及计算复杂性。文章讨论了五种类型的约束。正向约束要求至少有一条测试路径中某个顶点在另一个顶点之前。负向约束禁止任何此类测试路径。一次约束要求恰好一条测试路径中某个顶点出现一次在另一个顶点之前。最大一次约束允许在至多一条测试路径中出现此类 precedence。总是约束要求包含某个顶点的每条测试路径也必须包含另一个顶点在同一条路径上更后面的位置。每种类型都建模了不同的测试需求,如强制流、语义排除或执行成本限制。我们研究了寻找实现边覆盖并满足给定约束集的测试集的计算复杂性。对于正向约束,存在边覆盖测试集的可判定性可在多项式时间内通过扩展标准边覆盖构造并添加额外路径来实现。对于负向、最大一次、一次和总是约束,决策问题均为NP完全。证明依赖于多项式约简到SAT变种的证明。NP完全性结果甚至在受限图类中也成立,包括无环图,对于所有这些四个约束。最后,我们研究了负向约束的固定参数可处理性。虽然一般问题为NP完全,但本文提出了一个参数为约束数量的FPT算法。
英文摘要:
The article studies edge coverage for control flow graphs extended with explicit constraints. Achieving a given level of white-box coverage for a given code is a classic problem in software testing. We focus on designing test sets that achieve edge coverage \textit{while respecting additional constraints} between vertices. The paper analyzes how such constraints affect both the feasibility and computational complexity of edge coverage. The paper discusses five types of constraints. POSITIVE constraints require at least one test path where a given vertex precedes another. NEGATIVE constraints forbid any such test path. ONCE constraints require exactly one test path with a single occurrence of one vertex before another. MAX ONCE constraints allow such precedence in at most one test path. ALWAYS constraints require every test path containing a given vertex to also contain another vertex later on the same path. Each type models a different test requirement, such as mandatory flows, semantic exclusions, or execution cost limits. We investigate the computational complexity of finding a test set that achieves edge coverage and respects a given set of constraints. For POSITIVE constraints, the existence of an edge covering test set is decidable in polynomial time by extending standard edge coverage constructions with additional paths for each constraint. For NEGATIVE, MAX ONCE, ONCE, and ALWAYS constraints, the decision problem is NP-complete. The proofs rely on polynomial reductions from variants of SAT. The NP-completeness results hold even for restricted graph classes, including acyclic graphs, for all these four constraints. Finally, we study the fixed-parameter tractability of the NEGATIVE constraint. Although the general problem is NP-complete, the paper presents an FPT algorithm with respect to the number of constraints.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。