Test case generation method, test platform, equipment and storage medium
Through the collaborative work of interface management tools and generation agents, the interface test cases are automatically generated, which solves the problem of inefficient generation of test cases and realizes efficient interface testing.
Patent Information
- Application Number
- CN202510045410.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-09
AI Technical Summary
During application testing, testers need to spend a lot of time sorting out functional scenarios and writing interface test cases, resulting in inefficient test case generation.
The interface management tool is used to monitor the interface changes of the application to be tested, determine the interface set corresponding to the target interface, and send the interface change message to the messaging application. The tester configures the execution order between different interfaces in the interface collection, and inputs relevant data to generate agents to generate test cases for each interface.
It realizes automated generation of interface test cases, reducing the complexity and time of manual writing, and improving the efficiency of test case generation.
Smart Images

Figure CN119961161A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a test case generation method, a test platform, a device and a storage medium. Background Art
[0002] During the application testing process, test cases are usually generated and executed to determine whether the quality and performance of the application meet expectations. Test cases are usually presented in the form of documents, which record in detail a certain function to be tested, the prerequisites that need to be met for the test, the test steps, and the expected results.
[0003] In actual applications, the functions provided by an application usually require multiple interfaces to implement. Therefore, in the process of application testing, the process of testing the interfaces included in the application is particularly important. Generally speaking, testers can manually write interface test cases based on the functional scenarios provided by the application that are manually sorted out. However, the functions of an application are usually more complex, and the number of interfaces included in the application is usually large. Therefore, for testers, it not only takes a lot of time to sort out the functional scenarios provided by the application, but also takes a lot of time to understand the interface specifications and write interface test cases, which obviously reduces the efficiency of test case generation.
[0004] Therefore, how to improve the efficiency of test case generation becomes a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a test case method, a test platform, a device and a storage medium to improve the efficiency of generating test cases.
[0006] In a first aspect, an embodiment of the present invention provides a test case generation method, comprising:
[0007] In response to a change in a target interface in the application to be tested, determining an interface set corresponding to the target interface;
[0008] sending an interface change message to a messaging application, the messaging application displaying the interface change message as an instant messaging message in a target group corresponding to the target interface;
[0009] In response to a configuration operation triggered by a tester in the target group, configuring an execution order between different interfaces in the interface set;
[0010] The execution sequence, the data of different interfaces in the interface set input during a historical period, and the definition data of different interfaces in the interface set are input into a generating agent, so that the generating agent outputs test cases for different interfaces in the interface set.
[0011] In a second aspect, an embodiment of the present invention provides a test platform, including an interface management tool, a messaging application, and a test tool;
[0012] The interface management tool is used to determine the interface set corresponding to the target interface in the application to be tested in response to the change of the target interface in the application to be tested; send an interface change message to the messaging application; configure the execution order between different interfaces in the interface set in response to the configuration operation triggered by the tester in the target group; input the execution order, the data of different interfaces in the interface set in the historical period, and the definition data of different interfaces in the interface set into the generation agent, so that the generation agent outputs the test cases of different interfaces in the interface set;
[0013] The messaging application is configured to display the interface change message as an instant messaging message in the target group corresponding to the target interface;
[0014] The testing tool is used to publish the test cases of different interfaces in the interface set to the test case execution platform in response to the publishing operation triggered by the tester in the target group, so that the test cases of different interfaces in the interface set are executed by the test case execution platform.
[0015] In a third aspect, an embodiment of the present invention provides a test case generating device, comprising:
[0016] A determination module, configured to determine, in response to a change in a target interface in the application to be tested, a set of interfaces corresponding to the target interface;
[0017] A sending module, configured to send an interface change message to a messaging application, wherein the messaging application displays the interface change message as an instant messaging message in a target group corresponding to the target interface;
[0018] A configuration module, configured to configure the execution order between different interfaces in the interface set in response to a configuration operation triggered by a tester in the target group;
[0019] A generation module is used to input the execution sequence, data of different interfaces in the interface set within a historical period, and definition data of different interfaces in the interface set into a generation agent, so that the generation agent can output test cases for different interfaces in the interface set.
[0020] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the test case generation method in the first aspect. The electronic device may also include a communication interface for communicating with other devices or communication systems.
[0021] In a fifth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the test case generation method as described in the first aspect above.
[0022] In a sixth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor can implement the test case generation method described in the first aspect above.
[0023] In the test case generation method provided by the embodiment of the present invention, in response to the change of the target interface in the application to be tested, the interface set corresponding to the target interface can be determined first. Then, the interface change message can be sent to the messaging application, and the messaging application can display the interface change message as an instant messaging message in the target group corresponding to the target interface. Afterwards, in response to the configuration operation triggered by the tester in the target group, the execution order between different interfaces in the interface set can be configured. Finally, the execution order, the data of different interfaces in the interface set input within the historical period, and the definition data of different interfaces in the interface set can be input into the generation agent, so that the generation agent outputs the test cases of different interfaces in the interface set.
[0024] It can be seen that in the above scheme, the interface management tool can determine the target interface that has changed in the application to be tested through monitoring, and the interface change message can be sent directly to the tester in the target group who is responsible for testing the target interface in the form of an instant messaging message, so that the tester can respond to the testing requirements of the target interface in a timely manner.
[0025] Afterwards, with the help of the generated agent, it is possible to automatically generate test cases for different interfaces in the interface set according to the data of different interfaces in the interface set input during the historical period and the definition data of different interfaces in the interface set, without the need to manually write test cases, which reduces the complexity of manual operations and thus improves the efficiency of test case generation. In addition, in the process of using the generated agent, by using the determined execution order between different interfaces in the interface set as prompt information, the generated agent can better understand the target functions provided by the application to be tested, that is, the operation and behavior of the application to be tested in a specific functional scenario, thereby accurately generating test cases for different interfaces in the interface set. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 A flow chart of a test case generation method provided by an embodiment of the present invention;
[0028] Figure 2 A flowchart of another test case generation method provided by an embodiment of the present invention;
[0029] Figure 3 A schematic diagram of a working process of generating an intelligent agent provided by an embodiment of the present invention;
[0030] Figure 4 A flowchart of another test case generation method provided by an embodiment of the present invention;
[0031] Figure 5 A flowchart of another test case generation method provided by an embodiment of the present invention;
[0032] Figure 6 A schematic diagram of the structure of a test platform provided by an embodiment of the present invention;
[0033] Figure 7 A schematic diagram of the structure of a test case generation device provided by an embodiment of the present invention;
[0034] Figure 8 For Figure 7 A schematic diagram of the structure of an electronic device corresponding to the test case generating device provided in the illustrated embodiment. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the situation of including at least one.
[0037] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0038] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to identifying", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is identified" may be interpreted as "when determining" or "in response to determining" or "when identifying (stated condition or event)" or "in response to identifying (stated condition or event)", depending on the context.
[0039] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.
[0040] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0041] Before describing in detail the test case generation method provided by the following embodiments of the present invention, the related concepts involved in the following embodiments may also be explained:
[0042] In the process of using an application, an interface usually refers to an application programming interface (API), which can be a set of predefined functions or protocols to allow different applications to interact and communicate with each other.
[0043] A test case is a description of a test task for a specific software product (such as an application), which reflects the test plan, method, technology and strategy. As mentioned in the background technology, a test case is usually presented in the form of a document, which records in detail a certain function to be tested, the prerequisites that need to be met for the test, the test steps and the expected results. In practical applications, test cases can usually be used to verify whether the functions of the interface are correctly implemented according to the design requirements.
[0044] An agent is a system or software program that can perceive the environment (such as receiving input data) and make decisions or take actions based on the input data to achieve a specific task. In the test case generation scenario, the agent can be a generative agent that can use the generative model to generate test cases.
[0045] Based on the above description, some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0046] Figure 1 The flowchart of a test case generation method provided by an embodiment of the present invention. The test case generation method provided by an embodiment of the present invention can be executed by an interface management tool. It can be understood that the interface management tool can be implemented as software, or a combination of software and hardware. Figure 1 As shown, the method comprises the following steps:
[0047] 101 . In response to a change of a target interface in an application to be tested, determine an interface set corresponding to the target interface.
[0048] 102 , sending an interface change message to a messaging application, and the messaging application displays the interface change message as an instant messaging message in a target group corresponding to a target interface.
[0049] 103 , in response to a configuration operation triggered by a tester in the target group, configure an execution order between different interfaces in the interface set.
[0050] 104, input the execution sequence, the data of different interfaces in the interface set in the historical period, and the definition data of different interfaces in the interface set into the generated intelligent agent, so that the generated intelligent agent outputs the test cases of different interfaces in the interface set.
[0051] The interface management tool can monitor the interface in the application to be tested to determine whether the interface has changed. Specifically, the interface management tool can periodically obtain the definition data of the interface from the interface document in the interface document management platform. Optionally, the interface management tool can obtain the definition data of the interface from the interface document in the interface document management platform at a first moment. Then, the interface management tool can compare the definition data obtained at the first moment with the definition data obtained at the second moment to determine whether the interface has changed. Among them, the second moment is earlier than the first moment.
[0052] The interface document management platform is used to manage interface documents so that testers can consult and use them at any time. The interface document can include the definition data of different interfaces in the application to be tested. The definition data of the interface can specifically include basic interface information, request parameters (including path parameters), and the structure of the response result, etc.
[0053] When a change in the target interface in the application to be tested is determined, the interface management tool may determine an interface set corresponding to the target interface in response to the change in the target interface in the application to be tested.
[0054] In practice, the application to be tested refers to an application to be tested, which can provide multiple functions, such as user login function, payment function, and content search function, etc. Optionally, the interface management tool can filter multiple interfaces included in the application in response to the change of the target interface in the application to be tested, so as to obtain an interface set including the interface used by the application to be tested when providing the target function.
[0055] Then, the interface management tool can send the interface change message to the messaging application. The messaging application has an instant messaging function. That is to say, after the interface management tool sends the interface change message corresponding to the target interface to the messaging application, the messaging application can immediately display the interface change message as an instant messaging message in the target group corresponding to the target interface. Optionally, the interface change message can be displayed in the target group in the form of a message card. At this time, the tester in the target group who has an association relationship with the target interface can test the changed target interface in a timely manner.
[0056] Optionally, the target group may correspond to the usage requirements of the application to be tested, and the usage requirements may specifically include multiple functions provided by the application to be tested. Different testers in the target group may be responsible for testing different functions provided by the application to be tested. In other words, an association relationship between interfaces, functions, and testers may be established. The testers mentioned above who have an association relationship with the target interface are the testers in the target group who are responsible for testing the target functions.
[0057] Afterwards, the interface management tool can configure the execution order between different interfaces in the interface set in response to the configuration operation triggered by the tester in the target group who is responsible for testing the target function. Specifically, the tester can perform a simple drag and drop operation on different interfaces in the interface set to configure the execution order between different interfaces in the interface set.
[0058] Ultimately, the interface management tool can input the configured execution order, the data of different interfaces in the interface set during the historical period, and the definition data of different interfaces in the interface set into the generated intelligent agent, so that the generated intelligent agent can output the test cases for different interfaces in the interface set.
[0059] The configured execution order can be used as prompt information to enable the generated intelligent agent to better understand the target functions provided by the application to be tested, that is, the operations and behaviors of the application to be tested in a specific functional scenario, so as to generate test cases for different interfaces in the interface set. The test cases for different interfaces in the interface set can be regarded as test cases in the scenario dimension, and the test cases of any interface can be regarded as test cases in the interface dimension.
[0060] Optionally, the interface management tool can obtain data of different interfaces in the input interface set during the historical period from the traffic playback platform. The traffic playback platform can record the actual request data of the user, and it can also simulate the actual operation behavior of the user through the playback function to reproduce the request data of different interfaces in the input interface set during the historical period. Optionally, the interface management tool can obtain definition data of different interfaces in the interface set from the interface documents contained in the interface document management platform.
[0061] In this embodiment, the interface management tool can determine the target interface that has changed in the application to be tested through monitoring, and the interface change message can be sent directly to the tester in the target group who is responsible for testing the target interface in the form of an instant messaging message, so that the tester can respond to the testing requirements of the target interface in a timely manner.
[0062] Afterwards, with the help of generating intelligent agents, test cases for different interfaces in the interface set can be automatically generated based on the data of different interfaces in the interface set input within the historical period and the definition data of different interfaces in the interface set. There is no need to manually write test cases, which reduces the complexity of manual operations and improves the efficiency of test case generation.
[0063] And in the process of using the generated intelligent agent, by using the execution order between different interfaces in the determined interface set as prompt information, the generated intelligent agent can better understand the target functions provided by the application to be tested, that is, the operations and behaviors of the application to be tested in specific functional scenarios, thereby accurately generating test cases for different interfaces in the interface set.
[0064] In addition, in actual applications, since different testers write test cases in different ways, the manual writing of interface test cases may also cause certain difficulties in the management of test cases. In this solution, by using the method of generating intelligent agents to automatically write interface test cases, the uniformity of test case writing can be guaranteed, which is convenient for the management of test cases.
[0065] In passing Figure 1 After the method of the illustrated embodiment generates test cases for different interfaces in an interface collection, the interface management tool can further respond to a publishing operation triggered by a tester in the target group and directly publish the test cases for different interfaces in the interface collection to a test case execution platform, so that the test case execution platform can execute the test cases of the interface collection to implement testing of different interfaces in the interface collection.
[0066] It can be seen that compared to the solution in which the tester first sorts out the mind map of the execution order between the functional scenarios provided by the application, that is, the mind map of the execution order between the interfaces, and then configures the interface on the test case execution platform according to the mind map, in this solution, the tester only needs to trigger a simple configuration operation and release operation to enable the interface management tool to automatically configure the execution order and quickly publish the test cases it generates to the test case execution platform, without having to sort out the mind map first and then jump from the interface management tool to the test case platform for configuration. This can obviously reduce cross-platform operations and reduce the operation complexity of testers, thereby improving the efficiency of interface testing.
[0067] Figure 1 In the illustrated embodiment, it has been mentioned that the interface management tool can determine the interface set corresponding to the target interface in response to the change of the target interface in the application to be tested. Optionally, the change of the target interface can include any one of modification, addition, and deletion.
[0068] Then one situation may be: the interface management tool determines that the definition data of the target interface has been modified. In this case, the interface management tool may use the following Figure 2 The method shown is used to generate test cases. Figure 2 Another test case generation method provided by the embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0069] 201 , in response to modification of a target interface in the application to be tested, determining an interface set corresponding to the target interface, the interface set including the target interface and other interfaces used by the application to be tested to provide a target function.
[0070] 202 , sending an interface change message to a messaging application, and the messaging application displays the interface change message as an instant messaging message in a target group corresponding to a target interface.
[0071] 203 , in response to the configuration operation triggered by the tester in the target group, configure the execution order between the target interface and other interfaces in the interface set.
[0072] 204, inputting a prompt template including an execution sequence and a general test method, data of different interfaces in an input interface set within a historical period, definition data of a target interface after a change, and original definition data of other interfaces into a generated intelligent agent, so that the generated intelligent agent can output test cases for the target interface and other interfaces respectively.
[0073] In response to the modification of the target interface in the application to be tested, the interface management tool can determine an interface set corresponding to the target interface, wherein the interface set includes the target interface and other interfaces used by the application to be tested to provide the target function.
[0074] Specifically, the interface management tool can respond to the modification of the target interface in the application to be tested, and first determine the target function corresponding to the modified target interface. The target function can be any one of the multiple functions provided by the application to be tested. Then, the interface management tool can screen the multiple interfaces included in the application to be tested to obtain an interface set corresponding to the target interface.
[0075] For example, assuming that the target interface is a user login interface, when the definition data of the user login interface is changed, for example, the request parameters of the original login interface may only include the user name and password, while the definition data after the change may include not only the user name and password, but also additional verification information such as a verification code or email address. At this time, the interface management tool can respond to the modification of the user login interface, first determine the user login function corresponding to the password reset interface, and screen the multiple interfaces included in the application to be tested to obtain the user login interface and user registration interface used when the application to be tested provides the user login function.
[0076] Optionally, the interface management tool may maintain an interface list, which may include the status of different interfaces. After determining that the target interface has been modified, the interface management tool may modify the status of the target interface recorded in the interface list to a modified status. Then, the interface management tool may send an interface change message including the modified status to the messaging application. The messaging application may display the interface change message as an instant messaging message in the target group corresponding to the target interface.
[0077] Furthermore, in the case where the target interface is modified, the interface management tool can configure the execution order between the target interface and other interfaces in the interface set in response to the configuration operation triggered by the tester in the target group, where the tester who triggers the configuration operation is the tester in the target group who is responsible for testing the target function.
[0078] Afterwards, the interface management tool can input the prompt template, data of different interfaces in the interface set input during the historical period, the changed definition data of the target interface, and the original definition data of other interfaces into the generated intelligent agent, so that the generated intelligent agent can output the test cases for the target interface and other interfaces respectively.
[0079] The prompt template may include not only a configured execution order, but also a general test method. The general test method refers to a basic test method that can be widely applied to multiple test cases. Optionally, the general test method may include at least one of a regression test method, a boundary value analysis method, an abnormal input test method, and a unit test method.
[0080] Optionally, the interface management tool can obtain data of different interfaces in the input interface set during the historical period from the traffic playback platform. It is understandable that the modified definition data of the target interface is the definition data obtained from the interface document management platform after the target interface is modified. The original definition data of other interfaces can also be obtained from the interface document management platform.
[0081] The above process of generating intelligent agents can also be combined with Figure 3 understand.
[0082] In this embodiment, when the target interface in the application to be tested is modified, the interface management tool can accurately determine the interface set including the target interface and other interfaces used by the application to be tested to provide the target function. Furthermore, since the execution order between the target interface and other interfaces can simulate the target function provided by the application to be tested, that is, the operation and behavior of the application to be tested in a specific functional scenario, therefore, by filling the configured execution order into the prompt template, the generated intelligent agent can more accurately output the test cases of the target interface and other interfaces.
[0083] And because the general test method can be widely applied to multiple test cases, therefore, by filling the general test method into the prompt template, the generated intelligent agent can reduce the process of repeatedly generating the general test method, thereby further improving the test case generation efficiency.
[0084] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0085] In addition to the above Figure 2 Step 201 of the embodiment shown in the figure is a case where another case may be: the interface management tool determines that the definition data of the target interface is newly added. At this time, the interface management tool may use the following method: Figure 4 The method shown is used to generate test cases. Figure 4 Another test case generation method provided by an embodiment of the present invention. Figure 4 As shown, the method comprises the following steps:
[0086] 401 , in response to a target interface being newly added in the application to be tested, determining an interface set corresponding to the target interface, the interface set including the target interface and other interfaces used by the application to be tested to provide a target function.
[0087] 402 , sending an interface change message to a messaging application, and the messaging application displays the interface change message as an instant messaging message in a target group corresponding to the target interface.
[0088] 403 , in response to the configuration operation triggered by the tester in the target group, configure the execution order between the target interface and other interfaces in the interface set.
[0089] 404, input the prompt template containing the execution order and the general test method, the data of different interfaces in the input interface set within the historical period, the definition data of the target interface, and the definition data of other interfaces into the generated intelligent agent, so that the generated intelligent agent can output the test cases of the target interface and other interfaces respectively.
[0090] In response to the addition of a target interface in the application to be tested, the interface management tool may determine an interface set corresponding to the target interface, wherein the interface set includes the target interface and other interfaces used by the application to be tested to provide a target function.
[0091] Specifically, the interface management tool can respond to the addition of a target interface in the application to be tested by first determining a target function corresponding to the newly added target interface. Then, the interface management tool can screen multiple interfaces included in the application to be tested to obtain the target interface and other interfaces used by the application to be tested to provide the target function.
[0092] For example, assuming that the newly added target interface is a password reset interface, so that users can verify their passwords through email or mobile phone numbers when they forget their passwords, the interface management tool can respond to the addition of the password reset interface by determining the user login function corresponding to the password reset interface, and filter the multiple interfaces included in the application to be tested to obtain the password reset interface, user login interface, and user registration interface used when the application to be tested provides the user login function.
[0093] After determining that the target interface is newly added, the interface management tool can modify the state of the target interface recorded in the interface list to a newly added state. Then, the interface management tool can send an interface change message containing the newly added state to the messaging application. Accordingly, the messaging application can display the interface change message as an instant messaging message in the target group corresponding to the target interface.
[0094] Furthermore, in the case of a new target interface, the interface management tool can configure the execution order between the target interface and other interfaces in the interface set in response to a configuration operation triggered by a tester in the target group, where the tester who triggers the configuration operation is the tester in the target group who is responsible for testing the target function.
[0095] Finally, the interface management tool can input the prompt template containing the execution order and the general test method, the data of different interfaces in the interface set input during the historical period, the definition data of the target interface, and the definition data of other interfaces into the generated agent, so that the generated agent can output the test cases of the target interface and other interfaces respectively. Among them, the definition data of the target interface and the definition data of other interfaces can be obtained from the interface document platform. The data of different interfaces in the interface set input during the historical period can be obtained from the traffic playback platform. The specific process can be found in the description of the above embodiments, which will not be repeated here.
[0096] In this embodiment, when a target interface is newly added in the application to be tested, the interface management tool can accurately determine the interface set including the target interface and other interfaces used by the application to be tested to provide the target function. Further, considering the situation of the newly added target interface, by generating an intelligent agent, test cases for the newly added target interface and other interfaces can be generated, thereby ensuring the comprehensiveness of the test case generation.
[0097] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0098] In addition to the above Figure 2 Step 201 of the embodiment shown in the figure is a situation described above. Another situation may be: the interface management tool determines that the definition data of the target interface is deleted. At this time, the interface management tool may use the following method: Figure 5 The method shown is used to generate test cases. Figure 5 Another test case generation method provided by an embodiment of the present invention. Figure 5 As shown, the method comprises the following steps:
[0099] 501 , in response to deletion of a target interface in the application to be tested, determining an interface set corresponding to the target interface, the interface set including other interfaces used by the application to be tested to provide a target function.
[0100] 502, modify the state of the target interface recorded in the interface list to a deleted state.
[0101] 503 , sending an interface change message including a deleted state to a messaging application, and the messaging application displays the interface change message as an instant messaging message in a target group corresponding to the target interface.
[0102] 504 , in response to the configuration operation triggered by the tester in the target group, configure the execution order of other interfaces in the interface set.
[0103] 505, input the prompt template containing the execution order and the general test method, the data of different interfaces in the interface set input in the historical period, and the definition data of other interfaces into the generated intelligent agent, so that the generated intelligent agent can output the test cases of other interfaces.
[0104] In response to the deletion of the target interface in the application to be tested, the interface management tool may determine an interface set corresponding to the target interface, wherein the interface set includes other interfaces used by the application to be tested to provide the target function.
[0105] Specifically, the interface management tool can first determine the target function corresponding to the deleted target interface in response to the deletion of the target interface in the application to be tested. Then, the interface management tool can screen multiple interfaces included in the application to be tested to obtain other interfaces used by the application to be tested when providing the target function.
[0106] It should be noted that when the target interface in the application to be tested is modified or added, the target interface is included in the interface set determined by the interface management tool. When the target interface in the application to be tested is deleted, the target interface is not included in the interface set determined by the interface management tool, but before the target interface is deleted, the interface used by the application to be tested to provide the target function includes the target interface. Therefore, even if the target interface is not included in the determined interface set, there is a corresponding relationship between the interface set and the target interface in the historical period.
[0107] After determining that the target interface has been deleted, the interface management tool may modify the state of the target interface recorded in the interface list to a deleted state. Further, the interface management tool may send an interface change message containing the deleted state to the messaging application. Accordingly, the messaging application may display the interface change message as an instant messaging message in the target group corresponding to the target interface.
[0108] Furthermore, in the case where the target interface is deleted, the interface management tool can configure the execution order between other interfaces in the interface set in response to a configuration operation triggered by a tester in the target group, where the tester who triggers the configuration operation is the tester in the target group who is responsible for testing the target function.
[0109] Finally, the interface management tool can input the prompt template containing the execution order and the general test method, the data of different interfaces in the interface set input during the historical period, and the definition data of other interfaces into the generated agent, so that the generated agent can output the test cases of other interfaces. Among them, the definition data of other interfaces can be obtained from the interface document platform. The data of different interfaces in the interface set input during the historical period can be obtained from the traffic playback platform. The specific process can be referred to the description in the above embodiments, which will not be repeated here.
[0110] In this embodiment, when the target interface in the application to be tested is deleted, the interface management tool can accurately determine the interface set including other interfaces used by the application to be tested to provide the target function. Further, considering the case of deleting the target interface, by generating an agent, only test cases for other interfaces need to be generated, and no test cases for the target interface need to be generated, thereby improving the efficiency of test case generation.
[0111] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0112] Figure 6 A schematic diagram of the structure of a test platform provided by an embodiment of the present invention. Figure 6 As shown, the test platform includes an interface management tool, a messaging application, and a test tool.
[0113] The interface management tool may first determine an interface set corresponding to the target interface in response to a change in the target interface in the application to be tested. Optionally, the change in the target interface may include any one of modification, addition, and deletion.
[0114] Then, the interface management tool can send the interface change message to the messaging application. Then, the interface management tool can configure the execution order between different interfaces in the interface set in response to the configuration operation triggered by the tester in the target group. Specifically, the tester can perform a simple drag and drop operation on different interfaces in the interface set to configure the execution order between different interfaces.
[0115] Afterwards, the interface management tool can input the configured execution order, the data of different interfaces in the interface set during the historical period, and the definition data of different interfaces in the interface set into the generated intelligent agent, so that the generated intelligent agent can output the test cases of different interfaces in the interface set.
[0116] The messaging application can display the interface change message as an instant messaging message in the target group corresponding to the target interface. Optionally, the interface change message can be displayed in the target group in the form of a message card. At this time, the tester in the target group who has an association relationship with the target interface can test the changed target interface in a timely manner.
[0117] The testing tool can respond to the publishing operation triggered by the tester in the target group to publish the test cases of different interfaces in the interface set to the test case execution platform, so that the test case execution platform can execute the test cases of different interfaces in the interface set to realize the testing of different interfaces in the interface set.
[0118] In this embodiment, the test platform includes an interface management tool, a messaging application, and a test tool. Among them, the interface management tool can determine the target interface that has changed in the application to be tested by monitoring, and further, with the help of the messaging application, the interface change message can be notified to the tester in the target group who is responsible for testing the target interface in the form of an instant messaging message, so that the tester can respond to the test requirements of the target interface in a timely manner. And with the help of generating an intelligent agent, the interface management tool can automatically generate test cases for different interfaces in the interface set according to the data of different interfaces in the interface set input during the historical period and the definition data of different interfaces in the interface set, without the need to manually write test cases, which reduces the complexity of manual operations and thus improves the efficiency of test case generation.
[0119] And in the process of using the generated intelligent agent, by using the execution order between different interfaces in the determined interface set as prompt information, the generated intelligent agent can better understand the target functions provided by the application to be tested, that is, the operations and behaviors of the application to be tested in specific functional scenarios, thereby accurately generating test cases for different interfaces in the interface set.
[0120] Furthermore, testers in the target group only need to trigger a simple publishing operation to automatically publish test cases to the test case execution platform, so that the test case execution platform can execute the test cases of different interfaces in the interface set, which simplifies the operation of testers and ensures the testing efficiency of different interfaces in the interface set.
[0121] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0122] Figure 6In the illustrated embodiment, it has been mentioned that the messaging application can display an interface change message as an instant messaging message in a target group corresponding to the target interface. For the determination of the target group, the messaging application can optionally receive an interface change message including an interface identifier of the target interface. The interface change message can also include the state of the target interface.
[0123] In actual applications, the interface identifier included in the interface change message can reflect the usage requirements of the application to be tested. Further, the messaging application can determine the target group corresponding to the interface identifier in the candidate groups created by the messaging application, that is, determine the target group corresponding to the usage requirements.
[0124] Optionally, the usage requirements may include multiple functions provided by the application to be tested, and different testers in the target group may be responsible for testing different functions provided by the application to be tested. In other words, an association relationship between interfaces, functions, and testers may be established. Figure 6 The testers in the target group and associated with the target interface mentioned in the illustrated embodiment are the testers in the target group who are responsible for testing the target function.
[0125] In this embodiment, since the interface identifier contained in the interface change message can reflect the target function corresponding to the target interface, the message passing application can accurately determine the target group responsible for the target function from the alternative group, thereby ensuring the configuration effect of the execution order between different interfaces in the interface set by the testers in the subsequent target group.
[0126] The test case generation device of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these test case generation devices can be configured using commercially available hardware components through the steps taught in this solution.
[0127] Figure 7 A schematic diagram of a test case generation device provided by an embodiment of the present invention is shown in FIG. Figure 7 As shown, the device comprises:
[0128] The determination module 11 is used to determine an interface set corresponding to the target interface in response to a change of the target interface in the application to be tested.
[0129] The sending module 12 is used to send the interface change message to the messaging application, and the messaging application displays the interface change message as an instant messaging message in the target group corresponding to the target interface.
[0130] The configuration module 13 is used to configure the execution order between different interfaces in the interface set in response to the configuration operation triggered by the tester in the target group.
[0131] The generation module 14 is used to input the execution order, the data of different interfaces in the interface set input within the historical period, and the definition data of different interfaces in the interface set into the generation agent, so that the generation agent can output the test cases of different interfaces in the interface set.
[0132] Optionally, the application to be tested provides multiple functions. Based on this, the determination module 11 is used to determine an interface set corresponding to the target interface in response to the modification of the target interface in the application to be tested, and the interface set includes the target interface and other interfaces used by the application to be tested to provide the target function.
[0133] Optionally, the generation module 14 is used to input a prompt template containing the execution order and the general test method, data of different interfaces in the interface set input within a historical period, the changed definition data of the target interface, and the original definition data of the other interfaces into a generation agent, so that the generation agent outputs test cases for the target interface and the other interfaces respectively.
[0134] Optionally, the determination module 11 is used to determine an interface set corresponding to the target interface in response to the addition of the target interface in the application to be tested, and the interface set includes the target interface and other interfaces used by the application to be tested to provide a target function.
[0135] Optionally, the determination module 11 is used to determine an interface set corresponding to the target interface in response to deletion of the target interface in the application to be tested, wherein the interface set includes other interfaces used by the application to be tested to provide a target function.
[0136] The sending module 12 is used to modify the state of the target interface recorded in the interface list to a deleted state; and send an interface change message containing the deleted state to the messaging application.
[0137] Optionally, the device also includes an acquisition module 15, which is used to obtain data of different interfaces in the interface set input within a historical period from a traffic playback platform; and obtain definition data of different interfaces in the interface set from an interface document management platform.
[0138] Figure 7 The device shown can perform Figures 1 to 5 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figures 1 to 5The implementation process and technical effects of this technical solution refer to Figures 1 to 5 The description in the illustrated embodiment will not be repeated here.
[0139] In a possible design, the structure of the code detection device can be implemented as an electronic device, such as Figure 8 As shown, the electronic device may include: a processor 21 and a memory 22. The memory 22 is used to store the electronic device to perform the above Figures 1 to 5 The program of the test case generation method provided in the illustrated embodiment, the processor 21 is configured to execute the program stored in the memory 22 .
[0140] The program includes one or more computer instructions, wherein the one or more computer instructions can implement the following steps when executed by the processor 21:
[0141] In response to a change in a target interface in the application to be tested, determining an interface set corresponding to the target interface;
[0142] sending an interface change message to a messaging application, the messaging application displaying the interface change message as an instant messaging message in a target group corresponding to the target interface;
[0143] In response to a configuration operation triggered by a tester in the target group, configuring an execution order between different interfaces in the interface set;
[0144] The execution sequence, the data of different interfaces in the interface set input during a historical period, and the definition data of different interfaces in the interface set are input into a generating agent, so that the generating agent outputs test cases for different interfaces in the interface set.
[0145] Optionally, the processor 21 is further configured to execute the aforementioned Figures 1 to 5 All or part of the steps in the illustrated embodiments.
[0146] The structure of the electronic device may further include a communication interface 23 for the electronic device to communicate with other devices or a communication network.
[0147] In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the above electronic device, which includes instructions for executing the above Figures 1 to 5 The procedures involved in the test case generation method in the method embodiment shown.
[0148] The embodiment of the present invention further provides a computer program product, which includes computer program instructions. When the computer program instructions are read and executed by a processor, the above-mentioned Figures 1 to 5 The test case generating method in the method embodiment shown.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A test case generation method, characterized in that: include: In response to a change in a target interface in the application to be tested, determining an interface set corresponding to the target interface; sending an interface change message to a messaging application, the messaging application displaying the interface change message as an instant messaging message in a target group corresponding to the target interface; In response to a configuration operation triggered by a tester in the target group, configuring an execution order between different interfaces in the interface set; The execution sequence, the data of different interfaces in the interface set input during a historical period, and the definition data of different interfaces in the interface set are input into a generating agent, so that the generating agent outputs test cases for different interfaces in the interface set.
2. The method according to claim 1, characterized in that The application to be tested provides multiple functions; The step of determining, in response to a change in a target interface in the application to be tested, an interface set corresponding to the target interface comprises: In response to modification of a target interface in the application to be tested, an interface set corresponding to the target interface is determined, the interface set including the target interface and other interfaces used by the application to be tested to provide a target function.
3. The method according to claim 2, characterized in that The step of inputting the execution sequence, the data of different interfaces in the interface set in the historical period, and the definition data of different interfaces in the interface set into a generating agent, so that the generating agent outputs a test case of the interface set, comprises: A prompt template containing the execution sequence and the general test method, data of different interfaces in the interface set input within a historical period, the changed definition data of the target interface, and the original definition data of the other interfaces are input into a generating agent, so that the generating agent can output test cases for the target interface and the other interfaces respectively.
4. The method according to claim 1, characterized in that: The step of determining, in response to a change in a target interface in the application to be tested, an interface set corresponding to the target interface comprises: In response to the addition of a target interface in the application to be tested, an interface set corresponding to the target interface is determined, the interface set including the target interface and other interfaces used by the application to be tested to provide a target function.
5. The method according to claim 1, characterized in that The step of determining, in response to a change in a target interface in the application to be tested, an interface set corresponding to the target interface comprises: In response to the deletion of the target interface in the application to be tested, determining an interface set corresponding to the target interface, the interface set including other interfaces used by the application to be tested to provide a target function; The sending of the interface change message to the messaging application comprises: Modify the state of the target interface recorded in the interface list to a deleted state; An interface change message including the deleted state is sent to the messaging application.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining, from the traffic playback platform, data input into different interfaces in the interface set during a historical period; Obtain definition data of different interfaces in the interface set from the interface document management platform.
7. A test platform, characterized in that: Includes interface management tools, messaging applications, and testing tools; The interface management tool is used to determine an interface set corresponding to the target interface in the application to be tested in response to a change of the target interface in the application to be tested; sending an interface change message to the messaging application; In response to a configuration operation triggered by a tester in the target group, configuring an execution order between different interfaces in the interface set; Input the execution sequence, the data of different interfaces in the interface set input in the historical period, and the definition data of different interfaces in the interface set into the generation agent, so that the generation agent outputs the test cases of different interfaces in the interface set; The messaging application is configured to display the interface change message as an instant messaging message in the target group corresponding to the target interface; The testing tool is used to publish the test cases of different interfaces in the interface set to the test case execution platform in response to the publishing operation triggered by the tester in the target group, so that the test cases of different interfaces in the interface set are executed by the test case execution platform.
8. The platform according to claim 7, characterized in that The messaging application is used to receive the interface change message including the interface identifier of the target interface; and determine the target group corresponding to the interface identifier in the candidate groups created by the messaging application.
9. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the test case generation method according to any one of claims 1 to 6.
10. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the test case generation method according to any one of claims 1 to 6.