np hard
1993 United States NP-complete
12

Test Suite Minimization

Mary Jean Harrold, Rajiv Gupta, Mary Lou Soffa, 1993 — selecting the smallest test suite that still covers all the things you care about is NP-complete. Reduces to set cover.

Mary Jean Harrold (Clemson), Rajiv Gupta (Pittsburgh), and Mary Lou Soffa (Pittsburgh) gave the formal definition of the test suite minimization problem and proved it NP-complete by reduction from minimum set cover. Given a test suite T and a set of testing requirements R, find the smallest subset T' ⊆ T such that every requirement in R is satisfied by at least one test in T'. Each test "covers" some requirements; you want minimum number of tests that cover all requirements; this is set cover, exactly. Set cover was on Karp's 1972 list. Their paper introduced the HGS heuristic — a greedy algorithm that runs in polynomial time and gives a logarithmic approximation. Every modern test-reduction tool descends from this paper. The hardness is unavoidable; only the heuristic varies.

Harrold, M. J., Gupta, R., Soffa, M. L. (1993). A Methodology for Controlling the Size of a Test Suite. ACM Transactions on Software Engineering and Methodology, 2(3), 270–285. Source →