US 9,811,446 B2
Method and apparatus for providing test cases
Qi Cheng Li, Beijing (CN); Li Jun Mei, Beijing (CN); Jian Wang, Beijing (CN); Fang Quan Xie, Beijing (CN); and Zi Yu Zhu, Beijing (CN)
Assigned to INTERNATIONAL BUSINESS MACHINES CORPORATION, Armonk, NY (US)
Filed by INTERNATIONAL BUSINESS MACHINES CORPORATION, Armonk, NY (US)
Filed on Jun. 6, 2014, as Appl. No. 14/298,239.
Claims priority of application No. 2013 1 0257810 (CN), filed on Jun. 26, 2013.
Prior Publication US 2015/0007146 A1, Jan. 1, 2015
Int. Cl. G06F 9/44 (2006.01); G06F 11/36 (2006.01); G06F 11/34 (2006.01)
CPC G06F 11/3684 (2013.01) [G06F 11/3466 (2013.01)] 12 Claims
OG exemplary drawing
 
1. A method for providing a test case for a modified program, comprising:
obtaining a modification item that modifies a previous version of the program;
finding a first instrument of a plurality of instruments inserted into the program that is before the modification item;
finding a second instrument of the plurality of instruments inserted into the program that is after the modification item;
obtaining an execution path of the modified program that is between the first instrument and the second instrument and associated with the modification as well as a constraint set corresponding to the execution path;
obtaining an execution result, outputted by the first instrument, of executing the previous version of the program using an original test case; and
determining a test case applicable for the execution path based on the execution result and the constraint set; wherein determining a test case applicable for the execution path comprises:
further defining the constraint set using the execution result to form a combined constraint set;
solving the combined constraint set; and
judging whether the original test case is applicable for the execution path according to the solving result; and further wherein the judging comprises, in a case where the combined constraint set has no solution, determining the original test case not applicable for the execution path;
modifying parameter settings related to local variables in the constraint set to make the combined constraint set have a solution; and
generating a new test case based on the original test case and the modified parameter settings.