×

Method and apparatus for AI-driven automatic test script generation

  • US 10,552,299 B1
  • Filed: 08/14/2019
  • Issued: 02/04/2020
  • Est. Priority Date: 08/14/2019
  • Status: Active Grant
First Claim
Patent Images

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 all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×