Test method and device based on intelligent agent, electronic equipment and storage medium
By generating test sequences and scripts by the agent, the test is automatically executed, which solves the problems of inefficient testing of existing software and the inability to deal with changing needs in real time, and realizes an efficient testing process.
Patent Information
- Application Number
- CN202411320179.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-20
AI Technical Summary
The existing software testing methods are inefficient and cannot respond to new changes and requirements in the testing process in real time, resulting in low efficiency in manual design testing requirements.
Adopt an agent-based test method, and generate a planned path in the test sequence by inputting requirements information, and generate a test script based on the path, and automatically execute the script to determine the test results.
Improve testing efficiency, real-time testing of new or changing needs is achieved, reducing the time for manual design and combination testing needs, and improving the quality of testing.
Smart Images

Figure CN119166526A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of deep learning technology, testing technology and intelligent agent technology, and specifically to an intelligent agent-based testing method, device, electronic device, storage medium and program product. Background Art
[0002] With the continuous development of Internet technology, Internet products are constantly innovating and changing. In order to ensure the quality of various software systems, it is necessary to test the software systems. There are many problems encountered during the testing process, such as high labor costs. Summary of the invention
[0003] The present disclosure provides an agent-based testing method, device, agent, electronic device, storage medium and computer program product.
[0004] According to one aspect of the present disclosure, there is provided an agent-based testing method, comprising: in response to received input information, inputting requirement information in the input information into the agent, generating a plurality of planned paths with a test sequence, wherein the requirement information comprises a plurality of system functions of a system to be tested, and the planned path corresponds to one of the system functions; generating a test script for testing each of the system functions according to the planned path and the input information in accordance with the test sequence; and determining the test result of the system to be tested according to the execution results of each of the plurality of test scripts.
[0005] According to another aspect of the present disclosure, there is provided an agent-based testing device, including: a path generation module, for inputting the requirement information in the input information into the agent in response to received input information, and generating a plurality of planned paths with a test sequence, wherein the requirement information includes a plurality of system functions of the system to be tested, and the planned path corresponds to one of the system functions; a script generation module, for generating a test script for testing each of the system functions according to the planned path and the input information in accordance with the test sequence; and a result determination module, for determining the test result of the system to be tested according to the execution results of each of the plurality of test scripts.
[0006] According to another aspect of the present disclosure, an intelligent agent is provided, which is configured to execute the above method.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above method.
[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.
[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and the computer program implements the above method when executed by a processor.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0012] Figure 1 An exemplary system architecture to which an agent-based testing method and apparatus can be applied according to an embodiment of the present disclosure is schematically shown;
[0013] Figure 2 A flow chart of an agent-based testing method according to an embodiment of the present disclosure is schematically shown;
[0014] Figure 3 A schematic diagram schematically shows a method of generating a test result according to an embodiment of the present disclosure;
[0015] Figure 4 A schematic diagram of generating a test script according to an embodiment of the present disclosure is schematically shown;
[0016] Figure 5 A schematic diagram of generating a test script according to another embodiment of the present disclosure is schematically shown;
[0017] Figure 6 A schematic diagram of executing a test script according to an embodiment of the present disclosure is schematically shown;
[0018] Fig. 7A A schematic diagram schematically shows a method of generating a page image according to an embodiment of the present disclosure;
[0019] Figure 7B A schematic diagram schematically shows a page image according to a specific embodiment of the present disclosure;
[0020] Fig. 8A A schematic diagram of generating a test script according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 8B A schematic diagram of generating a test script according to another embodiment of the present disclosure is schematically shown;
[0022] Fig. 9 A flowchart schematically shows a method for generating test results according to a specific embodiment of the present disclosure.
[0023] Fig.10 A block diagram of an agent-based testing device according to an embodiment of the present disclosure is schematically shown;
[0024] Fig.11 A schematic diagram of a structure of an intelligent agent according to an embodiment of the present disclosure is shown; and
[0025] Fig.12 A block diagram of an electronic device 1200 suitable for implementing an agent-based testing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0026] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] In the field of software testing, manual testing of software systems is inefficient. To this end, related technologies can use semi-automatic testing methods, such as using large language models (LLM) to convert manually designed test requirements into executable test scripts to achieve interaction with the software system, extract interaction results from background logs, and compare the interaction results with expected results to obtain test results.
[0028] However, since the test requirements are pre-designed, it is impossible to conduct real-time testing for new changes and requirements added during the testing process. In addition, testers need to spend a lot of time reading relevant information about the software system during the process of designing test requirements, which leads to low efficiency in manually designing test requirements.
[0029] Therefore, in order to perform real-time testing on new changes and requirements during the testing process and improve testing efficiency, an embodiment of the present disclosure provides an agent-based testing method.
[0030] Figure 1 An exemplary system architecture to which the agent-based testing method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.
[0031] It should be noted that Figure 1The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, an exemplary system architecture to which the agent-based testing method and apparatus can be applied may include a terminal device, but the terminal device may implement the content processing method and apparatus provided by the embodiments of the present disclosure without interacting with the server.
[0032] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0033] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).
[0034] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0035] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for the content browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0036] The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server can also be a server of a distributed system, or a server combined with blockchain.
[0037] It should be noted that the agent-based test generation method provided in the embodiment of the present disclosure can generally be executed by the first terminal device 101, the second terminal device 102, and the third terminal device 103. Accordingly, the agent-based test device provided in the embodiment of the present disclosure can also be set in the first terminal device 101, the second terminal device 102, and the third terminal device 103.
[0038] Alternatively, the agent-based testing method provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the agent-based testing device provided in the embodiment of the present disclosure may generally be arranged in the server 105. The agent-based testing method provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the agent-based testing device provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0039] For example, when a user performs software testing through the first terminal device 101, the second terminal device 102, and the third terminal device 103, the first terminal device 101, the second terminal device 102, and the third terminal device 103 can receive the user's input information, input the demand information in the input information into the intelligent agent, and generate multiple planned paths with a test sequence, the demand information includes multiple system functions of the system to be tested, and the planned path corresponds to one system function; according to the test sequence, based on the planned path and the input information, a test script for testing each system function is generated; according to the execution results of each of the multiple test scripts, the test result of the system to be tested is determined.
[0040] Alternatively, the user can also send input information to the server 105, and with the help of the server 105, input the requirement information in the input information into the intelligent agent to generate multiple planned paths with a test sequence, where the requirement information includes multiple system functions of the system to be tested, and the planned path corresponds to one system function; according to the test sequence, based on the planned path and the input information, a test script for testing each system function is generated; and based on the execution results of each of the multiple test scripts, the test results of the system to be tested are determined.
[0041] Alternatively, the first terminal device 101, the second terminal device 102, and the third terminal device 103 may obtain input information input by the user, and send the input information to the server 105. The server 105 inputs the demand information in the input information into the agent, generates multiple planning paths with a test sequence, the demand information includes multiple system functions of the system to be tested, and the planning path corresponds to one system function; generates a test script for testing each system function according to the planned path and the input information according to the test sequence; and determines the test result of the system to be tested according to the execution results of each of the multiple test scripts.
[0042] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0043] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0044] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0045] Figure 2 A flowchart of an agent-based testing method according to an embodiment of the present disclosure is schematically shown.
[0046] like Figure 2 As shown, the method 200 includes operations S210 to S230.
[0047] In operation S210, in response to the received input information, the requirement information in the input information is input into the agent, and a plurality of planned paths with a test sequence are generated.
[0048] The input information may be information related to the system to be tested that is input by the user. For example, the user may interact with the interactive page of the terminal and input the input information into the interactive page in the form of text. In addition, the user may also create the input information in the form of a document and input the storage path of the input information into the interactive page.
[0049] The input information may include the demand information of the system to be tested, and may also include other information such as the code and data of the system to be tested. For example, the input information may be "want a system to realize the function of cargo transportation + XXX", and "want a system to realize the function of cargo transportation" is the demand information.
[0050] The requirement information includes multiple system functions of the system to be tested, wherein the multiple system functions have a sequence in implementation. For example, according to the implementation logic of the system functions, users can use other functions only after logging in, so the implementation sequence of the login function precedes other functions.
[0051] A planned path corresponds to a system function, that is, a planned path can be used to represent a path for testing a system function. Accordingly, since multiple system functions have a sequence in implementation, there is a test sequence between multiple planned paths.
[0052] The requirement information is input into the agent, and the agent can call the first large model that can analyze the requirement information, generate a test path for each system function, and generate a test sequence between multiple planned paths according to the order in which the system functions are implemented. At this time, the input of the first large model is the requirement information, and the output is the test paths of multiple system functions and the test sequence between multiple test paths. Alternatively, the output is the test paths of multiple system functions arranged in the test sequence.
[0053] For example: first test the planned path 1 for implementing function point 1, and then test the planned path 2 for implementing function point 2.
[0054] In operation S220 , a test script for testing each system function is generated according to the test sequence, the planned path and the input information.
[0055] The test script is used to test the system function. Specifically, the test script can simulate the test operation on the system to be tested. Since each system function has its own test script, the execution order of multiple test scripts can also be determined according to the test sequence.
[0056] In operation S230, a test result of the system to be tested is determined according to the execution results of each of the plurality of test scripts.
[0057] The execution result may be the response of the system to be tested to the test script. For example, the test script may be used to test the login function, and the execution result may be information generated due to a login failure.
[0058] The test result is obtained based on multiple execution results. For example, the system function can be evaluated based on the execution result to obtain the test sub-result corresponding to the system function, and the test result of the system to be tested can be obtained based on the test sub-results of the multiple system functions. Alternatively, the execution result of each test script can be directly used as the test sub-result of the system function corresponding to the current test script, and the test result of the system to be tested can be obtained by combining multiple test sub-results.
[0059] The embodiments of the present disclosure utilize intelligent agents to generate multiple planned paths with test sequences, simulate the test paths of testers when testing the system to be tested, and consider the impact of the planned paths in the previous sequence on the planned paths in the later sequence. There is no need for manual design and combination of test requirements. The user only needs to make one input to complete the test process of the system to be tested, thereby improving test efficiency.
[0060] Figure 3 A schematic diagram of generating test results according to an embodiment of the present disclosure is schematically shown.
[0061] like Figure 3 As shown, in the embodiment 300, the requirement information 311 in the input information 310 is input into the agent M1, and a plurality of planned paths 320 with a test sequence are obtained, such as the planned path 321, ... the planned path 32M. Based on the input information 310 and the planned path 320, a test script 330 for each of the plurality of planned paths 320 is generated, such as the test script 331 corresponding to the planned path 321, ..., and the test script 33M corresponding to the planned path 32M. The plurality of test scripts 330 are executed to obtain execution results 340 for each of the plurality of test scripts 330, such as the execution results 341, ..., and the execution results 34M. Based on the plurality of execution results 340, a test result 350 is obtained.
[0062] According to an embodiment of the present disclosure, generating a test script for testing each system function according to a test sequence, a planned path and input information includes: testing each system function according to the test sequence based on the following steps: utilizing an agent to process the planned path, system code and system data to generate a test script for testing the system function; and executing the test script of the system function to update the system data of the system to be tested.
[0063] The input information also includes system code and system data. The system code can be the code of the system to be tested, which can specifically include program code to implement system functions, configuration files, and scripts for building and deploying the system to be tested. Users can package the system to be tested and input the system code in the form of a software package.
[0064] The system data can be used to simulate the data generated when the system to be tested is running. Specifically, the user can load the system data in the database of the system to be tested in advance, and then use the database file including the system data as input information.
[0065] The test script can be generated by the agent based on the planned path, system code and system data. Specifically, the agent can call the second largest model capable of generating the test script to generate the test script. The input of the second largest model is the planned path, system code and system data, and the output is the test script.
[0066] The planned path may include a function name of a system function to be tested by the planned path, and a function description.
[0067] For example, for the cargo management system, after calling the first large model to analyze the demand information in the input information, the output is: planning paths for multiple system functions, such as planning paths 1 to 3. The function name of planning path 1 is cargo information display, and the function description is: verify the cargo information list of the system to see whether the cargo number, cargo name, purchase price, inventory and purchaser information are displayed; the function name of planning path 2 is adding cargo information, and the function description is: verify whether the system allows the administrator to add cargo information through the input form, and the added information can be correctly displayed in the cargo information list; the function name of planning path 3 is editing cargo information, and the function description is: verify whether the system allows the administrator to enter the form to edit the existing cargo information, and the modified information can be correctly displayed in the cargo information list.
[0068] When testing each system function in the test order, the second largest model is called. For each system function, such as system function 1, the input of the second largest model is: planning path 1, system code and system data. The second largest model can directly analyze the system code and system data to learn the function of the system to be tested, and then generate the corresponding test script 1 based on the planning path 1 based on the learned knowledge.
[0069] Since the system code includes program codes for implementing system functions, the fields required to implement the system functions and the attributes included in the fields can be determined based on the system code, and then the fields and attributes can be used to generate test scripts.
[0070] In one embodiment, for a system function that needs to be implemented based on system data, the system data corresponding to the system function can be obtained by using the attribute name obtained from the system code, and a test script can be generated based on the system data.
[0071] For example, for the login function, the user data already in the system data is required to log in. Therefore, the user data field used to implement the login function can be obtained from the system code used to represent the login function, wherein the user data field may include a user name attribute and a password attribute, etc. Then, after obtaining the user name data and password data corresponding to the user name attribute and the password attribute respectively from the system data, a test script simulating the login operation can be generated to test the login function.
[0072] In another embodiment, for system functions that do not need to be implemented based on system data, a test script can be generated directly based on the system code.
[0073] For another example, when the system function is to add new cargo information, the cargo data field and multiple attributes in the cargo data field can be obtained from the system code, and test data corresponding to each attribute can be randomly generated. Based on the test data, a test script simulating the addition of new cargo information is generated to test the function of adding new cargo information.
[0074] When executing the test script, the operation of the system under test may result in the update of system data, and the updated system data will be obtained. Therefore, in order to ensure the integrity of the test, when testing the system under test, it is necessary not only to test based on the original system data, but also to test the newly added or changed requirements based on the updated system data.
[0075] For example, when the test script is used to test the password modification function, the password data needs to be modified, so executing the test script of the password modification function will result in the update of the password data. In order to verify whether the password is successfully updated, the updated password data needs to be used to perform a login operation.
[0076] Before executing the test script, you can also use the intelligent agent to call the system deployment tool to deploy the system code to obtain the system to be tested, so that you can use the test script to test the system to be tested.
[0077] The embodiments of the present disclosure utilize intelligent agents to automatically generate test scripts, thereby improving test efficiency, and also update system data to implement testing of newly added or changed requirements, thereby improving test quality.
[0078] Figure 4 A schematic diagram of generating a test script according to an embodiment of the present disclosure is schematically shown.
[0079] like Figure 4 As shown, in the embodiment 400, the input information 410 includes a system code 411, a system data 412 and a requirement information 413, the requirement information 413 is input into the agent M1, and the first large model is called to output a plurality of planned paths 420 with a test sequence, such as planned paths 421, ..., planned paths 42M. The agent M1 can call the second large model, and based on the system code 411, the system data 412 and the plurality of planned paths 420, generate test scripts 430 for the plurality of planned paths 420, such as test scripts 431, ..., test scripts 43M.
[0080] According to an embodiment of the present disclosure, generating a test script for testing each system function according to a test sequence, a planned path and input information includes: testing each system function according to the test sequence based on the following steps: using an agent to process the planned path, system code and system data to generate a test case for testing the system function; inputting the test case into the agent and outputting a test script; executing the test script of the system function to update the system data of the system to be tested.
[0081] In this embodiment, the system code and system data are as described above and will not be described in detail here. The test case can represent the task description of testing the system function, which is usually more colloquial and easy to understand. For example, the test case may include test steps, expected results, etc. In this embodiment, the generation of the test script can be achieved through two large models. For example, the planning path, system code and system data can be input into the intelligent agent, and the intelligent agent determines and calls the third large model for generating the test case, and generates the test case using the third large model. Then the test case is input into the intelligent agent, and the intelligent agent calls the fourth large model to generate the test script.
[0082] The embodiments of the present disclosure can handle more complex test requirements and improve test accuracy by using the third model to generate test cases and using the fourth model to generate test scripts.
[0083] Figure 5 A schematic diagram of generating a test script according to another embodiment of the present disclosure is schematically shown.
[0084] like Figure 5 As shown, in embodiment 500, for system function 1, agent M1 calls the third largest model to process the planned path, system code and system data of system function 1, and generates a test case 511 corresponding to system function 1. Then, agent M1 inputs the test case 511 into the fourth largest model to obtain a test script 521; similarly, for system function M, agent M1 calls the third largest model to process the planned path, system code and system data of system function M, and generates a test case 51M corresponding to system function 1. Then, agent M1 inputs the test case 51M into the fourth largest model to obtain a test script 52M.
[0085] Figure 6 A schematic diagram of executing a test script according to an embodiment of the present disclosure is schematically shown.
[0086] like Figure 6As shown, in the embodiment 600, the system to be tested has a total of N system functions. When testing the first system function, based on the system code 610, the planned path 620_1 corresponding to the first system function, and the system data 630_1, a test script 640_1 for testing the first system function is generated, and the test script 640_1 is executed to update the system data 630_1 to the system data 630_2. When testing the second system function, based on the system code 610, the planned path 620_2 corresponding to the second system function, and the system data 630_2, a test script 640_2 for testing the second system function is generated, and the test script 640_2 is executed to update the system data 630_2. And so on, until the Nth system function is tested, based on the system code 610, the planned path 620_N corresponding to the Nth system function, and the system data 630_N, a test script 640_N is generated, and the test script 640_N is executed.
[0087] According to an embodiment of the present disclosure, the agent-based testing method also includes: adding a marking script to the system code to mark the interactive elements in multiple real-time pages to obtain multiple page images; inputting multiple page images, planned paths, system codes and system data into the agent to generate a test script; or, inputting multiple page images, planned paths, system codes and system data into the agent to generate a test case.
[0088] The page can be a page for users to interact with the system to be tested. Since users interact with the software system by interacting with the page, when generating the test script, in addition to analyzing the backend system code of the system to be tested, it is also possible to simulate the human perspective and generate test cases through the information seen by the "eyes".
[0089] The marking script can be used to mark the interactive elements. Specifically, the marking script can determine the HyperText Markup Language (HTML) code used to generate the page in the system code, identify the interactive elements in the HTML code, and mark them.
[0090] The page image may include multiple interactive elements rendered in the page based on HTML code and respective tags of the multiple interactive elements. When generating the page image, the path of the page may be sent to the agent, the agent accesses the page according to the path, takes a screenshot of the real-time page, obtains the page image, and saves the page image to a specified storage address. Here, the agent may call a pre-written tagging script through a tool module, and insert the tagging script into the system code to obtain the real-time page, and obtain the page image through a screenshot.
[0091] According to the embodiments of the present disclosure, the real-time page is generated based on the system code and system data. It should be noted that when the system function is tested, not only the system data will be updated, but also the page will be updated. Therefore, in order to be able to test the new and changed requirements in real time, it is necessary to generate a page image based on the real-time page, and before generating the test case for each system function, it is necessary to re-acquire the current latest page image.
[0092] According to an embodiment of the present disclosure, the display result of the real-time page is related to the tested system function. For example, the planned path of the system to be tested may include planned path 1, planned path 2 and planned path 3 with a test order, which are used to test system function 1, system function 2 and system function 3 respectively. When generating a test case for testing system function 2, the real-time page is the page after testing system function 1, and when generating a test case for testing system function 3, the real-time page is the page after testing system function 2, so that when testing system function 2, the changes caused by testing system function 1 can be taken into account, and when testing system function 3, the changes caused by testing system function 1 and system function 2 can be taken into account, so as to ensure the test quality.
[0093] In one embodiment, the page image, planned path, system code and system data can be input into the intelligent agent, which determines and calls the second large model for generating a test script, and inputs the page image, planned path, system code and system data into the second large model to obtain the test script, wherein the second large model can be a multimodal large model.
[0094] In another embodiment, the page image, the planned path, the system code and the system data can be input into the intelligent agent, the intelligent agent determines and calls the third large model for generating test cases, and inputs the page image, the planned path, the system code and the system data into the third large model to generate test cases, wherein the third large model can be a multimodal large model. In response to the generation of the test case, the intelligent agent inputs the test case into the fourth large model for generating a test script to generate a test script.
[0095] In addition, before testing multiple system functions, you can also perform static detection on the page. Specifically, you can use the agent to call the simulation script tool to access the pages in the system to be tested one by one, and identify whether the page responds normally and whether the display elements in the page are rendered normally. For example, you can detect whether the image in the page fails to render.
[0096] The embodiments of the present disclosure generate a page image of the system to be tested and use the page image as one of the multimodal data to generate a test case or a test script, thereby improving the accuracy of the test case and the test script and further improving the test quality.
[0097] Fig. 7A A schematic diagram of generating a page image according to an embodiment of the present disclosure is schematically shown.
[0098] like Fig. 7A As shown, in embodiment 700A, for a certain system function, a real-time page 703 corresponding to the system function is generated based on system code 701 and system code 702. After real-time page 703 is marked, page image 704 is obtained.
[0099] Figure 7B A schematic diagram of a page image according to a specific embodiment of the present disclosure is schematically shown.
[0100] like Figure 7B As shown, in the page image 700B of the goods information display page, 8 marked interactive elements are included, such as the supermarket goods management system, home page, add goods and query goods in the navigation bar, the add new goods button, search box, search button and goods information display bar in the goods information display area.
[0101] Fig. 8A A schematic diagram of generating a test script according to an embodiment of the present disclosure is schematically shown.
[0102] like Fig. 8A As shown, in embodiment 800A, multiple page images 801, planning paths 802, system codes 803 and system data 804 are input into agent M1, and a test script 805 is output.
[0103] Figure 8B A schematic diagram of generating a test script according to another embodiment of the present disclosure is schematically shown.
[0104] like Figure 8B As shown, in embodiment 800B, multiple page images 801, planning paths 802, system codes 803, and system data 804 are input into agent M1, and test cases 806 are output. Test cases 806 are input into agent M1, and test scripts 805 are output.
[0105] According to an embodiment of the present disclosure, multiple page images, planned paths, system codes and system data are input into an intelligent agent to generate test cases for testing system functions, including: determining a page image sequence from multiple page images based on the planned path and the system code; and generating test cases based on the system data and the page image sequence.
[0106] According to an embodiment of the present disclosure, a page image sequence includes multiple target page images arranged in the order of realizing system functions. Since multiple pages may be involved in realizing system functions, and there is a sequence between the multiple pages, an intelligent agent can be used to learn the system code to determine the order of multiple page images when testing each planned path, and then determine the page image sequence based on the multiple page images and the order of the page images.
[0107] For example, when the system function is to add new cargo information, the page may include a cargo information display page and an add cargo page. Since the page for adding cargo can only be jumped to after clicking the "add new cargo button" in the acquisition information display page, the page image of the cargo information display page is arranged before the page image of the add cargo page in the page image sequence corresponding to the system function of adding cargo information. In addition, the page image sequence may also include a page image of the cargo information display page after adding new cargo as a page image of a real-time page for testing subsequent system functions, such as the function of editing cargo information.
[0108] Since the multiple page images in the page image sequence have a sequence, when generating a test case, the sequence between the multiple test steps in the test case can be determined according to the page image sequence.
[0109] The embodiments of the present disclosure determine a page image sequence of a plurality of page images and generate a test case based on the page image sequence, so that the obtained test case is more accurate.
[0110] According to an embodiment of the present disclosure, a test case is input into an intelligent agent and a test script is output, including: inputting test steps and expected test results into the intelligent agent, so that the intelligent agent generates a test script that operates the interactive elements in the test steps and obtains the expected test results according to the test steps.
[0111] According to an embodiment of the present disclosure, a test case includes a test step and an expected test result. The test step can be used to characterize the operation of the interactive element during the test, such as click, input, etc. The expected test result can be used to characterize the expected result after executing the test step, that is, the response of the system to be tested after executing the test step when the system functions normally.
[0112] In one embodiment, a test case may include only one expected test result, that is, all test steps in the test case correspond to one expected test result.
[0113] In another embodiment, each test step may correspond to an expected test result. Since each test step has a corresponding expected test result, the cause of the system function abnormality can be determined in a more fine-grained manner, thereby improving the test efficiency and test quality.
[0114] For example, when the system function is to add new goods information, the test steps of the test case may include: Step 1, open the browser and navigate to the goods information display page; Step 2, click the "Add New Goods" button on the page to navigate to the add goods page; Step 3, fill in the data "Goods number: P001; Goods name: Apple; Purchase price: 5.00; Stock: 100; Purchaser: Zhang San" in the form of the add goods page; Step 4, click the "Add Goods" button to submit the form; Step 5, return to the goods information display page. The expected test results of the test case may include: Result 1, after executing "Step 1", the goods information display page is correctly loaded and the table is displayed; Result 2, after executing "Step 5", the newly added goods information "Apple" is correctly displayed in the table, and its goods number is P001, the purchase price is 5.00, the stock is 100, and the purchaser is Zhang San.
[0115] The number and type of interactive elements can be different for different pages. The test script can execute multiple test steps in the test case, determine the interactive elements to be operated on the page, and interact with the interactive elements to get the expected results. For example, the test script can simulate the user's click operation on the "Add New Goods" button based on the location of the "Add New Goods" button.
[0116] The embodiments of the present disclosure generate test cases with test steps and expected test results, and use the test cases to generate test scripts, so that the test scripts are closer to actual test operations and the test accuracy is improved.
[0117] According to an embodiment of the present disclosure, the test result of the system to be tested is determined according to the execution results of each of the multiple test scripts, including: obtaining the test result of the system to be tested by integrating the execution results of each of the multiple test scripts according to the priority of the planned path.
[0118] According to the embodiments of the present disclosure, the priority is generated by the agent according to the input demand information. Since the system to be tested may include a large number of system functions, different system functions have different requirements for implementation, and different requirements have different priorities, when testing the system to be tested, it is necessary to consider the priority of the requirements and then determine the priority of the planned path.
[0119] In one embodiment, the demand information may include respective priorities of multiple system functions. An intelligent agent may be used to directly obtain the priorities of the system functions from the demand information as the priorities of the planned paths.
[0120] In another embodiment, the demand information may only include the description of the system function, and the intelligent agent is used to learn the description of the system function in the demand information, determine the priority of each of the multiple system functions, and use it as the priority of the planned path. For example, the intelligent agent can call the first large model, use the predetermined prompt word template, construct the demand information and the prompt word template as the input of the first large model, and call the first large model to output the planned path.
[0121] For example, for a cargo information management system, the input of the first model may be “Please generate a planning path for the following multiple system functions based on the following demand information and generate priorities between the multiple system functions. The system functions mainly include: 1. Cargo information management page: can enter, update and delete cargo information, including cargo number, cargo name, purchase price, inventory and purchaser. If the newly added cargo number or cargo name exists in the original table, no new entry will be added to the list, and the inventory of the existing cargo name will be directly changed. 2. The purchase information query page allows users to retrieve detailed purchase records based on the purchase number, cargo name or purchaser. The main system usage process includes: 1. The administrator enters the system and enters the cargo management interface to add, delete or update detailed cargo information. 2. On the purchase information query page, the administrator uses the system query function to find specific purchase records based on the cargo number or cargo name to monitor and manage inventory status.”
[0122] For example, for the cargo information management system, the first large model output is: [(System function 1: cargo information display, system function 1 priority: 0.2, system function 1 description: verify the system's cargo information list, whether it displays the cargo number, cargo name, purchase price, inventory and purchaser information), (System function 2: add cargo information, system function 2 priority: 0.2, system function 2 description: verify whether the system allows the administrator to add cargo information through the form, and the added information can be correctly displayed in the cargo information list), (System function 3: edit cargo information, system function 3 priority: 0.2, system function 3 description: verify whether the system allows the administrator to edit the existing cargo information through the input form, and the modified information can be correctly displayed in the cargo information list), ...].
[0123] System functions related to cargo management should have a higher priority, such as cargo information display, adding cargo information, and editing cargo information, while auxiliary system functions such as adjusting system fonts and setting system page colors can have a lower priority.
[0124] The execution results can include the realization of each expected test result in the test case, as well as the overall realization of the test case.
[0125] For example, when the system function is to add new cargo information and each expected test result in the corresponding test case is successfully achieved, the execution results include: pass rate 100%; result one: after executing the "first step", the cargo information display page is correctly loaded and the table is displayed, and the verification is successful; result two, after executing the "fifth step", the newly added cargo information "apple" is correctly displayed in the table, its cargo number is P001, the purchase price is 5.00, the inventory is 100, and the purchaser is Zhang San, and the verification is successful.
[0126] The test result can be determined according to the priority and the execution result. Specifically, for each planned path, a weighted execution result is determined according to the priority and the execution result, and then the test result of the system to be tested is obtained according to the weighted execution result.
[0127] The embodiments of the present disclosure obtain test results by considering the priority of the planned path, so that the obtained test results can accurately reflect the status of the system to be tested.
[0128] According to an embodiment of the present disclosure, determining the test result of the system to be tested according to the execution results of each of the multiple test scripts also includes: inputting the priority and the execution results of each of the multiple test scripts into the intelligent agent, and outputting the test result.
[0129] The priority and the execution results of each of the multiple test scripts can be input into the intelligent agent, which can determine and call the fifth largest model for generating test results, input the priority and the execution results of each of the multiple test scripts into the fifth largest model, and obtain the test results output by the fifth largest model.
[0130] In one embodiment, after the priority and the execution results of each of the multiple test scripts are input into the fifth model, the fifth model can perform statistical and quantitative analysis on the execution results according to the priority to obtain the test results, wherein the test results can be in the form of a structured test report.
[0131] When the execution result characterization fails, the intelligent agent can also be used to call the analysis tool to give the reasons for the execution failure and the solution, and write it into the structured test report.
[0132] In another embodiment, the deployment results when deploying the system code, the detection results of static detection of the page and the test results output by the fifth model can be input into the fifth model again to output a quality inspection report for the entire system to be tested.
[0133] In addition, you can also use the intelligent agent to call the chart generation tool to generate charts and other information based on the quality inspection results, and display them in the quality inspection results, so that the quality inspection report is rich and users can intuitively obtain the quality inspection status of the system to be tested from the quality inspection report.
[0134] The embodiments of the present disclosure improve efficiency by utilizing intelligent agents to generate test results in the form of reports, eliminating the need for manual analysis of execution results and priorities.
[0135] It should be noted that the first large model to the fifth large model involved in the present disclosure can be obtained by training a large model using the corresponding training set. The structures of the first large model to the fifth large model can be the same or different, and the training methods can be the same or different. For example, they are all trained using a few-sample learning method. For example, the large model can be trained using sample demand information to obtain a trained first large model to generate a sample planning path. The same large model is trained using sample page images, sample planning paths, sample system codes, and sample system data to obtain a trained second large model to generate a sample test script. Alternatively, the same large model is tuned using sample page images, sample planning paths, sample system codes, and sample system data to obtain a trained third large model with sample test cases. The same large model is trained using sample test cases to obtain a trained fourth large model to generate a sample test script. In addition, when the large model is trained using sample demand information, the prompt words can also be updated so that the trained first large model can generate sample planning paths and sample priorities. The same large model is trained using sample priorities and the execution results of multiple sample test scripts to obtain a trained fifth large model to generate sample test results.
[0136] Fig. 9 The flowchart for generating test results according to a specific embodiment of the present disclosure is schematically shown.
[0137] like Fig. 9 As shown, in embodiment 900, operations S910 to S950 are included.
[0138] In operation S910, system deployment is performed based on the system code.
[0139] In operation S920 , static detection is performed on a plurality of pages in the system to be tested.
[0140] In operation S930 , a planned path is generated based on the demand information in the input information.
[0141] In operation S941_1, a page image corresponding to a first system function is generated.
[0142] In operation S941_2, a test script for testing the first system function is generated.
[0143] In operation S941_3, a test script for testing the first system function is executed.
[0144] In operation S941_4, an execution result of the test script of the second system function is generated.
[0145] In operation S942_1, a page image corresponding to a second system function is generated.
[0146] In operation S942_2, a test script for testing the second system function is generated.
[0147] In operation S942_3, a test script for testing the second system function is executed.
[0148] In operation S942_4, an execution result of the test script of the second system function is generated.
[0149] In operation S941_4, an execution result of the test script of the second system function is generated.
[0150] In operation S94N_1, a page image corresponding to the Nth system function is generated.
[0151] In operation S94N_2, a test script for testing the Nth system function is generated.
[0152] In operation S94N_3, a test script for testing the Nth system function is executed.
[0153] In operation S94N_4, the execution result of the test script of the Nth system function is generated.
[0154] In operation S950 , a test result is generated based on the N execution results.
[0155] Fig.10 The block diagram of a code generation device based on a large model according to an embodiment of the present disclosure is schematically shown.
[0156] like Fig.10 As shown, the agent-based testing device 1000 includes a path generating module 1010 , a testing module 1020 and a result determining module 1030 .
[0157] The path generation module is used to respond to the received input information, input the requirement information in the input information into the intelligent agent, and generate multiple planning paths with test sequences, the requirement information includes multiple system functions of the system to be tested, and the planning path corresponds to one system function.
[0158] The script generation module is used to generate a test script for testing each system function according to the test sequence, the planned path and the input information.
[0159] The result determination module is used to determine the test result of the system to be tested according to the execution results of each of the multiple test scripts.
[0160] According to an embodiment of the present disclosure, the input information also includes system code and system data; the test module is further used to test each system function according to the test sequence based on the following steps:
[0161] A first script generation submodule is used to process the planned path, system code and system data using an agent to generate a test script for testing system functions; and
[0162] The first execution submodule is used to execute the test script of the system function to update the system data of the system to be tested.
[0163] According to an embodiment of the present disclosure, the input information further includes: system code and system data; the test module is further used to test each system function according to the test sequence based on the following steps:
[0164] The first test case generation submodule is used to use the intelligent agent to process the planned path, system code and system data to generate a test case for testing the system function;
[0165] The second script generation submodule is used to input the test case into the intelligent agent and output the test script;
[0166] The second execution submodule is used to execute the test script of the system function to update the system data of the system to be tested.
[0167] According to an embodiment of the present disclosure, the test module further includes a page marking submodule, a third script generating submodule and a second use case generating submodule.
[0168] The page marking submodule is used to add a marking script to the system code to mark the interactive elements in multiple real-time pages to obtain multiple page images, wherein the real-time pages are generated based on the system code and system data, and the display results of the real-time pages are related to the tested system functions;
[0169] The third script generation submodule is used to input multiple page images, planning paths, system codes and system data into the intelligent agent to generate a test script; or,
[0170] The second use case generation submodule is also used to input multiple page images, planning paths, system codes and system data into the intelligent agent to generate test cases.
[0171] According to an embodiment of the present disclosure, the second use case generation submodule includes a sequence determination unit and a use case generation unit.
[0172] The sequence determination unit is used to determine a page image sequence from a plurality of page images according to a planned path and a system code, wherein the page image sequence includes a plurality of target page images arranged in the order of realizing system functions.
[0173] The use case generation unit is used to generate test cases according to system data and page image sequences.
[0174] According to an embodiment of the present disclosure, the test case includes test steps and expected test results, and the second script generation submodule includes a script generation unit.
[0175] The script generation unit is used to input the test steps and expected test results into the intelligent agent, so that the intelligent agent generates a test script that operates the interactive elements in the test steps and obtains the expected test results according to the test steps.
[0176] According to an embodiment of the present disclosure, the result determination submodule includes a result determination submodule.
[0177] The result determination submodule is used to obtain the test result of the system to be tested by combining the execution results of multiple test scripts according to the priority of the planned path; wherein the priority is generated by the intelligent agent according to the input demand information.
[0178] According to an embodiment of the present disclosure, the result determination submodule further includes a result output submodule.
[0179] The result output submodule is used to input the priority and the execution results of multiple test scripts into the intelligent agent and output the test results.
[0180] Fig.11 The structural block diagram of an intelligent agent according to an embodiment of the present disclosure is schematically shown.
[0181] In the embodiments of the present disclosure, inspired by the von Neumann structure in modern computer theory, such as Fig.11 As shown, the AI agent 1100 may include five core modules: an input module 1110 , a control module 1120 , a storage module 1130 , a calculation module 1140 and an output module 1150 .
[0182] The input module 1110 is responsible for receiving or sensing information such as queries, requests, instructions, signals or data from the outside world (such as users or external environment), and converting them into a format that can be understood and processed by the AI agent 1100. The input module 1110 is the primary link for the AI agent 1100 to interact with the outside world. It enables the AI agent 1100 to efficiently and accurately obtain the necessary "sensory" information from the outside world and respond to this information.
[0183] In an example, the input module 1110 may input the input information described above.
[0184] In the example, the control module 1120 is the core support for the AI agent 1100 to handle complex tasks. The control module 1120 can execute the agent-based testing method described above.
[0185] In the example, the control module 1120 will continuously interact with the storage module 1130, the computing module 1140 and / or the output module 1150 during operation. However, it should be noted that in the embodiment of the present disclosure, the control module 1120 acts as a single initiator to initiate communication with the storage module 1130, the computing module 1140 and / or the output module 1150, and there is no communication coupling between the storage module 1130, the computing module 1140 and the output module 1150.
[0186] In the example, the performance of the control module 1120 may be closely related to the large model on which the AI agent 1100 is based. In order to give full play to the capabilities of the large language model, the internal structure of the control module 1120 may be designed to be highly configurable and scalable to cope with various types of tasks and requirements in real scenarios.
[0187] The storage module 1130 may be responsible for memorizing information such as historical conversations, event flows, etc. The prompt information and data resources mentioned above may be included in the storage module 1130 .
[0188] In the example, after receiving the input information, the AI agent 1100 can generate multiple planned paths with a test sequence according to the demand information in the input information. The input information and the planned path can be stored in the storage module 1130. The AI agent 1100 can retrieve the relevant input information and planned path from the storage module 1130 and feed it back to the control module 1120. Then, the control module 1120 can use the fed-back input information and planned path, according to the test sequence, according to the planned path and the input information, to generate a test script for testing each of the system functions, and store the test script in the storage module 1130. Finally, according to the execution results of each of the multiple test scripts, the test result of the system to be tested is determined, and the test result is passed to the output module 1150.
[0189] The operation module 1140 can be regarded as a predefined tool library. The first large model, the second large model, the third large model, the fourth large model and the fifth large model mentioned above can be included in the operation module 1140.
[0190] In an example, the output module 1150 may output the test results described above.
[0191] The AI agent 1100 according to the embodiment of the present disclosure can simply and effectively improve the level of intelligence, and improve flexibility and versatility.
[0192] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0193] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.
[0194] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method as described above.
[0195] According to an embodiment of the present disclosure, a computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the method as described above.
[0196] Fig.12 A block diagram of an electronic device 1200 suitable for implementing a code generation method based on a large model according to an embodiment of the present disclosure is schematically shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0197] like Fig.12 As shown, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0198] A number of components in the device 1200 are connected to an input / output (I / O) interface 1205, including: an input unit 1206, such as a keyboard, a mouse, etc.; an output unit 1207, such as various types of displays, speakers, etc.; a storage unit 1208, such as a disk, an optical disk, etc.; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0199] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods and processes described above, such as a code generation method based on a large model. For example, in some embodiments, the code generation method based on a large model may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded into the RAM 1203 and executed by the computing unit 1201, one or more steps of the code generation method based on the large model described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to execute the large model-based code generation method in any other appropriate manner (for example, by means of firmware).
[0200] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0201] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0202] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0203] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0204] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0205] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.
[0206] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0207] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An agent-based testing method, comprising: In response to the received input information, inputting the requirement information in the input information into the agent to generate a plurality of planned paths with a test sequence, wherein the requirement information includes a plurality of system functions of the system to be tested, and the planned path corresponds to one of the system functions; Generate a test script for testing each of the system functions according to the test sequence, the planned path and the input information; The test result of the system to be tested is determined according to the execution results of each of the multiple test scripts.
2. The method according to claim 1, wherein: The input information also includes: system code and system data; generating a test script for testing each of the system functions according to the test sequence, the planned path and the input information includes: In the test sequence, each of the system functions is tested based on the following steps: Using the intelligent agent to process the planned path, the system code and the system data to generate a test script for testing the system function; and Execute the test script of the system function to update the system data of the system to be tested.
3. The method according to claim 1, wherein: The input information also includes: system code and system data; the test script for testing each of the system functions is generated according to the test sequence, the planned path and the input information, including: In the test sequence, each of the system functions is tested based on the following steps: Using the intelligent agent to process the planned path, the system code and the system data to generate a test case for testing the system function; Input the test case into the agent and output the test script; Execute the test script of the system function to update the system data of the system to be tested.
4. The method according to claim 2 or 3, further comprising: Adding a marking script to the system code to mark interactive elements in a plurality of real-time pages to obtain a plurality of page images, wherein the real-time pages are generated based on the system code and the system data, and the display results of the real-time pages are related to the tested system functions; Input multiple page images, the planned paths, the system codes and the system data into the intelligent agent to generate the test script; or input multiple page images, the planned paths, the system codes and the system data into the intelligent agent to generate the test case.
5. The method according to claim 4, wherein: The step of inputting the plurality of page images, the planned paths, the system codes and the system data into the intelligent agent to generate a test case for testing the system function comprises: Determining a page image sequence from the plurality of page images according to the planned path and the system code, wherein the page image sequence includes a plurality of target page images arranged in the order of realizing the system function; and The test case is generated according to the system data and the page image sequence.
6. The method according to claim 4, wherein: The test case includes test steps and expected test results; the step of inputting the test case into the agent and outputting the test script includes: The test steps and the expected test results are input into the intelligent agent, so that the intelligent agent generates a test script for operating the interactive elements in the test steps and obtaining the expected test results according to the test steps.
7. The method according to any one of claims 1 to 6, wherein: Determining the test result of the system to be tested according to the execution results of each of the plurality of test scripts includes: According to the priority of the planned path, the test result of the system to be tested is obtained by integrating the execution results of multiple test scripts; wherein the priority is generated by the agent according to the input demand information.
8. The method according to claim 7, further comprising: The priority level and the execution results of each of the multiple test scripts are input into the intelligent agent, and the test result is output.
9. An agent configured to perform the method according to any one of claims 1 to 8.
10. An agent-based testing device, comprising: A path generation module, configured to input demand information in the input information into the agent in response to the received input information, and generate a plurality of planned paths with a test sequence, wherein the demand information includes a plurality of system functions of the system to be tested, and the planned path corresponds to one of the system functions; A test module, used to generate a test script for testing each of the system functions according to the test sequence, the planned path and the input information; The result determination module is used to determine the test result of the system to be tested according to the execution results of each of the multiple test scripts.
11. The device according to claim 10, wherein: The input information also includes system code and system data; the test module is further used to test each of the system functions according to the test sequence based on the following steps: A first script generation submodule is used to use the agent to process the planned path, the system code and the system data to generate a test script for testing the system function; as well as The first execution submodule is used to execute the test script of the system function to update the system data of the system to be tested.
12. The device according to claim 10, wherein: The input information also includes: system code and system data; the test module is also used to test each of the system functions according to the test sequence based on the following steps: A first test case generation submodule is used to use the agent to process the planned path, the system code and the system data to generate a test case for testing the system function; A second script generation submodule, used for inputting the test case into the agent and outputting the test script; The second execution submodule is used to execute the test script of the system function to update the system data of the system to be tested.
13. The device according to claim 11 or 12, wherein the testing module further comprises: A page marking submodule, used for adding a marking script to the system code to mark interactive elements in a plurality of real-time pages to obtain a plurality of page images, wherein the real-time pages are generated based on the system code and the system data, and the display results of the real-time pages are related to the tested system functions; A third script generation submodule is used to input the plurality of page images, the planned paths, the system code and the system data into the agent to generate the test script; or The second use case generation submodule is also used to input a plurality of the page images, the planned paths, the system codes and the system data into the intelligent agent to generate the test case.
14. The device according to claim 13, wherein: The second use case generation submodule includes: a sequence determining unit, configured to determine a page image sequence from the plurality of page images according to the planned path and the system code, wherein the page image sequence includes a plurality of target page images arranged in a sequence for realizing the system function; and A case generation unit is used to generate the test case according to the system data and the page image sequence.
15. The device according to claim 13, wherein: The test case includes test steps and expected test results, and the second script generation submodule includes: The script generation unit is used to input the test steps and the expected test results into the agent, so that the agent generates a test script for operating the interactive elements in the test steps and obtaining the expected test results according to the test steps.
16. The device according to any one of claims 10 to 15, wherein: The result determination module comprises: The result determination submodule is used to obtain the test result of the system to be tested by integrating the execution results of multiple test scripts according to the priority of the planned path; wherein the priority is generated by the agent according to the input demand information.
17. The device according to claim 16, wherein: The result determination submodule also includes: The result output submodule is used to input the priority level and the execution results of each of the multiple test scripts into the intelligent agent, and output the test result.
18. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.
20. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Cited By
Function test method of information system based on artificial intelligence
CN120353715A
A functional testing method for information systems based on artificial intelligence
CN120353715B
