Interface testing method, system and device and electronic equipment
By generating dynamic test strategies through an intelligent agent decision engine and a large language model, the problems of high test script maintenance costs and insufficient coverage in interface testing are solved, realizing intelligent and efficient automation of interface testing, and improving test efficiency and coverage.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TRAVELSKY TECHNOLOGY LIMITED
- Filing Date
- 2025-12-05
- Publication Date
- 2026-04-21
Smart Images

Figure CN121901098A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software testing, and more specifically, to an interface testing method, system, apparatus, and electronic device. Background Technology
[0002] In software development and operations, interface testing is a crucial step in ensuring system stability and functional correctness. With the widespread adoption of microservice architectures and distributed systems, the number of interfaces has surged, and the dependencies between them have become increasingly complex, posing numerous challenges to interface testing methods. Although various tools and frameworks are widely used, these methods still have significant shortcomings in terms of testing efficiency, coverage, and intelligence. Specifically:
[0003] (1) Test script maintenance costs are high. For example, interface automated testing relies on manually writing and maintaining test scripts. When the interface definition or business logic changes, the test scripts need to be updated synchronously, which consumes a lot of manpower and is prone to failure. For example, in a large microservice system, a single interface change may affect dozens of dependent interfaces, and the maintenance workload increases exponentially.
[0004] (2) Insufficient test coverage: The testing methods in related technologies are based on fixed test cases, which makes it difficult to cover complex scenarios (such as boundary conditions, exception handling, concurrent requests, etc.). For example, in the civil aviation system, the interface involves multiple business scenarios (such as flight inquiry, ticket booking, check-in, and ticket refund). The testing tools in related technologies cannot automatically generate test cases that cover all scenarios, making it difficult to discover potential defects. In addition, there is a lack of in-depth coverage of abnormal processes, such as network latency and service timeouts, which further limits the comprehensiveness of the test.
[0005] (3) Lack of intelligent optimization capabilities: The test cases in related testing tools are executed in a fixed order, making it impossible to dynamically adjust strategies. For example, in scenarios with multiple interface dependencies, test cases are executed in a fixed order, making it impossible to optimize the execution order based on interface response time or failure rate, resulting in low testing efficiency. In addition, the testing methods in related technologies are difficult to continuously improve in terms of testing effectiveness. At the same time, the testing tools in related technologies lack intelligent scheduling for the allocation of testing resources, which can easily lead to resource waste or bottleneck problems.
[0006] There is currently no effective solution to the above problems. Summary of the Invention
[0007] This invention provides an interface testing method, system, device, and electronic device to at least solve the technical problem in related technologies where test scripts are used for automated interface testing, resulting in high maintenance costs for the test scripts.
[0008] According to one aspect of the present invention, an interface testing method is provided, comprising: receiving a test task through an intelligent agent decision engine, wherein the test task is used to request interface testing of a system to be tested; responding to the test task, obtaining parameters of a test environment to obtain environment parameters, wherein the test environment includes an environment for performing interface testing on the system to be tested; inputting the environment parameters into a target model to obtain a test strategy, wherein the test strategy includes a test case set and the execution order of multiple test cases in the test case set, and the type of the target model includes a large language model; performing interface testing on the system to be tested based on the test strategy, and adjusting the test strategy based on test data generated during the interface testing process.
[0009] Furthermore, after receiving the test task through the agent decision engine, the method further includes: determining agent workflow tasks, wherein the agent workflow tasks include at least one of the following: a task for generating the test strategy, a task for executing the test cases, a task for analyzing the test results, and a task for adjusting the test strategy; and allocating the agent workflow tasks to multiple agents, wherein the multiple agents are used to process the agent workflow tasks based on the priority and load balancing strategy of the agent workflow tasks.
[0010] Furthermore, after allocating the intelligent agent workflow task to multiple intelligent agents, the method further includes: acquiring the execution status data of the intelligent agent workflow task, wherein the execution status data includes at least one of the following: task completion rate, task execution time, and resource utilization rate; and adjusting the processing strategy of the intelligent agent workflow task based on the execution status data in the event of an abnormality in the processing of the intelligent agent workflow task.
[0011] Furthermore, during the interface testing of the system under test based on the test strategy, the method further includes: obtaining test termination conditions, wherein the test termination conditions include: multiple preset thresholds; invoking the test framework, executing test cases in the test case set based on the execution order, and determining whether the test data generated during the interface testing process meets the test termination conditions; if the test termination conditions are met, determining the test results of the system under test and generating a test report based on the test data generated during the testing process.
[0012] Furthermore, after performing interface testing on the system under test based on the test strategy and adjusting the test strategy based on the test data generated during the interface testing process, the method further includes: retraining the target model based on the test strategy, the test results, and the test data generated during the interface testing process to obtain a trained target model.
[0013] Further, the environmental parameters are input into the target model to obtain a testing strategy, including: inputting the environmental parameters into the target model and generating the test case set using a reinforcement learning strategy; determining the execution order of the test cases in the test case set based on a preset reward function; and determining the testing strategy based on the test case set and the execution order.
[0014] Furthermore, receiving test tasks through the agent decision engine includes: receiving the test tasks through the agent decision engine based on a first interface; after receiving the test tasks through the agent decision engine, it also includes: querying the execution status of the test tasks based on a second interface.
[0015] According to another aspect of the present invention, an interface testing system is also provided. The interface testing system is used to execute the interface testing method described above, comprising: a user interface and interaction module, used to receive a test task submitted by a user and send the test task to an intelligent agent decision engine; the intelligent agent decision engine, used to receive the test task, respond to the test task, obtain parameters of the test environment, obtain environment parameters, and input the environment parameters into a target model to obtain a test strategy, wherein the test strategy includes: a test case set and the execution order of multiple test cases in the test case set, and the type of the target model includes: a large language model; a test execution and monitoring module, used to perform interface testing on the system under test based on the test strategy and monitor the testing process; the intelligent agent decision engine is also used to adjust the test strategy based on the test data generated during the testing process.
[0016] According to another aspect of the present invention, an interface testing apparatus is also provided, comprising: a receiving unit, configured to receive a test task through an intelligent agent decision engine, wherein the test task is used to request interface testing of a system to be tested; a first acquiring unit, configured to respond to the test task, acquire parameters of a test environment, and obtain environment parameters, wherein the test environment includes an environment for performing interface testing on the system to be tested; a first processing unit, configured to input the environment parameters into a target model to obtain a test strategy, wherein the test strategy includes a test case set and the execution order of multiple test cases in the test case set, and the type of the target model includes a large language model; and a second processing unit, configured to perform interface testing on the system to be tested based on the test strategy, and adjust the test strategy based on test data generated during the interface testing process.
[0017] Furthermore, the interface testing apparatus further includes: a determining unit, configured to determine an agent workflow task after receiving a test task through an agent decision engine, wherein the agent workflow task includes at least one of the following: a task for generating the test strategy, a task for executing the test cases, a task for analyzing test results, and a task for adjusting the test strategy; and an allocation unit, configured to allocate the agent workflow task to multiple agents, wherein the multiple agents are used to process the agent workflow task based on the priority and load balancing strategy of the agent workflow task.
[0018] Furthermore, the interface testing device also includes: a second acquisition unit, configured to acquire execution status data of the intelligent agent workflow task after allocating the intelligent agent workflow task to multiple intelligent agents, wherein the execution status data includes at least one of the following: task completion rate, task execution time, and resource utilization rate; and an adjustment unit, configured to adjust the processing strategy of the intelligent agent workflow task based on the execution status data in the event of an abnormality in the processing of the intelligent agent workflow task.
[0019] Furthermore, the second processing unit further includes: an acquisition subunit, used to acquire test termination conditions during interface testing of the system under test based on the test strategy, wherein the test termination conditions include: multiple preset thresholds; a first processing subunit, used to call the test framework, execute test cases in the test case set based on the execution order, and determine whether the test data generated during the interface testing process meets the test termination conditions; and a first determination subunit, used to determine the test results of the system under test and generate a test report based on the test data generated during the testing process, provided that the test termination conditions are met.
[0020] Furthermore, the interface testing device also includes: a training unit, used to perform interface testing on the system under test based on the test strategy, and after adjusting the test strategy based on the test data generated during the interface testing process, to retrain the target model based on the test strategy, the test results, and the test data generated during the interface testing process, so as to obtain the trained target model.
[0021] Further, the first processing unit includes: a second processing subunit, used to input the environmental parameters into the target model and generate the test case set using a reinforcement learning strategy; a second determining subunit, used to determine the execution order of the test cases in the test case set based on a preset reward function; and a third determining subunit, used to determine the testing strategy based on the test case set and the execution order.
[0022] Furthermore, the first receiving unit includes: a first receiving subunit, used to receive the test task through the agent decision engine based on a first interface; the interface testing device further includes: a query unit, used to query the execution status of the test task based on a second interface after receiving the test task through the agent decision engine.
[0023] According to another aspect of the present invention, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the interface testing method of any of the above via executing the executable instructions.
[0024] According to another aspect of the present invention, a computer-readable storage medium is also provided, which stores a computer program, wherein the computer program controls the device where the computer-readable storage medium is located to execute the interface testing method described above when it is running.
[0025] In this invention, the following approach is adopted: A test task is received through an intelligent agent decision engine, whereby the test task requests interface testing of the system under test; The test task is responded to by obtaining parameters of the test environment, resulting in environment parameters, where the test environment includes an environment for interface testing of the system under test; The environment parameters are input into a target model to obtain a test strategy, whereby the test strategy includes a test case set and the execution order of multiple test cases within the test case set, and the type of the target model includes a large language model; Interface testing of the system under test is performed based on the test strategy, and the test strategy is adjusted based on the test data generated during the interface testing process. This solves the technical problem of high maintenance costs of test scripts used for automated interface testing in related technologies. In this invention, a test strategy is dynamically generated through an intelligent agent decision engine based on the interface test environment parameters, and the interface under test is tested based on the test strategy. The test strategy can also be adjusted during the testing process, avoiding the high manual maintenance costs of predefined test scripts used in related technologies, thus achieving the technical effect of reducing the manual cost of interface testing. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0027] Figure 1 This is a flowchart of an optional interface testing method according to an embodiment of the present invention;
[0028] Figure 2This is a schematic diagram of an optional interface testing system according to an embodiment of the present invention;
[0029] Figure 3 This is a software flowchart of an optional interface test according to an embodiment of the present invention;
[0030] Figure 4 This is an architecture diagram of an optional interface testing system according to an embodiment of the present invention;
[0031] Figure 5 This is a schematic diagram of an optional interface testing device according to an embodiment of the present invention;
[0032] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] It should be noted that the user information (including but not limited to user device information, user personal information, etc.), the collected information and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse.
[0036] Example 1
[0037] According to an embodiment of the present invention, an optional interface testing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0038] Figure 1 This is a flowchart of an optional interface testing method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0039] Step S101: Receive test tasks through the intelligent agent decision engine, wherein the test tasks are used to request interface testing of the system to be tested.
[0040] The aforementioned agent decision engine can be used to dynamically generate test strategies and optimize the execution order of test cases after receiving test tasks. The test strategy can include test cases and the execution order of test cases.
[0041] Step S102: Respond to the test task, obtain the parameters of the test environment, and obtain the environment parameters. The test environment includes: the environment used to perform interface testing on the system under test.
[0042] The aforementioned testing environment may include an interface testing system, and the parameters of the testing environment may include, but are not limited to, system resource status, such as CPU (Central Processing Unit) and memory usage.
[0043] Step S103: Input the environmental parameters into the target model to obtain the test strategy. The test strategy includes: a test case set and the execution order of multiple test cases in the test case set. The type of the target model includes: a large language model.
[0044] In this embodiment, based on environmental parameters and existing test cases, an optimal test strategy is generated by combining an AI (Artificial Intelligence) big data model and reinforcement learning algorithms (such as Q-Learning). The execution order of test cases in the test strategy is dynamically adjusted with test coverage and execution efficiency as reward signals.
[0045] Step S104: Perform interface testing on the system under test based on the testing strategy, and adjust the testing strategy based on the test data generated during the interface testing process.
[0046] In this embodiment, an intelligent agent can be used to call the testing framework to execute the test cases in the testing strategy according to the execution order of the test cases in the testing strategy. During the interface testing process, environmental parameters of the testing environment and parameters of the interface to be tested (e.g., response time, status code, and error information) can also be collected in real time. By combining the intelligent agent decision engine with the AI large model and reinforcement learning algorithm, the execution order of the test cases can be adjusted to improve testing efficiency and coverage.
[0047] Through the above steps, in this embodiment, a test strategy is dynamically generated by an intelligent agent decision engine based on interface testing environment parameters. The interface to be tested is then tested based on this strategy. The test strategy can also be adjusted during the testing process. This avoids the high manual maintenance costs associated with testing interfaces using predefined test scripts in related technologies, thus achieving a reduction in the manual costs of interface testing. Furthermore, it solves the technical problem of high test script maintenance costs in related technologies that use test scripts for automated interface testing.
[0048] Optionally, after receiving the test task through the agent decision engine, the method further includes: determining agent workflow tasks, wherein the agent workflow tasks include at least one of the following: a task for generating a test strategy, a task for executing test cases, a task for analyzing test results, and a task for adjusting the test strategy; and allocating the agent workflow tasks to multiple agents, wherein the multiple agents process the agent workflow tasks based on the priority and load balancing strategy of the agent workflow tasks.
[0049] When the agent decision engine receives the test task instruction from the user interface, it can determine a series of agent workflow tasks. The agent workflow tasks can be divided into the following categories: (1) Tasks for generating test strategies: This task may involve analyzing the interface definition file and determining the scope, type, and execution order of test cases. The agent can generate the best test strategy based on these definitions to ensure the comprehensiveness and efficiency of the test. (2) Tasks for executing test cases: (3) Tasks for executing specific test cases according to the generated test strategy, using an automated testing framework to simulate various requests, and evaluating the response of the test interface. Tasks for analyzing test results: After the test cases are executed, the test results can be analyzed in depth, including identifying failed test cases, analyzing possible causes of failure, and generating detailed test reports. (4) Tasks for adjusting test strategies: Based on the feedback of test results, the agent can evaluate the effectiveness of the current test strategy and adjust the strategy when necessary, such as optimizing the test case generation algorithm or execution order, to improve test coverage and efficiency.
[0050] After determining the workflow tasks of the agents, these tasks can be assigned to multiple agents for execution. Task assignment is based on two main principles: (1) Task priority: Different workflow tasks have different priorities. For example, the task of generating test strategies usually needs to be processed first to ensure that subsequent tests can proceed smoothly. Tasks can be sorted according to their urgency and importance to ensure that high-priority tasks are processed in a timely manner. (2) Load balancing strategy: In order to make reasonable use of system resources and prevent some agents from being overloaded while others are idle, a load balancing strategy can be used to allocate tasks. Different types of tasks can be assigned to agents that are good at handling the task, or the task allocation can be dynamically adjusted according to the current load of the agents to ensure efficient use of resources.
[0051] Through the above process, the intelligent agent decision engine can effectively manage the automated testing process, ensuring the efficient execution of test tasks and the reasonable allocation of resources, thereby improving the overall efficiency and intelligence level of interface automated testing.
[0052] In one optional example, a priority queue can be maintained, containing all pending tasks. High-priority tasks can be retrieved and assigned to agents first. While an agent is executing a task, its state (such as whether it is idle, the type of task it is processing, etc.) can be monitored in real time. When an agent completes its current task or becomes idle, it can be immediately assigned the next task. During testing, if a certain type of test case is found to be particularly important or time-consuming, task priorities can be dynamically adjusted to ensure these tasks are executed first. Simultaneously, if an agent's execution efficiency is low, the number of tasks assigned to it can be temporarily reduced, or its tasks can be transferred to other agents with higher execution efficiency.
[0053] By decomposing test tasks into agent workflow tasks and allocating them to agents based on priority and load balancing strategies, the test process is highly automated, ensuring the comprehensiveness and accuracy of the tests while reducing resource waste and improving the response speed of the test system.
[0054] In one alternative example, agent workflow orchestration is the core function of the system. Dynamic scheduling and task allocation of agents are achieved through target tools (AI models or tools based on generative pre-trained transformers). The implementation process is divided into three stages: workflow definition, workflow scheduling, and workflow monitoring and optimization, as detailed below:
[0055] Workflow Definition Phase: This phase allows you to define the workflow tasks for the intelligent agent, including test case generation, test execution, result analysis, and optimization. Each task consists of multiple sub-tasks; for example, the test case generation task includes data loading, test case generation, and test case optimization. Workflow definitions use JSON (JavaScript Object Notation, a lightweight data interchange format). Example code is shown below:
[0056]
[0057] Workflow scheduling phase: Tasks are dynamically allocated to the agent through a scheduler. The scheduler allocates tasks based on task priority and resource availability, supporting concurrent execution to improve efficiency. The scheduling algorithm employs priority queues and load balancing strategies to ensure that high-priority tasks are executed first. For example, it may include the following:
[0058] (1) Schedule workflow tasks to the agent:
[0059] Workflow definition (including tasks, priorities, and dependencies);
[0060] Determine the list of available agents;
[0061] Determine the maximum number of concurrent tasks for each agent;
[0062] (2) Initialize the data structure:
[0063] Initialize the task priority queue (the smaller the priority value, the higher the priority);
[0064] Initialize the task state of each agent;
[0065] Initialize the task's dependencies;
[0066] (3) Parse the workflow, build the task queue and dependencies:
[0067] (4) Scheduling tasks:
[0068] Retrieve the highest priority task from the task queue;
[0069] Check if the task dependencies are satisfied;
[0070] If the dependency is not satisfied, put the task back into the queue;
[0071] (5) Find available agents:
[0072] Assign tasks to intelligent agents;
[0073] If no agent is available, put the task back into the queue;
[0074] (6) Shut down the thread pool.
[0075] Optionally, after assigning the agent workflow task to multiple agents, the method further includes: obtaining execution status data of the agent workflow task, wherein the execution status data includes at least one of the following: task completion rate, task execution time, and resource utilization rate; and adjusting the processing strategy of the agent workflow task based on the execution status data in the event of an abnormality in the processing of the agent workflow task.
[0076] After assigning tasks to multiple agents, the status of the agents executing tasks can be continuously monitored, and relevant status data can be collected and analyzed. For example, (1) Task completion rate: measures how many test cases have been executed and their execution results (success or failure); (2) Task execution time: records the execution time of each test case or task to evaluate the processing speed of the agents and the overall testing efficiency of the system; (3) Resource utilization: monitors the usage of system resources (such as CPU, memory, GPU (Graphics Processing Unit)) used by the agents during runtime, including average utilization and peak utilization, in order to analyze whether the resource allocation is reasonable and whether there are resource bottlenecks.
[0077] When an abnormality is detected in the execution of a task in the agent workflow, such as task timeout, resource overload, or agent failure, dynamic adjustments can be made based on the collected execution status data to restore the normal operation of the test process. The adjustment strategies may include: (1) Intelligent weight scheduling: Reassign tasks that are slow or fail due to insufficient resources to agents with more resources to ensure that tasks can be completed in a timely and successful manner; (2) Task priority adjustment: Adjust the priority of tasks according to the task execution time and resource utilization, give higher priority to resource-intensive tasks to avoid resource bottlenecks; at the same time, reduce the priority of tasks with abnormal execution time to facilitate troubleshooting; (3) Resource optimization and allocation: Analyze resource utilization data, identify imbalances in resource allocation, and dynamically adjust resource allocation strategies, such as increasing the number of GPU nodes or adjusting the number of concurrently executed tasks to improve overall test efficiency; (4) Anomaly detection and recovery: When an agent fails, the faulty agent can be automatically detected and recovered, or the tasks on the faulty agent can be reassigned to other agents to ensure the continuity and stability of the test process.
[0078] Through the above mechanism, various abnormal situations can be responded to intelligently, test strategies can be dynamically adjusted, test tasks can be executed efficiently, resource waste can be minimized, and the overall performance and reliability of the test system can be improved.
[0079] In one optional example, the workflow monitoring and optimization phase of the intelligent agent workflow orchestration can ensure the efficiency and stability of the testing process by dynamically adjusting task allocation strategies through real-time monitoring of task execution status. Key monitoring metrics can include task completion rate, execution time, and resource utilization, which can be acquired and stored in real-time through a data acquisition module. Task completion rate reflects the overall progress of the test tasks, execution time can be used to evaluate the efficiency of individual tasks, and resource utilization measures the usage of system hardware resources (such as CPU, memory, and network). When task execution anomalies are detected (such as task timeouts or resource overload), tasks can be automatically reassigned or execution strategies adjusted to avoid task backlog or resource waste. For example, if a task times out due to insufficient resources, it can be reassigned to a node with sufficient resources; when resource utilization is below a threshold, more tasks can be dynamically allocated to improve resource utilization efficiency. This intelligent monitoring and optimization mechanism not only improves the stability of the testing process but also provides an efficient solution for complex testing scenarios.
[0080] Optionally, during the interface testing of the system under test based on the testing strategy, the process further includes: obtaining test termination conditions, wherein the test termination conditions include: multiple preset thresholds; calling the testing framework, executing test cases in the test case set based on the execution order, and determining whether the test data generated during the interface testing process meets the test termination conditions; if the test termination conditions are met, determining the test results of the system under test based on the test data generated during the testing process and generating a test report.
[0081] Test termination conditions may include, but are not limited to: (1) Failure rate threshold: setting a failure rate threshold for a test case, such as when the failure rate reaches 10%; (2) Response time threshold: the average or maximum response time of the interface, such as when the average response time exceeds 5 seconds; (3) Preset test time: the total execution time of the test task, such as exceeding 3 hours. In an optional example, the above test termination conditions can be dual threshold conditions, for example, terminating the test when the failure rate is greater than the first threshold (e.g., 10%) and the response time exceeds the second preset threshold (e.g., 5 seconds). It should be noted that the thresholds are preset in the system configuration and can be adjusted at any time according to test requirements and environmental changes.
[0082] During the testing of the interface under test, test data can be continuously tracked and analyzed in real time. For example, test cases can be executed through a testing framework, following the execution order generated by the agent's decision engine, and concurrent testing can be supported to improve testing efficiency. When executing each test case, relevant test data can be collected, including test results (success / failure), response time, and resource usage. After collecting this data, it can be analyzed to determine whether the test termination conditions are met. For example, if during testing, the failure rate suddenly exceeds a preset 10% and the average response time reaches more than 5 seconds, then the test can be determined to have met the termination conditions and should be stopped immediately to avoid continuing to execute invalid or inefficient test cases, thus saving time and resources.
[0083] When the test termination condition is triggered, the execution of all ongoing test cases can be stopped, no new test instances will be started, and the test results of the system under test can be determined based on the test data that has been generated. For example, (1) Summarize test data: calculate the total number of test cases, the number of passes, the number of failures, the number of skips, and the average and longest response times, etc.; (2) Analyze test results: evaluate key indicators such as test coverage, stability, and performance, and identify the problem patterns and trends of failed test cases; (3) Generate test report: compile the summarized data and analysis results into a detailed test report, which may include: test overview, test details, failure analysis, performance evaluation, and possible resource usage statistics.
[0084] Once the report is generated, it can be sent to the test initiator, and the test results can be communicated via email notification, interface display, or API response.
[0085] When the preset test objectives are achieved, the test process should be terminated in a timely manner to avoid unnecessary resource consumption. At the same time, the test results can be quickly fed back to provide data support for subsequent system optimization and troubleshooting.
[0086] Optionally, after performing interface testing on the system under test based on the testing strategy and adjusting the testing strategy based on the test data generated during the interface testing process, the method further includes: retraining the target model based on the testing strategy, the test results, and the test data generated during the interface testing process to obtain the trained target model.
[0087] During testing, various test data may be collected in real time, including but not limited to the execution results of test cases (such as pass rate and failure rate), the response time of each interface, and resource usage (such as CPU utilization and memory usage). This data will be continuously stored and analyzed to evaluate the effectiveness of the testing strategy and identify potential problems encountered during testing.
[0088] After collecting test data, the testing strategy can be adjusted based on this data. For example, if the failure rate of a certain type of test case is found to be higher than expected, it can be decided to increase the number of such test cases or prioritize their execution in future tests. Alternatively, if the execution time of some test cases is too long, it may be necessary to optimize the execution order of these test cases to reduce the overall testing time.
[0089] After adjusting the testing strategy, the AI model (target model) that generated the testing strategy can be retrained based on the latest testing strategy and results, as well as all test data from the interface testing process. Retraining is a crucial step in model learning and self-improvement. Through machine learning (such as deep learning) or reinforcement learning algorithms, the model can learn new patterns and rules from the test data, thereby generating more effective testing strategies in the future.
[0090] For example, within the framework of reinforcement learning, a model can treat testing strategies as "actions" and test results as "rewards." Through multiple iterations of learning, the model attempts to find a series of "action" strategies that maximize test coverage and efficiency. Specifically, after each test, the model can update its internal Q-table (used to store the expected rewards for the agent taking different actions in different states, i.e., recording the effect of test execution) to reflect the expected test results under different testing strategies. Through continuous trial and learning, the model gradually optimizes its strategy generation algorithm, improving the quality and adaptability of testing strategies.
[0091] Finally, through the retraining process, an updated target model can be obtained. The new model can be immediately applied to the next round of testing, or, after further validation and testing, deployed as the official version to the production environment.
[0092] The model retraining mechanism based on test data feedback is the core of achieving continuous optimization of test strategies and self-improvement of automated testing systems. It not only improves testing efficiency and coverage but also ensures that test strategies remain highly adaptable and effective as the system changes and requirements evolve. Through continuous iteration and learning, the model can gradually master more complex test logic, better adapt to the ever-changing test environment, and provide a more intelligent and efficient solution for interface automated testing.
[0093] Optionally, environmental parameters are input into the target model to obtain a testing strategy, including: inputting environmental parameters into the target model and generating a test case set using a reinforcement learning strategy; determining the execution order of test cases in the test case set based on a preset reward function; and determining the testing strategy based on the test case set and the execution order.
[0094] For example, after receiving environmental parameters, the target model (e.g., a reinforcement learning model based on a value function) can generate a test policy based on a reinforcement learning algorithm.
[0095] For example, an agent learns to choose the optimal action in different states by interacting with environmental parameters. In this context, the agent's goal is to generate a set of test cases that maximizes test coverage and efficiency. The target model can consider interface definitions, dependencies, historical performance of test cases, etc., to generate a set of test cases. In an optional example, a combinatorial testing algorithm can also be used to generate the test case set.
[0096] The target model can dynamically adjust the execution order of test cases using test coverage and execution efficiency as reward signals. For example, based on a preset reward function (e.g., reward function R = 0.7 × coverage + 0.3 × execution efficiency), the target model can assign an expected reward value to each test case in the test case set based on the test coverage and the execution efficiency predicted by the model. Then, the model can adjust the execution order of the test cases according to these expected reward values. The model can prioritize executing test cases with larger expected reward values (i.e., higher test coverage or faster execution speed) to improve testing efficiency while ensuring that important test points are covered first. Finally, based on the generated test case set and the optimized execution order, the final testing strategy is formed.
[0097] In one optional example, a reinforcement learning model based on a value function (corresponding to the target model) can be constructed. The state space is defined as the historical test case set, the actions are weight adjustment strategies (e.g., "increase the weight of the parameter combination by 5%), and the reward function is: R = 0.7 × coverage + 0.3 × execution efficiency. The Q-value table is updated after each round of testing to continuously optimize the test case generation strategy.
[0098] Optionally, receiving test tasks through the agent decision engine includes: receiving test tasks through the agent decision engine based on a first interface; after receiving test tasks through the agent decision engine, it further includes: querying the execution status of test tasks based on a second interface.
[0099] The first interface can be a RESTful (Representational State Transfer) API (Application Programming Interface) endpoint, used to receive test task requests. This endpoint can be defined as ` / api / test / start`, receiving POST (for submitting data to a specified resource) requests. Request parameters may include the interface definition file of the system under test, a test strategy description, resource requirements (such as the number of GPUs), etc. Users or automated test scripts can submit test tasks to the agent decision engine by calling the first interface.
[0100] The second interface can also be a RESTful API endpoint used to query the execution status of test tasks. This endpoint can be defined as ` / api / test / status` and accepts GET requests (for requesting data or resources). Request parameters may include a unique identifier for the test task (`task_id`) to determine the specific test task to query.
[0101] After the test task begins execution, users or monitoring systems can query the execution status of the test task in real time by calling the second interface, including test progress, currently executing test cases, test results (pass / fail), resource usage, etc. The information returned by the second interface may be a JSON format response, which contains detailed execution information of the test task.
[0102] Standardized API interfaces, such as submitting test tasks via the POST method and viewing task status via the GET method, enable efficient reception and processing of test tasks. At the same time, it allows users or monitoring systems to track the execution status of test tasks in real time, ensuring smooth testing and timely feedback.
[0103] In this embodiment, through intelligent agent workflow orchestration and dynamic scheduling mechanisms, the entire process from test case generation and test execution to result analysis is automated, significantly improving testing efficiency. Real-world testing shows that the testing cycle is shortened from 2 days using traditional methods to 4 hours, with an efficiency improvement of over 80%. Simultaneously, the intelligent agent scheduling engine dynamically allocates tasks and optimizes resource utilization by monitoring the intelligent agent status and task load in real time, reducing resource idle rate by 30% and improving task execution efficiency by 40%.
[0104] The intelligent agent can generate high-coverage test case sets based on combined testing algorithms and dynamically optimize the test case generation strategy through reinforcement learning, increasing test coverage from 75% to over 95% compared to traditional methods, effectively reducing the risk of missed tests. Furthermore, by monitoring the test execution process in real time and dynamically adjusting the testing strategy based on dual threshold conditions (such as failure rate and response time), the intelligent agent ensures the accuracy and reliability of test results, improving problem localization accuracy from 70% to over 90% compared to traditional methods.
[0105] Example 2
[0106] Embodiment 2 of the present invention provides an optional interface testing system, which can be used to execute the interface testing method provided in Embodiment 1 of the present invention.
[0107] Figure 2 This is a schematic diagram of an optional interface testing system according to an embodiment of the present invention, such as... Figure 2 As shown, the interface testing system provided in Embodiment 2 of the present invention includes: a user interface and interaction module, used to receive test tasks submitted by users and send the test tasks to the intelligent agent decision engine; an intelligent agent decision engine, used to receive test tasks, respond to test tasks, obtain parameters of the test environment, obtain environment parameters, and input the environment parameters into the target model to obtain a test strategy, wherein the test strategy includes: a test case set and the execution order of multiple test cases in the test case set, and the type of the target model includes: a large language model; a test execution and monitoring module, used to perform interface testing on the system under test based on the test strategy and monitor the test process; the intelligent agent decision engine is also used to adjust the test strategy based on the test data generated during the test process.
[0108] Intelligent agents, as AI systems capable of autonomous planning, tool invocation, memory, and action, possess the ability to handle complex business processes, significantly improving the efficiency and intelligence of interface testing. The interface testing system provided in this embodiment consists of several core modules, including: an intelligent agent decision engine, a test execution and monitoring module, a strategy learning and optimization module, and a user interface and interaction module. These modules communicate via standardized APIs, forming a complete closed loop from test case generation to test result analysis. The intelligent agent decision engine is responsible for dynamically generating test strategies and optimizing the execution order; the test execution and monitoring module is responsible for automatically executing test cases and monitoring the testing process in real time; the strategy learning and optimization module continuously optimizes test strategies by collecting test data; and the user interface and interaction module provides a RESTful API and a web interface (a user interface accessible and interacted with via a browser), supporting users in submitting test tasks and viewing progress. Through the collaborative work of these modules, this system achieves fully automated and intelligent interface testing, significantly reducing testing costs and improving testing efficiency.
[0109] The agent decision engine is the core module of this system, capable of dynamically generating test strategies and optimizing the execution order of test cases within those strategies. Its functions include generating test strategies based on agent technology and dynamically adjusting test priorities by perceiving the test environment. Technically, the agent decision engine can include an environment perception submodule and a strategy generation submodule. The environment perception submodule can collect interface test data in real time, such as response time, status codes, and error messages, and obtain system resource status, such as CPU and memory usage, through API monitoring tools. The strategy generation submodule can generate optimal test strategies based on existing test cases, combining AI large-scale models (corresponding to the target model) and reinforcement learning algorithms (such as Q-Learning), dynamically adjusting the execution order of test cases with test coverage and execution efficiency as reward signals. The input to the agent decision engine can be interface test environment data (corresponding to environment parameters), and the output is the optimized test strategy, including the execution order and priority of test cases. Through the agent decision engine, the system can dynamically adjust test strategies based on real-time environment data, significantly improving test efficiency and coverage.
[0110] The test execution and monitoring module automates the execution of test cases and monitors the testing process in real time. Its functions include automated test case execution, intelligent determination of test termination conditions, and dynamic adjustment of resource allocation strategies. Technically, this module can include a test execution submodule and a monitoring and termination submodule. The test execution submodule calls the test framework to execute test cases and supports concurrent testing to improve efficiency. The monitoring and termination submodule collects test metrics in real time, such as pass rate, failure rate, and response time, and sets dual threshold conditions, for example, terminating the test when the failure rate exceeds 10% and the response time exceeds 5 seconds. The test execution and monitoring module takes test strategies (including test case sets and execution order) as input and outputs test results (e.g., a test report), which may include metrics such as pass rate, failure rate, and response time. Through the test execution and monitoring module, test cases can be executed automatically and the testing process can be monitored in real time, ensuring the efficiency and reliability of the test.
[0111] The user interface and interaction module provides a RESTful API and web interface, allowing users to submit test tasks and view their progress. Its functionality includes providing API and web interface support for user operations. Technically, this module may include a standardized API interface, for example, submitting test tasks via the POST method and viewing task status via the GET method. Through the user interface and interaction module, users can easily submit test tasks and view test progress in real time, improving the system's usability and interactivity.
[0112] like Figure 2As shown, the interface testing system may also include a strategy learning and optimization module. This module is responsible for collecting test process data and continuously optimizing test strategies and verification rules. Its functions include collecting test data and continuously optimizing test strategies. Technically, this module is divided into a data collection submodule and an offline training submodule. The data collection submodule records the test case set, execution order, and test results for each test, providing data support for subsequent optimization. The offline training submodule builds and trains an AI model (corresponding to the target model) based on the test results and recommends the optimal test strategy. Through the strategy learning and optimization module, the system can learn from historical test data and continuously optimize test strategies, significantly improving the intelligence and adaptability of the tests.
[0113] Figure 3 This is a software flowchart of an optional interface test according to an embodiment of the present invention, such as... Figure 3 As shown, the software flow of the system provided in this embodiment includes four main steps: initialization and data loading, agent decision generation, automated testing and monitoring, and closed-loop feedback and optimization. In the initialization and data loading phase, test tasks can be submitted via API, and the system loads the interface definition file. In the agent decision generation phase, the agent decision engine can generate optimized test strategies based on environmental data. In the automated testing and monitoring phase, the test execution and monitoring module can execute test cases and monitor the testing process in real time, generating test reports. In the closed-loop feedback and optimization phase, the strategy learning and optimization module can adjust the test strategy based on the test results and iteratively optimize it. Through the above process, the system can achieve fully automated and intelligent interface testing, significantly improving test efficiency and coverage.
[0114] Figure 4 This is an architecture diagram of an optional interface testing system according to an embodiment of the present invention, such as... Figure 4 As shown, it includes: client, access layer, application service layer, intelligent agent and model layer, infrastructure layer and data persistence layer.
[0115] It should be noted that the intelligent agent in this embodiment can be generated based on a large AI model, and the interface testing system provided in this embodiment can be deployed on a server cluster equipped with high-performance computing nodes.
[0116] For example, the hardware environment can use an 8-card target server with 256GB of video memory, each node can be configured with no less than 512GB of memory, and the CPU can have no less than 32 cores. The storage system needs to use a distributed file system to meet the storage and retrieval requirements of large-scale training data.
[0117] The software environment can install preset versions of specified programming language systems, and the deep learning framework needs to meet preset training speeds and inference efficiency. For hardware monitoring, hardware devices (e.g., processors) can have specified system management and monitoring tools installed, and graphics processing units (GPUs) can be configured with drivers for monitoring and managing the GPU. Engineering support modules rely on specified Python libraries for code detection, and data processing and analysis libraries for handling structured data. Furthermore, the system can be configured with a Redis caching service to accelerate data access, and system monitoring and alerting tools can be installed for real-time monitoring of system performance.
[0118] In this embodiment, the process of generating test cases for intelligent agents is divided into three stages.
[0119] 1. Data Preparation Phase: Collect and standardize the storage of API definition data. Taking a RESTful API as an example, this requires organizing information such as the API path, request method, parameters, and response format. Data files are in JSON format by default, with each API definition stored as a separate file.
[0120] 2. Test Case Generation Phase: A test case set is generated using a combined testing algorithm.
[0121] 3. Test Case Optimization Phase: Construct a reinforcement learning model based on the value function. Define the state space as the historical test case set, the actions as weight adjustment strategies (e.g., "increase the weight of the parameter combination by 5%), and the reward function R = 0.7 × coverage + 0.3 × execution efficiency. Update the Q-value table after each round of testing to continuously optimize the test case generation strategy.
[0122] 4. Intelligent Agent Test Execution and Monitoring: This function automates the execution of test cases and monitors the testing process in real time, ensuring efficient task execution and timely handling of anomalies. During test execution, the system automatically assigns tasks and executes tests based on the generated test case set. During test monitoring, the system collects test metrics (such as pass rate, failure rate, and response time) in real time and sets dual threshold conditions (e.g., terminating the test when the failure rate exceeds 10% and the response time exceeds 5 seconds). This monitoring data is stored through system monitoring and alerting tools and displayed through visualization tools, allowing testers to understand the test status in real time. For example, when the pass rate is lower than expected, the system issues an alert and prompts testers to check test cases or environment configurations; when the response time exceeds the threshold, the system automatically terminates the test and generates an anomaly report. During test termination, when the termination conditions are met, the system automatically saves the test results and generates a test report, including key metrics such as pass rate, failure rate, and response time. Furthermore, the system supports pausing, resuming, and terminating test tasks, ensuring the flexibility and controllability of the testing process. This intelligent test execution and monitoring mechanism not only improves the efficiency of test task execution, but also provides a reliable solution for complex test scenarios.
[0123] 5. User Interface Module: Provides multi-dimensional human-computer interaction channels, offering a convenient entry point for user interaction with the system. First, the system is designed with RESTful APIs conforming to the OpenAPI 3.0 specification (an open standard interface definition language and framework for describing RESTful APIs), supporting the start, query, and termination of test tasks. For example, users can start test tasks via the POST / api / test interface (corresponding to the first interface), query task progress via the GET / api / status interface (corresponding to the second interface), and terminate running tasks via the DELETE / api / task interface. These interfaces support not only independent operations on single tasks but also concurrent processing of batch tasks. Second, the system provides a command-line tool that supports batch operations and the execution of automated scripts. The command-line tool integrates functions such as auto-completion and command history query, and supports JSON / YAML configuration files, facilitating quick configuration and start of test tasks. Furthermore, the system also provides a graphical web interface, using an intuitive interface and rich visualization charts to help users easily manage test tasks and view test results. This multi-dimensional user interface design not only improves the system's usability but also provides flexible operating methods for different user groups, ensuring that the system can be widely applied to various testing scenarios.
[0124] Example 3
[0125] Embodiment 3 of the present invention provides an optional interface testing device, wherein each implementation unit in the interface testing device corresponds to each implementation step in Embodiment 1.
[0126] Figure 5 This is a schematic diagram of an optional interface testing apparatus according to an embodiment of the present invention, such as... Figure 5 As shown, the interface testing device includes: a receiving unit 51, a first acquisition unit 52, a first processing unit 53, and a second processing unit 54.
[0127] The receiving unit 51 is used to receive test tasks through the intelligent agent decision engine, wherein the test tasks are used to request interface testing of the system to be tested.
[0128] The first acquisition unit 52 is used to respond to the test task, acquire the parameters of the test environment, and obtain the environment parameters. The test environment includes an environment for performing interface testing on the system under test.
[0129] The first processing unit 53 is used to input environmental parameters into the target model to obtain a test strategy. The test strategy includes a test case set and the execution order of multiple test cases in the test case set. The type of the target model includes a large language model.
[0130] The second processing unit 54 is used to perform interface testing on the system under test based on the test strategy, and to adjust the test strategy based on the test data generated during the interface testing process.
[0131] In the interface testing apparatus provided in Embodiment 3 of the present invention, the receiving unit 51 can receive test tasks through an intelligent agent decision engine. The test task requests interface testing of the system under test. The first acquisition unit 52 responds to the test task, acquiring parameters of the test environment to obtain environment parameters. The test environment includes an environment for performing interface testing on the system under test. The first processing unit 53 inputs the environment parameters into a target model to obtain a test strategy. The test strategy includes a test case set and the execution order of multiple test cases within the test case set. The type of the target model includes a large language model. The second processing unit 54 performs interface testing on the system under test based on the test strategy and adjusts the test strategy based on the test data generated during the interface testing process. This solves the technical problem in related technologies where test scripts are used for automated interface testing, resulting in high maintenance costs for the test scripts. In this embodiment, a test strategy is dynamically generated by an intelligent agent decision engine based on interface test environment parameters, and the interface to be tested is tested based on the test strategy. The test strategy can also be adjusted during the test, which avoids the high manual maintenance cost of test scripts in related technologies, thereby achieving the technical effect of reducing the manual cost of interface testing.
[0132] Optionally, in the interface testing apparatus provided in this embodiment of the invention, the interface testing apparatus further includes: a determining unit, configured to determine an agent workflow task after receiving a test task through an agent decision engine, wherein the agent workflow task includes at least one of the following: a task for generating a test strategy, a task for executing test cases, a task for analyzing test results, and a task for adjusting the test strategy; and an allocation unit, configured to allocate the agent workflow task to multiple agents, wherein the multiple agents are used to process the agent workflow task based on the priority and load balancing strategy of the agent workflow task.
[0133] Optionally, in the interface testing apparatus provided in this embodiment of the invention, the interface testing apparatus further includes: a second acquisition unit, configured to acquire execution status data of the intelligent agent workflow task after allocating the intelligent agent workflow task to multiple intelligent agents, wherein the execution status data includes at least one of the following: task completion rate, task execution time, and resource utilization rate; and an adjustment unit, configured to adjust the processing strategy of the intelligent agent workflow task based on the execution status data in the event of an abnormality in the processing of the intelligent agent workflow task.
[0134] Optionally, in the interface testing apparatus provided in this embodiment of the invention, the second processing unit further includes: an acquisition subunit, used to acquire test termination conditions during interface testing of the system under test based on a test strategy, wherein the test termination conditions include: multiple preset thresholds; a first processing subunit, used to call a test framework, execute test cases in the test case set based on the execution order, and determine whether the test data generated during the interface testing process meets the test termination conditions; and a first determination subunit, used to determine the test results of the system under test and generate a test report based on the test data generated during the testing process, provided that the test termination conditions are met.
[0135] Optionally, in the interface testing apparatus provided in the embodiments of the present invention, the interface testing apparatus further includes: a training unit, used to perform interface testing on the system to be tested based on the testing strategy, and after adjusting the testing strategy based on the test data generated during the interface testing process, to retrain the target model based on the testing strategy, the test results, and the test data generated during the interface testing process, so as to obtain the trained target model.
[0136] Optionally, in the interface testing apparatus provided in this embodiment of the invention, the first processing unit includes: a second processing subunit, used to input environmental parameters into the target model and generate a test case set using a reinforcement learning strategy; a second determining subunit, used to determine the execution order of the test cases in the test case set based on a preset reward function; and a third determining subunit, used to determine a testing strategy based on the test case set and the execution order.
[0137] Optionally, in the interface testing apparatus provided in this embodiment of the invention, the first receiving unit includes: a first receiving subunit, used to receive a test task through an intelligent agent decision engine based on a first interface; the interface testing apparatus further includes: a query unit, used to query the execution status of the test task based on a second interface after receiving the test task through the intelligent agent decision engine.
[0138] The aforementioned interface testing device may also include a processor and a memory. The aforementioned receiving unit 51, first acquisition unit 52, first processing unit 53, and second processing unit 54 are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0139] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, a test strategy is dynamically generated by an intelligent agent decision engine based on interface test environment parameters. The interface to be tested is then tested based on this strategy. The test strategy can be adjusted during the testing process. This avoids the high manual maintenance costs associated with predefined test scripts used in related technologies, thus achieving a significant reduction in the manual costs of interface testing.
[0140] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0141] According to another aspect of the present invention, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the interface testing method of any of the above via executing the executable instructions.
[0142] According to another aspect of the present invention, a computer-readable storage medium is also provided, which stores a computer program, wherein the computer program controls the device where the computer-readable storage medium is located to execute the interface testing method described above when it is running.
[0143] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention, such as... Figure 6 As shown, an embodiment of the present invention provides an electronic device 60, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the interface testing method of any of the above-mentioned methods.
[0144] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0145] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0146] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0148] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0150] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An interface testing method, characterized in that, include: The test task is received through the intelligent agent decision engine, wherein the test task is used to request interface testing of the system to be tested; In response to the test task, the parameters of the test environment are obtained, and the environment parameters are obtained. The test environment includes an environment for performing interface testing on the system under test. The environmental parameters are input into the target model to obtain the test strategy, wherein the test strategy includes: a test case set and the execution order of multiple test cases in the test case set, and the type of the target model includes: a large language model; The system under test is subjected to interface testing based on the aforementioned testing strategy, and the testing strategy is adjusted based on the test data generated during the interface testing process.
2. The interface testing method according to claim 1, characterized in that, After receiving the test task through the agent decision engine, it also includes: The intelligent agent workflow tasks are defined, wherein the intelligent agent workflow tasks include at least one of the following: a task for generating the test strategy, a task for executing the test cases, a task for analyzing the test results, and a task for adjusting the test strategy; The agent workflow task is assigned to multiple agents, wherein the multiple agents are used to process the agent workflow task based on the priority and load balancing strategy of the agent workflow task.
3. The interface testing method according to claim 2, characterized in that, After assigning the agent workflow tasks to multiple agents, the method further includes: Obtain the execution status data of the intelligent agent workflow task, wherein the execution status data includes at least one of the following: task completion rate, task execution time, and resource utilization rate; In the event of an anomaly in the processing of the agent workflow task, the processing strategy for the agent workflow task is adjusted based on the execution status data.
4. The interface testing method according to claim 1, characterized in that, The process of performing interface testing on the system under test based on the aforementioned testing strategy also includes: Obtain test termination conditions, wherein the test termination conditions include: multiple preset thresholds; The test framework is invoked, and the test cases in the test case set are executed based on the execution order. It is then determined whether the test data generated during the interface test meets the test termination condition. If the test termination conditions are met, the test results of the system under test are determined and a test report is generated based on the test data generated during the test.
5. The interface testing method according to claim 4, characterized in that, After performing interface testing on the system under test based on the aforementioned testing strategy, and adjusting the testing strategy based on the test data generated during the interface testing process, the method further includes: Based on the test strategy, the test results, and the test data generated during the interface test, the target model is retrained to obtain the trained target model.
6. The interface testing method according to claim 1, characterized in that, The environmental parameters are input into the target model to obtain the testing strategy, including: The environmental parameters are input into the target model, and the test case set is generated using a reinforcement learning strategy. Based on a preset reward function, the execution order of test cases in the test case set is determined; The testing strategy is determined based on the test case set and the execution order.
7. The interface testing method according to claim 1, characterized in that, Receiving test tasks through the agent decision engine includes: receiving the test tasks through the agent decision engine based on the first interface; After receiving the test task through the intelligent agent decision engine, the process also includes: querying the execution status of the test task based on the second interface.
8. An interface testing system, characterized in that, The interface testing system is used to execute the interface testing method according to any one of claims 1 to 7, including: The user interface and interaction module is used to receive test tasks submitted by users and send the test tasks to the intelligent agent decision engine. The intelligent agent decision engine is used to receive test tasks, respond to the test tasks, obtain parameters of the test environment, obtain environment parameters, and input the environment parameters into the target model to obtain a test strategy. The test strategy includes a test case set and the execution order of multiple test cases in the test case set. The type of the target model includes a large language model. The test execution and monitoring module is used to perform interface testing on the system under test based on the test strategy and to monitor the test process. The agent decision engine is also used to adjust the test strategy based on the test data generated during the testing process.
9. An interface testing device, characterized in that, include: A receiving unit is used to receive test tasks through an intelligent agent decision engine, wherein the test tasks are used to request interface testing of the system to be tested; The first acquisition unit is used to respond to the test task, acquire parameters of the test environment, and obtain environment parameters, wherein the test environment includes: an environment for performing interface testing on the system under test; The first processing unit is used to input the environmental parameters into the target model to obtain a test strategy, wherein the test strategy includes: a test case set and the execution order of multiple test cases in the test case set, and the type of the target model includes: a large language model; The second processing unit is used to perform interface testing on the system under test based on the test strategy, and to adjust the test strategy based on the test data generated during the interface testing process.
10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the interface testing method according to any one of claims 1 to 7.