Table of Contents
Fetching ...

Computational Complexity of Edge Coverage Problem for Constrained Control Flow Graphs

Jakub Ruszil, Artur Polański, Adam Roman, Jakub Zelek

TL;DR

This work studies edge coverage (EC) for constrained control flow graphs (cCFGs), where test paths must satisfy semantic constraints in addition to traversing every edge. It systematically classifies five constraint types and analyzes the computational complexity of finding EC test sets that respect these constraints. The authors prove polynomial-time solvability for POSITIVE constraints, and NP-completeness for NEGATIVE, ONCE, MAX-ONCE, and ALWAYS constraints, with proofs based on polynomial-time reductions from SAT variants and even acyclic graph restrictions. An important contribution is a fixed-parameter tractable (FPT) algorithm for NEGATIVE with respect to the number of constraints, offering a concrete tractable approach when constraint counts are small. These results map the computational limits of constraint-aware path-based testing and suggest directions for further work on multi-constraint combinations and practical constraint modeling in test generation.

Abstract

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.

Computational Complexity of Edge Coverage Problem for Constrained Control Flow Graphs

TL;DR

This work studies edge coverage (EC) for constrained control flow graphs (cCFGs), where test paths must satisfy semantic constraints in addition to traversing every edge. It systematically classifies five constraint types and analyzes the computational complexity of finding EC test sets that respect these constraints. The authors prove polynomial-time solvability for POSITIVE constraints, and NP-completeness for NEGATIVE, ONCE, MAX-ONCE, and ALWAYS constraints, with proofs based on polynomial-time reductions from SAT variants and even acyclic graph restrictions. An important contribution is a fixed-parameter tractable (FPT) algorithm for NEGATIVE with respect to the number of constraints, offering a concrete tractable approach when constraint counts are small. These results map the computational limits of constraint-aware path-based testing and suggest directions for further work on multi-constraint combinations and practical constraint modeling in test generation.

Abstract

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.
Paper Structure (10 sections, 7 theorems, 1 equation, 1 figure, 1 table, 2 algorithms)

This paper contains 10 sections, 7 theorems, 1 equation, 1 figure, 1 table, 2 algorithms.

Key Result

Theorem 1

Let $G=(V, E, s, t, C, C_-)$ be a cCFG with a set of NEGATIVE constraints. Deciding whether a test set achieving EC for $G$ respecting $C$ of type $C_-$ exists is NP--complete.

Figures (1)

  • Figure 1: Enterprise procurement and vendor management business process model

Theorems & Definitions (7)

  • Theorem 1
  • Theorem 2
  • Theorem 3
  • Theorem 4
  • Lemma 8
  • Lemma 10
  • Theorem 14