Method and apparatus for AI-driven automatic test script generation
First Claim
1. A method for generating a test script to test a web application based on a user log of past user interactions with the web application and a blueprint that models the web application, wherein the blueprint includes a state machine, in which states of the state machine correspond to at least one of (i) application pages of the web application or (ii) actions that are performed to transition from one of the application pages to another one of the application pages, and edges of the state machine correspond to transitions between the states of the state machine, the method comprising:
- creating, by a processor, a data structure with a root node corresponding to a root node of the blueprint, and setting a current node equal to the root node of the data structure;
receiving, by the processor, a first request from the user log;
computing, by the processor, a similarity score between the first request and each candidate action/request pair in the blueprint, wherein each candidate action/request pair includes an action from the state machine that is paired with a corresponding request from the state machine;
for non-zero ones of the similarity scores, adjusting, by the processor, the similarity score based on a number of steps to reach the candidate action/request pair associated with the similarity score from a node of the blueprint corresponding to the current node of the data structure, wherein a determination of the steps to reach the candidate action/request pair takes into account candidate action/request pairs that have been depleted from the node of the blueprint corresponding to the current node of the data structure;
eliminating, by the processor, candidate action/request pairs in the blueprint by comparing the adjusted similarity score to a threshold;
for each of the remaining candidate action/request pairs, storing, by the processor, the remaining candidate action/request pairs as terminal nodes from the current node in the data structure;
determining, by the processor, whether there are remaining requests in the user log;
if there are remaining requests in the user log, (i) receiving a next request from the user log, (ii) computing a similarity score between the next request and each candidate action/request pair in the blueprint, and (iii) for each of the terminal nodes in the data structure, setting the current node equal to the terminal node and repeating the method starting with the adjusting step; and
otherwise, if there are no remaining requests in the user log, determining, by the processor, a traversal through the data structure with a highest aggregate similarity score, and constructing, by the processor, the test script based on the determined traversal through the data structure and the blueprint.
2 Assignments
0 Petitions
Accused Products
Abstract
Models of certain groups of graphical user interface (GUI) objects (e.g., menu objects, product objects, title objects, etc.) are created. A website is then modeled as a state machine (also called a blueprint), in which states are used to model webpages of the website. Identifying characteristics of the states are specified based on the models of the GUI objects. Certain scanning options are used to reduce the complexity of the state machine and accelerate the state machine creation process, known as the “one per page” and “once per app” scanning options. After the state machine model of the website has been created, test cases are generated as traversals through the state machine. In one embodiment, user logs direct the generation of test cases so that the test cases resemble past user behavior.
-
Citations
20 Claims
-
1. A method for generating a test script to test a web application based on a user log of past user interactions with the web application and a blueprint that models the web application, wherein the blueprint includes a state machine, in which states of the state machine correspond to at least one of (i) application pages of the web application or (ii) actions that are performed to transition from one of the application pages to another one of the application pages, and edges of the state machine correspond to transitions between the states of the state machine, the method comprising:
-
creating, by a processor, a data structure with a root node corresponding to a root node of the blueprint, and setting a current node equal to the root node of the data structure; receiving, by the processor, a first request from the user log; computing, by the processor, a similarity score between the first request and each candidate action/request pair in the blueprint, wherein each candidate action/request pair includes an action from the state machine that is paired with a corresponding request from the state machine; for non-zero ones of the similarity scores, adjusting, by the processor, the similarity score based on a number of steps to reach the candidate action/request pair associated with the similarity score from a node of the blueprint corresponding to the current node of the data structure, wherein a determination of the steps to reach the candidate action/request pair takes into account candidate action/request pairs that have been depleted from the node of the blueprint corresponding to the current node of the data structure; eliminating, by the processor, candidate action/request pairs in the blueprint by comparing the adjusted similarity score to a threshold; for each of the remaining candidate action/request pairs, storing, by the processor, the remaining candidate action/request pairs as terminal nodes from the current node in the data structure; determining, by the processor, whether there are remaining requests in the user log; if there are remaining requests in the user log, (i) receiving a next request from the user log, (ii) computing a similarity score between the next request and each candidate action/request pair in the blueprint, and (iii) for each of the terminal nodes in the data structure, setting the current node equal to the terminal node and repeating the method starting with the adjusting step; and otherwise, if there are no remaining requests in the user log, determining, by the processor, a traversal through the data structure with a highest aggregate similarity score, and constructing, by the processor, the test script based on the determined traversal through the data structure and the blueprint. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. A non-transitory machine-readable storage medium for generating a test script to test a web application based on a user log of past user interactions with the web application and a blueprint that models the web application, wherein the blueprint includes a state machine, in which states of the state machine correspond to at least one of (i) application pages of the web application or (ii) actions that are performed to transition from one of the application pages to another one of the application pages, and edges of the state machine correspond to transitions between the states of the state machine, the non-transitory machine-readable storage medium comprising instructions that, when executed by a processor of the computing system, cause the processor to:
-
create a data structure with a root node corresponding to a root node of the blueprint, and setting a current node equal to the root node of the data structure; receive a first request from the user log; compute a similarity score between the first request and each candidate action/request pair in the blueprint, wherein each candidate action/request pair includes an action from the state machine that is paired with a corresponding request from the state machine; for non-zero ones of the similarity scores, adjust the similarity score based on a number of steps to reach the candidate action/request pair associated with the similarity score from a node of the blueprint corresponding to the current node of the data structure, wherein a determination of the steps to reach the candidate action/request pair takes into account candidate action/request pairs that have been depleted from the node of the blueprint corresponding to the current node of the data structure; eliminate candidate action/request pairs in the blueprint by comparing the adjusted similarity score to a threshold; for each of the remaining candidate action/request pairs, store the remaining candidate action/request pairs as terminal nodes from the current node in the data structure; determine whether there are remaining requests in the user log; if there are remaining requests in the user log, (i) receive a next request from the user log, (ii) compute a similarity score between the next request and each candidate action/request pair in the blueprint, and (iii) for each of the terminal nodes in the data structure, set the current node equal to the terminal node and repeat the method starting with the adjusting step; and otherwise, if there are no remaining requests in the user log, determine a traversal through the data structure with a highest aggregate similarity score, and construct the test script based on the determined traversal through the data structure and the blueprint. - View Dependent Claims (13, 14, 15, 16)
-
-
17. A computing device for generating a test script to test a web application based on a user log of past user interactions with the application and a blueprint that models the application, wherein the blueprint includes a state machine, in which states of the state machine correspond to at least one of (i) application pages of the web application or (ii) actions that are performed to transition from one of the application pages to another one of the application pages, and edges of the state machine correspond to transitions between the states of the state machine, the computing device comprising:
a processor; and a memory storing instructions that, when executed by a processor of the computing system, cause the processor to; create a data structure with a root node corresponding to a root node of the blueprint, and setting a current node equal to the root node of the data structure; receive a first request from the user log; compute a similarity score between the first request and each candidate action/request pair in the blueprint, wherein each candidate action/request pair includes an action from the state machine that is paired with a corresponding request from the state machine; for non-zero ones of the similarity scores, adjust the similarity score based on a number of steps to reach the candidate action/request pair associated with the similarity score from a node of the blueprint corresponding to the current node of the data structure, wherein a determination of the steps to reach the candidate action/request pair takes into account candidate action/request pairs that have been depleted from the node of the blueprint corresponding to the current node of the data structure; eliminate candidate action/request pairs in the blueprint by comparing the adjusted similarity score to a threshold; for each of the remaining candidate action/request pairs, store the remaining candidate action/request pairs as terminal nodes from the current node in the data structure; determine whether there are remaining requests in the user log; if there are remaining requests in the user log, (i) receive a next request from the user log, (ii) compute a similarity score between the next request and each candidate action/request pair in the blueprint, and (iii) for each of the terminal nodes in the data structure, set the current node equal to the terminal node and repeat the method starting with the adjusting step; and otherwise, if there are no remaining requests in the user log, determine a traversal through the data structure with a highest aggregate similarity score, and construct the test script based on the determined traversal through the data structure and the blueprint. - View Dependent Claims (18, 19, 20)
Specification