Automatic testing method and device, electronic equipment and storage medium

By using pre-trained test case generation models, test cases are generated based on the interface information of the target software, and dynamically responding to interface changes, the problem of insufficient efficiency and accuracy of test case generation in the existing technology is solved, and efficient and accurate automated testing is achieved.

CN119718921APending Publication Date: 2025-03-28GOWIN SEMICON CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411787536.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When existing automated testing methods face software complexity and interface changes, it is difficult to effectively generate test cases, resulting in poor accuracy of test results.

Method used

A pre-trained test case generation model is used to generate multiple target test cases based on the interface information of the target software, and dynamically respond to interface changes to adapt to different states and operations.

Benefits of technology

It realizes the automated generation of test cases, improves testing efficiency and accuracy, and has the ability to adapt to software interface changes, avoiding the limitations of static test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718921A_ABST
    Figure CN119718921A_ABST
Patent Text Reader

Abstract

The invention provides an automatic testing method and device, electronic equipment and a storage medium, and relates to the technical field of software testing. The method comprises the following steps: in response to a test trigger instruction for target software, generating a plurality of target test cases corresponding to the target software through a pre-trained test case generation model according to interface information of the target software; and aiming at the target software, executing each test case, and generating a test result of the target software under each target test case. According to the method, the test case of the target software is generated through the pre-trained test case generation model, so that automatic generation of the test case is realized, automatic testing of the target software can be realized by triggering execution of the test case, and the test efficiency is improved. Wherein the test case generation model can explore and generate a better test case based on the state and operation information extracted from the interface information of the target software, so that the accuracy of a test result is improved when the test case generation model is used for testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to an automated testing method, device, electronic device and storage medium. Background Art

[0002] Automated testing refers to the process of using tools to simulate human operations, automatically execute test cases, and generate test results. It is an efficient, accurate, and consistent testing method that reduces the cost and time of manual testing and helps testers quickly discover defects in the software.

[0003] Traditional testing methods often involve manually writing test cases and scripts, then executing the test cases and analyzing the test results.

[0004] However, with the increasing complexity of software, manually writing test cases requires a lot of time and effort. Moreover, since the test cases are pre-defined, they have poor adaptability to changes in software interfaces, resulting in poor accuracy of test results. Summary of the invention

[0005] The purpose of this application is to provide an automated testing method, device, electronic device and storage medium to improve the efficiency and accuracy of software testing in order to address the deficiencies in the above-mentioned prior art.

[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, an embodiment of the present application provides an automated testing method, comprising:

[0008] In response to a test trigger instruction for the target software, a plurality of target test cases corresponding to the target software are generated by a pre-trained test case generation model according to the interface information of the target software; the interface information is used to indicate each element on the interface and the operation result corresponding to each element;

[0009] For the target software, each target test case is executed to generate a test result of the target software under each target test case.

[0010] Optionally, generating a plurality of target test cases corresponding to the target software by using a pre-trained test case generation model according to the interface information of the target software includes:

[0011] Determine a state space set and an action space set of the target software according to the interface information of the target software, wherein the state space set includes various state information affecting the interface function of the target software; and the action space set includes various action information executable under various state information;

[0012] The state space set and the action space set are input into the test case generation model, and the test case generation model generates a plurality of target test cases corresponding to the target software according to the state space set and the action space set.

[0013] Optionally, the generating a plurality of target test cases corresponding to the target software by the test case generation model according to the state space set and the action space set includes:

[0014] Determining, by the test case generation model, at least one candidate state information from the state space set, and determining, from the action space set, at least one target action information corresponding to each candidate state information;

[0015] A plurality of target test cases corresponding to the target software are generated according to each candidate state information and at least one target action information corresponding to each candidate state information.

[0016] Optionally, after generating a plurality of target test cases corresponding to the target software, the method further includes:

[0017] Responding to the interface change of the target software, acquiring new interface information of the target software;

[0018] Determine a new state space set and a new action space set of the target software according to the new interface information;

[0019] According to the new state space set and the new action space set, a new test case corresponding to the target software is generated through the test case generation model.

[0020] Optionally, the training process of the test case generation model includes:

[0021] Generate initial test cases for each sample software based on the interface information of each sample software;

[0022] The test case generation model is trained based on the initial test cases of each sample software.

[0023] Optionally, generating an initial test case for each sample software according to the interface information of each sample software includes:

[0024] According to the interface information of each sample software, determine the information of each factor affecting the interface function of each sample software;

[0025] For each factor information of each sample software, determine the result information that can be generated by each factor information;

[0026] According to each factor information of each sample software and result information that can be generated by each factor information, each initial test case of each sample software is generated.

[0027] Optionally, generating each initial test case of each sample software according to each factor information of each sample software and result information that can be generated by each factor information includes:

[0028] Constructing an association relationship between each factor information of the sample software and the result information that can be generated by each factor information, and generating a test case diagram of the sample software based on the association relationship; the test case diagram includes a node and a pointing relationship between adjacent nodes, and the node corresponds to a factor information or result information;

[0029] According to the test case diagram, initial test cases of the sample software are generated, each initial test case corresponds to a test requirement, and each initial test case includes a test path under the corresponding test requirement.

[0030] Optionally, the training of the test case generation model according to the initial test cases of each sample software includes:

[0031] Inputting each initial test case as input data into an initial test case generation model, and constructing a current state space set and a current action space set according to each initial test case by the initial test case generation model;

[0032] According to the current state space set and the current action space set, based on the network parameters of the initial test case generation model, explore and generate at least one test case of the current iteration round;

[0033] Determine the reward information for the current iteration round based on the test cases of the current iteration round and the constructed reward function;

[0034] According to the reward information of the current iteration round and the preset reward threshold, determine whether to stop iterative training, and if so, use the current test case generation model as the test case generation model;

[0035] If not, the current state space set and the current action space set are updated, and the network parameters of the current test case generation model are updated.

[0036] Optionally, determining the reward information of the current iteration round according to each test case of the current iteration round and the constructed reward function includes:

[0037] Determine the requirement coverage reward for the test case based on the test requirements corresponding to each test case and all the test requirements contained in the test requirement document;

[0038] Determine the defect discovery rate reward for each test case based on the number of defects found in each test case;

[0039] Determine the diversity reward for each test case based on the similarity between the test cases;

[0040] The reward information for the current iteration round is determined according to the requirement coverage rate reward, the defect discovery rate reward, and the diversity reward.

[0041] Optionally, updating the current state space set and the current action space set includes:

[0042] According to the current interface information of each test case and / or sample software of the current iteration round, the current state space set is updated to obtain a new current state space set;

[0043] According to the new current state space set, the current action space set is updated to obtain a new current action space set.

[0044] In a second aspect, an embodiment of the present application further provides an automated testing device, including: a generation module and a testing module;

[0045] The generation module is used to respond to the test trigger instruction for the target software, generate multiple target test cases corresponding to the target software according to the interface information of the target software through a pre-trained test case generation model; the interface information is used to indicate each element on the interface and the operation result corresponding to each element;

[0046] The test module is used to execute each target test case for the target software and generate test results of the target software under each target test case.

[0047] Optionally, the generating module is specifically used to determine a state space set and an action space set of the target software according to the interface information of the target software, wherein the state space set includes various state information affecting the interface function of the target software; and the action space set includes various action information executable under various state information;

[0048] The state space set and the action space set are input into the test case generation model, and the test case generation model generates a plurality of target test cases corresponding to the target software according to the state space set and the action space set.

[0049] Optionally, the generation module is specifically configured to determine, by the test case generation model, at least one candidate state information from the state space set, and determine at least one target action information corresponding to each candidate state information from the action space set;

[0050] A plurality of target test cases corresponding to the target software are generated according to each candidate state information and at least one target action information corresponding to each candidate state information.

[0051] Optionally, the generating module is specifically used to respond to the interface change of the target software and obtain new interface information of the target software;

[0052] Determine a new state space set and a new action space set of the target software according to the new interface information;

[0053] According to the new state space set and the new action space set, a new test case corresponding to the target software is generated through the test case generation model.

[0054] Optionally, it also includes: a training module;

[0055] The training module is used to generate initial test cases for each sample software according to the interface information of each sample software;

[0056] The test case generation model is trained based on the initial test cases of each sample software.

[0057] Optionally, the training module is specifically used to determine information of various factors affecting the interface function of each sample software according to the interface information of each sample software;

[0058] For each factor information of each sample software, determine the result information that can be generated by each factor information;

[0059] According to each factor information of each sample software and result information that can be generated by each factor information, each initial test case of each sample software is generated.

[0060] Optionally, the training module is specifically used to construct an association relationship between each factor information of the sample software and the result information that can be generated by each factor information, and based on the association relationship, generate a test case diagram of the sample software; the test case diagram includes a node and a pointing relationship between adjacent nodes, and the node corresponds to a factor information or result information;

[0061] According to the test case diagram, initial test cases of the sample software are generated, each initial test case corresponds to a test requirement, and each initial test case includes a test path under the corresponding test requirement.

[0062] Optionally, the training module is specifically used to input each initial test case as input data into an initial test case generation model, and the initial test case generation model constructs a current state space set and a current action space set according to each initial test case;

[0063] According to the current state space set and the current action space set, based on the network parameters of the initial test case generation model, explore and generate at least one test case of the current iteration round;

[0064] Determine the reward information for the current iteration round based on the test cases of the current iteration round and the constructed reward function;

[0065] According to the reward information of the current iteration round and the preset reward threshold, determine whether to stop iterative training, and if so, use the current test case generation model as the test case generation model;

[0066] If not, the current state space set and the current action space set are updated, and the network parameters of the current test case generation model are updated.

[0067] Optionally, the training module is specifically used to determine the requirement coverage reward of the test case according to the test requirements corresponding to each test case and all test requirements contained in the test requirement document;

[0068] Determine the defect discovery rate reward for each test case based on the number of defects found in each test case;

[0069] Determine the diversity reward for each test case based on the similarity between the test cases;

[0070] The reward information for the current iteration round is determined according to the requirement coverage rate reward, the defect discovery rate reward, and the diversity reward.

[0071] Optionally, the training module is specifically used to update the current state space set according to each test case of the current iteration round and / or the current interface information of the sample software to obtain a new current state space set;

[0072] According to the new current state space set, the current action space set is updated to obtain a new current action space set.

[0073] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to implement the automated testing method provided in the first aspect.

[0074] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the automated testing method provided in the first aspect is executed.

[0075] The beneficial effects of this application are:

[0076] The present application provides an automated testing method, device, electronic device and storage medium, including: responding to a test trigger instruction for a target software, generating multiple target test cases corresponding to the target software through a pre-trained test case generation model according to the interface information of the target software; the interface information is used to indicate each element on the interface and the operation result corresponding to each element; for the target software, executing each test case, and generating the test result of the target software under each target test case. The method generates test cases for the target software through a pre-trained test case generation model, realizes the automated generation of test cases, and thus triggering the execution of test cases can realize the automated testing of the target software, thereby improving the testing efficiency. Among them, the test case generation model can explore and generate better test cases based on the state and operation information extracted from the interface information of the target software, so as to improve the accuracy of the test results when used for testing.

[0077] Among them, in the process of test case generation model application, it can dynamically respond to changes in the software interface to adapt to different states and operations, avoiding the limitations of static test cases and improving the effectiveness of the test.

[0078] During the training process of the test case generation model, reinforcement learning can detect and generate more test cases by continuously learning the relationship between the state of the software interface and the operations caused by the state. Through the set reward function, the generated test cases can be rewarded, so that the model can be feedback-adjusted through the reward information to guide the model to generate test cases with higher rewards, improve the usability of the generated test cases, and then perform software testing based on the generated test cases, which can improve the effectiveness and accuracy of software testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0080] Figure 1 A schematic diagram of a flow chart of an automated testing method provided in an embodiment of the present application;

[0081] Figure 2 A flowchart of another automated testing method provided in an embodiment of the present application;

[0082] Figure 3 A flowchart of another automated testing method provided in an embodiment of the present application;

[0083] Figure 4 A flowchart of another automated testing method provided in an embodiment of the present application;

[0084] Figure 5 A schematic diagram of the training architecture of the test case generation model provided in an embodiment of the present application;

[0085] Figure 6 A flow chart of a training method for a test case generation model provided in an embodiment of the present application;

[0086] Figure 7 A flowchart of another method for training a test case generation model provided in an embodiment of the present application;

[0087] Figure 8 A flowchart of a training method for a test case generation model provided in another embodiment of the present application;

[0088] Fig. 9 A schematic diagram of a test case diagram provided in an embodiment of the present application;

[0089] Fig.10 A flowchart of another method for training a test case generation model provided in an embodiment of the present application;

[0090] Fig.11 A flowchart of a training method for a test case generation model provided in another embodiment of the present application;

[0091] Fig.12 A flowchart of another method for training a test case generation model provided in an embodiment of the present application;

[0092] Fig.13 A schematic diagram of an automated testing device provided in an embodiment of the present application;

[0093] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0094] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0095] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0096] Automated testing refers to the process of using tools to simulate human operations, automatically execute test cases, and generate test results. It is an efficient, accurate, and consistent testing method that reduces the cost and time of manual testing and helps testers quickly discover defects in the software.

[0097] In the process of using EDA (Electronic Design Automation) tools, GUI (Graphical User Interface) automated testing is an important link. Usually, it is necessary to use automated tools or manually write test cases and scripts, then execute the test and analyze the results. However, with the increase in software complexity, manually writing test cases and scripts takes a lot of time and effort. In addition, due to the poor adaptability of traditional automated testing methods to interface changes, a slight change in the interface may cause the test script to fail. Therefore, it is less efficient when dealing with complex interfaces. In addition, the behavior of each test case in the traditional GUI automated testing method is pre-defined, and it has a strong dependence on the environment and platform, and is easily affected by the external environment, resulting in poor stability. With the continuous update of software and the change of functions, the test script needs to be continuously maintained and updated, lacks adaptability and intelligence, and is difficult to handle fast iteration of complex and constantly changing interface elements and dynamic interfaces.

[0098] Based on the existence of the above problems, this solution provides an automated testing method, which obtains a test case generation model based on reinforcement learning training, and then deploys the test case generation model to the target software to be tested. By running the test case generation module, a better test case for testing the target software can be generated, and then the generated test case can be run to test the target software and obtain the test results, thereby realizing the automated testing of the software. In the training process of the test case generation model, reinforcement learning can detect and generate more test cases by continuously learning the relationship between the state of the software interface and the operations caused by the state, and the generated test cases can be rewarded through the set reward function, so that the model can be feedback-adjusted through the reward information to guide the model to generate test cases with higher rewards, improve the usability of the generated test cases, and thus perform software testing based on the generated test cases, which can improve the effectiveness and accuracy of software testing.

[0099] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0100] Figure 1 A flowchart of an automated testing method provided in an embodiment of the present application; the execution subject of the method may be a computer device such as a processor or a server, such as Figure 1 As shown, the method may include:

[0101] S101, responding to a test trigger instruction for a target software, generating a plurality of target test cases corresponding to the target software through a pre-trained test case generation model according to the interface information of the target software.

[0102] The interface information is used to indicate each element on the interface and the operation result corresponding to each element.

[0103] The target software can be any software that needs to be functionally tested. The target software can be deployed in a test platform, and the test of the target software can be triggered by the test platform. For example, the test of the target software can be triggered by a start button.

[0104] Optionally, in response to a test trigger instruction for the target software, interface information of the target software may be collected, wherein the interface information is used to indicate each element on the interface and the operation result corresponding to each element.

[0105] The elements on the interface may include but are not limited to functional modules, controls, drop-down menus, text boxes, etc., which are objects that enable users to input interactive operations.

[0106] For different elements, corresponding operation results may be generated after the input operation. For example, after the user enters valid content in the text box, the interface may jump to the next interface; or after the button is clicked, a prompt box will pop up.

[0107] It is worth noting that, based on the interface information of the target software, the relationship between the status of each interface element in the target software and the operation results can be systematically understood and expressed, thereby being used to explore and generate test cases for the target software.

[0108] In some embodiments, based on the interface information, the input data of the model can be obtained, so that according to the input data, a model can be generated through pre-trained test cases, and multiple target test cases corresponding to the target software can be generated.

[0109] It should be noted that the test case generation model can be pre-trained based on reinforcement learning, and the trained test case generation model can be deployed to the test platform in advance. After triggering the test of the target software, the test case generation model can run and generate target test cases corresponding to the target software.

[0110] Among them, during the training process of the test case generation model, reinforcement learning can detect and generate more test cases by continuously learning the relationship between the state of the software interface and the operations caused by the state. Through the set reward function, the generated test cases can be rewarded, so that the model can be feedback-adjusted through the reward information to guide the model to generate test cases with higher rewards and improve the usability of the generated test cases.

[0111] S102: Execute each test case for the target software and generate test results of the target software under each target test case.

[0112] Optionally, each target test case is automatically executed on the target software, and then the test results of the target software under each target test case can be generated.

[0113] Since the target test cases of the target software are automatically generated through the test case generation model, the manual workload is reduced and the testing efficiency is improved. In addition, the test cases generated based on the test case generation model have strong usability and better testing performance, which can improve the accuracy of the test results of the target software.

[0114] In summary, the automated testing method provided in this embodiment includes: responding to a test trigger instruction for the target software, generating multiple target test cases corresponding to the target software through a pre-trained test case generation model according to the interface information of the target software; the interface information is used to indicate each element on the interface and the operation result corresponding to each element; for the target software, executing each test case, and generating the test result of the target software under each target test case. This method generates test cases for the target software through a pre-trained test case generation model, thereby realizing the automated generation of test cases, so that the automated testing of the target software can be realized by triggering the execution of the test cases, thereby improving the testing efficiency. Among them, the test case generation model can explore and generate better test cases based on the state and operation information extracted from the interface information of the target software, so as to improve the accuracy of the test results when used for testing.

[0115] Figure 2 A flowchart of another automated testing method provided by an embodiment of the present application; optionally, in step S101, generating multiple target test cases corresponding to the target software through a pre-trained test case generation model according to the interface information of the target software may include:

[0116] S201 . Determine a state space set and an action space set of the target software according to interface information of the target software.

[0117] The state space set includes various state information that affects the interface function of the target software; and the action space set includes various action information that can be executed under various state information.

[0118] First, the functions and characteristics of the software interface of the target software can be clarified, including the various controls, functional modules and user interaction processes (operation paths) on the interface.

[0119] Next, all state information affecting the interface function of the target software is determined, including the control state on the interface, user input, system state, etc., and all state information affecting the interface function of the target software is formed into a state space set.

[0120] Exemplarily, the state space set may include, but is not limited to, whether a button is enabled, the content entered in a text box, the options in a drop-down menu, etc.

[0121] For each state information, the impact of the state information on the system can be determined, that is, the result information that may be caused by the state information can be determined. In other words, the action information that can be executed under the state information can be determined. It can be a system state change, a function trigger, an error message, etc. The action information that can be executed under each state information can form an action space set.

[0122] Exemplarily, the action space set may include but is not limited to: whether a dialog box will pop up after a button is clicked; whether an error message will be displayed when invalid content is entered in a text box; whether a file will be opened after a file name is clicked, etc.

[0123] S202: input the state space set and the action space set into a test case generation model, and the test case generation model generates a plurality of target test cases corresponding to the target software according to the state space set and the action space set.

[0124] Optionally, the obtained state space set and action space set can be used as input data and input into a test case generation model, so that the test case generation model explores each state information and each action information executable under each state information, and generates multiple target test cases for the target software.

[0125] Figure 3 A flowchart of another automated testing method provided by an embodiment of the present application; Optionally, in step S202, the test case generation model generates multiple target test cases corresponding to the target software according to the state space set and the action space set, which may include:

[0126] S301. The test case generation model determines at least one candidate state information from a state space set, and determines at least one target action information corresponding to each candidate state information from an action space set.

[0127] Usually, a test case corresponds to a test requirement, that is, a test function, and a test case usually includes test steps, which constitute a test path. By simulating the interactive actions of the software according to the test path indicated in the test case, a function of the software can be tested.

[0128] At least one candidate state information may be determined from the state space set, that is, the candidate state information may be part or all of the state information in the state space set.

[0129] Different candidate state information may correspond to different executable action information, and at least one target action information corresponding to each candidate state information may be determined.

[0130] S302: Generate multiple target test cases corresponding to the target software according to each candidate state information and at least one target action information corresponding to each candidate state information.

[0131] Then, a plurality of target test cases corresponding to the target software can be generated based on the selected candidate state information and the at least one target action information corresponding to each candidate state information.

[0132] It should be noted that the candidate state information determines the determined action information. When the number of determined candidate state information is different, or when the determined candidate state information is different, the corresponding generated target test cases are also different.

[0133] Exemplarily: based on the interface information of the target software, the acquired state space set includes: state information 1: the user has logged into the system but has not performed any operation; state information 2: the user has opened the software installation directory or the location of the desktop shortcut; state information 3: the user has selected the FloorPlanner executable file or shortcut and is ready to double-click to start; state information 4: the software is starting and loading; state information 5: the software startup is complete and enters the main interface.

[0134] The action space set obtained includes: action information 1: user logs into the system; action information 2: opens the software installation directory or the location of the desktop shortcut; action information 3: selects the FloorPlanner executable file or shortcut; action information 4: double-clicks to start the software; action information 5: handles errors during the startup process (such as retrying, canceling operations, etc.).

[0135] The action information corresponding to the state information 1 may be action information 2, the action information corresponding to the state information 2 may be action information 3, the action information corresponding to the state information 3 may be action information 4; and the action information corresponding to the state information 4 may be action information 5.

[0136] Then, when the candidate status information is status information 1, status information 2, and status information 3, the corresponding target test case 1 can be: user logs in to the system -> opens the software installation directory -> double-clicks the FloorPlanner executable file -> observes whether the software is successfully started and enters the main interface. Target test case 1 is used to test: the function of starting FloorPlanner through the software installation directory.

[0137] Alternatively, a target test case 2 may be generated as follows: user logs into the system -> double-clicks the FloorPlanner shortcut on the desktop -> observes whether the software is successfully started and enters the main interface. Target test case 2 is used to test the function of starting FloorPlanner via a desktop shortcut.

[0138] In some embodiments, based on the target test cases generated above, the test case generation model will continue to explore and expand to generate more target test cases until all test cases that can cover all test requirements are generated as much as possible.

[0139] For example, based on the above test cases, target test case 3 can also be generated: log in to the system using different user accounts -> open the software installation directory -> double-click the FloorPlanner executable file -> observe and record the startup behavior of the software. Target test case 3 is used to test: start FloorPlanner through different user accounts and check whether the startup behavior of the software is consistent.

[0140] You can also generate target test case 4: disconnect the network connection or limit system resources (such as CPU, memory, etc.) before the software starts -> open the software installation directory -> double-click the FloorPlanner executable file -> observe and record the software startup behavior and error handling mechanism. Target test case 4 is used to test: simulate network disconnection or system resource shortage during the startup process to check whether the software startup behavior is stable.

[0141] Figure 4 A flowchart of another automated testing method provided by an embodiment of the present application; optionally, in step S202, after generating multiple target test cases corresponding to the target software, the following may also be included:

[0142] S401. Respond to the interface change of the target software and obtain new interface information of the target software.

[0143] In some embodiments, the method of generating test cases through a test case generation model can adapt to dynamic changes in software interfaces, and when changes in the interface of the target software are detected, new interface information can be immediately acquired.

[0144] S402: Determine a new state space set and a new action space set of the target software according to the new interface information.

[0145] Based on the new interface information, the state space set and the action space set of the target software can be updated to obtain a new state space set and a new action space set.

[0146] For example: if new controls are added to the interface of the target software, or if the functions of old controls in the interface are changed, new state information will be generated accordingly, and the new state information will trigger new action information accordingly. Therefore, by adding the new state information to the state space set, a new state space set can be obtained; by adding the new action information to the action space set, a new action space set can be obtained.

[0147] S403: Generate new test cases corresponding to the target software through a test case generation model according to the new state space set and the new action space set.

[0148] Similarly, the new state space set and the new action space set can be used as input to the test case generation model, and the test case generation model explores and generates new test cases corresponding to the target software in the manner described in the above steps.

[0149] It can be seen that the test case generation model obtained based on reinforcement learning training can dynamically adapt to changes in the environment in practical applications, that is, adapt to changes in the software interface, thereby continuously generating more comprehensive test cases.

[0150] Figure 5 A schematic diagram of the training architecture of the test case generation model provided in the embodiment of the present application. Based on the interface information of the sample software, the factors affecting the software interface function and the results caused by the factors can be analyzed to generate a test case diagram, an initial test case can be generated based on the test case diagram, and environmental modeling can be performed based on the initial test case, a state space and an action space can be constructed, and a reward function can be set to explore and generate test cases through the state space and the action space; reward information for the test case is generated through the reward function, and the network parameters of the test case generation model are continuously optimized through the reward information and the set reward threshold, as well as the state space and the action space, so as to train and obtain a test case generation model, and the test case generation model can generate test cases with higher rewards.

[0151] Figure 6 A flow chart of a training method for a test case generation model provided in an embodiment of the present application; Figure 6 As shown, the training process of the test case generation model may include:

[0152] S601. Generate initial test cases for each sample software according to the interface information of each sample software.

[0153] Similar to the processing of the above model during application, the factors and results affecting the functions of each sample software can be analyzed based on the interface information of each sample software, and initial test cases for each sample software can be generated.

[0154] S602: According to the initial test cases of each sample software, a test case generation model is trained.

[0155] By using the initial test cases of each sample software as training data, a test case generation model can be trained.

[0156] Since the interface information of the collected sample software may not be comprehensive, the initial test cases generated for each sample software cannot fully cover all the test requirements in the requirements file. The initial test cases are input into the reinforcement learning model as the starting point of training, and the known test paths are used to explore new test paths, obtain reward feedback, and continuously optimize the strategy to generate more effective test cases.

[0157] When the training reaches the stopping condition, the reinforcement learning model at this time can be used as a test case generation model. The network parameters of the test case generation model at this time are better and can be used to generate more effective test cases with higher rewards.

[0158] Figure 7 A flow chart of another training method for a test case generation model provided in an embodiment of the present application; Optionally, in step S601, generating an initial test case for each sample software according to the interface information of each sample software may include:

[0159] S701. Determine information of factors that affect interface functions of each sample software according to interface information of each sample software.

[0160] Referring to step S201 , various factor information affecting the interface function of each sample software may be determined according to the interface information of the sample software, that is, various state information may be determined.

[0161] S702: for each factor information of each sample software, determine the result information that can be generated by each factor information.

[0162] Referring to step S201 as well, the result information generated by each factor information can be determined according to the interface information of the sample software, that is, each action information can be determined.

[0163] S703 , generating initial test cases for each sample software according to each factor information of each sample software and result information that can be generated by each factor information.

[0164] Therefore, various initial test cases of the sample software can be generated according to the various factor information of the sample software and the result information that can be produced.

[0165] It is worth noting that the factor information here may correspond to the above-mentioned state information, and the result information may correspond to the action information.

[0166] Figure 8 A flow chart of another training method for a test case generation model provided in an embodiment of the present application; Optionally, in step S703, generating initial test cases for each sample software according to each factor information of each sample software and result information that can be generated by each factor information may include:

[0167] S801. Construct an association relationship between each factor information of the sample software and the result information that can be generated by each factor information, and generate a test case diagram of the sample software based on the association relationship.

[0168] The test case diagram includes nodes and pointing relationships between adjacent nodes, and a node corresponds to a factor information or result information.

[0169] Taking a sample software as an example, according to the correlation between each factor information of the sample software and the result information that can be generated by each factor information, a test case diagram of the sample software can be generated, which can also be called a UML (Unified Modeling Language) diagram.

[0170] Fig. 9 A schematic effect of a test case diagram provided for an embodiment of the present application. In this test case diagram, each node represents an event or state, and the arrows represent the causal relationship between events. For example, "user logs in to the system" is a prerequisite for "opening the software installation directory", "double-clicking the FloorPlanner (FP for short) executable file" is a prerequisite for "software startup loading", and so on. Another path to start the software through a desktop shortcut is also considered.

[0171] S802. Generate initial test cases of the sample software according to the test case diagram, each initial test case corresponds to a test requirement, and each initial test case includes a test path under the corresponding test requirement.

[0172] The sample software interface factors (such as button status, user input) and their impacts (such as system response, error prompts) can be associated with the test case diagram, and the initial test cases can be generated.

[0173] For example, based on Fig. 9 The test case diagram shown can generate the following initial test cases:

[0174] Test case 1: Launch FloorPlanner from the software installation directory.

[0175] Steps: Log in to the system -> open the software installation directory -> double-click the FloorPlanner executable file -> observe whether the software is successfully started and enters the main interface.

[0176] Test case 2: Launch FloorPlanner via desktop shortcut.

[0177] Steps: Log in to the system -> double-click the FloorPlanner shortcut on the desktop -> observe whether the software is successfully started and enters the main interface.

[0178] Fig.10 A flow chart of another training method for a test case generation model provided in an embodiment of the present application; Optionally, in step S602, training a test case generation model according to initial test cases of each sample software may include:

[0179] S1001. Input each initial test case as input data into an initial test case generation model, and the initial test case generation model constructs a current state space set and a current action space set according to each initial test case.

[0180] The initial test case generation model here refers to the model before the network parameters are trained, which can also be understood as a general reinforcement learning model.

[0181] After each initial test case is input as input data into the initial test case generation model, the current state space set and the current action space set can be constructed from the initial test case generation model.

[0182] Exemplarily, in combination with the initial test cases in step S802, the current state space set constructed may include: state information 1: the user has logged into the system but has not performed any operation; state information 2: the user has opened the software installation directory or the location of the desktop shortcut; state information 3: the user has selected the FloorPlanner executable file or shortcut and is ready to double-click to start; state information 4: the software is starting and loading; state information 5: the software startup is complete and enters the main interface; error state information: an error occurs during the startup process, such as file not found, insufficient permissions, etc.

[0183] The current action space set constructed may include: action information 1: user logs into the system; action information 2: opens the software installation directory or the location of the desktop shortcut; action information 3: selects the FloorPlanner executable file or shortcut; action information 4: double-clicks to start the software; action information 5: handles errors during the startup process (such as retrying, canceling operations, etc.).

[0184] S1002. According to the current state space set and the current action space set, based on the network parameters of the initial test case generation model, explore and generate at least one test case for the current iteration round.

[0185] Optionally, based on the current state space set and the current action space set, an initial test case generation model may be used to explore and generate at least one test case for the current iteration round.

[0186] During the exploration process, the model can continuously optimize network parameters based on the test path of the existing test cases, select state information from the current state space set, and select executable action information under the state information from the current action space set to form a test path and obtain test cases.

[0187] S1003. Determine the reward information for the current iteration round according to each test case of the current iteration round and the constructed reward function.

[0188] After each round of training, the model can generate at least one new test case, and through the set reward function, the reward information of each test case can be calculated to obtain the reward information of the current iteration round.

[0189] S1004. Determine whether to stop iterative training based on the reward information of the current iteration round and the preset reward threshold. If so, use the current test case generation model as the test case generation model.

[0190] The reward information obtained in the current iteration round is compared with the preset reward threshold to determine whether the stopping condition of the iteration is reached. If so, the training is stopped and the current test case generation model is used as the final test case generation model.

[0191] Of course, in some embodiments, a preset number of iterations may be set, and when the number of iterations reaches the preset number of iterations, the training may be stopped regardless of whether the reward information reaches a preset reward threshold.

[0192] S1005: If not, then update the current state space set and the current action space set, and update the network parameters of the current test case generation model.

[0193] In some embodiments, if the current iteration round does not meet the iteration stop condition, the network parameters of the current test case generation model can be optimized and updated, and the current state space set and the current action space set can be updated. Based on the updated state space set and the updated action space set, the test case generation model with updated network parameters is used to perform the next round of exploration and generate the next round of test cases.

[0194] Fig.11 A flowchart of another training method for a test case generation model provided in an embodiment of the present application; Optionally, in step S1003, determining the reward information of the current iteration round according to each test case of the current iteration round and the constructed reward function may include:

[0195] S1101. Determine the requirement coverage reward for the test case based on the test requirements corresponding to each test case and all test requirements included in the test requirement document.

[0196] In this solution, the reward function can be constructed from three dimensions. For example, the three dimensions can be: test case coverage, defect detection rate, and diversity. In practical applications, there can also be other dimensions.

[0197] For coverage rewards, you can check the test requirements corresponding to the generated test cases and all the test requirements contained in the requirements document to determine whether the generated test cases cover a certain functional point in the requirements document. If so, a reward of 1 is given, otherwise a penalty of -1 is given.

[0198] S1102. Determine a defect discovery rate reward for each test case based on the number of defects found in each test case.

[0199] In terms of defect detection rate, the generated test cases can be run on the sample software, and rewards can be given based on the number of defects found during the test case operation. If the test case finds defects or errors in the system (such as software crashes, startup failures, etc.), a reward of 1 will be given. If not, the reward will be 0.

[0200] S1103. Determine the diversity reward for each test case based on the similarity between the test cases.

[0201] In order to encourage the generation of different test cases, rewards are given according to the diversity of test cases. For example, the similarity between each test case and existing test cases can be calculated. The lower the similarity, the higher the reward. In this example, it is assumed that each test case generated is new (i.e., not repeated), so a certain reward is given as long as a new test case is generated.

[0202] S1104. Determine the reward information for the current iteration round based on the requirement coverage reward, defect discovery rate reward, and diversity reward.

[0203] By combining the coverage reward, defect discovery rate reward, and diversity reward, we can get the reward information for the current iteration round.

[0204] For example, the reward information of a test case can be calculated using the following formula:

[0205] R=α·R1+β·R2+γ·R3

[0206] Among them, R1 represents coverage bonus, R2 represents defect discovery rate bonus, and R3 represents diversity bonus. R1=Cr×W1, where Cr is the proportion of function points in the requirement document covered by the test case, and W1 is a weight coefficient; R2=Dr×W2, where Dr represents 1 for defects found and -1 for no defects found, and W2 is a weight coefficient. R3=Dm×W3, where Dm is the similarity measure between test cases, and W3 is a weight coefficient.

[0207] α, β, and γ are weight coefficients for adjusting the influence of each reward mechanism. According to specific needs, these coefficients can be adjusted to balance the impact of different reward mechanisms.

[0208] By using the above-mentioned reward information calculation method, the reward information of the current iteration round can be calculated.

[0209] Of course, the reward information of any iteration round can be calculated in the above way.

[0210] In any round of training, if the calculated reward information does not reach the reward threshold, the network parameters of the model can be updated, that is, the generation strategy of the model to generate test cases can be updated so that the model can generate test cases with higher rewards.

[0211] For example, if the generated test cases fail to effectively improve the coverage, it is necessary to readjust the network parameters and continuously iterate and optimize the test case generation strategy to gradually improve the test case coverage.

[0212] Fig.12 A flow chart of another training method for a test case generation model provided in an embodiment of the present application; Optionally, in step S1005, updating the current state space set and the current action space set may include:

[0213] S1201. Update the current state space set according to the current interface information of each test case and / or sample software in the current iteration round to obtain a new current state space set.

[0214] In some embodiments, if the current iteration round does not reach the stopping condition of training, the changes in the interface can be detected in real time, and the current state space set can be updated based on the current interface information; of course, in the process of generating new test cases, some new state information may also be generated based on the new test cases. Therefore, according to the test cases of the current iteration round, the current state space set can also be updated.

[0215] For example: in the process of generating new test cases, it is found that clicking a certain control can jump to a new interface or pop up a new prompt message. This new interface or new prompt message would not have been triggered by this control before. Therefore, this information can be updated as new state information to the current state space set to obtain a new state space set.

[0216] S1202: Update the current action space set according to the new current state space set to obtain a new current action space set.

[0217] Based on the new state information, new action information can be generated accordingly, so that the new action information is updated to the current action space set, and a new current action space set can be obtained.

[0218] In summary, the automated testing method provided in this embodiment includes: responding to a test trigger instruction for the target software, generating multiple target test cases corresponding to the target software through a pre-trained test case generation model according to the interface information of the target software; the interface information is used to indicate each element on the interface and the operation result corresponding to each element; for the target software, executing each test case, and generating the test result of the target software under each target test case. This method generates test cases for the target software through a pre-trained test case generation model, thereby realizing the automated generation of test cases, so that the automated testing of the target software can be realized by triggering the execution of the test cases, thereby improving the testing efficiency. Among them, the test case generation model can explore and generate better test cases based on the state and operation information extracted from the interface information of the target software, so as to improve the accuracy of the test results when used for testing.

[0219] Among them, in the process of test case generation model application, it can dynamically respond to changes in the software interface to adapt to different states and operations, avoiding the limitations of static test cases and improving the effectiveness of the test.

[0220] During the training process of the test case generation model, reinforcement learning can detect and generate more test cases by continuously learning the relationship between the state of the software interface and the operations caused by the state. Through the set reward function, the generated test cases can be rewarded, so that the model can be feedback-adjusted through the reward information to guide the model to generate test cases with higher rewards, improve the usability of the generated test cases, and then perform software testing based on the generated test cases, which can improve the effectiveness and accuracy of software testing.

[0221] The following describes the apparatus, equipment, storage medium, etc. used to execute the automated testing method provided in this application. The specific implementation process and technical effects are described above and will not be repeated below.

[0222] Fig.13 This is a schematic diagram of an automated testing device provided in an embodiment of the present application. The functions implemented by the automated testing device correspond to the steps performed by the above method. The device can be understood as the above server, or the processor of the server, or can be understood as a component independent of the above server or processor that implements the functions of the present application under the control of the server, such as Fig.13 As shown, the device may include: a generating module 130, a testing module 131;

[0223] The generation module 130 is used to respond to the test trigger instruction for the target software, generate multiple target test cases corresponding to the target software through the pre-trained test case generation model according to the interface information of the target software; the interface information is used to indicate each element on the interface and the operation result corresponding to each element;

[0224] The testing module 131 is used to execute each target test case for the target software and generate the test result of the target software under each target test case.

[0225] Optionally, the generating module 130 is specifically used to determine the state space set and the action space set of the target software according to the interface information of the target software, wherein the state space set includes various state information affecting the interface function of the target software; and the action space set includes various action information executable under various state information;

[0226] The state space set and the action space set are input into the test case generation model, and the test case generation model generates a plurality of target test cases corresponding to the target software according to the state space set and the action space set.

[0227] Optionally, the generating module 130 is specifically configured to determine at least one candidate state information from the state space set by the test case generation model, and determine at least one target action information corresponding to each candidate state information from the action space set;

[0228] A plurality of target test cases corresponding to the target software are generated according to each candidate state information and at least one target action information corresponding to each candidate state information.

[0229] Optionally, the generating module 130 is specifically used to respond to the interface change of the target software and obtain new interface information of the target software;

[0230] Determine a new state space set and a new action space set of the target software according to the new interface information;

[0231] According to the new state space set and the new action space set, a new test case corresponding to the target software is generated through a test case generation model.

[0232] Optionally, it also includes: a training module;

[0233] A training module, used to generate initial test cases for each sample software according to the interface information of each sample software;

[0234] According to the initial test cases of each sample software, a test case generation model is trained.

[0235] Optionally, the training module is specifically used to determine information of various factors affecting the interface function of each sample software according to the interface information of each sample software;

[0236] For each factor information of each sample software, determine the result information that can be generated by each factor information;

[0237] According to each factor information of each sample software and result information that can be generated by each factor information, each initial test case of each sample software is generated.

[0238] Optionally, the training module is specifically used to construct an association relationship between each factor information of the sample software and the result information that can be generated by each factor information, and generate a test case diagram of the sample software based on the association relationship; the test case diagram includes nodes and pointing relationships between adjacent nodes, and a node corresponds to a factor information or result information;

[0239] According to the test case diagram, initial test cases of the sample software are generated, each initial test case corresponds to a test requirement, and each initial test case includes a test path under the corresponding test requirement.

[0240] Optionally, the training module is specifically used to input each initial test case as input data into an initial test case generation model, and the initial test case generation model constructs a current state space set and a current action space set according to each initial test case;

[0241] According to the current state space set and the current action space set, based on the network parameters of the initial test case generation model, explore and generate at least one test case for the current iteration round;

[0242] Determine the reward information for the current iteration round based on the test cases of the current iteration round and the constructed reward function;

[0243] According to the reward information of the current iteration round and the preset reward threshold, determine whether to stop iterative training. If so, use the current test case generation model as the test case generation model;

[0244] If not, the current state space set and the current action space set are updated, and the network parameters of the current test case generation model are updated.

[0245] Optionally, a training module is specifically used to determine a requirement coverage reward for a test case based on the test requirements corresponding to each test case and all test requirements included in the test requirement document;

[0246] Determine the defect discovery rate reward for each test case based on the number of defects found in each test case;

[0247] Determine the diversity reward for each test case based on the similarity between the test cases;

[0248] Determine the reward information for the current iteration round based on the requirement coverage reward, defect discovery rate reward, and diversity reward.

[0249] Optionally, the training module is specifically used to update the current state space set according to each test case of the current iteration round and / or the current interface information of the sample software to obtain a new current state space set;

[0250] According to the new current state space set, the current action space set is updated to obtain a new current action space set.

[0251] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0252] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0253] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.

[0254] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, which may be a computing device with data processing capabilities.

[0255] The device may include: a processor 801 and a storage medium 802 .

[0256] The storage medium 802 is used to store programs, and the processor 801 calls the programs stored in the storage medium 802 to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0257] The storage medium 802 stores program code, and when the program code is executed by the processor 801, the processor 801 executes various steps of the automated testing method according to various exemplary embodiments of the present application described in the above “Exemplary Method” section of this specification.

[0258] Processor 801 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0259] Storage medium 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Storage medium may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type storage medium, random access storage medium (Random Access Memory, RAM), static random access storage medium (Static Random Access Memory, SRAM), programmable read-only storage medium (Programmable Read Only Memory, PROM), read-only storage medium (Read Only Memory, ROM), electrically erasable programmable read-only storage medium (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic storage medium, disk, optical disk, etc. Storage medium is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The storage medium 802 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0260] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute the above method embodiment when executed by a processor.

[0261] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0262] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0263] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0264] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only storage medium (English: Read-Only Memory, referred to as: ROM), random access storage medium (English: Random Access Memory, referred to as: RAM), disk or optical disk and other media that can store program code.

Claims

1. An automated testing method, characterized in that: include: In response to a test trigger instruction for the target software, a plurality of target test cases corresponding to the target software are generated by a pre-trained test case generation model according to the interface information of the target software; The interface information is used to indicate each element on the interface and the operation result corresponding to each element; For the target software, each target test case is executed to generate a test result of the target software under each target test case.

2. The method according to claim 1, characterized in that: The step of generating a plurality of target test cases corresponding to the target software by using a pre-trained test case generation model according to the interface information of the target software includes: Determining a state space set and an action space set of the target software according to the interface information of the target software, wherein the state space set includes various state information affecting the interface function of the target software; and the action space set includes various action information executable under various state information; The state space set and the action space set are input into the test case generation model, and the test case generation model generates a plurality of target test cases corresponding to the target software according to the state space set and the action space set.

3. The method according to claim 2, characterized in that The step of generating a plurality of target test cases corresponding to the target software by the test case generation model according to the state space set and the action space set includes: The test case generation model determines at least one candidate state information from the state space set, and determines at least one target action information corresponding to each candidate state information from the action space set; A plurality of target test cases corresponding to the target software are generated according to each candidate state information and at least one target action information corresponding to each candidate state information.

4. The method according to claim 2, characterized in that: After generating a plurality of target test cases corresponding to the target software, the method further includes: Responding to the interface change of the target software, acquiring new interface information of the target software; Determine a new state space set and a new action space set of the target software according to the new interface information; According to the new state space set and the new action space set, a new test case corresponding to the target software is generated through the test case generation model.

5. The method according to any one of claims 1 to 4, characterized in that: The training process of the test case generation model includes: Generate initial test cases for each sample software based on the interface information of each sample software; The test case generation model is trained based on the initial test cases of each sample software.

6. The method according to claim 5, characterized in that The generating of initial test cases for each sample software according to the interface information of each sample software comprises: According to the interface information of each sample software, determine the information of each factor affecting the interface function of each sample software; For each factor information of each sample software, determine the result information that can be generated by each factor information; According to each factor information of each sample software and result information that can be generated by each factor information, each initial test case of each sample software is generated.

7. The method according to claim 6, characterized in that The generating of each initial test case of each sample software according to each factor information of each sample software and result information that can be generated by each factor information includes: Constructing an association relationship between each factor information of the sample software and the result information that can be generated by each factor information, and generating a test case diagram of the sample software based on the association relationship; the test case diagram includes a node and a pointing relationship between adjacent nodes, and the node corresponds to a factor information or result information; According to the test case diagram, initial test cases of the sample software are generated, each initial test case corresponds to a test requirement, and each initial test case includes a test path under the corresponding test requirement.

8. The method according to claim 5, characterized in that The training of the test case generation model based on the initial test cases of each sample software includes: Inputting each initial test case as input data into an initial test case generation model, and constructing a current state space set and a current action space set according to each initial test case by the initial test case generation model; According to the current state space set and the current action space set, based on the network parameters of the initial test case generation model, explore and generate at least one test case of the current iteration round; Determine the reward information for the current iteration round based on the test cases of the current iteration round and the constructed reward function; According to the reward information of the current iteration round and the preset reward threshold, determine whether to stop iterative training, and if so, use the current test case generation model as the test case generation model; If not, the current state space set and the current action space set are updated, and the network parameters of the current test case generation model are updated.

9. The method according to claim 8, characterized in that Determining the reward information of the current iteration round according to each test case of the current iteration round and the constructed reward function includes: Determine the requirement coverage reward for the test case based on the test requirements corresponding to each test case and all the test requirements contained in the test requirement document; Determine the defect discovery rate reward for each test case based on the number of defects found in each test case; Determine the diversity reward for each test case based on the similarity between the test cases; The reward information for the current iteration round is determined according to the requirement coverage rate reward, the defect discovery rate reward, and the diversity reward.

10. The method according to claim 8, characterized in that The updating of the current state space set and the current action space set includes: According to the current interface information of each test case and / or sample software of the current iteration round, the current state space set is updated to obtain a new current state space set; According to the new current state space set, the current action space set is updated to obtain a new current action space set.

11. An automated testing device, characterized in that: include: Generate module and test module; The generation module is used to respond to a test trigger instruction for the target software, generate a plurality of target test cases corresponding to the target software through a pre-trained test case generation model according to the interface information of the target software; The interface information is used to indicate each element on the interface and the operation result corresponding to each element; The test module is used to execute each target test case for the target software and generate test results of the target software under each target test case.

12. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to implement the automated testing method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the automated testing method according to any one of claims 1 to 10 is implemented.