NP problems in Test Case Design

Source: Internet
Author: User

Links to related articles are as follows:
  • Microsoft bridge problem and testing personnel literacy
  • New Equivalence Method Solution
  • View an instance using C/C ++ code
  • 90% programmers cannot write BUG-free binary lookup programs?
  • 3.1.1 NP difficulties in NP test case design in Test Case DesignHow to divide the test space to cover the entire test space with as few subsets as possible is an optimization problem in the test case design. In mathematics, this is actually an NP-completeness problem. The following describes why the minimum number of test cases is an NP-complete problem. To illustrate this problem, we must first establish a mathematical model for solving the minimum number of test cases. Assume that n sets of measurable data are recorded as D = {d1 ,... Dn}. Suppose there are m possible defects in the test space, and the set of m defects is recorded as B = {b1 ,... Bm }. Each measurable data may reveal several possible errors in the defect Set B, that is, the defect set that can be revealed for each measurable data is a subset of B, note that these subsets are e1 ,... En, (ei, B, 1 ≤ I ≤ n ). Because any defect in the test space is caused by measurable data, for any defect bk ε B (1 ≤ k ≤ n ), there must be a measurable data di ε D (1 ≤ I ≤ n) that can reveal this defect, that is, there is a set of ei (1 ≤ I ≤ n), making bk ε ei. The least number of test cases is the problem of finding the least number of test cases. Using these test cases can reveal all the defects in the defect set. In fact, it is necessary to find several subsets of ei (1 ≤ I ≤ n) so that the members of these subsets can overwrite all the members of Set B. In this way, a mathematical model with the minimum number of test cases is established, which is a typical NP-completeness problem due to the set coverage problem in mathematics. Currently, no precise polynomial algorithms can be found to solve this problem. Only some approximate algorithms can be designed to solve this problem, the test case design method described later is actually an approximate algorithm for solving this problem. For more information about approximate mathematical algorithms for set coverage problems, see Section 35.3 of Introduction to algorithms by Thomas H. Cormen. The introduction to algorithms also provides another practical example of a set coverage problem: Suppose X represents a set of techniques required to solve a problem, in addition, there is a set of people that can be used to solve the problem. That is to say, at least one person can master this set of skills. The question now is how to select a minimum number of people to form a committee so that at least one member of the Committee can master any skill set. Compare this example with the mathematical model with the minimum number of test cases, and you will find that this is the same problem. Although the minimum number of test cases is an NP-complete problem, in most cases, the number of test cases is not too large, and it is very likely to obtain a precise solution, only when there are complex combinations, the number of use cases may be redundant.

     

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.