IP Library › Granted Patent US 11,288,173
Granted Patent B1
US 11,288,173 · App. 17/027,780 · Granted Mar 29, 2022

Test case selection

Inventors: Jin Wang (Xi'an, CN); Lei Gao (Xian, CN); A Peng Zhang (Xian, CN); Si Er Han (Xi'an, CN); Jing James Xu (Xi'an, CN); Kai Li (Xian, CN)
Assignee: International Business Machines Corporation
G06F11/3684G06F11/3688G06F16/285G06Q10/06395
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,288,173
App. No.
17/027,780
Granted
Mar 29, 2022
Kind
B1
Abstract

Test case selection methods are disclosed. A feature of a candidate test case and respective features of a set of test cases are extracted. The set of test cases is clustered into a plurality of clusters based on the respective features of the set of test cases. At least one cluster related to the candidate test case is determined from the plurality of clusters based on the feature of the candidate test case. At least one test case similar to the candidate test case is selected from a plurality of test cases included in the at least one cluster.

Claims (74)

1. A computer-implemented method comprising:

extracting a feature of a candidate test case and respective features of a set of test cases;

clustering the set of test cases into a plurality of clusters based on the respective features of the set of test cases;

determining distances between centers of respective clusters of the plurality of clusters and the candidate test case, wherein the distances indicate an average similarity between the candidate test case and test cases included in respective clusters of test cases;

ranking the distances by length, smallest to largest, the smallest distance indicating a closest average similarity;

determining a cluster of the plurality of clusters is related to the candidate test case by selecting the cluster having a distance with the smallest length, wherein a ratio of cluster test cases in the selected cluster to total test cases in the set of test cases exceeds a first threshold; and

selecting at least one cluster test case similar to the candidate test case from the cluster test cases included in the selected cluster.

2. The method of claim 1 , wherein extracting the feature of the candidate test case includes:

extracting values of a set of feature elements from the candidate test case, wherein the set of feature elements is applicable for distinguishing different test cases; and

determining the feature of the candidate test case based on the values of the set of feature elements extracted from the candidate test case.

3. The method of claim 2 , wherein extracting the respective features of the set of test cases includes:

extracting values of the set of feature elements from each of the set of test cases; and

determining the respective features of the set of test cases based on the values of the set of feature elements extracted from each of the set of test cases.

4. The method of claim 1 , further includes:

receiving a user input indicating the first threshold.

5. The method of claim 1 , wherein the selecting at least one test case similar to the candidate test case includes:

determining respective similarities between the plurality of test cases and the candidate test case based on the feature of the candidate test case and respective features of the plurality of test cases; and

selecting the at least one test case from the plurality of test cases based on the respective similarities.

6. The method of claim 5 , wherein the selecting the at least one test case from the plurality of test cases includes:

ordering the plurality of test cases based on the respective similarities; and

selecting the at least one test case from the ordered test cases, wherein a sum of the similarities between the at least one test case and the candidate test case exceeds a second threshold.

7. The method of claim 6 , further including:

receiving a user input indicating the second threshold.

8. The method of claim 5 , wherein the selecting the at least one test case from the plurality of test cases includes:

determining respective test efficiencies of the plurality of test cases based on the respective similarities and respective historical execution time of the plurality of test cases;

ordering the plurality of test cases based on the respective test efficiencies; and

selecting the at least one test case from the ordered test cases, wherein a sum of the test efficiencies of the at least one test case exceeds a third threshold.

9. The method of claim 8 , further including:

receiving a user input indicating the third threshold.

10. A computer system comprising:

a processor(s) set;

a machine readable storage device; and

computer code stored on the machine readable storage device, with the computer code including instructions and data for causing the processor(s) set to perform operations including the following:

extracting a feature of a candidate test case and respective features of a set of test cases,

clustering the set of test cases into a plurality of clusters based on the respective features of the set of test cases,

determining distances between centers of respective clusters of the plurality of clusters and the candidate test case, wherein the distances indicate an average similarity between the candidate test case and test cases included in respective clusters of test cases,

ranking the distances by length, smallest to largest, the smallest distance indicating a closest average similarity,

determining a cluster of the plurality of clusters is related to the candidate test case by selecting the cluster having a distance with the smallest length, wherein a ratio of cluster test cases in the selected cluster to total test cases in the set of test cases exceeds a first threshold, and

selecting at least one cluster test case similar to the candidate test case from the cluster test cases included in the selected cluster.

11. The computer system of claim 10 , wherein extracting the feature of the candidate test case includes:

extracting values of a set of feature elements from the candidate test case, wherein the set of feature elements is applicable for distinguishing different test cases; and

determining the feature of the candidate test case based on the values of the set of feature elements extracted from the candidate test case.

12. The system of claim 11 , wherein extracting the respective features of the set of test cases includes:

extracting values of the set of feature elements from each of the set of test cases; and

determining the respective features of the set of test cases based on the values of the set of feature elements extracted from each of the set of test cases.

13. The system of claim 10 , wherein the actions further include:

receiving a user input indicating the first threshold.

14. The system of claim 10 , wherein the selecting at least one test case similar to the candidate test case includes:

determining respective similarities between the plurality of test cases and the candidate test case based on the feature of the candidate test case and respective features of the plurality of test cases; and

selecting the at least one test case from the plurality of test cases based on the respective similarities.

15. The system of claim 14 , wherein the selecting the at least one test case from the plurality of test cases includes:

ordering the plurality of test cases based on the respective similarities; and

selecting the at least one test case from the ordered test cases, wherein a sum of the similarities between the at least one test case and the candidate test case exceeds a second threshold.

16. The system of claim 15 , further includes:

receiving a user input indicating the second threshold.

17. The system of claim 14 , wherein the selecting the at least one test case from the plurality of test cases includes:

determining respective test efficiencies of the plurality of test cases based on the respective similarities and respective historical execution time of the plurality of test cases;

ordering the plurality of test cases based on the respective test efficiencies; and

selecting the at least one test case from the ordered test cases, wherein a sum of the test efficiencies of the at least one test case exceeds a third threshold.

18. A computer program product comprising:

a machine readable storage device; and

computer code stored on the machine readable storage device, with the computer code including instructions and data for causing a processor(s) set to perform operations including the following:

extracting a feature of a candidate test case and respective features of a set of test cases,

clustering the set of test cases into a plurality of clusters based on the respective features of the set of test cases,

determining distances between centers of respective clusters of the plurality of clusters and the candidate test case, wherein the distances indicate an average similarity between the candidate test case and test cases included in respective clusters of test cases,

ranking the distances by length, smallest to largest, the smallest distance indicating a closest average similarity,

determining a cluster of the plurality of clusters is related to the candidate test case by selecting the cluster having a distance with the smallest length, wherein a ratio of cluster test cases in the selected cluster to total test cases in the set of test cases exceeds a first threshold, and

selecting at least one cluster test case similar to the candidate test case from the cluster test cases included in the selected cluster.

19. The computer program product of claim 18 , wherein extracting the feature of the candidate test case includes:

extracting values of a set of feature elements from the candidate test case, wherein the set of feature elements is applicable for distinguishing different test cases, and

determining the feature of the candidate test case based on the values of the set of feature elements extracted from the candidate test case.

20. The computer program product of claim 18 , wherein selecting at least one cluster test case similar to the candidate test case includes:

determining respective similarities between the plurality of test cases and the candidate test case based on the feature of the candidate test case and respective features of the plurality of test cases, and

selecting the at least one test case from the plurality of test cases based on the respective similarities.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 22, 2020
From: WANG, JIN; GAO, LEI; ZHANG, A PENG; HAN, SI ER; XU, JING JAMES; LI, KAI
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 053839/0161 →
Cited By (1)
US 12,547,525