Software testing using machine learning
First Claim
Patent Images
1. A method for analyzing a computer program, comprising:
- Performing, using at least one processor, a static analysis on a program to determine property correctness;
generating and conducting test cases to provide test output data;
applying one or more learning methods for producing hypotheses about aspects of execution of the program to classify paths for test cases to determine whether the test cases have been encountered or otherwise, wherein each learning is a generalization from input data and the output of the learning methods inductively classifies if each test output trace is similar to a prior test case, and wherein path selection traverses program paths in a control flow graph (CFG) representation of the program and to select paths from the CFG along with constraints on the variables at different nodes that contradict a hypothesis given by one learning method;
performing an iterated exploration of one or more paths while testing each path for membership;
for each path segment (f,g) in a path, performing a depth first search of the CFG representation of the program to find all loop free paths lending from f to g while visiting no other functions;
determining a path summary consisting of a guard y and an update U and marking the path as feasible if the guard is feasible;
determining a set of path summaries σ
(π
) by iterated composition as follows
σ
(π
0)=σ
f1,g1, σ
(π
m+1)=σ
(π
m)∘
σ
fm+1,gm+1;
wherein π
represents a call graph path; and
in accordance with the hypothesis, generating new test cases to cause the program to exercise behavior which is outside of the encountered test cases.
2 Assignments
0 Petitions
Accused Products
Abstract
A system and method for analyzing a computer program includes performing a static analysis on a program to determine property correctness. Test cases are generated and conducted to provide test output data. Hypotheses about aspects of execution of the program are produced to classify paths for test cases to determine whether the test cases have been encountered or otherwise. In accordance with the hypothesis, new test cases are generated to cause the program to exercise behavior which is outside of the encountered test cases.
48 Citations
20 Claims
-
1. A method for analyzing a computer program, comprising:
-
Performing, using at least one processor, a static analysis on a program to determine property correctness; generating and conducting test cases to provide test output data; applying one or more learning methods for producing hypotheses about aspects of execution of the program to classify paths for test cases to determine whether the test cases have been encountered or otherwise, wherein each learning is a generalization from input data and the output of the learning methods inductively classifies if each test output trace is similar to a prior test case, and wherein path selection traverses program paths in a control flow graph (CFG) representation of the program and to select paths from the CFG along with constraints on the variables at different nodes that contradict a hypothesis given by one learning method; performing an iterated exploration of one or more paths while testing each path for membership; for each path segment (f,g) in a path, performing a depth first search of the CFG representation of the program to find all loop free paths lending from f to g while visiting no other functions; determining a path summary consisting of a guard y and an update U and marking the path as feasible if the guard is feasible; determining a set of path summaries σ
(π
) by iterated composition as follows
σ
(π
0)=σ
f1,g1, σ
(π
m+1)=σ
(π
m)∘
σ
fm+1,gm+1;wherein π
represents a call graph path; andin accordance with the hypothesis, generating new test cases to cause the program to exercise behavior which is outside of the encountered test cases. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A non-transitory computer readable storage device comprising a computer readable program, wherein the computer readable program when executed on a computer causes the computer to perform the steps of:
-
performing a static analysis on a program to determine property correctness; generating and conducting test cases to provide test output data; applying one or more learning methods for producing hypotheses about aspects of execution of the program to classify paths for test cases to determine whether the test cases have been encountered or otherwise, wherein each learning is a generalization from input data and the output of the learning methods inductively classifies if each test output trace is similar to a prior test case, and wherein path selection traverses program paths in a control flow graph (CFG) representation of the program and to select paths from the CFG along with constraints on the variables at different nodes that contradict a hypothesis given by one learning method; performing an iterated exploration of one or more paths while testing each path for membership; for each path segment (f,g) in a path, performing a depth first search of the CFG representation of the program to find all loop free paths lending from f to g while visiting no other functions; determining a path summary consisting of a guard y and an update U and marking the path as feasible if the guard is feasible; determining a set of path summaries σ
(π
) by iterated composition as follows
σ
(π
0)=σ
f1,g1, σ
(π
m+1)=σ
(π
m)∘
σ
fm+1,gm+1;wherein π
represents a call graph path; andin accordance with the hypothesis, generating new test cases to cause the program to exercise behavior which is outside of the encountered test cases.
-
-
12. A system for analyzing a computer program, comprising:
-
at least one processor; a static analysis code executed by a processor and configured to instrument and analyze a program to determine property correctness; a test generator to generate test cases on an instrumented version of the program and to provide test output data; a learning system configured to produce hypotheses about aspects of execution of the program to classify paths for the test cases to determine whether the test cases have been encountered or otherwise, wherein each learning is a generalization from input data and the output of the learning methods inductively classifies if each test output trace is similar to a prior test case, and wherein path selection traverses program paths in a control flow graph (CFG) representation of the program and to select paths from the CFG along with constraints on the variables at different nodes that contradict a hypothesis given by one learning method, wherein the learning system performs an iterated exploration of one or more paths while testing each path for membership, and for each path segment (f,g) in a path, performs a depth first search of the CFG representation of the program to find all loop free paths lending from f to g while visiting no other functions;
determines a path summary consisting of a guard y and an update U and marking the path as feasible if the guard is feasible; and
determines a set of path summaries σ
(π
) by iterated composition as follows
σ
(π
0)=σ
f1,g1, σ
(π
m+1)=σ
(π
m)∘
σ
fm+1,gm+1;wherein π
represents a call graph path; anda feedback loop coupled from the learning system to the test generator to provide hypotheses to the test generator to generate new test cases to cause the program to exercise behavior which outside of the encountered test cases. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20)
-
Specification