Interface testing method and device, computer equipment and storage medium
By obtaining interface data of the financial insurance service system, generating and optimizing automatic test scripts, combining verification strategies and chaotic particle swarm algorithms, efficient and accurate interface testing is achieved, solving the problems of inefficient testing and insufficient accuracy in the existing technology.
Patent Information
- Application Number
- CN202510013216.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is inefficient in interface testing of financial insurance service systems, and the accuracy of the test results is low. It is mainly due to the reliance on manual recording of scripts, which is time-consuming and labor-intensive, error-prone, and the consistency and repeatability of the test scripts are difficult to guarantee.
An interface testing method is proposed, by obtaining the interface data of the target business system, generating an automatic test script using a script recording tool, and thread allocation optimization processing is performed based on the target chaotic particle swarm algorithm to obtain the target test script. Then, the target test script is verified based on the preset verification strategy. If the verification is passed, the preconfigured test environment is obtained, and the target test script is tested in this environment to obtain the test results.
Through the automated interface testing process, the efficiency of interface testing is significantly improved, the accuracy and consistency of test results are ensured, and the security and stability of the target business system are enhanced.
Smart Images

Figure CN119938536A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence development technology and the field of financial technology, and in particular to interface testing methods, devices, computer equipment and storage media. Background Art
[0002] In the field of financial insurance services, the performance and stability of the system are crucial to ensuring business continuity and customer trust. Traditional performance stress testing methods, as a key means of evaluating the performance of the system under high load conditions, have long relied on manually recorded scripts for simulated operations. The basic process of this method is that the tester first manually operates the various functional modules of the financial insurance service system according to business needs, and records this series of operation steps through a recording tool to form an automated test script. For example, a typical test process may involve a series of orderly steps such as user login (operation A), selection of insurance products (operation B), and submission of insurance information (operation C).
[0003] However, with the increasing complexity and functional diversification of financial insurance service systems, this traditional testing method has gradually exposed significant limitations. On the one hand, financial insurance service systems often integrate hundreds or even thousands of functions, covering multiple links from user registration, product browsing, premium calculation, claim application to customer service. Faced with such a large set of functions, testers need to spend a lot of time recording each operation step one by one. This process is not only time-consuming and labor-intensive, but also prone to errors and low testing efficiency. On the other hand, since the manual recording script method is highly dependent on the experience and skill level of the tester, there may be problems such as operating habits and understanding differences between different testers, which makes it difficult to ensure the consistency and repeatability of the test script, resulting in low accuracy of the test results. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose an interface testing method, apparatus, computer equipment and storage medium to solve the technical problems of low testing efficiency and low accuracy of test results of existing financial insurance service systems that rely on manual testing.
[0005] In order to solve the above technical problems, the present application embodiment provides an interface testing method, which adopts the following technical solution:
[0006] Acquire interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes a plurality;
[0007] Generate an automatic test script corresponding to the interface data based on a preset script recording tool;
[0008] Based on a preset target chaotic particle swarm algorithm, thread allocation optimization processing is performed on the automatic test script to obtain a corresponding target test script;
[0009] Verifying the target test script based on a preset verification strategy;
[0010] If the target test script passes the verification, obtaining a pre-configured test environment;
[0011] The target test script is tested in the test environment to obtain corresponding test results.
[0012] Furthermore, the step of performing thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script specifically includes:
[0013] Performing thread initialization processing on the automatic test script based on the target chaotic particle swarm algorithm to obtain an initial thread allocation scheme corresponding to the interface;
[0014] Obtaining the importance value and calling frequency corresponding to the interface;
[0015] Adjusting parameters of the target chaotic particle swarm algorithm based on the importance value and the calling frequency to optimize the initial thread allocation scheme and obtain a corresponding target thread allocation scheme;
[0016] Adjusting the automatic test script based on the target thread allocation scheme to obtain an adjusted automatic test script;
[0017] The adjusted automatic test script is used as the target test script.
[0018] Furthermore, the step of verifying the target test script based on a preset verification strategy specifically includes:
[0019] Get the preset syntax verification strategy and logic verification strategy;
[0020] Performing syntax verification on the target test script based on the syntax verification strategy;
[0021] If the target test script passes the syntax verification, logic verification is performed on the target test script based on the logic verification strategy;
[0022] If the target test script passes the logic verification, it is determined that the target test script passes the verification; otherwise, it is determined that the target test script fails the verification.
[0023] Furthermore, the step of generating an automatic test script corresponding to the interface data based on a preset script recording tool specifically includes:
[0024] Determine a target script recording tool from among multiple preset script recording tools;
[0025] Configuring recording data corresponding to the target script recording tool;
[0026] Performing recording processing on the interface data based on the target script recording tool to generate a specified test script corresponding to the interface data;
[0027] The designated test script is used as the automatic test script.
[0028] Furthermore, before the step of acquiring the interface data corresponding to the interface of the target business system, the method further includes:
[0029] Obtaining an operation log of an initial interface involved in the target business system within a preset time period;
[0030] Based on the operation log, using a preset first clustering algorithm to perform preliminary classification processing on the initial interface to obtain a corresponding first interface;
[0031] Based on a preset regular expression, the first interface is classified and processed to obtain a corresponding second interface;
[0032] The second interface is used as the interface.
[0033] Furthermore, after the step of testing the target test script in the test environment to obtain the corresponding test result, the step further includes:
[0034] Acquire performance data collected during the testing process of the target test script;
[0035] Preprocessing the performance data to obtain corresponding target performance data;
[0036] Performing cluster analysis on the target performance data based on a preset second clustering algorithm to obtain corresponding cluster analysis results;
[0037] The performance data and the cluster analysis results are visualized.
[0038] Furthermore, after the step of performing cluster analysis on the target performance data based on the preset second clustering algorithm to obtain corresponding cluster analysis results, the method further includes:
[0039] Calling pre-trained analysis models;
[0040] Processing the cluster analysis results based on the analysis model to obtain corresponding output results;
[0041] Acquire an initial test strategy corresponding to the target test script;
[0042] Optimizing the initial test strategy based on the output result to obtain a corresponding target test strategy;
[0043] The target test strategy is stored.
[0044] In order to solve the above technical problems, the embodiment of the present application also provides an interface testing device, which adopts the following technical solution:
[0045] A first acquisition module is used to acquire interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes multiple;
[0046] A generation module, used to generate an automatic test script corresponding to the interface data based on a preset script recording tool;
[0047] An optimization module, used for performing thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script;
[0048] A verification module, used to verify the target test script based on a preset verification strategy;
[0049] A second acquisition module, configured to acquire a pre-configured test environment if the target test script passes the verification;
[0050] The test module is used to test the target test script in the test environment to obtain corresponding test results.
[0051] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0052] Acquire interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes a plurality;
[0053] Generate an automatic test script corresponding to the interface data based on a preset script recording tool;
[0054] Based on a preset target chaotic particle swarm algorithm, thread allocation optimization processing is performed on the automatic test script to obtain a corresponding target test script;
[0055] Verifying the target test script based on a preset verification strategy;
[0056] If the target test script passes the verification, obtaining a pre-configured test environment;
[0057] The target test script is tested in the test environment to obtain corresponding test results.
[0058] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0059] Acquire interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes a plurality;
[0060] Generate an automatic test script corresponding to the interface data based on a preset script recording tool;
[0061] Based on a preset target chaotic particle swarm algorithm, thread allocation optimization processing is performed on the automatic test script to obtain a corresponding target test script;
[0062] Verifying the target test script based on a preset verification strategy;
[0063] If the target test script passes the verification, obtaining a pre-configured test environment;
[0064] The target test script is tested in the test environment to obtain corresponding test results.
[0065] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0066] The present application first obtains interface data corresponding to the interface of the target business system; wherein the number of the interfaces includes multiple; then generates an automatic test script corresponding to the interface data based on a preset script recording tool; then performs thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script; subsequently verifies the target test script based on a preset verification strategy; if the target test script passes the verification, obtains a pre-configured test environment; finally, tests the target test script in the test environment to obtain a corresponding test result. The present application obtains interface data corresponding to the interface of the target business system, and generates an automatic test script corresponding to the interface data based on the use of a script recording tool, then performs thread allocation optimization processing on the automatic test script based on the use of a target chaotic particle swarm algorithm to obtain a corresponding target test script, and when the target test script is determined to pass the verification based on the use of a verification strategy, the target test script is automatically and intelligently tested in a pre-configured test environment to obtain a corresponding test result, thereby realizing an automated stress test of the interface of the target business system, improving the efficiency of interface testing, ensuring the accuracy of the obtained test results, and ensuring the security and stability of the target business system. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0068] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0069] Figure 2 A flowchart according to an embodiment of the interface testing method of the present application;
[0070] Figure 3 is a structural schematic diagram of an embodiment of an interface testing device according to the present application;
[0071] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0073] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0074] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0075] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0076] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0077] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0078] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0079] It should be noted that the interface testing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the interface testing device is generally arranged in the server / terminal device.
[0080] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0081] Continue to refer Figure 2 , shows a flow chart of an embodiment of the interface testing method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The interface testing method provided in the embodiment of the present application can be applied to any scenario that requires interface testing, and the interface testing method can be applied to products in these scenarios, for example, interface testing in the financial insurance field. The interface testing method comprises the following steps:
[0082] Step S201, obtaining interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes multiple.
[0083] In this embodiment, the electronic device (eg, Figure 1The server / terminal device shown in the figure) can obtain the image to be checked for duplicates through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future. The executor of the present application may specifically be an interface testing system, or simply referred to as a system. In the system testing scenario in the financial and insurance field, the above-mentioned target business system may specifically be a financial and insurance service system. The interface of the above-mentioned target business system may at least include a login interface, a task acquisition interface, a service communication interface, a communication record query interface, other query interfaces, and the like. The above-mentioned interface data may at least include interface input parameters, output parameters, call relationships, log information and other data.
[0084] Step S202: Generate an automatic test script corresponding to the interface data based on a preset script recording tool.
[0085] In this embodiment, the specific implementation process of generating the automatic test script corresponding to the interface data based on the preset script recording tool will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated on here.
[0086] Step S203, performing thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script.
[0087] In this embodiment, the above-mentioned thread allocation optimization processing is performed on the automatic test script based on the preset target chaotic particle swarm algorithm to obtain the specific implementation process of the corresponding target test script. This application will provide further detailed descriptions of this in subsequent specific embodiments, and will not be elaborated on here.
[0088] Step S204: verify the target test script based on a preset verification strategy.
[0089] In this embodiment, the specific implementation process of verifying the target test script based on the preset verification strategy will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0090] Step S205: If the target test script passes the verification, a pre-configured test environment is obtained.
[0091] In this embodiment, a test environment similar to the production environment of the target business system may be configured, including hardware, operating system, database, etc., and the software version and configuration in the test environment may be ensured to be consistent with the production environment.
[0092] Step S206: testing the target test script in the test environment to obtain corresponding test results.
[0093] In this embodiment, the generated target test script can be automatically executed in the above test environment, and the execution status of the target test script can be monitored to ensure that the test process proceeds smoothly, thereby obtaining corresponding test results.
[0094] The present application first obtains interface data corresponding to the interface of the target business system; wherein the number of the interfaces includes multiple; then generates an automatic test script corresponding to the interface data based on a preset script recording tool; then performs thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script; subsequently verifies the target test script based on a preset verification strategy; if the target test script passes the verification, obtains a pre-configured test environment; finally, tests the target test script in the test environment to obtain a corresponding test result. The present application obtains interface data corresponding to the interface of the target business system, and generates an automatic test script corresponding to the interface data based on the use of a script recording tool, then performs thread allocation optimization processing on the automatic test script based on the use of a target chaotic particle swarm algorithm to obtain a corresponding target test script, and when the target test script is determined to pass the verification based on the use of a verification strategy, the target test script is automatically and intelligently tested in a pre-configured test environment to obtain a corresponding test result, thereby realizing an automated stress test of the interface of the target business system, improving the efficiency of interface testing, ensuring the accuracy of the obtained test results, and ensuring the security and stability of the target business system.
[0095] In some optional implementations, step S203 includes the following steps:
[0096] The automatic test script is subjected to thread initialization processing based on the target chaotic particle swarm algorithm to obtain an initial thread allocation scheme corresponding to the interface.
[0097] In this embodiment, the thread initialization process includes: defining a particle swarm, chaos initialization, and setting parameter processing. Among them, defining a particle swarm includes: each particle represents a thread allocation scheme, wherein the position vector of the particle represents the number of threads allocated to each interface. Chaotic initialization includes: using a chaotic sequence (such as a Logistic map) to initialize the particle swarm to increase the diversity of the initial solution and avoid local optimality. Setting parameters includes: including inertia factor (w), acceleration constants (c1 and c2), maximum number of iterations, etc. Among them, according to the test requirements, determine the range of the number of threads that need to be optimized. Use a chaotic particle swarm algorithm to initialize the threads and generate a set of random thread allocation schemes.
[0098] Obtain the importance value and calling frequency corresponding to the interface.
[0099] In this embodiment, a fitness function can be defined to evaluate the pros and cons of each thread allocation scheme based on the importance value and call frequency of the interface obtained, as well as the performance target (such as response time, throughput, etc.) of the target business system, that is, to evaluate the performance of different thread allocation schemes. The fitness function can be calculated based on indicators such as the response time, throughput, and error rate of the interface. This fitness function reflects the impact of the thread allocation scheme on system performance. Among them, key indicators such as the number of calls, response time, and error rate of the interface can be analyzed, and the importance threshold of the interface, that is, the importance value, can be pre-set. And the call frequency of each interface can be collected using historical data. In addition, different importance thresholds should be set for different interfaces. For example, if the total number of quotation calls is the highest, the threshold is relatively high, and it is placed in the queue. Other interfaces also place information in other different queues in a similar manner. Therefore, queues with higher priorities will be given priority and focused on.
[0100] The target chaotic particle swarm algorithm is parameter-adjusted based on the importance value and the calling frequency to optimize the initial thread allocation scheme and obtain a corresponding target thread allocation scheme.
[0101] In this embodiment, the fitness value of each particle (i.e., each thread allocation scheme) is calculated. It is used to evaluate the performance of different thread allocation schemes. Then, according to the result of the fitness function, the position and speed of the particle are updated. The iterative process is repeated until a predetermined number of iterations is reached or the fitness function converges. This iterative process is intended to find the optimal thread allocation scheme. Specifically, the particle speed is first updated according to the speed of the current particle, the individual optimal position (pbest) and the global optimal position (gbest), as well as the acceleration constant and the inertia factor. The position of the particle is updated using the updated speed, that is, the number of threads of each interface is adjusted. Then, in each iteration, a chaotic local search is performed on some particles to further explore the solution space and increase the probability of finding the global optimal solution. Afterwards, according to the convergence in the iterative process, the inertia factor, the acceleration constant and other parameters are dynamically adjusted to optimize the thread allocation effect. When the maximum number of iterations is reached or the fitness value meets the preset conditions, the iteration is terminated to obtain the corresponding optimization result, that is, the target thread allocation scheme.
[0102] Specifically, the optimization is performed in the particle swarm algorithm. The chaotic particle swarm algorithm is used to first break up the threads to avoid local optimality, and the parameters of the chaotic particle swarm algorithm are adjusted based on the importance value of the interface and the call frequency to intelligently allocate the number of threads. 1. First, all threads are broken up and initialized randomly. 2. Determine whether the individual is optimal. If the individual is optimal, then determine whether the overall optimality is achieved. 3. Update the weight and position ratio of each thread:
[0103] V id =ωV id +c 1 random(0,1)(P id -X id )+C 2 random(0,1)(P gd -X id )
[0104] X id =X id +V id
[0105] Among them, ω is called the inertia factor, C 1 and C 2 It is called the acceleration constant and is usually taken as C 1 =C 2 ∈[0,4]. Random(0,1) represents a random number in the interval [0,1]. id represents the dth dimension of the individual extreme value of the i-th variable. gd represents the dth dimension of the global optimal solution.
[0106] In order to avoid the optimal particle swarm algorithm, a dynamic threshold is set for continuous adjustment and optimization based on the context of the thread and the analysis of text information such as logs and parameters.
[0107]
[0108] In the above formula, It represents the best solution generated in the current execution process; j The meaning is the parameter of coefficient adjustment, which is obtained according to the interface information text of the context; Z j,k , k are variable parameters whose range is [-1, 1].
[0109] The automatic test script is adjusted based on the target thread allocation scheme to obtain an adjusted automatic test script.
[0110] In this embodiment, the optimal thread allocation scheme can be selected from the above optimization results, i.e., the target thread allocation scheme, and the thread number setting in the test script can be adjusted according to the optimal thread allocation scheme, thereby obtaining an adjusted automatic test script. The adjustment process is a dynamic resource allocation strategy based on the importance of interface business and the expected concurrency, aiming to improve the overall performance and stability of the system.
[0111] The adjusted automatic test script is used as the target test script.
[0112] In this embodiment, the importance value of the interface is used as a guiding principle for the allocation of the number of threads. The higher the importance of the interface, the more threads should be allocated to ensure that the concurrent requests of real users can be fully simulated in the stress test. In addition, in the optimization process of the chaotic particle swarm algorithm, the allocation of the number of threads is dynamic. The algorithm will continuously adjust the allocation scheme of the number of threads according to the result of the fitness function to find the optimal performance.
[0113] The present application performs thread initialization processing on the automatic test script based on the target chaotic particle swarm algorithm to obtain an initial thread allocation scheme corresponding to the interface; then obtains the importance value and calling frequency corresponding to the interface; then adjusts the parameters of the target chaotic particle swarm algorithm based on the importance value and the calling frequency to optimize the initial thread allocation scheme and obtain the corresponding target thread allocation scheme; subsequently adjusts the automatic test script based on the target thread allocation scheme to obtain an adjusted automatic test script; finally, the adjusted automatic test script is used as the target test script. The present application performs thread initialization processing on the automatic test script based on the use of a target chaotic particle swarm algorithm to obtain an initial thread allocation scheme corresponding to the interface, and then adjusts the parameters of the target chaotic particle swarm algorithm according to the acquired importance value and calling frequency of the interface to optimize the initial thread allocation scheme and obtain the corresponding target thread allocation scheme, and adjusts the automatic test script based on the obtained target thread allocation scheme to quickly and accurately complete the thread allocation optimization processing for the automatic test script, thereby ensuring the accuracy of the obtained target test script, facilitating the subsequent use of the target test script for interface testing, and effectively improving the overall performance and stability of the target business system in interface stress testing.
[0114] In some optional implementations of this embodiment, step S204 includes the following steps:
[0115] Get the preset syntax validation strategy and logic validation strategy.
[0116] In this embodiment, the policy content of the above syntax verification policy includes: using the syntax checking tool provided by the scripting language to check the syntax correctness of the script. The policy content of the above logic verification policy includes: verifying whether the logic of the script is correct through automated testing to ensure that the script can execute the test as expected.
[0117] The target test script is syntax-verified based on the syntax verification strategy.
[0118] In this embodiment, the target test script can be syntax-verified according to the policy content of the above-mentioned syntax verification policy to obtain a corresponding syntax verification result. If the syntax correctness of the target test script passes the verification, it is determined that the target test script passes the syntax verification. If the syntax correctness of the target test script fails to pass the verification, it is determined that the target test script fails the syntax verification, and then directly determines that the target test script fails the verification.
[0119] If the target test script passes the syntax verification, logic verification is performed on the target test script based on the logic verification strategy.
[0120] In this embodiment, the target test script can be logically verified according to the policy content of the above-mentioned logic verification policy to obtain the corresponding logic verification result. If the target test script can perform the test as expected, it is determined that the target test script has passed the logic verification. If the grammatical correctness of the target test script cannot perform the test as expected, it is determined that the target test script has not passed the logic verification, and then it is determined that the target test script has not passed the verification.
[0121] If the target test script passes the logic verification, it is determined that the target test script passes the verification; otherwise, it is determined that the target test script fails the verification.
[0122] In this embodiment, only when it is detected that the target test script has passed both syntax verification and logic verification, will it be determined that the target test script has passed verification, thereby ensuring the correctness and stability of the obtained target test script.
[0123] The present application obtains a preset syntax verification strategy and a logic verification strategy; then performs syntax verification on the target test script based on the syntax verification strategy; if the target test script subsequently passes the syntax verification, then performs logic verification on the target test script based on the logic verification strategy; if the target test script passes the logic verification, then the target test script is determined to have passed the verification, otherwise, the target test script is determined to have failed the verification. The present application performs syntax verification and logic verification on the target test script based on the use of syntax verification strategy and logic verification strategy, effectively ensuring the correctness and stability of the target test script, so that the subsequent use of the target test script for test processing helps to improve the accuracy and reliability of the interface stress test.
[0124] In some optional implementations, step S202 includes the following steps:
[0125] Determine the target script recording tool from among the various preset script recording tools.
[0126] In this embodiment, the script recording tools may include at least JMeter, LoadRunner, etc. According to actual business needs, one tool may be selected from the script recording tools as the target script recording tool.
[0127] Configure recording data corresponding to the target script recording tool.
[0128] In this embodiment, the recording data may include recording parameters and recording options. The matching recording data may be configured according to the tool features of the target script recording tool, and the recording parameters and options may be configured according to the user documentation of the target script recording tool, such as recording mode (HTTP / HTTPS), proxy settings, log level, etc. Alternatively, the recording data corresponding to the target script recording tool may be configured according to the user's personal needs.
[0129] The interface data is recorded and processed based on the target script recording tool to generate a specified test script corresponding to the interface data.
[0130] In this embodiment, a test environment is pre-built, and it is ensured that the test environment can access the interface to be recorded. Then the target script recording tool is started, and the target script recording tool is used to simulate user operations to access and call the interface. The target script recording tool automatically captures the call information of the interface and generates a corresponding specified test script.
[0131] The designated test script is used as the automatic test script.
[0132] In this embodiment, the generated test script can be further checked to ensure that the test script contains key information such as the calling sequence, parameters, expected results, etc. of each interface, and the test script can be manually adjusted or supplemented as needed.
[0133] The present application determines a target script recording tool from a plurality of preset script recording tools; then configures recording data corresponding to the target script recording tool; then records and processes the interface data based on the target script recording tool to generate a designated test script corresponding to the interface data; and subsequently uses the designated test script as the automatic test script. The present application determines a target script recording tool from a plurality of preset script recording tools, configures recording data corresponding to the target script recording tool, and then records and processes the interface data based on the use of the target script recording tool, thereby realizing automatic, rapid, and accurate generation of an automatic test script corresponding to the interface data, thereby improving the generation efficiency and generation accuracy of the automatic test script.
[0134] In some optional implementations, before step S201, the electronic device may further perform the following steps:
[0135] Obtain an operation log of an initial interface involved in the target business system within a preset time period.
[0136] In this embodiment, the operation log of the initial interface involved in the operation of the service personnel of the above-mentioned target business system in the production environment within a preset time period can be captured by using a log collection tool. Among them, the operation log can at least include key information such as interface input parameters, output parameters, the association relationship between the upper and lower interfaces called, logs, and interface names.
[0137] Based on the operation log, a preset first clustering algorithm is used to perform preliminary classification processing on the initial interface to obtain a corresponding first interface.
[0138] In this embodiment, the first clustering algorithm may be a K-means or DBSCAN clustering algorithm. By using the first clustering algorithm, the initial interfaces may be preliminarily classified according to factors such as the calling frequency and business type of the initial interfaces, so as to classify the initial interfaces into first interfaces of different categories.
[0139] The first interface is refined and classified based on a preset regular expression to obtain a corresponding second interface.
[0140] In this embodiment, the interface name, parameters, etc. of the first interface can be matched by combining regular expressions, and then the classification result of the first interface can be further refined according to the matching result, so as to obtain the corresponding second interface. For example, for a login module, the interface must contain loginXXX and the like, and in Chinese, it generally contains values such as loginXXX, and through the above descriptions and the connections between them, it is classified into login, task acquisition, quotation service, telephone communication, insurance policy delivery and inquiry interfaces.
[0141] The second interface is used as the interface.
[0142] The present application obtains the operation log of the initial interface involved in the target business system within a preset time period; then, based on the operation log, uses a preset first clustering algorithm to perform preliminary classification processing on the initial interface to obtain the corresponding first interface; then, based on a preset regular expression, performs detailed classification processing on the first interface to obtain the corresponding second interface; and subsequently uses the second interface as the interface. The present application obtains the operation log of the initial interface involved in the target business system within a preset time period; and based on the operation log, uses a first clustering algorithm to perform preliminary classification processing on the initial interface to obtain the corresponding first interface; then, based on the use of regular expressions, performs detailed classification processing on the first interface, thereby achieving rapid and accurate completion of interface classification processing for the target business system, effectively ensuring the classification accuracy of the obtained interface.
[0143] In some optional implementations of this embodiment, after step S206, the electronic device may further perform the following steps:
[0144] The performance data collected during the test process of the target test script is obtained.
[0145] In this embodiment, during the testing process of the target test script, a performance testing tool is used to collect key performance indicators such as the response time, throughput, and error rate of the interface, and ensure the comprehensiveness and accuracy of data collection, including data with different concurrency and different time periods, so as to obtain corresponding performance data.
[0146] The performance data is preprocessed to obtain corresponding target performance data.
[0147] In this embodiment, the above preprocessing includes cleaning the collected performance data, removing abnormal values and duplicate values, and standardizing the row performance data to ensure the comparability between different indicators, so as to obtain corresponding target performance data.
[0148] Based on a preset second clustering algorithm, cluster analysis is performed on the target performance data to obtain corresponding cluster analysis results.
[0149] In this embodiment, the second clustering algorithm may specifically adopt the KNN clustering algorithm. The process of using the second clustering algorithm to perform cluster analysis on the target performance data includes: selecting a suitable K value (number of clusters), which can usually be determined by methods such as the elbow method or the silhouette coefficient method. Then, the KNN algorithm is used to cluster the performance data to identify a set of interfaces with similar performance. After that, the clustering results are analyzed to identify performance bottlenecks (such as interfaces with long response times) and outliers (such as interfaces with high error rates) to obtain cluster analysis results.
[0150] The performance data and the cluster analysis results are visualized.
[0151] In this embodiment, the performance data and the cluster analysis results can be visualized by using a visualization tool, and specifically, the performance of the interface and the cluster analysis results can be intuitively displayed through charts and images.
[0152] The present application obtains the performance data collected during the test process of the target test script; then preprocesses the performance data to obtain the corresponding target performance data; then performs cluster analysis on the target performance data based on a preset second clustering algorithm to obtain the corresponding cluster analysis results; and subsequently visualizes the performance data and the cluster analysis results. The present application obtains the performance data collected during the test process of the target test script, and preprocesses the performance data to obtain the corresponding target performance data, and then performs cluster analysis on the target performance data based on the use of a second clustering algorithm to obtain the corresponding cluster analysis results, and subsequently visualizes the performance data and the cluster analysis results, thereby achieving an intuitive display of the performance data and cluster analysis results of the interface, improving the display intelligence of the performance data and cluster analysis results, and helping to improve the user experience.
[0153] In some optional implementations of this embodiment, after the step of performing cluster analysis on the target performance data based on the preset second clustering algorithm to obtain corresponding cluster analysis results, the electronic device may further perform the following steps:
[0154] Call a pre-trained analysis model.
[0155] In this embodiment, the above-mentioned analysis model is a BP neural network that is generated by pre-training based on the mapping relationship between the learned system performance data and parameters such as the number of threads, and can predict the system performance under different numbers of threads, thereby assisting in determining the optimal number of threads. Specifically, the model construction process of the analysis model includes: extracting a data set for training the BP neural network from a database, including historical test data and cluster analysis results. And dividing the data set into a training set and a validation set. Then select a suitable BP neural network structure, including the number of nodes in the input layer, hidden layer and output layer. And set the activation function, learning rate, number of iterations and other parameters of the BP neural network. Then use the training set to train the BP neural network, and adjust the network weights and biases through the back propagation algorithm. During the training process, use the validation set to monitor the performance of the BP neural network to prevent overfitting, thereby obtaining the final analysis model.
[0156] The cluster analysis results are processed based on the analysis model to obtain corresponding output results.
[0157] In this embodiment, the above-mentioned clustering analysis results can be input into a trained analysis model. The analysis model will establish a mapping relationship between input and output based on the inherent rules and characteristics of the data learned during the training process, thereby predicting the optimal test strategy and outputting corresponding output results, including the setting of parameters such as the number of threads and test frequency.
[0158] An initial test strategy corresponding to the target test script is obtained.
[0159] In this embodiment, the initial test strategy refers to the test strategy of the originally set target test script.
[0160] The initial test strategy is optimized based on the output result to obtain a corresponding target test strategy.
[0161] In this embodiment, the effectiveness of the test strategy of the target test script can be analyzed according to the output of the neural network. The deficiencies in the test strategy can be identified, such as the test script is not accurate enough, the number of threads is not configured reasonably, and then the number of threads, test frequency and other parameters are adjusted accordingly to ensure that the optimized target test strategy can better simulate the real user behavior and reflect the real performance of the system, thereby improving the test efficiency and accuracy.
[0162] The target test strategy is stored.
[0163] In this embodiment, there is no specific limitation on the storage method of the target test strategy, and it can be set according to actual storage requirements, such as using a local database, a disk, a cloud server, a blockchain, etc. In addition, the optimized target test strategy can be used to re-execute the test. The test results before and after the optimization can be compared to verify whether the optimization effect is significant.
[0164] This application calls a pre-trained analysis model; then processes the cluster analysis results based on the analysis model to obtain the corresponding output results; then obtains the initial test strategy corresponding to the target test script; subsequently optimizes the initial test strategy based on the output results to obtain the corresponding target test strategy; and finally stores the target test strategy. After clustering the target performance data based on the second clustering algorithm to obtain the corresponding cluster analysis results, this application will also intelligently process the cluster analysis results based on the analysis model to obtain the corresponding output results, and then optimize the initial test strategy of the target test script based on the output results to obtain the corresponding target test strategy, which effectively improves the accuracy and stability of the target test script, so that the subsequent use of the target test strategy for test processing helps to improve the accuracy and reliability of the interface stress test. In addition, the target test strategy will also be intelligently stored to ensure the data security of the target test strategy.
[0165] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.
[0166] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.
[0167] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0168] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target test script, the above-mentioned target test script can also be stored in a node of a blockchain.
[0169] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0170] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0171] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0172] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0173] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0174] Further references Figure 3 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of an interface testing device, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0175] like Figure 3 As shown, the interface testing device 300 described in this embodiment includes: a first acquisition module 301, a generation module 302, an optimization module 303, a verification module 304, a second acquisition module 305 and a testing module 306. Among them:
[0176] A first acquisition module 301 is used to acquire interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes multiple;
[0177] A generating module 302, configured to generate an automatic test script corresponding to the interface data based on a preset script recording tool;
[0178] The optimization module 303 is used to perform thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script;
[0179] A verification module 304, configured to verify the target test script based on a preset verification strategy;
[0180] A second acquisition module 305 is used to acquire a pre-configured test environment if the target test script passes the verification;
[0181] The test module 306 is used to perform test processing on the target test script in the test environment to obtain corresponding test results.
[0182] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the interface testing method in the aforementioned implementation mode, and are not described in detail here.
[0183] In some optional implementations of this embodiment, the optimization module 303 includes:
[0184] A processing submodule, used for performing thread initialization processing on the automatic test script based on the target chaotic particle swarm algorithm to obtain an initial thread allocation scheme corresponding to the interface;
[0185] A first acquisition submodule is used to acquire the importance value and call frequency corresponding to the interface;
[0186] An optimization submodule, used for adjusting parameters of the target chaotic particle swarm algorithm based on the importance value and the calling frequency, so as to optimize the initial thread allocation scheme and obtain a corresponding target thread allocation scheme;
[0187] An adjustment submodule, used for adjusting the automatic test script based on the target thread allocation scheme to obtain an adjusted automatic test script;
[0188] The first determination submodule is used to use the adjusted automatic test script as the target test script.
[0189] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the interface testing method in the aforementioned implementation mode, and are not described in detail here.
[0190] In some optional implementations of this embodiment, the verification module 304 includes:
[0191] The second acquisition submodule is used to acquire a preset syntax verification strategy and a logic verification strategy;
[0192] A first verification submodule, configured to perform syntax verification on the target test script based on the syntax verification strategy;
[0193] A second verification submodule, configured to perform logic verification on the target test script based on the logic verification strategy if the target test script passes syntax verification;
[0194] The determination submodule is used to determine that the target test script has passed the verification if the target test script has passed the logic verification, and otherwise determine that the target test script has not passed the verification.
[0195] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the interface testing method in the aforementioned implementation mode, and are not described in detail here.
[0196] In some optional implementations of this embodiment, the generating module 302 includes:
[0197] A second determination submodule is used to determine a target script recording tool from a plurality of preset script recording tools;
[0198] A configuration submodule, used to configure recording data corresponding to the target script recording tool;
[0199] A recording submodule, used for recording and processing the interface data based on the target script recording tool to generate a specified test script corresponding to the interface data;
[0200] The third determination submodule is used to use the specified test script as the automatic test script.
[0201] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the interface testing method in the aforementioned implementation mode, and are not described in detail here.
[0202] In some optional implementations of this embodiment, the interface testing device further includes:
[0203] A third acquisition module is used to acquire the operation log of the initial interface involved in the target business system within a preset time period;
[0204] A first classification module, configured to perform preliminary classification processing on the initial interface based on the operation log using a preset first clustering algorithm to obtain a corresponding first interface;
[0205] A second classification module, used to perform detailed classification processing on the first interface based on a preset regular expression to obtain a corresponding second interface;
[0206] A determination module is used to use the second interface as the interface.
[0207] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the interface testing method in the aforementioned implementation mode, and are not described in detail here.
[0208] In some optional implementations of this embodiment, the interface testing device further includes:
[0209] A fourth acquisition module, used to acquire performance data collected during the test process of the target test script;
[0210] A preprocessing module, used to preprocess the performance data to obtain corresponding target performance data;
[0211] An analysis module, used to perform cluster analysis on the target performance data based on a preset second clustering algorithm to obtain corresponding cluster analysis results;
[0212] A display module is used to visually display the performance data and the cluster analysis results.
[0213] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the interface testing method in the aforementioned implementation mode, and are not described in detail here.
[0214] In some optional implementations of this embodiment, the interface testing device further includes:
[0215] The calling module is used to call the pre-trained analysis model;
[0216] A first processing module, used for processing the cluster analysis result based on the analysis model to obtain a corresponding output result;
[0217] A fourth acquisition module, used to acquire an initial test strategy corresponding to the target test script;
[0218] A second processing module, configured to optimize the initial test strategy based on the output result to obtain a corresponding target test strategy;
[0219] A storage module is used to store the target test strategy.
[0220] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the interface testing method in the aforementioned implementation mode, and are not described in detail here.
[0221] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0222] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0223] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0224] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the interface test method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0225] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the interface testing method.
[0226] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0227] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the interface testing method as described above.
[0228] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0229] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. An interface testing method, characterized in that: The steps include: Acquire interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes a plurality; Generate an automatic test script corresponding to the interface data based on a preset script recording tool; Based on a preset target chaotic particle swarm algorithm, thread allocation optimization processing is performed on the automatic test script to obtain a corresponding target test script; Verifying the target test script based on a preset verification strategy; If the target test script passes the verification, obtaining a pre-configured test environment; The target test script is tested in the test environment to obtain corresponding test results.
2. The interface testing method according to claim 1, characterized in that: The step of performing thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script specifically includes: Performing thread initialization processing on the automatic test script based on the target chaotic particle swarm algorithm to obtain an initial thread allocation scheme corresponding to the interface; Obtaining the importance value and calling frequency corresponding to the interface; Adjusting parameters of the target chaotic particle swarm algorithm based on the importance value and the calling frequency to optimize the initial thread allocation scheme and obtain a corresponding target thread allocation scheme; Adjusting the automatic test script based on the target thread allocation scheme to obtain an adjusted automatic test script; The adjusted automatic test script is used as the target test script.
3. The interface testing method according to claim 1, characterized in that: The step of verifying the target test script based on a preset verification strategy specifically includes: Get the preset syntax verification strategy and logic verification strategy; Performing syntax verification on the target test script based on the syntax verification strategy; If the target test script passes the syntax verification, logic verification is performed on the target test script based on the logic verification strategy; If the target test script passes the logic verification, it is determined that the target test script passes the verification; otherwise, it is determined that the target test script fails the verification.
4. The interface testing method according to claim 1, characterized in that: The step of generating an automatic test script corresponding to the interface data based on a preset script recording tool specifically includes: Determine a target script recording tool from among multiple preset script recording tools; Configuring recording data corresponding to the target script recording tool; Performing recording processing on the interface data based on the target script recording tool to generate a specified test script corresponding to the interface data; The designated test script is used as the automatic test script.
5. The interface testing method according to claim 1, characterized in that: Before the step of acquiring the interface data corresponding to the interface of the target business system, the method further includes: Obtaining an operation log of an initial interface involved in the target business system within a preset time period; Based on the operation log, using a preset first clustering algorithm to perform preliminary classification processing on the initial interface to obtain a corresponding first interface; Based on a preset regular expression, the first interface is classified and processed to obtain a corresponding second interface; The second interface is used as the interface.
6. The interface testing method according to claim 1, characterized in that: After the step of testing the target test script in the test environment to obtain the corresponding test result, the method further includes: Acquire performance data collected during the testing process of the target test script; Preprocessing the performance data to obtain corresponding target performance data; Performing cluster analysis on the target performance data based on a preset second clustering algorithm to obtain corresponding cluster analysis results; The performance data and the cluster analysis results are visualized.
7. The interface testing method according to claim 6, characterized in that: After the step of performing cluster analysis on the target performance data based on the preset second clustering algorithm to obtain corresponding cluster analysis results, the method further includes: Calling pre-trained analysis models; Processing the cluster analysis results based on the analysis model to obtain corresponding output results; Acquire an initial test strategy corresponding to the target test script; Optimizing the initial test strategy based on the output result to obtain a corresponding target test strategy; The target test strategy is stored.
8. An interface testing device, characterized in that: include: A first acquisition module is used to acquire interface data corresponding to an interface of a target business system; wherein the number of the interfaces includes multiple; A generation module, used to generate an automatic test script corresponding to the interface data based on a preset script recording tool; An optimization module, used for performing thread allocation optimization processing on the automatic test script based on a preset target chaotic particle swarm algorithm to obtain a corresponding target test script; A verification module, used to verify the target test script based on a preset verification strategy; A second acquisition module, configured to acquire a pre-configured test environment if the target test script passes the verification; The test module is used to test the target test script in the test environment to obtain corresponding test results.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the interface testing method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the interface testing method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Tool generation method and device, computer equipment and storage medium
CN121478667A