WO2020151301A1 - Reinforcement learning-based test script generation method and apparatus - Google Patents

Reinforcement learning-based test script generation method and apparatus Download PDF

Info

Publication number
WO2020151301A1
WO2020151301A1 PCT/CN2019/116263 CN2019116263W WO2020151301A1 WO 2020151301 A1 WO2020151301 A1 WO 2020151301A1 CN 2019116263 W CN2019116263 W CN 2019116263W WO 2020151301 A1 WO2020151301 A1 WO 2020151301A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
state
behavior
target
states
Prior art date
Application number
PCT/CN2019/116263
Other languages
French (fr)
Chinese (zh)
Inventor
李佳楠
张新琛
陈忻
黄伟东
孙震
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020151301A1 publication Critical patent/WO2020151301A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present disclosure relates to the field of testing technology, and in particular to a method and device for generating test scripts based on reinforcement learning.
  • Testing is the process of operating a program under specified conditions to find program errors, measure software quality, and evaluate whether it can meet design requirements.
  • Automated testing is a process that transforms human-driven testing behavior into machine execution.
  • testers need to manually write test scripts for automated testing, and the writing of test scripts often takes most of the testers' time.
  • one or more embodiments of this specification provide a method and device for generating test scripts based on reinforcement learning, so as to save labor costs for automated testing and make testing more convenient.
  • a method for generating test scripts based on reinforcement learning where the test scripts are used to test target software under test; the method includes:
  • the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
  • a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
  • a test script generation device based on reinforcement learning is provided, the device is used to generate a test script; the device includes:
  • the information acquisition module is used to acquire the state and behavior used for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, One said state corresponds to multiple possible actions;
  • the model running module is used to run the reinforcement learning model to determine the corresponding Q value between each state and each behavior;
  • the script generation module is used to obtain a test script according to the Q value, the test script corresponding to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to Test through the test script.
  • a test script generation device based on reinforcement learning.
  • the device includes a memory and a processor.
  • the memory is used to store computer instructions that can run on the processor.
  • the processor is used to execute the The following steps are implemented when the computer commands:
  • the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
  • a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
  • the method and device for generating test scripts based on reinforcement learning uses a reinforcement learning model to automatically generate test scripts through the reinforcement learning model, thereby saving labor costs.
  • Fig. 1 is an application system of a test script generation method provided by at least one embodiment of this specification
  • FIG. 2 is a scenario of automatic path generation of a login example provided by at least one embodiment of this specification
  • Figure 3 is a process of automatically generating paths according to Figure 2;
  • FIG. 4 is a flow of automatic generation of test scripts based on Qianghu learning provided by at least one embodiment of this specification
  • Fig. 5 is a test script generation device based on reinforcement learning according to at least one embodiment of this specification.
  • At least one embodiment of this specification uses a reinforcement learning model to automatically generate test scripts.
  • the system may include: a test script generation device 11 based on reinforcement learning (hereinafter referred to as a script generation device), an agent device 12 and a device under test 13.
  • a test script generation device 11 based on reinforcement learning (hereinafter referred to as a script generation device)
  • an agent device 12 based on reinforcement learning (hereinafter referred to as a script generation device)
  • a device under test 13 the system to which this method is applied. 1.
  • the system may include: a test script generation device 11 based on reinforcement learning (hereinafter referred to as a script generation device), an agent device 12 and a device under test 13.
  • a reinforcement learning model can be run in the script generation device 11.
  • the reinforcement learning model may be a Q Learning model, or may also be a deep Q-Network (Deep Q-Network, referred to as DQN) model, etc.
  • DQN deep Q-Network
  • the agent device 12 can receive the command sent by the script generation device 11 and operate the device under test 13 according to the command.
  • the proxy device 12 can receive a command to execute a certain action sent by the script generation device 11, and the proxy device 12 can operate and control the device under test 13 to execute the action.
  • the device under test 13 may feed back the feedback result after executing the action to the proxy device 12.
  • the feedback result may include the state reached after executing the action, and the proxy device 12 may return the feedback state to the script generating device 11 to make the script The generating device 11 performs the next processing.
  • the device under test 13 may be a device running the test software.
  • the device under test 13 may be a mobile terminal device or a PC terminal device.
  • FIG. 1 takes the mobile terminal as an example.
  • the purpose of Q_learning is to update the Q table to make it an accurate Q table.
  • Such a Q table can be maintained in the script generation device 11, and the Q table can include status and action.
  • Table 1 The following example in Table 1:
  • the "state” may include multiple test states from the test initial state to the test target state.
  • the test state may include the test initial state and the test intermediate state.
  • the initial state of the test can be that the user opens the application homepage
  • the test target state can be that the user enters the application homepage.
  • the test initial state to the test target state may include multiple test intermediate states. For example, after the user clicks the login button, the page jumps to the login page, and the displayed login page can be a test state. For another example, after the user enters the user name, the entered user name is displayed on the page, which can be used as a test state.
  • Switching between multiple test states is triggered by action actions. For example, if the user clicks the login button, this operation triggers the test state to switch from the application homepage display to the login page display.
  • the various states mentioned above are observable, and the display information of the current interface can also be obtained through some excuses provided by the system as the state.
  • an android device can automatically obtain the observation status of the current interface control information through adb dump.
  • the state of the Q table can be designed as follows: Taking the android device as an example, the description information of the current device interface controls can be obtained through adb dump and recorded in an xml format file, which can be recorded The type and coordinate information of all controls on the current interface. A state vector of the interface state can be extracted to identify the state of the current interface. The state vector represents the test state. The state vector can include multiple state features, and each state feature corresponds to the target software under test running in the test state. An interface description dimension of the interface.
  • the state feature x1 represents the number of controls on the current interface
  • the state feature x2 represents the maximum level of the current interface layout
  • x3 is the total area of all controls on the current interface
  • x4 is the x value of the average center coordinates of all controls
  • x5 is the y value of the average center coordinates of all controls.
  • the number of controls, the number of levels, the total area, etc. can each be regarded as an interface description dimension. Using this information, the test status of an interface can be roughly expressed in a numerical manner.
  • the "behavior” multiple action operations that may be encountered in a certain state. In the test scenario, you can test as many possible behaviors as possible in a certain state.
  • behavior action can be the user's operational behavior, such as clicking the login button.
  • the method in this specification can also be applied to other types of testing, such as functional testing or interface testing, and is not limited to UI testing.
  • the login button is in a certain position on the login page, but the user may not click on the correct position when clicking, for example, clicking an unambiguous empty position, or clicking a wrong Place, wait.
  • the page screen can be divided into multiple units, each unit is represented by a position, and clicking on that position is used as an action.
  • click (30,10), click (10,10), the above (30,10) can be the coordinates of the click position. How to divide it can be customized.
  • a design method of click coordinates In order to improve the universality of the operation, the definition of the operation should be as universal as possible.
  • a click operation can be defined as a click on the interface coordinates, and the specific coordinates can be divided according to the screen resolution. For example, define a total of 20*40 for all click operations.
  • Unit width (current interface width/20)
  • Unit length (current interface length/40)
  • the design of the click operation coordinate can manually specify the size of the grid.
  • the grid corresponding to the click operation can be 20*40 or 30*60, which can be adjusted according to the performance of the operation in specific use.
  • actions can also be included, such as input behavior and sliding behavior.
  • the specific type of action can be related to the design of the interface function of the test software. For example, if the user wants to enter a user name and password on the page, it can include an input action; if the page requires the user to slide, it can include a slide action. Further, the sliding action may also include sliding to the left and sliding to the right, which are respectively an action.
  • Other types of actions can also be designed as universally as possible. For example, for sliding operations, four parameters can be specified, including the coordinates of the specified starting point (x, y) and the coordinates of the ending point (x, y).
  • test case When testing software, there are many situations that need to be tested. For example, when testing a certain software, the software can include multiple tests. Here are a few test cases, each of which can be called a test case:
  • Test case 1 Enter the correct user name and password, and click the submit button to verify whether you can log in correctly. (Normal input)
  • Test case 2 Enter the wrong user name or password, the authentication login will fail, and the corresponding error message will be prompted. (Error checking);
  • Test case 3 If the user name and password are too short or too long, what should be done (security, whether there is a prompt when the password is too short)
  • Each case can design its own Q table, but in order to improve the test efficiency, you can try to design a universal Q table.
  • the correct click position can be different for the case of different test target states, but all possible positions can be listed in the Q table, and the behavior in the Q table can include respective corresponding Clicking behaviors at different screen coordinate positions can be guided by setting different reward values for different position behaviors in different cases.
  • Different tested cases can have the same action, and some cases have exactly the same action.
  • part of the status may be the same.
  • the initial status of both login and registration cases may go through the registration login page, and the final status may also reach the application homepage.
  • the intermediate links may be different. If there are two different cases, after the corresponding operations are performed, the states on a series of operation paths are the same, then there will be situations where the states are also exactly the same, but this kind of situation is rare.
  • the first test target state and the second test target state are two different test target states (these are two different cases), for example, the first test target state can display the login success page, and the second test The target status may be a pop-up error message. Then, when the test target state is the first test target state, the multiple test state statuses are used when the test target state is the second test target state. Status, at least part of the test status can be the same. As mentioned above, the initial test state of the two cases may be the same as the intermediate test state.
  • At least part of the behaviors used when the test target state is the first test target state and the plurality of behavior actions used when the test target state is the second test target state may be the same.
  • both cases include click operations and include the same multiple possible click coordinates.
  • the corresponding Q value between the state and behavior Can be different. For example, suppose the above test case 1 and test case 2 can use the same Q table. When the Q value is updated, for test case 1, if the login is successful, the reward value is set higher; and for test case 2, if If login fails, the reward value is set higher. Then the Q values in the Q tables of the two cases can be different.
  • the script generation device 11 can update the Q table, and after the update is completed, the execution path during the test is obtained according to the Q table.
  • Figure 2 illustrates the automatic path generation scenario of the login example.
  • Figure 3 is based on the path automatic generation process shown in Figure 2. Please refer to Figure 2 and Figure 3.
  • the method may include:
  • step 300 the Q table is initialized, and the Q table includes the state and behavior.
  • Table 2 is the Q table in the user login application example.
  • state 1 may be the home page of the application; a login button is displayed on the home page of the application, and the corresponding operation action in state 1 may include clicking on various positions of the home page, including clicking the login button.
  • State 2 can be an application login page, which displays input boxes for the user name and password, and also includes the display of a login button.
  • possible actions may include clicking on different locations, and may also include input operations such as entering a user name or entering a password.
  • input operations such as entering a user name or entering a password.
  • State 3 may be to display the user name entered by the user. There can also be state 4, state 5 and other states before the user successfully logs in to the application.
  • the state switch be triggered. For example, if the user clicks on a meaningless location on the application homepage, the state may remain in state 1, and it will not switch to state 2.
  • the state is a number of intermediate states that may be reached during the test.
  • the action action is the possible user behavior in each state.
  • the Q value in the table indicates what behavior the user takes, which is more likely to achieve the goal of this test. If the behavior performed by the user is closer to the test target, a higher Q value can be set; it is equivalent to a guide to the user's behavior, so that the path to the test target can be found more quickly. When in a certain state, select a certain behavior action in that state, the behavior with a higher Q value will have a greater probability of being selected.
  • the status, behavior, and Q value setting in the Q table are all related to the characteristics of the test software itself and the test target status, and are determined accordingly.
  • Different test software and test target states can have different states and behaviors, and different Q values can be set to guide the generation of test paths.
  • the values in the Q table can be initialized to all 0s, or other values can be used.
  • the Q table is updated by means of Q Learning to obtain the updated Q table.
  • the Q table includes Q values corresponding to various behaviors in each state.
  • the script generation device 11 can randomly select an action in that state, and notify the agent device 12 to execute the action.
  • the agent device 12 controls the execution behavior of the device under test 13 according to instructions, and the ring device under test 13 is equivalent to an operating environment of the software under test.
  • the proxy device 12 may feed back a feedback result to the script generation device 11, and the feedback result may include whether the state reached after executing the action is the test target state.
  • the process of updating the Q table can be performed according to the conventional Q Learning method, which will not be described in detail.
  • state 1 an action is randomly selected to instruct the agent device 12 to execute.
  • the proxy device 12 reports back to enter state 2.
  • the state 2 is not the target state (successful login).
  • the script generation device 11 continues to select an action from the action corresponding to state 2, and continues to instruct the proxy device 12 to execute .
  • the result returned by the proxy device 12 is that a successful login has been achieved.
  • a reward value can be given, and the reward value may be used to update the action in the state that triggered the login. For example, after the user enters the user name and password, and clicks the login button, it leads to the successful login to the application. You can enter the user name, enter the password, and click the login button in the above three states. The value is updated slightly higher. For example, the Q values corresponding to other actions in the same state are all 0, and the Q values of these actions can be 0.8 or 0.9.
  • step 304 the execution path of the test script is obtained according to the Q value, and the execution path includes a sequence of actions that can reach the target state.
  • the execution path of the test script can be obtained accordingly.
  • the action with the highest Q value in each state can be selected to form a behavior sequence, which is the execution path of the test.
  • the script generating device 11 has automatically generated a test script so far, and the test script can be sent to the agent device 12 for execution, and the test can be performed through the test script.
  • the generated test script may be at least one.
  • the test script generation method of this example can save labor costs by using a reinforcement learning model and can generate better test scripts.
  • the above example is based on Q Learning in reinforcement learning, and other reinforcement learning models can also be used for processing, such as DQN.
  • the DQN network can be pre-trained, and the input of the DQN network can be the state in the Q table, which is the state during the test, such as the image of the software interface of the test.
  • the output of the DQN model can be the Q value corresponding to each action action in the corresponding state.
  • the Q value is the state-action value, which is a function of state and action.
  • the trained DQN network can be obtained.
  • the Q values corresponding to each behavior in each state have been obtained.
  • test scripts The method for generating test scripts is not limited to the above Q Learning and DQN, and other reinforcement learning models can also be used.
  • the flow in Figure 4 illustrates the processing flow when reinforcement learning is applied to the automatic generation of test scripts, which may include the following processing:
  • step 400 a status status and a behavior action for testing are obtained, the status includes a plurality of test states from the test initial state to the test target state, and the switching of the plurality of test states is triggered by the behavior, one The state corresponds to multiple possible behaviors;
  • step 402 run a reinforcement learning model to determine the corresponding Q value between each state and each behavior
  • step 404 the execution path of the test script is obtained according to the Q value, and the execution path includes a sequence of actions that can reach the target state, so as to pass the test script for testing.
  • the model based on reinforcement learning realizes the automatic generation of automated test cases, which greatly reduces the investment in labor costs, and can achieve the effect of automatically generating use cases without manually writing use case scripts.
  • Fig. 5 provides a test script generation device based on reinforcement learning according to at least one embodiment of this specification, and the device is used to generate a test script.
  • the device may include: an information acquisition module 51, a model running module 52, and a script generation module 53.
  • the information acquisition module 51 is configured to acquire the state and behavior used for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior , One state corresponds to multiple possible behaviors;
  • the model running module 52 is configured to run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
  • the script generation module 53 is configured to obtain a test script according to the Q value, the test script corresponding to an execution path from the initial test state to the test target state, and the execution path includes a sequence of actions that can reach the target state, To pass the test script for testing.
  • the behavior when the type of the behavior is click, the behavior includes click behaviors corresponding to different interface coordinates, and the interface is the running interface of the target software under test.
  • the model running module 52 is specifically configured to: initialize the Q table, which includes the state and behavior; update the Q table by means of Q Learning, to obtain the updated Q table .
  • the model running module 52 is specifically used to train a DQN, where the input of the DQN is the state, and the output is the Q value corresponding to the state and behavior; and the DQN after the training is obtained.
  • At least one embodiment of the present specification also provides a test script generation device based on reinforcement learning.
  • the device includes a memory and a processor.
  • the memory is used to store computer instructions that can run on the processor; the processor is used for The following steps are implemented when the computer instructions are executed:
  • the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
  • a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
  • one or more embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may adopt a computer program implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The form of the product.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • One or more embodiments of this specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

Abstract

Provided in the embodiments of the present description are a reinforcement learning-based test script generation method and apparatus. The method comprises: acquiring states and behaviors used for testing, wherein the states comprise a plurality of testing states from a testing initial state to a testing target state, switching between the plurality of testing states is triggered by the behaviors, and one of the states corresponds to a plurality of possible behaviors; running a reinforcement learning model to determine a corresponding Q value between each of the states and each behavior; according to the Q value, obtaining a test script, the test script corresponding to one execution path from the testing initial state to the testing target state, the execution path comprising a sequence of behaviors that may reach the target state so as to test target software to be tested by means of the test script.

Description

一种基于强化学习的测试脚本生成方法和装置Method and device for generating test script based on reinforcement learning 技术领域Technical field
本公开涉及测试技术领域,特别涉及一种基于强化学习的测试脚本生成方法和装置。The present disclosure relates to the field of testing technology, and in particular to a method and device for generating test scripts based on reinforcement learning.
背景技术Background technique
测试是在规定的条件下对程序进行操作,以发现程序错误,衡量软件质量,并对其是否能满足设计要求进行评估的过程。而自动化测试是把以人为驱动的测试行为转化为机器执行的一种过程。Testing is the process of operating a program under specified conditions to find program errors, measure software quality, and evaluate whether it can meet design requirements. Automated testing is a process that transforms human-driven testing behavior into machine execution.
在传统的自动化测试过程中,需要由测试人员手动编写自动化测试的测试脚本,测试脚本的编写往往会花费测试人员的大部分时间。In the traditional automated testing process, testers need to manually write test scripts for automated testing, and the writing of test scripts often takes most of the testers' time.
发明内容Summary of the invention
有鉴于此,本说明书一个或多个实施例提供一种基于强化学习的测试脚本生成方法和装置,以节省自动化测试的人力成本,更便捷的进行测试。In view of this, one or more embodiments of this specification provide a method and device for generating test scripts based on reinforcement learning, so as to save labor costs for automated testing and make testing more convenient.
具体地,本说明书一个或多个实施例是通过如下技术方案实现的:Specifically, one or more embodiments of this specification are implemented through the following technical solutions:
第一方面,提供一种基于强化学习的测试脚本生成方法,所述测试脚本用于测试目标被测软件;所述方法包括:In a first aspect, a method for generating test scripts based on reinforcement learning is provided, where the test scripts are used to test target software under test; the method includes:
获取用于测试的状态和行为,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;Acquire the state and behavior for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;Run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本对目标被测软件进行测试。According to the Q value, a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
第二方面,提供一种基于强化学习的测试脚本生成装置,所述装置用于生成测试脚本;所述装置包括:In a second aspect, a test script generation device based on reinforcement learning is provided, the device is used to generate a test script; the device includes:
信息获取模块,用于获取用于测试的状态和行为,所述状态包括由测试初始状态至 测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;The information acquisition module is used to acquire the state and behavior used for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, One said state corresponds to multiple possible actions;
模型运行模块,用于运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;The model running module is used to run the reinforcement learning model to determine the corresponding Q value between each state and each behavior;
脚本生成模块,用于根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本进行测试。The script generation module is used to obtain a test script according to the Q value, the test script corresponding to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to Test through the test script.
第三方面,提供一种基于强化学习的测试脚本生成设备,所述设备包括存储器、处理器,所述存储器用于存储可在处理器上运行的计算机指令;所述处理器用于在执行所述计算机指令时实现以下步骤:In a third aspect, a test script generation device based on reinforcement learning is provided. The device includes a memory and a processor. The memory is used to store computer instructions that can run on the processor. The processor is used to execute the The following steps are implemented when the computer commands:
获取用于测试的状态和行为,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;Acquire the state and behavior for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;Run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本对目标被测软件进行测试。According to the Q value, a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
本说明书一个或多个实施例的基于强化学习的测试脚本生成方法和装置,通过利用强化学习模型的方式,使得通过强化学习模型就可以自动生成测试脚本,从而节省人力成本。The method and device for generating test scripts based on reinforcement learning in one or more embodiments of this specification uses a reinforcement learning model to automatically generate test scripts through the reinforcement learning model, thereby saving labor costs.
附图说明Description of the drawings
为了更清楚地说明本说明书一个或多个实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书一个或多个实施例中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain one or more embodiments of this specification or the technical solutions in the prior art, the following will briefly introduce the accompanying drawings needed in the description of the embodiments or prior art. Obviously, in the following description The drawings are only some of the embodiments described in one or more embodiments of this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. .
图1为本说明书至少一个实施例提供的一种测试脚本生成方法的应用系统;Fig. 1 is an application system of a test script generation method provided by at least one embodiment of this specification;
图2为本说明书至少一个实施例提供的一种登录例子的路径自动生成场景;FIG. 2 is a scenario of automatic path generation of a login example provided by at least one embodiment of this specification;
图3为根据图2所示的路径自动生成流程;Figure 3 is a process of automatically generating paths according to Figure 2;
图4为本说明书至少一个实施例提供的一种基于羌胡学习的测试脚本自动生成的流程;FIG. 4 is a flow of automatic generation of test scripts based on Qianghu learning provided by at least one embodiment of this specification;
图5为本说明书至少一个实施例的基于强化学习的测试脚本生成装置。Fig. 5 is a test script generation device based on reinforcement learning according to at least one embodiment of this specification.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本说明书一个或多个实施例中的技术方案,下面将结合本说明书一个或多个实施例中的附图,对本说明书一个或多个实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书一个或多个实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本公开保护的范围。In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will combine the drawings in one or more embodiments of this specification to compare The technical solution is described clearly and completely. Obviously, the described embodiments are only a part of the embodiments in this specification, rather than all the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the scope of protection of the present disclosure.
本说明书至少一个实施例用强化学习模型自动化生成测试脚本。At least one embodiment of this specification uses a reinforcement learning model to automatically generate test scripts.
首先,通过图1描述该方法应用的系统。如图1所示,该系统中可以包括:基于强化学习的测试脚本生成设备11(后续简称脚本生成设备)、代理设备12和被测设备13。First, the system to which this method is applied is described through FIG. 1. As shown in FIG. 1, the system may include: a test script generation device 11 based on reinforcement learning (hereinafter referred to as a script generation device), an agent device 12 and a device under test 13.
其中,脚本生成设备11中可以运行强化学习模型。例如,该强化学习模型可以是Q Learning模型,或者,还可以是深度Q网络(Deep Q-Network,简称:DQN)模型,等。Among them, a reinforcement learning model can be run in the script generation device 11. For example, the reinforcement learning model may be a Q Learning model, or may also be a deep Q-Network (Deep Q-Network, referred to as DQN) model, etc.
代理设备12(Agent)可以接收脚本生成设备11发送的命令,并根据该命令操作被测设备13。例如,代理设备12可以接收脚本生成设备11发送的执行某个action的命令,则代理设备12可以操作控制被测设备13执行该action。并且,被测设备13可以向代理设备12反馈执行action后的反馈结果,该反馈结果可以包括执行action后达到的状态,代理设备12可以将该反馈的状态返回给脚本生成设备11,以使得脚本生成设备11进行下一步处理。The agent device 12 (Agent) can receive the command sent by the script generation device 11 and operate the device under test 13 according to the command. For example, the proxy device 12 can receive a command to execute a certain action sent by the script generation device 11, and the proxy device 12 can operate and control the device under test 13 to execute the action. In addition, the device under test 13 may feed back the feedback result after executing the action to the proxy device 12. The feedback result may include the state reached after executing the action, and the proxy device 12 may return the feedback state to the script generating device 11 to make the script The generating device 11 performs the next processing.
被测设备13可以是测试软件运行的设备,例如,该被测设备13可以是移动端设备,也可以是PC端设备,图1以移动端为例。The device under test 13 may be a device running the test software. For example, the device under test 13 may be a mobile terminal device or a PC terminal device. FIG. 1 takes the mobile terminal as an example.
如下以Q Learing为例,描述基于图1的系统,通过强化学习的方法来自动生成测试脚本:Take QLearing as an example as follows to describe the system based on Figure 1, which uses reinforcement learning to automatically generate test scripts:
测试中的Q表Q table under test
在Q Learing方法中,Q_learning的目的就是更新Q表,使之变成一个准确的Q表。 脚本生成设备11中可以维护这样一份Q表,Q表中可以包括状态status和行为action。如下表1的示例:In the QLearing method, the purpose of Q_learning is to update the Q table to make it an accurate Q table. Such a Q table can be maintained in the script generation device 11, and the Q table can include status and action. The following example in Table 1:
表1 Q表示例Table 1 Example of Q
QQ action_1action_1 action_2action_2 .......... action_naction_n
state_1state_1  To  To  To  To
state_2state_2  To  To  To  To
..........  To  To  To  To
state_nstate_n  To  To  To  To
在测试的场景中,解释Q表中的相关概念如下:In the test scenario, explain the related concepts in the Q table as follows:
所述的“状态”:可以包括由测试初始状态至测试目标状态之间的多个测试状态,例如,该测试状态可以包括测试初始状态及测试中间状态。The "state": may include multiple test states from the test initial state to the test target state. For example, the test state may include the test initial state and the test intermediate state.
以基于UI的测试为例,且以用户登录应用为例:Take the UI-based test as an example, and the user login application as an example:
测试初始状态可以是用户打开了应用首页;The initial state of the test can be that the user opens the application homepage;
测试目标状态可以是用户进入应用主页。The test target state can be that the user enters the application homepage.
测试初始状态至测试目标状态之间可以包括多个测试中间状态。例如,用户在点击了登录按钮后,页面跳转到登录页面,该显示登录页面可以是一个测试状态。又例如,用户输入用户名后,页面中显示了输入的用户名,这又可以作为一个测试状态。The test initial state to the test target state may include multiple test intermediate states. For example, after the user clicks the login button, the page jumps to the login page, and the displayed login page can be a test state. For another example, after the user enters the user name, the entered user name is displayed on the page, which can be used as a test state.
多个测试状态之间的切换由行为action的操作触发,比如,用户点击了登录按钮,这个操作触发测试状态由应用首页显示切换到登录页面的显示。Switching between multiple test states is triggered by action actions. For example, if the user clicks the login button, this operation triggers the test state to switch from the application homepage display to the login page display.
上述的各种状态,状态是可观测的,也可以通过系统提供的一些借口来获取当前界面的显示信息作为状态。比如,android设备可以通过adb dump的方式,自动获取到对当前界面控件信息的观测状态。The various states mentioned above are observable, and the display information of the current interface can also be obtained through some excuses provided by the system as the state. For example, an android device can automatically obtain the observation status of the current interface control information through adb dump.
例如,可以是按照如下方式设计Q表的状态:以android设备为例,可以通过adb dump的方式获取到当前设备界面控件的描述信息,并记录在一个xml格式的文件中,该文件中可以记录当前界面所有控件的类型、坐标信息等。可以提取出一个界面状态的状态向量来标识当前界面的状态,该状态向量表示测试状态,状态向量中可以包括多个状态特征,每一个状态特征对应在所述测试状态下的目标被测软件运行界面的一种界面描述维度。For example, the state of the Q table can be designed as follows: Taking the android device as an example, the description information of the current device interface controls can be obtained through adb dump and recorded in an xml format file, which can be recorded The type and coordinate information of all controls on the current interface. A state vector of the interface state can be extracted to identify the state of the current interface. The state vector represents the test state. The state vector can include multiple state features, and each state feature corresponds to the target software under test running in the test state. An interface description dimension of the interface.
比如,在状态向量[x1,x2,x3,x4,x5]中,状态特征x1表示当前界面的控件数量,状态 特征x2表示当前界面布局的最大层级数,x3是当前界面所有控件的总面积,x4是所有控件的平均中心坐标的x值,x5是所有控件的平均中心坐标的y值。其中,上述的控件数量、层级数、总面积等,各自都可以看做是一种界面描述维度,利用这些信息就可以大致用数值化的方式来表示一个界面的测试状态了。For example, in the state vector [x1, x2, x3, x4, x5], the state feature x1 represents the number of controls on the current interface, the state feature x2 represents the maximum level of the current interface layout, and x3 is the total area of all controls on the current interface. x4 is the x value of the average center coordinates of all controls, and x5 is the y value of the average center coordinates of all controls. Among them, the number of controls, the number of levels, the total area, etc., can each be regarded as an interface description dimension. Using this information, the test status of an interface can be roughly expressed in a numerical manner.
所述的“行为”:在某一状态下可能遇到的多种action操作。在测试场景中,可以尽可能的测试在某一状态下的多种可能的行为。The "behavior": multiple action operations that may be encountered in a certain state. In the test scenario, you can test as many possible behaviors as possible in a certain state.
本例子是以UI测试为例,所以行为action可以是用户的操作行为,比如点击登录按钮。本说明书的方法也可以应用于其他类型的测试,比如功能测试或接口测试,不限于UI测试。This example is based on UI testing, so the behavior action can be the user's operational behavior, such as clicking the login button. The method in this specification can also be applied to other types of testing, such as functional testing or interface testing, and is not limited to UI testing.
仍以UI测试为例,登录按钮在登录页面的某个位置,但是用户在点击时可能并不是点击在正确的位置上,比如,点了一个毫无疑义的空位置,或者点了一个错误的地方,等。本例子可以将页面屏幕划分为多个单元,每个单元以一个位置表示,点击该位置作为一个action。例如,点击(30,10),点击(10,10),上述的(30,10)可以是点击位置的坐标。具体如何划分,可以自定义。Taking the UI test as an example, the login button is in a certain position on the login page, but the user may not click on the correct position when clicking, for example, clicking an unambiguous empty position, or clicking a wrong Place, wait. In this example, the page screen can be divided into multiple units, each unit is represented by a position, and clicking on that position is used as an action. For example, click (30,10), click (10,10), the above (30,10) can be the coordinates of the click position. How to divide it can be customized.
举例一种点击坐标的设计方式:为了提高操作的普适性,对操作的定义应尽量做到普适。比如,点击操作可以定义为对界面坐标的点击,具体的坐标可以根据屏幕的分辨率来分割得到。例如,定义所有点击操作一共有20*40个。For example, a design method of click coordinates: In order to improve the universality of the operation, the definition of the operation should be as universal as possible. For example, a click operation can be defined as a click on the interface coordinates, and the specific coordinates can be divided according to the screen resolution. For example, define a total of 20*40 for all click operations.
每个点击操作的横坐标x分别为:The abscissa x of each click operation is:
单位宽度=(当前界面宽度/20)Unit width = (current interface width/20)
第i列操作的x坐标=单位宽度/2+i*单位宽度。The x coordinate of the i-th column operation=unit width/2+i*unit width.
每个点击操作的纵坐标为:The ordinate of each click operation is:
单位长度=(当前界面长度/40)Unit length = (current interface length/40)
第j行操作的y坐标=单位长度/2+j*单位长度。The y coordinate of the jth line operation=unit length/2+j*unit length.
点击操作坐标的设计,可以人为来指定网格的尺寸,比如点击操作对应的网格可以是20*40或者30*60,可以在具体使用中根据运行表现好坏调整。The design of the click operation coordinate can manually specify the size of the grid. For example, the grid corresponding to the click operation can be 20*40 or 30*60, which can be adjusted according to the performance of the operation in specific use.
在点击操作之外,还可以包括其他类型的行为action,比如,输入行为,滑动行为。具体何种类型的action可以根据测试软件的界面功能设计相关。例如,若页面中用户要输入用户名和密码,可以包括输入action;若页面中需要用户滑动,则可以包括滑动action。 进一步的,滑动action还可以包括向左滑动和向右滑动,分别是一个action。其他类型的行为action也可以尽量进行普适性设计,比如,对于滑动操作,可以指定四个参数,包括指定起始点的坐标(x,y)和终止点的坐标(x,y)。In addition to click operations, other types of actions can also be included, such as input behavior and sliding behavior. The specific type of action can be related to the design of the interface function of the test software. For example, if the user wants to enter a user name and password on the page, it can include an input action; if the page requires the user to slide, it can include a slide action. Further, the sliding action may also include sliding to the left and sliding to the right, which are respectively an action. Other types of actions can also be designed as universally as possible. For example, for sliding operations, four parameters can be specified, including the coordinates of the specified starting point (x, y) and the coordinates of the ending point (x, y).
上述的“状态”和“行为”可以根据测试软件的特点进行设计。The above-mentioned "state" and "behavior" can be designed according to the characteristics of the test software.
在进行软件测试时,需要测试的情况有多种,比如,在测试某个软件时,该软件可以包括多方面的测试,如下列举几个测试情况,每一种情况可以称为一个测试case:When testing software, there are many situations that need to be tested. For example, when testing a certain software, the software can include multiple tests. Here are a few test cases, each of which can be called a test case:
测试case一:输入正确的用户名和密码,点击提交按钮,验证是否能正确登录。(正常输入)Test case 1: Enter the correct user name and password, and click the submit button to verify whether you can log in correctly. (Normal input)
测试case二:输入错误的用户名或者密码,验证登录会失败,并且提示相应的错误信息。(错误校验);Test case 2: Enter the wrong user name or password, the authentication login will fail, and the corresponding error message will be prompted. (Error checking);
测试case三:用户名和密码,如果太短或者太长,应该怎么处理(安全性,密码太短时是否有提示)Test case 3: If the user name and password are too short or too long, what should be done (security, whether there is a prompt when the password is too short)
每一种case可以设计自己的Q表,不过,为了提高测试效率,可以尽量设计一个具有普适性的Q表。比如,以点击类型的action为例,不同测试目标状态的case,正确的点击位置可以是不同的,但是在Q表中可以将所有可能的位置都列举出来,Q表中的行为可以包括分别对应不同屏幕坐标位置的点击行为,只要在不同的case中对不同的位置行为设置不同的奖励值进行引导即可。Each case can design its own Q table, but in order to improve the test efficiency, you can try to design a universal Q table. For example, taking the action of the click type as an example, the correct click position can be different for the case of different test target states, but all possible positions can be listed in the Q table, and the behavior in the Q table can include respective corresponding Clicking behaviors at different screen coordinate positions can be guided by setting different reward values for different position behaviors in different cases.
不同的被测case可以有相同的action,有的case的action可能完全相同。不同的case中,状态有一部分可能是一样的,比如,执行登录和注册两个case,登录和注册这两个case的初始状态可能都会经过注册登录页面,最终状态也都可能是达到了应用首页,但中间环节可能是不一样的。如果说有两个不同的case,在执行了对应的操作之后,一系列的操作路径上的状态都一样,那就会出现状态也完全相同的情况,但这种情况很少。Different tested cases can have the same action, and some cases have exactly the same action. In different cases, part of the status may be the same. For example, when performing login and registration, the initial status of both login and registration cases may go through the registration login page, and the final status may also reach the application homepage. , But the intermediate links may be different. If there are two different cases, after the corresponding operations are performed, the states on a series of operation paths are the same, then there will be situations where the states are also exactly the same, but this kind of situation is rare.
即,如果说第一测试目标状态和第二测试目标状态是两个不同的测试目标状态(这是两个不同的case),比如,第一测试目标状态可以是显示登录成功页面,第二测试目标状态可以是弹出错误提示信息,那么,当所述测试目标状态是第一测试目标状态时使用的多个测试状态status,与所述测试目标状态是第二测试目标状态时使用的多个测试状态status,至少部分测试状态可以相同。如上面提到的,两个case的测试初始状态和中间的部分测试状态可能是一样。That is, if the first test target state and the second test target state are two different test target states (these are two different cases), for example, the first test target state can display the login success page, and the second test The target status may be a pop-up error message. Then, when the test target state is the first test target state, the multiple test state statuses are used when the test target state is the second test target state. Status, at least part of the test status can be the same. As mentioned above, the initial test state of the two cases may be the same as the intermediate test state.
当所述测试目标状态是第一测试目标状态时使用的多个行为action,与所述测试目 标状态是第二测试目标状态时使用的多个行为action,至少部分行为可以相同。比如,两个case都包括点击操作,且包括相同的多个可能的点击坐标。而不同的case中,对于每个所述状态和每个行为之间对应的Q值,尽管在不同的case中使用的某个行为和状态分别相同,但是该状态和行为之间对应的Q值可以不同。举例来说,假设上述的测试case一和测试case二可以使用同一个Q表,在Q值的更新时,对于测试case一,如果登录成功,奖励值设置更高;而对于测试case二,如果登录失败,奖励值设置更高。那么这两个case的Q表中的Q值是可以存在差异的。At least part of the behaviors used when the test target state is the first test target state and the plurality of behavior actions used when the test target state is the second test target state may be the same. For example, both cases include click operations and include the same multiple possible click coordinates. In different cases, for the corresponding Q value between each state and each behavior, although a certain behavior and state used in different cases are the same, the corresponding Q value between the state and behavior Can be different. For example, suppose the above test case 1 and test case 2 can use the same Q table. When the Q value is updated, for test case 1, if the login is successful, the reward value is set higher; and for test case 2, if If login fails, the reward value is set higher. Then the Q values in the Q tables of the two cases can be different.
测试中的Q表的更新Update of the Q table under test
在设计好Q表之后,可以由脚本生成设备11对该Q表进行更新,并在更新完成后根据Q表得到测试时的执行路径。After the Q table is designed, the script generation device 11 can update the Q table, and after the update is completed, the execution path during the test is obtained according to the Q table.
以用户登录应用为例,描述如何得到测试执行路径:Take the user login application as an example to describe how to get the test execution path:
图2示例了登录例子的路径自动生成场景,图3是根据图2所示的路径自动生成流程,请结合图2和图3所示,该方法可以包括:Figure 2 illustrates the automatic path generation scenario of the login example. Figure 3 is based on the path automatic generation process shown in Figure 2. Please refer to Figure 2 and Figure 3. The method may include:
在步骤300中,初始化Q表,所述Q表中包括所述状态和行为。In step 300, the Q table is initialized, and the Q table includes the state and behavior.
例如,可以参见下面的表2,该表2是用户登录应用例子中的Q表。For example, see Table 2 below, which is the Q table in the user login application example.
表2 用户登录应用例子中的Q表示例Table 2 Example of Q in the user login application example
Figure PCTCN2019116263-appb-000001
Figure PCTCN2019116263-appb-000001
例如,状态1可以是应用首页;该应用首页中显示了登录按钮,该状态1下对应的操作action可以包括点击首页的多种不同位置,其中有点击登录按钮。For example, state 1 may be the home page of the application; a login button is displayed on the home page of the application, and the corresponding operation action in state 1 may include clicking on various positions of the home page, including clicking the login button.
状态2可以是应用登录页面,该登录页面中显示用户名和密码的输入框,还包括登录按钮的显示。在该状态2下,可能的行为可以包括点击不同的位置,还可以包括输入用户名,或者输入密码等输入操作。当然,在其他的例子中,除了输入用户名和密码,还可以有一些其他的身份认证方式,比如页面中需要用户滑动标签进行配图,那么可以包括向左滑动或者向右滑动等action。State 2 can be an application login page, which displays input boxes for the user name and password, and also includes the display of a login button. In this state 2, possible actions may include clicking on different locations, and may also include input operations such as entering a user name or entering a password. Of course, in other examples, in addition to entering the user name and password, there can also be some other identity authentication methods. For example, if the page requires the user to slide the tab to configure the picture, then it can include actions such as sliding to the left or sliding to the right.
状态3可以是显示用户输入的用户名。还可以有状态4,状态5等到达用户成功登录应用前的其他状态。State 3 may be to display the user name entered by the user. There can also be state 4, state 5 and other states before the user successfully logs in to the application.
登录成功后进入应用主页。After successful login, enter the application homepage.
其中,用户执行了正确的操作后,才可以触发状态的切换。比如,如果在用户在应用首页点击了无意义的位置,那也许状态仍然保持在状态1,不会切换到状态2。Among them, only after the user performs the correct operation can the state switch be triggered. For example, if the user clicks on a meaningless location on the application homepage, the state may remain in state 1, and it will not switch to state 2.
可以看到,状态是在测试过程中可能达到的多个中间状态,It can be seen that the state is a number of intermediate states that may be reached during the test,
而动作action是在各个状态下可能的用户行为。The action action is the possible user behavior in each state.
而表中的Q值,表示用户采取何种行为,会更有可能达到本次测试的目标。如果用户执行的行为距离测试目标更近,可以设置更高的Q值;相当于对用户行为的一种引导,使得更快速的找到达到测试目标的路径。当在某一个状态下,选择该状态下的某个行为action时,Q值较高的行为将有更大概率得到选择。The Q value in the table indicates what behavior the user takes, which is more likely to achieve the goal of this test. If the behavior performed by the user is closer to the test target, a higher Q value can be set; it is equivalent to a guide to the user's behavior, so that the path to the test target can be found more quickly. When in a certain state, select a certain behavior action in that state, the behavior with a higher Q value will have a greater probability of being selected.
即在测试场景中,Q表中的状态、行为以及Q值的设定,都与测试软件本身的特点以及测试目标状态相关,据此确定。不同的测试软件、测试目标状态可以有不同的状态和行为,可以设置不同的Q值来引导测试路径的生成。That is, in the test scenario, the status, behavior, and Q value setting in the Q table are all related to the characteristics of the test software itself and the test target status, and are determined accordingly. Different test software and test target states can have different states and behaviors, and different Q values can be set to guide the generation of test paths.
本步骤中,初始时,可以将Q表中的值初始化为全0,也可以采用其他值。In this step, initially, the values in the Q table can be initialized to all 0s, or other values can be used.
在步骤302中,通过Q Learning的方式,对所述Q表进行更新,得到更新后的Q表,Q表中包括每个状态下的各种行为对应的Q值。In step 302, the Q table is updated by means of Q Learning to obtain the updated Q table. The Q table includes Q values corresponding to various behaviors in each state.
请结合图2所示,在每个状态下,脚本生成设备11可以随机的选择该状态下的一个action,并通知代理设备12执行该action。代理设备12根据指令控制被测设备13执行行为,被测环设备13相当于被测软件的一个运行环境。As shown in FIG. 2, in each state, the script generation device 11 can randomly select an action in that state, and notify the agent device 12 to execute the action. The agent device 12 controls the execution behavior of the device under test 13 according to instructions, and the ring device under test 13 is equivalent to an operating environment of the software under test.
代理设备12可以反馈给脚本生成设备11一个反馈结果,该反馈结果可以包括执行action之后达到的状态是否是测试目标状态。The proxy device 12 may feed back a feedback result to the script generation device 11, and the feedback result may include whether the state reached after executing the action is the test target state.
Q表更新的过程可以根据常规的Q Learning方式执行,不再详述。The process of updating the Q table can be performed according to the conventional Q Learning method, which will not be described in detail.
如下简单描述一种更新Q表的过程,但不局限于此:The process of updating the Q table is briefly described as follows, but it is not limited to this:
例如,参见表2,在状态1下随机选择一个action,指示代理设备12执行。代理设备12反馈回来进入了状态2,该状态2不是目标状态(成功登录),只要未达到最终状态,那么脚本生成设备11继续由状态2对应的action中选择一个行为,继续指示代理设备12执行。For example, referring to Table 2, in state 1, an action is randomly selected to instruct the agent device 12 to execute. The proxy device 12 reports back to enter state 2. The state 2 is not the target state (successful login). As long as the final state is not reached, the script generation device 11 continues to select an action from the action corresponding to state 2, and continues to instruct the proxy device 12 to execute .
如此循环,直至最后一个状态下选择了action后,代理设备12反馈回来的结果是达到了成功登录,那么,可以给予奖励值,并使用该奖励值更新触发登录的那个状态下的action。比如,用户输入了用户名和密码后,并点击了登录按钮后,才导致成功登录应用,则可以将上述三个状态下的输入用户名、输入密码、点击登录按钮这几个行为action对应的Q值更新的稍微高一些,例如,同状态下的其他action对应的Q值都是0,而这些行为的Q值可以是0.8,或者0.9之类的。In this loop, until the action is selected in the last state, the result returned by the proxy device 12 is that a successful login has been achieved. Then, a reward value can be given, and the reward value may be used to update the action in the state that triggered the login. For example, after the user enters the user name and password, and clicks the login button, it leads to the successful login to the application. You can enter the user name, enter the password, and click the login button in the above three states. The value is updated slightly higher. For example, the Q values corresponding to other actions in the same state are all 0, and the Q values of these actions can be 0.8 or 0.9.
同样的方式,可以继续迭代,重新由状态1开始,随机选择一个action去执行。若能到达测试目标的行为,则更新较高的Q值,直至更新完Q表中的所有状态行。然后,使用生成的Q表继续迭代,在每个状态下选择Q值比较高的行为action,并根据最后的结果是否到达测试目标状态来更新Q表。In the same way, you can continue to iterate, start again from state 1, and randomly select an action to execute. If the behavior of the test target can be reached, the higher Q value is updated until all status lines in the Q table are updated. Then, use the generated Q table to continue iterating, select the action with a higher Q value in each state, and update the Q table according to whether the final result reaches the test target state.
在步骤304中,根据Q值,得到测试脚本的所述执行路径,所述执行路径包括能够达到所述目标状态的行为序列。In step 304, the execution path of the test script is obtained according to the Q value, and the execution path includes a sequence of actions that can reach the target state.
本步骤中,在更新完Q表后,可以据此得到测试脚本的执行路径,比如,可以选择每个状态下的Q值最高的action后,组成一个行为序列,这就是测试的执行路径。In this step, after updating the Q table, the execution path of the test script can be obtained accordingly. For example, the action with the highest Q value in each state can be selected to form a behavior sequence, which is the execution path of the test.
脚本生成设备11至此自动生成了测试脚本,可以将该测试脚本发送至代理设备12执行,通过所述测试脚本进行测试。生成的测试脚本可以是至少一个。The script generating device 11 has automatically generated a test script so far, and the test script can be sent to the agent device 12 for execution, and the test can be performed through the test script. The generated test script may be at least one.
本例子的测试脚本生成方法,通过利用强化学习模型的方式,可以节省人力成本,并且可以生成较好的测试脚本。The test script generation method of this example can save labor costs by using a reinforcement learning model and can generate better test scripts.
上述的例子是以强化学习中的Q Learning为例,还可以使用其他强化学习模型来处理,例如DQN。The above example is based on Q Learning in reinforcement learning, and other reinforcement learning models can also be used for processing, such as DQN.
在使用DQN模型时,可以预先训练DQN网络,所述DQN网络的输入可以是Q表中的状态,该状态是测试过程中的状态,比如测试的软件界面的图像。DQN模型的输出可以是对应该状态下的各个行为action对应的Q值,Q值就是state-action value它是一个关于状态和动作的函数。经过训练后,可以得到训练完成的DQN网络。DQN网络训练完成后,已经得到了各个状态下的各个行为对应的Q值。在测试时,把当前状态输入,选取最大Q值对应的action执行,这就是测试路径。When using the DQN model, the DQN network can be pre-trained, and the input of the DQN network can be the state in the Q table, which is the state during the test, such as the image of the software interface of the test. The output of the DQN model can be the Q value corresponding to each action action in the corresponding state. The Q value is the state-action value, which is a function of state and action. After training, the trained DQN network can be obtained. After the DQN network training is completed, the Q values corresponding to each behavior in each state have been obtained. During the test, input the current state and select the action corresponding to the maximum Q value to execute. This is the test path.
对于不同的case,可以使用相同的方法得到该case下对应的测试路径。For different cases, you can use the same method to get the corresponding test path in that case.
测试脚本的生成方法不局限于上述的Q Learning和DQN,还可以采用其他的强化学习模型。图4的流程示例了将强化学习应用于测试脚本的自动生成时的处理流程,可以 包括如下处理:The method for generating test scripts is not limited to the above Q Learning and DQN, and other reinforcement learning models can also be used. The flow in Figure 4 illustrates the processing flow when reinforcement learning is applied to the automatic generation of test scripts, which may include the following processing:
在步骤400中,获取用于测试的状态status和行为action,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态的切换由所述行为触发,一个所述状态对应多个可能的行为;In step 400, a status status and a behavior action for testing are obtained, the status includes a plurality of test states from the test initial state to the test target state, and the switching of the plurality of test states is triggered by the behavior, one The state corresponds to multiple possible behaviors;
在步骤402中,运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;In step 402, run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
在步骤404中,根据所述Q值,得到测试脚本的所述执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本进行测试。In step 404, the execution path of the test script is obtained according to the Q value, and the execution path includes a sequence of actions that can reach the target state, so as to pass the test script for testing.
基于强化学习的模型实现自动生成自动化测试用例,大幅减少了人力成本的投入,可以达到不用手动编写用例脚本即可自动生成用例的效果。The model based on reinforcement learning realizes the automatic generation of automated test cases, which greatly reduces the investment in labor costs, and can achieve the effect of automatically generating use cases without manually writing use case scripts.
图5提供了一种本说明书至少一个实施例的基于强化学习的测试脚本生成装置,所述装置用于生成测试脚本。如图5所示,该装置可以包括:信息获取模块51、模型运行模块52和脚本生成模块53。Fig. 5 provides a test script generation device based on reinforcement learning according to at least one embodiment of this specification, and the device is used to generate a test script. As shown in FIG. 5, the device may include: an information acquisition module 51, a model running module 52, and a script generation module 53.
信息获取模块51,用于获取用于测试的状态和行为,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;The information acquisition module 51 is configured to acquire the state and behavior used for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior , One state corresponds to multiple possible behaviors;
模型运行模块52,用于运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;The model running module 52 is configured to run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
脚本生成模块53,用于根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本进行测试。The script generation module 53 is configured to obtain a test script according to the Q value, the test script corresponding to an execution path from the initial test state to the test target state, and the execution path includes a sequence of actions that can reach the target state, To pass the test script for testing.
在一个例子中,当所述行为的类型是点击时,所述行为包括分别对应不同界面坐标的点击行为,所述界面是目标被测软件的运行界面。In an example, when the type of the behavior is click, the behavior includes click behaviors corresponding to different interface coordinates, and the interface is the running interface of the target software under test.
在一个例子中,模型运行模块52,具体用于:初始化Q表,所述Q表中包括所述状态和行为;通过Q Learning的方式,对所述Q表进行更新,得到更新后的Q表。In an example, the model running module 52 is specifically configured to: initialize the Q table, which includes the state and behavior; update the Q table by means of Q Learning, to obtain the updated Q table .
在一个例子中,模型运行模块52,具体用于:训练DQN,所述DQN的输入是状态,输出是对应状态和行为的Q值;得到训练完成的DQN。In an example, the model running module 52 is specifically used to train a DQN, where the input of the DQN is the state, and the output is the Q value corresponding to the state and behavior; and the DQN after the training is obtained.
本说明书至少一个实施例还提供了一种基于强化学习的测试脚本生成设备,所述设备包括存储器、处理器,所述存储器用于存储可在处理器上运行的计算机指令;所 述处理器用于在执行所述计算机指令时实现以下步骤:At least one embodiment of the present specification also provides a test script generation device based on reinforcement learning. The device includes a memory and a processor. The memory is used to store computer instructions that can run on the processor; the processor is used for The following steps are implemented when the computer instructions are executed:
获取用于测试的状态和行为,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;Acquire the state and behavior for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;Run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本对目标被测软件进行测试。According to the Q value, a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "including", "including" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that one or more embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may adopt a computer program implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The form of the product.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于数据处理设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围 内。在一些情况下,在权利要求书中记载的行为或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。The above descriptions are only preferred embodiments of one or more embodiments of this specification, and are not intended to limit one or more embodiments of this specification. All within the spirit and principle of one or more embodiments of this specification, Any modification, equivalent replacement, improvement, etc. made should be included in the protection scope of one or more embodiments of this specification.

Claims (14)

  1. 一种基于强化学习的测试脚本生成方法,所述测试脚本用于测试目标被测软件;所述方法包括:A method for generating test scripts based on reinforcement learning, where the test scripts are used to test target software under test; the method includes:
    获取用于测试的状态和行为,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;Acquire the state and behavior for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
    运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;Run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
    根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本对目标被测软件进行测试。According to the Q value, a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
  2. 根据权利要求1所述的方法,所述行为包括:多种类型的行为,所述行为的类型与目标被测软件的界面设计相关。The method according to claim 1, wherein the behavior includes multiple types of behavior, and the type of the behavior is related to the interface design of the target software under test.
  3. 根据权利要求1所述的方法,The method according to claim 1,
    当所述测试目标状态是第一测试目标状态时使用的多个测试状态,与所述测试目标状态是第二测试目标状态时使用的多个测试状态,至少部分测试状态相同;The multiple test states used when the test target state is the first test target state are at least partially the same as the multiple test states used when the test target state is the second test target state;
    当所述测试目标状态是第一测试目标状态时使用的多个行为,与所述测试目标状态是第二测试目标状态时使用的多个行为,至少部分行为相同;The multiple behaviors used when the test target state is the first test target state are at least partially the same as the multiple behaviors used when the test target state is the second test target state;
    所述第一测试目标状态和第二测试目标状态不同。The first test target state and the second test target state are different.
  4. 根据权利要求1所述的方法,The method according to claim 1,
    当所述行为的类型是点击时,所述行为包括分别对应不同界面坐标的点击行为,所述界面是目标被测软件的运行界面。When the type of the behavior is click, the behavior includes click behaviors corresponding to different interface coordinates, and the interface is the running interface of the target software under test.
  5. 根据权利要求4所述的方法,According to the method of claim 4,
    所述界面坐标根据目标被测软件的运行界面的屏幕分辨率分割得到。The interface coordinates are divided according to the screen resolution of the running interface of the target software under test.
  6. 根据权利要求1所述的方法,所述运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值,包括:The method according to claim 1, wherein the running a reinforcement learning model to determine the corresponding Q value between each state and each behavior includes:
    初始化Q表,所述Q表中包括所述状态和行为;Initialize the Q table, the Q table includes the state and behavior;
    通过Q Learning的方式,对所述Q表进行更新,得到更新后的Q表。The Q table is updated through Q Learning, and the updated Q table is obtained.
  7. 根据权利要求1所述的方法,所述运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值,包括:The method according to claim 1, wherein the running a reinforcement learning model to determine the corresponding Q value between each state and each behavior includes:
    训练深度Q网络,所述深度Q网络的输入是状态,输出是对应状态和行为的Q值;得到训练完成的所述深度Q网络。Training a deep Q network, the input of the deep Q network is the state, and the output is the Q value corresponding to the state and behavior; the trained deep Q network is obtained.
  8. 根据权利要求1所述的方法,所述行为是用户在目标被测软件的运行界面的操作行为。The method according to claim 1, wherein the behavior is a user's operation behavior on the running interface of the target software under test.
  9. 根据权利要求1所述的方法,The method according to claim 1,
    所述目标被测软件的每一个所述测试状态,包括多个状态特征;Each of the test states of the target software under test includes multiple state characteristics;
    每个所述状态特征,对应在所述测试状态下的目标被测软件运行界面的一种界面描述维度。Each of the state characteristics corresponds to an interface description dimension of the target software running interface in the test state.
  10. 一种基于强化学习的测试脚本生成装置,所述装置用于生成测试脚本;所述装置包括:A test script generation device based on reinforcement learning, the device is used to generate a test script; the device includes:
    信息获取模块,用于获取用于测试的状态和行为,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;The information acquisition module is used to acquire the state and behavior used for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, One said state corresponds to multiple possible actions;
    模型运行模块,用于运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;The model running module is used to run the reinforcement learning model to determine the corresponding Q value between each state and each behavior;
    脚本生成模块,用于根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本进行测试。The script generation module is used to obtain a test script according to the Q value, the test script corresponding to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to Test through the test script.
  11. 根据权利要求10所述的装置,The device according to claim 10,
    当所述行为的类型是点击时,所述行为包括分别对应不同界面坐标的点击行为,所述界面是目标被测软件的运行界面。When the type of the behavior is click, the behavior includes click behaviors corresponding to different interface coordinates, and the interface is the running interface of the target software under test.
  12. 根据权利要求10所述的装置,The device according to claim 10,
    所述模型运行模块,具体用于:初始化Q表,所述Q表中包括所述状态和行为;通过Q Learning的方式,对所述Q表进行更新,得到更新后的Q表。The model running module is specifically configured to: initialize a Q table, which includes the state and behavior; and update the Q table by means of Q Learning to obtain an updated Q table.
  13. 根据权利要求10所述的装置,The device according to claim 10,
    所述模型运行模块,具体用于:训练深度Q网络,所述深度Q网络的输入是状态,输出是对应状态和行为的Q值;得到训练完成的所述深度Q网络。The model operation module is specifically used to train a deep Q network, the input of the deep Q network is the state, and the output is the Q value corresponding to the state and behavior; and the trained deep Q network is obtained.
  14. 一种基于强化学习的测试脚本生成设备,所述设备包括存储器、处理器,所述存储器用于存储可在处理器上运行的计算机指令;所述处理器用于在执行所述计算机指令时实现以下步骤:A test script generation device based on reinforcement learning. The device includes a memory and a processor. The memory is used to store computer instructions that can run on the processor; the processor is used to implement the following when executing the computer instructions step:
    获取用于测试的状态和行为,所述状态包括由测试初始状态至测试目标状态的多个测试状态,且所述多个测试状态之间的切换由所述行为触发,一个所述状态对应多个可能的行为;Acquire the state and behavior for testing, the state includes a plurality of test states from the test initial state to the test target state, and the switching between the plurality of test states is triggered by the behavior, and one state corresponds to multiple Possible actions
    运行强化学习模型,确定每个所述状态和每个行为之间对应的Q值;Run a reinforcement learning model to determine the corresponding Q value between each state and each behavior;
    根据所述Q值,得到测试脚本,所述测试脚本对应一条由测试初始状态至测试目标状态的执行路径,所述执行路径包括能够达到所述目标状态的行为序列,以通过所述测试脚本对目标被测软件进行测试。According to the Q value, a test script is obtained, the test script corresponds to an execution path from the initial test state to the test target state, and the execution path includes a sequence of behaviors that can reach the target state to pass the test script pair The target software under test is tested.
PCT/CN2019/116263 2019-01-21 2019-11-07 Reinforcement learning-based test script generation method and apparatus WO2020151301A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910054193.1 2019-01-21
CN201910054193.1A CN109901994B (en) 2019-01-21 2019-01-21 Test script generation method and device based on reinforcement learning

Publications (1)

Publication Number Publication Date
WO2020151301A1 true WO2020151301A1 (en) 2020-07-30

Family

ID=66943961

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116263 WO2020151301A1 (en) 2019-01-21 2019-11-07 Reinforcement learning-based test script generation method and apparatus

Country Status (2)

Country Link
CN (1) CN109901994B (en)
WO (1) WO2020151301A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901994B (en) * 2019-01-21 2020-05-15 阿里巴巴集团控股有限公司 Test script generation method and device based on reinforcement learning
CN110442515B (en) * 2019-07-12 2023-07-25 创新先进技术有限公司 Application testing method, device, equipment and readable storage medium
CN111008154B (en) * 2019-12-31 2021-09-28 南京大学 Android application automatic test method and system based on reinforcement learning
CN111694755B (en) * 2020-07-31 2023-07-18 抖音视界有限公司 Application program testing method and device, electronic equipment and medium
CN112383482B (en) * 2020-11-16 2021-10-08 北京邮电大学 Dynamic Q value route calculation method and device based on data plane
CN112685318A (en) * 2021-01-07 2021-04-20 广州三星通信技术研究有限公司 Method and system for generating test script

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334439A (en) * 2018-03-14 2018-07-27 百度在线网络技术(北京)有限公司 A kind of method for testing pressure, device, equipment and storage medium
US20180246801A1 (en) * 2017-02-24 2018-08-30 International Business Machines Corporation Controlling a system under test using a cognitive control based test runner
CN109901994A (en) * 2019-01-21 2019-06-18 阿里巴巴集团控股有限公司 A kind of test script generation method and device based on intensified learning

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572123B (en) * 2015-01-27 2019-05-14 Oppo广东移动通信有限公司 A kind of scenario generation method and device
CN106991030B (en) * 2017-03-01 2020-04-14 北京航空航天大学 Online learning-based system power consumption optimization lightweight method
CN109062782B (en) * 2018-06-27 2022-05-31 创新先进技术有限公司 Regression test case selection method, device and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180246801A1 (en) * 2017-02-24 2018-08-30 International Business Machines Corporation Controlling a system under test using a cognitive control based test runner
CN108334439A (en) * 2018-03-14 2018-07-27 百度在线网络技术(北京)有限公司 A kind of method for testing pressure, device, equipment and storage medium
CN109901994A (en) * 2019-01-21 2019-06-18 阿里巴巴集团控股有限公司 A kind of test script generation method and device based on intensified learning

Also Published As

Publication number Publication date
CN109901994B (en) 2020-05-15
CN109901994A (en) 2019-06-18

Similar Documents

Publication Publication Date Title
WO2020151301A1 (en) Reinforcement learning-based test script generation method and apparatus
CN109726093B (en) Method, apparatus and computer program product for executing test cases
CN108959068B (en) Software interface testing method, device and storage medium
US10216377B2 (en) Visual regression analysis
US9830252B2 (en) System, method and non-transitory computer readable medium for software testing
US20080209405A1 (en) Distributed debugging for a visual programming language
CN110673936B (en) Breakpoint continuous operation method and device for arrangement service, storage medium and electronic equipment
US11468880B2 (en) Dialog system training using a simulated user system
CN103984626A (en) Method and device for generating test-case script
CN111475390A (en) Log collection system deployment method, device, equipment and storage medium
US20100312541A1 (en) Program test device and program
CN111400167A (en) Redfish service compliance verification method, device, equipment and medium
US9612944B2 (en) Method and system for verifying scenario based test selection, execution and reporting
CN111414309A (en) Automatic test method of application program, computer equipment and storage medium
KR20210036167A (en) Test automation of application
US7827540B2 (en) Method for program debugging
CN110717315A (en) System data batch modification method and device, storage medium and electronic equipment
KR101753314B1 (en) Method for testing application of using learning image matching and apparatus for executing the method
CN112486802A (en) Flutter test auxiliary method and device
CN113220511A (en) Method, apparatus and computer-readable storage medium for testing BIOS
US10545858B2 (en) Method for testing a graphical interface and corresponding test system
CN112445711A (en) Test method for generating simulation test scene based on visual dragging of Web page
US20210133628A1 (en) Analysing Machine-Learned Classifier Models
CN111949510A (en) Test processing method and device, electronic equipment and readable storage medium
CN110968519A (en) Game testing method, device, server and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19911865

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19911865

Country of ref document: EP

Kind code of ref document: A1