Interface testing method and device, electronic equipment and storage medium
By automatically generating interface test scripts and optimizing test cases using large language models and AI agents, the problems of low efficiency and error-proneness in traditional manual testing are solved, achieving efficient and standardized interface testing.
Patent Information
- Application Number
- CN202511153891.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-21
AI Technical Summary
Traditional manual interface automation testing is inefficient, error-prone, and fails to effectively improve software quality. Furthermore, it is difficult to maintain interfaces when they change.
Test scripts are generated using large language models, and test data is analyzed by AI Agents to optimize test scripts and test cases.
It improves the efficiency of test script generation, avoids logical errors that occur when writing test scripts manually, enhances the quality and adaptability of test scripts, and strengthens the testing effect.
Smart Images

Figure CN120994561A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to an interface testing method and device, electronic equipment and storage medium. BACKGROUND
[0002] Under the background of rapid development of the current software industry, the scale and complexity of software systems continue to increase, and the automatic testing of interfaces has become an important means to improve software quality. However, the traditional manual interface automatic testing method is facing many severe challenges.
[0003] For example, in the manual interface automatic testing scheme, test cases or test scripts need to be manually written first, so there are problems such as low efficiency and easy to make mistakes, which seriously hinder the efficient promotion of software testing work and also make it difficult to effectively improve software quality. SUMMARY
[0004] The embodiments of the present application provide an interface testing method, device, electronic equipment and storage medium to improve the efficiency and effect of interface testing.
[0005] In a first aspect, the embodiments of the present application provide an interface testing method, comprising:
[0006] obtaining basic information of an interface to be tested and description information of a test case;
[0007] constructing a prompt word based on the basic information and the description information;
[0008] processing the prompt word through a large language model to generate a test script of the interface to be tested;
[0009] executing the test script to obtain test data of the interface to be tested, and analyzing the test data through artificial intelligence agents (AIAgents) to obtain an analysis result, wherein the analysis result is used to optimize the test script and / or the test case.
[0010] Optionally, the analyzing the test data through the artificial intelligence agents (AIAgents) to obtain an analysis result comprises:
[0011] determining task configuration information of the AIAgents and an interaction interface of the AIAgents;
[0012] acquiring the test data through the AIAgents based on the task configuration information and the interaction interface during the testing process;
[0013] analyzing the test data to obtain the analysis result.
[0014] Optionally, the analyzing the test data to obtain the analysis result comprises:
[0015] comparing the test data with a preset index to obtain a comparison result as the analysis result, the comparison result being used to indicate that the test data does not conform to the preset index;
[0016] The method further comprises:
[0017] determining an optimization scheme of the test script and / or the test case based on the analysis result;
[0018] executing the optimization scheme by the AI Agents.
[0019] Optionally, the method further comprises:
[0020] verifying the test script by a code verification tool to obtain a first verification result, and verifying the test case by the code verification tool to obtain a second verification result;
[0021] in a case where the first verification result indicates that the test script has a syntax error, optimizing the test script, and / or in a case where the second verification result indicates that the test case does not meet a preset test requirement, optimizing the test case based on the preset test requirement.
[0022] Optionally, before the processing the prompt by the large language model to generate the test script of the interface to be tested, the method further comprises:
[0023] initializing a request parameter of the large language model to obtain a target large language model;
[0024] The processing the prompt by the large language model to generate the test script of the interface to be tested comprises:
[0025] inputting the prompt into the target large language model, processing the prompt by the target large language model to obtain the test script output by the target large language model.
[0026] Optionally, the constructing the prompt based on the basic information and the description information comprises:
[0027] obtaining a prompt template, the prompt template comprising a basic information item and a description information item;
[0028] replacing the basic information item based on the basic information, and replacing the description information based on the description information item, to obtain the prompt.
[0029] Optionally, after the processing of the prompt word by the large language model to generate the test script of the to-be-tested interface, the method further comprises:
[0030] updating a data analysis library pandas in the test script to a version rewritten by a Rust language; updating a request processing library requsets in the test script to an asynchronous request library aiohttp; and performing performance analysis on target code in the test script to obtain a performance analysis result, and optimizing the target code based on the performance analysis result.
[0031] In a second aspect, the embodiments of the present application provide an interface testing device, comprising:
[0032] an information acquisition module configured to acquire basic information of a to-be-tested interface and description information of a test case;
[0033] a prompt word construction module configured to construct a prompt word based on the basic information and the description information;
[0034] a test script generation module configured to process the prompt word by a large language model to generate a test script of the to-be-tested interface;
[0035] an interface testing module configured to execute the test script to obtain test data of the to-be-tested interface, and analyze the test data by an artificial intelligence agent AI Agents to obtain an analysis result, wherein the analysis result is used to optimize the test script and / or the test case.
[0036] In a third aspect, the embodiments of the present application provide an electronic device, comprising: a processor, a memory, a system bus;
[0037] the processor and the memory are connected through the system bus;
[0038] the memory is configured to store a program, the program comprising instructions which, when executed by the processor, cause the processor to perform any implementation step of the interface testing method.
[0039] From the above technical solutions, it can be seen that the embodiments of the present application have the following advantages:
[0040] In the embodiments of the present application, after obtaining the basic information of the interface to be tested and the description information of the test case, the prompt word can be constructed based on the above-mentioned basic information and description information, and the prompt word is processed through the large language model, so as to generate the test script of the interface to be tested. Then, the test data of the interface to be tested is obtained by executing the test script, and the test data is analyzed by the AI Agents to obtain the analysis result, which can be used to optimize the test script and / or the test case. As can be seen, by using the powerful natural language understanding and generation capabilities of the large language model, the test script can be quickly and automatically generated, avoiding the tedious process of traditional manual script writing, greatly improving the generation efficiency of the test script, and avoiding the logical errors or inconsistent code styles that may occur during manual writing, improving the quality and standardization of the test script. Moreover, with the help of the ability of AI Agents to make autonomous decisions, collaborate and perform complex tasks, the test data can be analyzed in depth to optimize the test script and / or the test case using the analysis result, improving the flexibility and adaptability of the test script and / or the test case, thereby improving the test effect. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 The flow of an interface testing method provided by the embodiments of the present application;
[0042] Figure 2 The structural diagram of an interface testing device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0043] As described above, in the scheme of manual interface automatic testing, the test case or test script needs to be manually written first, so there are problems such as low efficiency and easy to make mistakes, which seriously hinder the efficient promotion of software testing work and also make it difficult to effectively improve software quality.
[0044] Specifically, the workload of manually writing test cases is extremely huge. In a medium-sized software project, there are usually hundreds or even thousands of interfaces. The tester must understand the request mode of each interface one by one, and master the specific meaning, format specification and access path of a large number of parameters. For example, in a rental core business system, there are multiple functional modules such as quotation sheet, rental object, business declaration, etc., and each module contains a large number of interfaces, and each parameter has specific format requirements and business rules. If the tester relies on manual method to write these test cases one by one, not only the time is huge, but also a high degree of concentration is required to ensure that each detail is accurate, which undoubtedly greatly increases the human investment and time cost.
[0045] And, due to the large number of interfaces and complex information, testers are likely to make omissions or mistakes during long and intensive writing processes. For example, some key parameters may be missed, or parameter formats may be filled in incorrectly, such as date formats not meeting specifications. These errors can not only cause test cases to fail to execute normally, but can also produce incorrect test results, thereby affecting accurate judgment and evaluation of software quality.
[0046] In addition, when an interface changes, it is extremely difficult to manually maintain test cases. During software development and iteration, frequent adjustments to business requirements often result in the addition, deletion, or modification of interface parameters. Testers need to find the relevant code for the interface in a large number of test cases one by one and manually make the corresponding adjustments. This approach is not only inefficient, but also prone to omissions, resulting in some test cases not being updated in a timely manner and not being consistent with the actual interface situation, thereby causing automated testing to lose its intended effect and failing to timely identify potential problems that may be caused by interface changes.
[0047] Based on this, to solve the above problems, the embodiments of the present application provide an interface testing method, which can include: after obtaining the basic information of the interface to be tested and the description information of the test case, the prompt words can be constructed based on the above basic information and description information, and the prompt words are processed by a large language model, thereby generating a test script of the interface to be tested. Then, the test data of the interface to be tested is obtained by executing the test script, and the test data is analyzed by AI Agents to obtain an analysis result, which can be used to optimize the test script and / or the test case.
[0048] As can be seen, by using the powerful natural language understanding and generation capabilities of the large language model, the test script can be quickly and automatically generated, avoiding the tedious process of traditional manual script writing, greatly improving the generation efficiency of the test script, and avoiding logical errors or inconsistent code styles that may occur during manual writing, thereby improving the quality and standardization of the test script. Moreover, with the ability of AI Agents to make autonomous decisions, collaborate, and perform complex tasks, the test data can be analyzed in depth to optimize the test script and / or the test case using the analysis result, thereby improving the flexibility and adaptability of the test script and / or the test case, and thus improving the testing effect.
[0049] It should be noted that the embodiments of the present application can not limit the subject performing the interface testing method. For example, the interface testing method of the embodiments of the present application can be applied to terminal devices or server data analysis devices. The terminal device can be a smartphone, a computer, a personal digital assistant (PDA), a tablet computer, or other electronic devices. The server can be a standalone server, a cluster server, or a cloud server.
[0050] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0051] Figure 1 A flowchart of an interface test method provided by an embodiment of the present application is shown in FIG. 1. According to the interface test method provided by the embodiment of the present application, the interface test method can include the following steps S101-S104. Figure 1
[0052] S101: Obtain basic information of a to-be-tested interface and description information of a test case.
[0053] The basic information of the to-be-tested interface can include a uniform resource locator (URL) of the to-be-tested interface, a request method (such as GET or POST, etc.), a request header (Headers), and a request body (Request Body) structure.
[0054] The description information of the test case can include information such as input parameters, expected output, and business scenarios used for testing the to-be-tested interface.
[0055] Based on this, in the embodiment of the present application, first, the description information of various test cases can be accurately read with the help of a file loading tool. In actual application, the file loading tool is, for example, LangChain, which supports multiple common formats such as lightweight markup language Markdown or Word, and helps to improve the integrity and accuracy of data.
[0056] In addition, the basic information of the to-be-tested interface can be extracted by parsing an HTTP Archive Format (HAR) file, a Swagger interface document, or other interface definition files, and using a corresponding parsing library.
[0057] S102: Construct a prompt word based on the basic information and the description information.
[0058] The prompt word is information input to the large language model. In the embodiment of the present application, the construction process of the prompt word can be specifically that a prompt word template is first obtained, the prompt word template includes a basic information item and a description information item, then the basic information item is replaced based on the basic information, and the description information is replaced based on the description information item, to obtain the prompt word. In this way, after the prompt word is constructed by the prompt word template, it is helpful to guide the large language model to understand the interface information and test requirements in the subsequent process, to generate a comprehensive and accurate test script, thereby improving the generation efficiency and quality of the test case. For ease of understanding, an example of a possible prompt word template is described below.
[0059] As an example, the format of the prompt word template can be "You are an automated test engineer, proficient in pytest and requests library of Python. The following is the detailed technical information of the interface: {context} Question: {input}". Wherein, {context} is a basic information item, which can be filled with basic information of the interface to be tested; {input} is a description information item, which can be filled with description information of the test case of the interface to be tested.
[0060] S103: processing the prompt word by the large language model to generate a test script of the interface to be tested.
[0061] In the embodiment of the present application, before processing the prompt word by the large language model, the request parameters of the large language model can be first initialized and set to obtain a target large language model. For example, the request parameters are model version, maximum generation length or temperature coefficient (used to control the randomness of generated text), etc.
[0062] Then, the target large language model can be used to process the prompt word, that is, the prompt word is input to the target large language model, and the prompt word is processed by the target large language model to obtain a test script output by the target large language model. Wherein, the test script can be implemented in Python language and complies with the syntax specification of pytest framework and requests library.
[0063] Further, after obtaining the test script, the generated test script and test case can be verified by using a custom code verification tool to obtain a first verification result and a second verification result, respectively.
[0064] For example, the verification of the test script can be a syntax check of the test script, so as to make the code of the test script as free of syntax errors as possible, and improve the usability of the test script. In this way, in the case that the first verification result indicates that the test script has syntax errors, the test script can be optimized.
[0065] The checking of the test case can be checking the rationality of the assertion in the test case, verifying whether it accurately covers the expected test result or meets the preset test requirement. In this way, if the second checking result indicates that the function test case does not meet the preset test requirement, the test case can be optimized based on the preset test requirement, for example, adding annotations to improve code readability, adjusting the order of test steps to improve test efficiency, and the like.
[0066] Further, after obtaining the test script, the test script can be further optimized and improved. For ease of understanding, the following will be described in combination with multiple examples.
[0067] As an example, in terms of data processing, the data analysis library pandas in the test script can be updated to a high-performance version after being rewritten in Rust language, such as pandas 3.0, so as to utilize the efficient memory management and multi-threading capability of Rust to significantly shorten the time for data reading, cleaning, conversion and analysis when processing large-scale test data.
[0068] As another example, in terms of network request, the request processing library requsets in the test script can be updated to the asynchronous request library aiohttp, so that when testing multiple interfaces, multiple requests can be initiated simultaneously by utilizing the asynchronous programming feature of Python to reduce the waiting time between requests and improve the overall test speed.
[0069] As yet another example, the target code in the test script can also be subjected to performance analysis to obtain a performance analysis result, and the target code is optimized based on the performance analysis result. The target code refers to a key code segment in the test script, and tools such as cProfile can be used to find out the performance bottleneck and optimize it in a targeted manner, such as optimizing the algorithm complexity and reducing unnecessary function calls.
[0070] S104: Execute the test script to obtain test data of the to-be-tested interface, and analyze the test data by using the AI Agents to obtain an analysis result, which is used for optimizing the test script and / or the test case.
[0071] In the embodiments of the present application, the test data can include interface response duration, status code, or return data, etc. The process of executing the test script is not specifically limited, and any implementation manner existing or possibly appearing in the future can be adopted to implement it.
[0072] Further, before data analysis by the AI Agents, a vector database Chroma can be used to build a knowledge base of the AI Agents, and information such as test knowledge, historical test data, and test specifications involved by the AI Agents is converted into a vector form for storage, so as to facilitate subsequent fast retrieval and query functions.
[0073] In this way, when the AI Agents analyze the test data, the task configuration information of the AI Agents and the interactive interface of the AI Agents can be determined first. For example, the task configuration information of the AI Agents can indicate the tasks performed by the AI Agents, such as automatically formulating a test plan according to a test target or dynamically adjusting a test strategy according to a test result. The interactive interface of the AI Agents refers to the interactive interface of the AI Agents with other test tools and systems, and determining the interactive interface helps the AI Agents to work collaboratively with the entire test ecosystem.
[0074] In this way, during the test process, the AI Agents can collect test data based on the task configuration information and the interactive interface, analyze the test data, and obtain an analysis result.
[0075] Specifically, during the test, the AI Agents can collect test data in real time, compare the test data with preset indicators, and obtain a comparison result as the analysis result. Accordingly, if the comparison result indicates that the test data does not conform to the preset indicators, an optimization scheme of a test script and / or a test case can be determined based on the analysis result, and the optimization scheme can be executed by the AI Agents.
[0076] For example, if the preset indicators include a preset interface response time indicator, and the comparison result indicates that the interface response time in the test data is much longer than the preset interface response time indicator, it can be concluded that there is a performance problem such as slow interface response. Based on this, the AI Agents can automatically add test cases for the interface according to the knowledge base and algorithms, cover more boundary and abnormal scenarios, adjust the number of concurrent requests, simulate a high-concurrency environment, and diagnose performance bottlenecks in depth.
[0077] As can be seen, based on the related content of steps S101-S104, in the embodiment of the present application, after obtaining the basic information of the to-be-tested interface and the description information of the test case, the prompt word can be constructed based on the above-mentioned basic information and description information, and the prompt word is processed by the large language model to generate the test script of the to-be-tested interface. Then, the test data of the to-be-tested interface is obtained by executing the test script, and the test data is analyzed by the AI Agents to obtain the analysis result, which can be used to optimize the test script and / or the test case. As can be seen, by using the powerful natural language understanding and generation capabilities of the large language model, the test script can be quickly and automatically generated, avoiding the tedious process of traditional manual script writing, greatly improving the generation efficiency of the test script, and avoiding the logical errors or inconsistent code styles that may occur during manual writing, improving the quality and standardization of the test script. Moreover, with the ability of autonomous decision-making, collaboration and execution of complex tasks of AI Agents, the test data can be analyzed in depth to optimize the test script and / or the test case using the analysis result, improving the flexibility and adaptability of the test script and / or the test case, thereby improving the test effect.
[0078] Further, based on the interface testing method provided in the above embodiment, the embodiment of the present application can also provide an interface testing device. The interface testing device will be described below in combination with the embodiments and the drawings.
[0079] Figure 2 The structure diagram of an interface testing device provided in the embodiment of the present application is shown. In combination with Figure 2 the interface testing device 200 provided in the embodiment of the present application can include:
[0080] The information acquisition module 201 is configured to acquire the basic information of the to-be-tested interface and the description information of the test case.
[0081] The prompt word construction module 202 is configured to construct a prompt word based on the basic information and the description information.
[0082] The test script generation module 203 is configured to process the prompt word by a large language model to generate a test script of the to-be-tested interface.
[0083] The interface testing module 204 is configured to execute the test script to obtain test data of the to-be-tested interface, and analyze the test data by an artificial intelligence agent AI Agents to obtain an analysis result, which is used to optimize the test script and / or the test case.
[0084] Optionally, the interface testing module 204 includes:
[0085] information determining module, configured to determine task configuration information of the AI Agents and an interaction interface of the AI Agents;
[0086] data collecting module, configured to collect, during the test process, the test data by the AI Agents based on the task configuration information and the interaction interface;
[0087] data analyzing module, configured to analyze the test data to obtain the analysis result.
[0088] Optionally, the data analyzing module is specifically configured to:
[0089] compare the test data with a preset index to obtain a comparison result as the analysis result, the comparison result being used to indicate that the test data is inconsistent with the preset index;
[0090] The interface test apparatus 200 further includes:
[0091] scheme determining module, configured to determine an optimization scheme of the test script and / or the test case based on the analysis result;
[0092] scheme executing module, configured to execute the optimization scheme by the AI Agents.
[0093] Optionally, the interface test apparatus 200 further includes:
[0094] test script verifying module, configured to verify the test script by a code verifying tool to obtain a first verification result, and verify the function test case by the code verifying tool to obtain a second verification result;
[0095] test script optimizing module, configured to optimize the test script in a case where the first verification result indicates that the test script has a syntax error, and / or optimize the test case based on a preset test requirement in a case where the second verification result indicates that the function test case does not meet the preset test requirement.
[0096] Optionally, the interface test apparatus 200 further includes:
[0097] initializing module, configured to initialize a request parameter of the large language model to obtain a target large language model;
[0098] The test script generating module 203 is specifically configured to:
[0099] The prompt word is input into the target large language model, and the prompt word is processed by the target large language model to obtain the test script output by the target large language model.
[0100] Optionally, the prompt word construction module 202 is specifically configured to:
[0101] Obtain a prompt word template, the prompt word template including an interface basic information item to be filled and a use case description information item to be filled;
[0102] Replace the interface basic information item to be filled based on the basic information, and replace the use case description information to be filled based on the description information item, to obtain the prompt word.
[0103] Optionally, the interface test device 200 further includes:
[0104] The data processing module is configured to update a data analysis library pandas in the test script to a version after Rust language rewriting, update a request processing library requsets in the test script to an asynchronous request library aiohttp, and perform performance analysis on target code in the test script to obtain a performance analysis result and optimize the target code based on the performance analysis result.
[0105] Further, the embodiment of the present application further provides an electronic device, including: a processor, a memory, a system bus;
[0106] The processor and the memory are connected through the system bus;
[0107] The memory is configured to store one or more programs, the one or more programs including instructions, the instructions causing the processor to execute any implementation step of the interface test method described above when executed by the processor.
[0108] Further, the embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium storing instructions, when the instructions run on the electronic device, the electronic device executes any implementation step of the interface test method described above.
[0109] Those skilled in the art can clearly understand that all or part of the steps of the above-mentioned method in the embodiments can be implemented by means of software and necessary universal hardware platforms based on the description of the above-mentioned embodiments. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) execute the method described in the various embodiments or some parts of the embodiments of the present application. It should be noted that the various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0110] For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts are referred to the method part.
[0111] It should also be noted that the relationship terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0112] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An interface testing method, characterized in that, include: Obtain basic information about the interface to be tested and descriptions of the test cases; Based on the basic information and the description information, prompt words are constructed; The prompt words are processed using a large language model to generate a test script for the interface to be tested. The test script is executed to obtain test data for the interface to be tested, and the test data is analyzed by AIAgents to obtain analysis results. The analysis results are used to optimize the test script and / or the test cases.
2. The interface testing method according to claim 1, characterized in that, The analysis of the test data using AI agents to obtain analysis results includes: Determine the task configuration information of the AI Agents and the interaction interface of the AI Agents; During the test, the test data is collected through the AI Agents based on the task configuration information and the interaction interface; The test data is analyzed to obtain the analysis results.
3. The interface testing method according to claim 2, characterized in that, The analysis of the test data to obtain the analysis results includes: The test data is compared with preset indicators, and the comparison result is used as the analysis result. The comparison result is used to indicate that the test data does not match the preset indicators. The method further includes: Based on the analysis results, an optimization scheme for the test script and / or the test cases is determined; The optimization scheme is executed through the AI Agents.
4. The interface testing method according to claim 1, characterized in that, The method further includes: The test script is validated using a code validation tool to obtain a first validation result; and the test case is validated using the code validation tool to obtain a second validation result. If the first verification result indicates that the test script has a syntax error, the test script is optimized, and / or, if the second verification result indicates that the test case does not meet the preset test requirements, the test case is optimized based on the preset test requirements.
5. The interface testing method according to any one of claims 1 to 4, characterized in that, Before processing the prompt words using a large language model to generate the test script for the interface to be tested, the method further includes: The request parameters of the large language model are initialized to obtain the target large language model; The step of processing the prompt words using a large language model to generate a test script for the interface to be tested includes: The prompt word is input into the target large language model, and the prompt word is processed by the target large language model to obtain the test script output by the target large language model.
6. The interface testing method according to any one of claims 1 to 4, characterized in that, The step of constructing prompt words based on the basic information and the descriptive information includes: Obtain a prompt word template, the prompt word template including basic information items and descriptive information items; The basic information item is replaced based on the basic information, and the description information item is replaced based on the description information item to obtain the prompt word.
7. The interface testing method according to any one of claims 1 to 4, characterized in that, After processing the prompt words using a large language model to generate the test script for the interface to be tested, the method further includes: The pandas data analysis library in the test script is updated to a version rewritten in Rust; the requests processing library requests in the test script is updated to the asynchronous request library aiohttp; and the target code in the test script is subjected to performance analysis to obtain performance analysis results, and the target code is optimized based on the performance analysis results.
8. An interface testing device, characterized in that, include: The information acquisition module is used to acquire basic information about the interface to be tested and description information of the test cases; The prompt word construction module is used to construct prompt words based on the basic information and the description information; The test script generation module is used to process the prompt words through a large language model to generate the test script for the interface to be tested; The interface testing module executes the test script to obtain test data for the interface to be tested, and analyzes the test data through artificial intelligence agents (AI agents) to obtain analysis results. The analysis results are used to optimize the test script and / or the test cases.
9. An electronic device, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions that, when executed by the processor, cause the processor to perform the steps of the interface testing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, which, when executed by a terminal device, implements the steps of the interface testing method according to any one of claims 1 to 7.