Automatic software testing tool
First Claim
1. A method of testing machine-executable code, the code having a plurality of possible states, the method comprising:
- generating a first set of input operations based on a definition of the states, each input operation including machine-executable instructions for causing the code to enter at least one of the states;
causing the code to be executed in response to the first set of input operations;
assigning a fitness value to each input operation based on a result of causing the code to be executed; and
generating a second set of input operations from the first set of input operations based on the fitness values.
2 Assignments
0 Petitions
Accused Products
Abstract
A method of testing a software module using a genetic algorithm to generate a best test script is provided. The software module has a number of possible states. A set of state machines is created which represent a definition for either a user interface or an application program interface (API) of the software module in terms of the possible states. From the state machines, a set of test cases is automatically generated, such that each test case consists of code for manipulating the user interface or API. A genetic algorithm creates populations of test scripts from the test cases, in which each test script includes a number of test cases. Each test script from each successive generation of test scripts is executed by applying the script as input to the software module. A code coverage analyzer provides a measure of code coverage to the genetic algorithm for each test script. The genetic algorithm uses the measure of code coverage as a fitness value in generating future populations of test scripts and in determining a best script.
184 Citations
48 Claims
-
1. A method of testing machine-executable code, the code having a plurality of possible states, the method comprising:
-
generating a first set of input operations based on a definition of the states, each input operation including machine-executable instructions for causing the code to enter at least one of the states; causing the code to be executed in response to the first set of input operations; assigning a fitness value to each input operation based on a result of causing the code to be executed; and generating a second set of input operations from the first set of input operations based on the fitness values. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method of testing a software module including a plurality of machine-executable instructions, the software module including instructions for receiving a plurality of inputs when executed by a processor, the method comprising:
-
(a) inputting a definition of the instructions for receiving a plurality of inputs, the definition corresponding to a plurality of possible states of the software; (b) generating a plurality of test cases from the definition, each test case including machine-executable instructions for producing at least one of the states in response to a test input; (c) generating a first population of scripts, such that each script includes at least one of the test cases; (d) causing the software module to be executed in response to each script; (e) assigning a fitness value to each script based on execution of the software module according to the causing step; and (f) generating a new population of scripts based on the first population and the fitness values. - View Dependent Claims (9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. A method of testing a software module, the software module having an input interface, the method comprising:
-
(a) inputting a definition of the input interface in terms of a plurality of state machines, each state machine having a plurality of logically interconnected states; (b) generating from the state machines a plurality of test cases, wherein each test case includes a set of instructions representing a chronological sequence of states in one of the state machines and at least one test input for causing a transition between two states in the sequence; (c) generating a first population of scripts, each script including a plurality of the test cases; (d) causing the software application to be executed in response to each script of the first population; (e) generating a fitness value for each script based on a result of the software module being executed in response to said script; (f) ranking the scripts based on the fitness values; (g) generating a new population of scripts based on a result of the ranking step; and (h) causing the software application to be executed in response to each script of the new population. - View Dependent Claims (21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)
-
-
32. A program storage device readable by a machine, the program storage device tangibly embodying a program of instructions executable by the machine to perform steps for testing a test software module, the steps comprising:
-
building a dynamically generated test script from a population of test cases; inputting the test script to the test software module for execution by the test software module; generating a fitness score corresponding to the test script by comparing a result of execution of the test script with a predefined fitness attribute; and using the fitness score to modify the test script for a subsequent iteration of the inputting step. - View Dependent Claims (33, 34, 35, 36, 37, 38)
-
-
39. A program storage device readable by a machine, the program storage device tangibly embodying a program of instructions executable by the machine to perform steps for testing software, the software including code for receiving a plurality of inputs when executed by a processor, the steps comprising:
-
(a) inputting a definition of the code for receiving the plurality of inputs, the definition corresponding to a plurality of possible states of the software; (b) generating a plurality of test cases from the definition, each test case including machine-executable instructions for producing at least one of the states in response to a test input; (c) using a genetic algorithm to generate a population of scripts for testing the software, each script including at least one of the test cases; (d) causing the software to be executed in response to the scripts of the first population of scripts; (e) generating a fitness value for each script based on execution of the software; and (e) using the genetic algorithm to generate a second population of scripts based on the fitness values. - View Dependent Claims (40, 41, 42, 43)
-
-
44. A device for testing a software module, the software module including code for providing an input interface when executed by a processor, the software module having a plurality of possible states, the device comprising:
-
a test case generator coupled to receive a definition of the states, the test case generator generating a plurality of test cases based on the definition of the states, each test case including instructions for causing the software module to enter at least one of the states; a test script generator coupled to receive the test cases, the test script generator dynamically generating a first population of scripts, each script of the first population of scripts including at least one of the test cases, the script generator coupled to provide each of the test scripts to the software module as input to the input interface during execution by the processor; a test script evaluator coupled to receive output from the software module during execution by the processor, the script generator generating a plurality of fitness values in response to the software module being executed, one fitness value for each script, the test script evaluator providing the fitness values to the test script generator; and wherein the test script generator further dynamically generates at least one new population of scripts based on a previous population of scripts and a plurality of fitness values associated with the previous population of scripts. - View Dependent Claims (45, 46, 47, 48)
-
Specification