Patent ID: 7861226

Claim:
A method for generating test cases for testing software code, comprising: (a) identifying, by a processor, a path through the software code, wherein the path comprises a selected high priority code unit and wherein the path is determined using a representation of a flow graph for the software code; (b) determining, by a processor, constraints in a set of code units that, if satisfied, cause the path to be executed and, if violated, indicate an occurrence of a fault in execution of the software code; (c) solving, by a processor, the constraints for determining input data to the software code; wherein the solving step comprises the substeps: (c1) determining whether a selected path is infeasible, wherein a path is infeasible when there are at least first and second contradictory constraints; (c2) when the selected path is infeasible, rejecting the selected path and returning to step (a) to identify a next path; (c3) when the selected path is feasible, traversing the selected path and, for each further node along the selected path, adding, to the determined constraints, any additional constraints on data identified by the code units of the further node that would force the execution of the code units identified by a next following node along the path; (d) determining, by a processor, a corresponding data set satisfying the constraints; and (e) generating, by a processor, from the data set, test code for executing the software code in a manner that causes execution of the software code to perform the set of code units.