IP Library › Granted Patent US 10,684,943
Granted Patent B2
US 10,684,943 · App. 16/115,409 · Granted Jun 16, 2020

Generating executable test automation code automatically according to a test case

Inventors: Peng Fei (Chengdu, CN); Zhongyi Zhou (Chengdu, CN)
Assignee: EMC IP Holding Company LLC
G06F11/3684G06F9/45512G06K9/6218G06K9/6256G06K9/6278G06N20/00
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 10,684,943
App. No.
16/115,409
Filed
Aug 28, 2018
Granted
Jun 16, 2020
Kind
B2
Art Unit
2192
USPC
717/124
Abstract

A mapping is created between test steps from existing test cases and code snippets from existing automated test scripts. The code snippets are clustered into categories. The test steps are refined to generate training word segments. A new manual test case to automate is received. New test steps from the new manual test case are refined to generate new word segments. Probabilities are calculated for the categories, each probability indicating a likelihood that a new test step belongs in a particular category, and being based on a training word segment associated with the particular category, and a new word segment derived from the new test step. The new test step is mapped to a code snippet from a category having the highest probability. The probability calculation and code snippet mapping is repeated for each other new test step.

Claims (84)

1. A system comprising: a processor; and memory storing one or more sequences of instructions which, when executed by the processor, cause the processor to carry out the steps of:

creating a mapping between a plurality of test steps split from existing manual test cases and a plurality of code snippets split from existing automated test scripts for the existing manual test cases;

clustering the plurality of code snippets into categories, each category comprising a subset of code snippets that are determined to match each other, and a corresponding subset of the plurality of test steps according to the mapping;

refining the subset of test steps in each category to generate training word segments for each category;

receiving a new manual test case to automate;

splitting the new manual test case into a plurality of new test steps;

refining the plurality of new test steps to generate new word segments;

calculating a plurality of probabilities for the plurality of categories, each probability indicating a likelihood that a new test step belongs in a particular category, and each probability being based on a training word segment associated with the particular category, and a new word segment derived from refining the new test step;

identifying a category having a highest probability;

mapping the new test step to a code snippet from the category having the highest probability; and

repeating the calculating, identifying, and mapping for each other new test step from the new manual test case to generate a new automated test script for the new manual test case.

2. The system of claim 1 wherein the plurality of test steps and the plurality of new test steps are in a natural language format.

3. The system of claim 1 wherein the refining the subset of test steps in each category to generate training word segments for each category comprises:

segmenting words from the test steps and deleting stopping words from the test steps to identify meaningful units of one or more words, the meaningful units being the training word segments.

4. The system of claim 1 wherein the refining the plurality of new test steps to generate new word segments comprises:

segmenting words from the new test steps and deleting stopping words from the new test steps to identify meaningful units of one or more words, the meaningful units being the new word segments.

5. The system of claim 1 wherein the plurality of probabilities are calculated according to a Naïve Bayes algorithm.

6. The system of claim 1 wherein the clustering the plurality of code snippets into categories comprises:

collecting keywords into a dictionary, each keyword comprising code;

chunking a first code snippet into a first plurality of chunks;

comparing the first plurality of chunks to the keywords in the dictionary;

placing chunks of the first plurality of chunks that match the keywords in the dictionary into a first code snippet keyword list;

chunking a second code snippet into a second plurality of chunks;

comparing the second plurality of chunks to the keywords in the dictionary;

placing chunks of the second plurality of chunks that match the keywords in the dictionary into a second code snippet keyword list;

comparing the first and second code snippet keywords lists to each other;

if the first code snippet keyword list matches the second code snippet keyword list, clustering the first code snippet and the second code snippet into a same category; and

if the first code snippet keyword list does not match the second code snippet keyword list, clustering the first code snippet and the second code snippet into different categories.

7. A method comprising:

creating a mapping between a plurality of test steps split from existing manual test cases and a plurality of code snippets split from existing automated test scripts for the existing manual test cases;

clustering the plurality of code snippets into categories, each category comprising a subset of code snippets that are determined to match each other, and a corresponding subset of the plurality of test steps according to the mapping;

refining the subset of test steps in each category to generate training word segments for each category;

receiving a new manual test case to automate;

splitting the new manual test case into a plurality of new test steps;

refining the plurality of new test steps to generate new word segments;

calculating a plurality of probabilities for the plurality of categories, each probability indicating a likelihood that a new test step belongs in a particular category, and each probability being based on a training word segment associated with the particular category, and a new word segment derived from refining the new test step;

identifying a category having a highest probability;

mapping the new test step to a code snippet from the category having the highest probability; and

repeating the calculating, identifying, and mapping for each other new test step from the new manual test case to generate a new automated test script for the new manual test case.

8. The method of claim 7 wherein the plurality of test steps and the plurality of new test steps are in a natural language format.

9. The method of claim 7 wherein the refining the subset of test steps in each category to generate training word segments for each category comprises:

segmenting words from the test steps and deleting stopping words from the test steps to identify meaningful units of one or more words, the meaningful units being the training word segments.

10. The method of claim 7 wherein the refining the plurality of new test steps to generate new word segments comprises:

segmenting words from the new test steps and deleting stopping words from the new test steps to identify meaningful units of one or more words, the meaningful units being the new word segments.

11. The method of claim 7 wherein the plurality of probabilities are calculated according to a Naïve Bayes algorithm.

12. The method of claim 7 wherein the clustering the plurality of code snippets into categories comprises:

collecting keywords into a dictionary, each keyword comprising code;

chunking a first code snippet into a first plurality of chunks;

comparing the first plurality of chunks to the keywords in the dictionary;

placing chunks of the first plurality of chunks that match the keywords in the dictionary into a first code snippet keyword list;

chunking a second code snippet into a second plurality of chunks;

comparing the second plurality of chunks to the keywords in the dictionary;

placing chunks of the second plurality of chunks that match the keywords in the dictionary into a second code snippet keyword list;

comparing the first and second code snippet keywords lists to each other;

if the first code snippet keyword list matches the second code snippet keyword list, clustering the first code snippet and the second code snippet into a same category; and

if the first code snippet keyword list does not match the second code snippet keyword list, clustering the first code snippet and the second code snippet into different categories.

13. A computer program product, comprising a non-transitory computer-readable medium having a computer-readable program code embodied therein, the computer-readable program code adapted to be executed by one or more processors to implement a method comprising:

creating a mapping between a plurality of test steps split from existing manual test cases and a plurality of code snippets split from existing automated test scripts for the existing manual test cases;

clustering the plurality of code snippets into categories, each category comprising a subset of code snippets that are determined to match each other, and a corresponding subset of the plurality of test steps according to the mapping;

refining the subset of test steps in each category to generate training word segments for each category;

receiving a new manual test case to automate;

splitting the new manual test case into a plurality of new test steps;

refining the plurality of new test steps to generate new word segments;

calculating a plurality of probabilities for the plurality of categories, each probability indicating a likelihood that a new test step belongs in a particular category, and each probability being based on a training word segment associated with the particular category, and a new word segment derived from refining the new test step;

identifying a category having a highest probability;

mapping the new test step to a code snippet from the category having the highest probability; and

repeating the calculating, identifying, and mapping for each other new test step from the new manual test case to generate a new automated test script for the new manual test case.

14. The computer program product of claim 13 wherein the plurality of test steps and the plurality of new test steps are in a natural language format.

15. The computer program product of claim 13 wherein the refining the subset of test steps in each category to generate training word segments for each category comprises:

segmenting words from the test steps and deleting stopping words from the test steps to identify meaningful units of one or more words, the meaningful units being the training word segments.

16. The computer program product of claim 13 wherein the refining the plurality of new test steps to generate new word segments comprises:

segmenting words from the new test steps and deleting stopping words from the new test steps to identify meaningful units of one or more words, the meaningful units being the new word segments.

17. The computer program product of claim 13 wherein the plurality of probabilities are calculated according to a Naïve Bayes algorithm.

18. The computer program product of claim 13 wherein the clustering the plurality of code snippets into categories comprises:

collecting keywords into a dictionary, each keyword comprising code;

chunking a first code snippet into a first plurality of chunks;

comparing the first plurality of chunks to the keywords in the dictionary;

placing chunks of the first plurality of chunks that match the keywords in the dictionary into a first code snippet keyword list;

chunking a second code snippet into a second plurality of chunks;

comparing the second plurality of chunks to the keywords in the dictionary;

placing chunks of the second plurality of chunks that match the keywords in the dictionary into a second code snippet keyword list;

comparing the first and second code snippet keywords lists to each other;

if the first code snippet keyword list matches the second code snippet keyword list, clustering the first code snippet and the second code snippet into a same category; and

if the first code snippet keyword list does not match the second code snippet keyword list, clustering the first code snippet and the second code snippet into different categories.

Assignments (4)
RELEASE OF SECURITY INTEREST IN PATENTS PREVIOUSLY RECORDED AT REEL/FRAME (053546/0001) Recorded Jun 23, 2022
From: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A., AS NOTES COLLATERAL AGENT
To: DELL MARKETING L.P. (ON BEHALF OF ITSELF AND AS SUCCESSOR-IN-INTEREST TO CREDANT TECHNOLOGIES, INC.); DELL INTERNATIONAL L.L.C.; DELL PRODUCTS L.P.; DELL USA L.P.; EMC CORPORATION; DELL MARKETING CORPORATION (SUCCESSOR-IN-INTEREST TO FORCE10 NETWORKS, INC. AND WYSE TECHNOLOGY L.L.C.); EMC IP HOLDING COMPANY LLC
Reel/Frame 071642/0001 →
SECURITY AGREEMENT Recorded Apr 22, 2020
From: CREDANT TECHNOLOGIES INC.; DELL INTERNATIONAL L.L.C.; DELL MARKETING L.P.; DELL PRODUCTS L.P.; DELL USA L.P.; EMC CORPORATION; FORCE10 NETWORKS, INC.; WYSE TECHNOLOGY L.L.C.; EMC IP HOLDING COMPANY LLC
To: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A.
Reel/Frame 053546/0001 →
SECURITY AGREEMENT Recorded Mar 21, 2019
From: CREDANT TECHNOLOGIES, INC.; DELL INTERNATIONAL L.L.C.; DELL MARKETING L.P.; DELL PRODUCTS L.P.; DELL USA L.P.; EMC CORPORATION; FORCE10 NETWORKS, INC.; WYSE TECHNOLOGY L.L.C.; EMC IP HOLDING COMPANY LLC
To: THE BANK OF NEW YORK MELLON TRUST COMPANY, N.A.
Reel/Frame 049452/0223 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 28, 2018
From: FEI, PENG; ZHOU, ZHONGYI
To: EMC IP HOLDING COMPANY LLC
Reel/Frame 046731/0262 →
Priority Claims (1)
CN 2018 1 0765680 · Jul 12, 2018 · national
Continuity (1)
Related Publication 20200019492A1 · Jan 16, 2020
Cited By (3)
US 12,326,802 US 12,353,317 US 12,579,050