Method and computer program product for generating a computer program product test that includes an optimized set of computer program product test cases, and method for selecting same
First Claim
1. A method for selecting a set of test cases for testing a software program having a number of possible code blocks that may be exercised during execution of the program, the method comprising the steps of:
- identifying the code blocks that may be exercised during execution of the program; and
executing a genetic algorithm to determine a set of test cases that exercises a maximum number of the identified code blocks in a minimum amount of time, said executing step further comprising;
providing a population representation of each test case;
randomly selecting a subset of said population representation;
determining a fitness value for each subset, said fitness value corresponding to an execution time of the test case and an amount of the code blocks covered by the test case;
totaling the fitness values calculated by said determining step; and
deciding if said subset should be included in another population representation for calculating another fitness value until a desired overall fitness value is achieved.
2 Assignments
0 Petitions
Accused Products
Abstract
A method for selecting a set of test cases which may be used to test a software program product is disclosed. The program to be tested may have a number of code blocks that may be exercised during execution of the program. The method includes identifying each of the code blocks that may be exercised, and determining a time for executing each of the test cases in the set. A set of the test cases is then selected that exercises a maximum number of the identified code blocks that can be exercised in a minimum time. The selection step may be performed by executing a genetic algorithm for determining which subset of test cases to use, using a combination of time and coverage as a fitness value.
93 Citations
3 Claims
-
1. A method for selecting a set of test cases for testing a software program having a number of possible code blocks that may be exercised during execution of the program, the method comprising the steps of:
-
identifying the code blocks that may be exercised during execution of the program; and executing a genetic algorithm to determine a set of test cases that exercises a maximum number of the identified code blocks in a minimum amount of time, said executing step further comprising; providing a population representation of each test case; randomly selecting a subset of said population representation; determining a fitness value for each subset, said fitness value corresponding to an execution time of the test case and an amount of the code blocks covered by the test case; totaling the fitness values calculated by said determining step; and deciding if said subset should be included in another population representation for calculating another fitness value until a desired overall fitness value is achieved.
-
-
2. A computer program product comprising:
a computer useable medium having computer readable code embodied therein for causing a software test routine to be generated by selecting a set of test cases to test a computer program product to be tested having multiple blocks of code which may be selectively executed, comprising; computer readable program code devices configured to cause a computer to effect an identification of all of said code blocks in said product to be tested for determining the coverage of said test cases on said code blocks which can be executed; computer readable program code devices configured to cause a computer to effect a measure of time for executing each of the test cases; and computer readable program code devices configured to cause a computer to effect an identification of a set of test cases that exercises a maximum number of said identified code blocks in a minimum time, comprising computer readable program code devices configured to cause a computer to execute a genetic algorithm for determining which test cases to use to exercise the computer program product using test time and code coverage as fitness values, wherein said computer readable program code devices configured to cause a computer to execute a genetic algorithm further comprises; computer readable program code devices configured to cause a computer to effect providing a population representation of each test case; computer readable program code devices configured to cause a computer to effect randomly selecting a subset of said population representation; computer readable program code devices configured to cause a computer to effect determining a fitness value for each subset said fitness value corresponding to an execution time of the test case and an amount of the code blocks covered by the test case; computer readable program code devices configured to cause a computer to effect totaling the fitness values calculated by said determining step; and computer readable program code devices configured to cause a computer to effect deciding if said subset should be included in another population representation for calculating another fitness value until a desired overall fitness value is achieved. - View Dependent Claims (3)
Specification