Automatic analysis method for interface performance test and related equipment

By creating and setting performance metrics in the automated test tool, writing and importing interface test cases to automatically generate performance test scripts, the problem that existing tools cannot deeply analyze and manage interface performance tests is solved, and automated analysis and result management is achieved, improving Test efficiency.

CN119512927APending Publication Date: 2025-02-25TUS CLOUD CONTROL (BEIJING) TECH LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411368972.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Existing interface performance testing tools cannot deeply analyze the main performance metrics, and cannot uniformly manage interface test cases and generate performance test scripts, resulting in inconvenient and inefficient testing processes.

Method used

Provides an automated analysis method for interface performance testing. By creating performance metrics and setting thresholds in the automated testing tool, writing interface test cases and importing tools to automatically generate performance test scripts, perform automated testing, and visual presentation and analysis.

Benefits of technology

It realizes automated analysis of interface performance, overall management and maintenance performance test results, reduces labor costs and improves the efficiency of test management work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512927A_ABST
    Figure CN119512927A_ABST
Patent Text Reader

Abstract

The invention provides an interface performance test automatic analysis method and related equipment, which are applied to interface performance test in an automatic test tool, and the method comprises the following steps: creating at least one performance index of interface performance test in the automatic test tool, and carrying out threshold setting on the performance index, the performance indexes comprise at least one of query rate per second, average response time, maximum response time, minimum response time, concurrency and throughput; compiling an interface test case and importing the interface test case into an automatic test tool to automatically generate a performance test script; performing automatic testing based on the performance testing script to obtain an interface performance testing result and performing visual display; and performing automatic analysis on an interface performance test result and performing visual management on an analysis result. According to the method, the interface performance is automatically analyzed, the analysis result is obtained, the performance test result is integrally managed and maintained, and the overall efficiency of daily test management work is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interface testing, and in particular to an automated analysis method for interface performance testing and related equipment. Background Art

[0002] Interface performance testing is a very important part of software development and operation and maintenance. It focuses on the performance of system interfaces under specific load conditions. As software systems become increasingly complex and the number of interfaces continues to increase, the stability and efficiency of interface performance have become key factors affecting user experience and system stability.

[0003] There are many third-party tools for interface performance testing, such as Locust. There are many types of existing third-party tools, but these testing tools can only get the final performance test results, and cannot conduct in-depth analysis of several key performance indicators that are of particular concern in daily testing. In addition, the existing tools do not provide a convenient way to uniformly manage interface test cases after interface testing, and cannot directly generate corresponding interface performance test scripts through interface test cases to perform interface performance testing. This leads to inconvenience and efficiency loss during the testing process.

[0004] Therefore, for interface performance testing, how to quickly perform performance testing and automatically analyze interface performance results is becoming increasingly important. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides an automated analysis method for interface performance testing and related equipment, aiming to realize automated analysis of interface performance and obtain analysis results, as well as overall management and maintenance of performance test results, so as to reduce labor costs and comprehensively improve the overall efficiency of daily test management work.

[0006] In order to achieve the above purpose and other advantages, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides an interface performance test automation analysis method, which is applied to perform interface performance testing in an automated testing tool, the method comprising:

[0008] Creating at least one performance indicator of the interface performance test in the automated testing tool, and setting a threshold for the performance indicator, the performance indicator comprising at least one of: query rate per second, average response time, maximum response time, minimum response time, concurrency, and throughput;

[0009] Write interface test cases and import them into the automated testing tool to automatically generate performance test scripts;

[0010] Perform automated testing based on the performance test script to obtain corresponding interface performance test results and perform visual display;

[0011] Based on the threshold of the performance indicator, the interface performance test result is automatically analyzed and the analysis result is visually managed.

[0012] According to an interface performance test automation analysis method provided by the present invention, the step of writing interface test cases and importing them into an automated testing tool to automatically generate performance test scripts includes:

[0013] Write interface test cases through an Excel file. The fields required for writing the interface test cases include: test case ID, module name, case name, request address, request type, request header, request parameters, and transfer parameters;

[0014] Importing the Excel file into the automated testing tool;

[0015] The automated testing tool automatically parses the Excel file and generates the corresponding performance testing script.

[0016] According to an automated analysis method for interface performance testing provided by the present invention, the automated testing tool automatically parses the Excel file to generate the corresponding performance testing script, including:

[0017] Extract each of the interface test cases from the Excel file by row, group the interface test cases according to different modules, and one module corresponds to one performance test script;

[0018] In each of the modules, different interface request scripts are generated according to different request types, and parameter settings and variable transfers are performed according to the association relationship between the interfaces to simulate the real interaction process between the interfaces;

[0019] According to preset script rules, interface test cases belonging to the same module are generated into one performance test script, and different labels are added to the interface test cases according to different test case names.

[0020] According to an interface performance test automation analysis method provided by the present invention, the step of performing an automated test based on the performance test script, obtaining corresponding interface performance test results and performing visual display includes:

[0021] Each time an automated test is executed, the corresponding interface performance test results will be generated based on the execution timestamp and different URL addresses;

[0022] Based on the interface performance test results, the execution timestamp, interface URL address, several performance indicator test result values, and whether each performance indicator test result value is within the threshold range set by the performance indicator are obtained, and they are used as display data for the visual chart and the results are displayed.

[0023] According to an automated analysis method for interface performance testing provided by the present invention, the steps of automatically analyzing the interface performance test results based on the threshold of the performance indicator and visually managing the analysis results include:

[0024] Use a visual interface to manage the interface performance test results of different modules and the threshold settings of the performance indicators;

[0025] The interface performance test results of different modules are automatically analyzed and the analysis results are visually managed.

[0026] According to an automated analysis method for interface performance testing provided by the present invention, the step of automatically analyzing the interface performance test results of different modules and visually managing the analysis results includes:

[0027] Select a time range and performance index in the visualization interface, aggregate the test result values ​​of the performance index obtained by the test, calculate the fluctuation of the test result values ​​of the performance index in different time periods, and visualize them in the form of a trend chart;

[0028] Based on the threshold setting of the performance indicator, a normal fluctuation range of the performance indicator is set in the trend graph;

[0029] If the overall fluctuation range of the performance indicator exceeds the normal fluctuation range, the performance indicator value abnormality and the interface performance abnormality are displayed in the trend graph.

[0030] According to an automated analysis method for interface performance testing provided by the present invention, the step of automatically analyzing the interface performance test results of different modules and visually managing the analysis results further includes:

[0031] Execute the performance test script under different concurrent numbers to obtain performance test results;

[0032] Based on the performance test results, obtain the average response time, query rate per second and CPU usage;

[0033] Form a trend comparison chart of the average response time, the query rate per second and the CPU usage rate at different concurrent numbers;

[0034] In the trend comparison chart, the optimal concurrency point is automatically found with the query conditions of minimum average response time, maximum query rate per second and CPU usage not exceeding the set threshold, indicating that at the optimal concurrency point, the average response time is optimal and the query rate per second is optimal.

[0035] In a second aspect, the present invention provides an electronic device, the electronic device comprising:

[0036] One or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of any of the above-mentioned methods for automated analysis of interface performance testing.

[0037] In a third aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for automated analysis of interface performance testing.

[0038] In a fourth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of any of the above-mentioned methods for automated analysis of interface performance testing.

[0039] The present invention provides an interface performance test automation analysis method and related equipment, which are applied to interface performance testing in an automated testing tool, by creating at least one performance indicator of the interface performance test in the automated testing tool and setting a threshold for the performance indicator, the performance indicator includes: at least one of query rate per second, average response time, maximum response time, minimum response time, concurrency and throughput; writing interface test cases and importing them into the automated testing tool to automatically generate performance test scripts; performing automated testing based on the performance test scripts, obtaining corresponding interface performance test results and performing visual display; based on the threshold of the performance indicator, automatically analyzing the interface performance test results and visually managing the analysis results. The present invention realizes automated analysis of interface performance and obtaining analysis results, as well as overall management and maintenance of performance test results, without the need to determine whether the performance indicator meets the limit value through manual analysis, reducing the time for manually writing interface performance test scripts and reducing labor costs. At the same time, the interface performance test results are managed in a visual manner, and overall statistical analysis is performed, making the test management work clearer and more intuitive, and comprehensively improving the overall efficiency of daily test management work. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other implementation methods can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 This is one of the flow charts of the automated analysis method for interface performance testing provided by an embodiment of the present invention;

[0042] Figure 2 This is the second flow chart of the automated analysis method for interface performance testing provided by an embodiment of the present invention;

[0043] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0044] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following specifically cites a preferred embodiment and describes it in detail with the accompanying drawings as follows.

[0045] It should be noted that it is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in the present invention can be combined with other embodiments without conflict. Unless otherwise defined, the technical terms or scientific terms involved in the present invention should be the usual meanings understood by people with ordinary skills in the technical field to which the present invention belongs. The words "one", "a", "a", "the" and the like involved in the present invention do not indicate a quantitative limitation and may represent the singular or plural. The terms "including", "comprising", "having" and any of their variations involved in the present invention are intended to cover non-exclusive inclusions; the terms "first", "second", "third", etc. involved in the present invention are merely to distinguish similar objects and do not represent a specific ordering of objects.

[0046] To facilitate understanding of the embodiments of the present invention, the following is an explanation of the key terms / technical abbreviations in the present invention:

[0047] pyQt: Qt is a cross-platform C++ development framework for creating desktop and mobile applications. It provides a rich set of GUI components, tool libraries, and platform-dependent functions. PyQt is a cross-platform library for Python that is used to create desktop and mobile applications. It is based on the Qt framework and provides a rich set of GUI components and tool libraries.

[0048] Requests: is a Python library for sending HTTP requests. It provides a simple and easy-to-use API that can be used to send HTTP requests such as GET, POST, PUT, DELETE, and process response data.

[0049] Openpyxl: is a Python library for reading and writing Excel files.

[0050] Locust: An open source load testing tool for simulating user behavior and testing the performance of the system.

[0051] Qps: (Queries Per Second) The query rate per second. It is an important indicator for measuring system performance, usually used for the processing capacity of systems such as API gateways. The Qps indicator standard is usually set according to the actual needs and performance goals of the system.

[0052] Reference Figure 1 , 2 As shown, an embodiment of the present invention provides an interface performance test automation analysis method, which is applied to perform interface performance testing in an automated testing tool. The method includes:

[0053] Step S1: Create at least one performance indicator for interface performance testing in the automated testing tool and set thresholds for the performance indicators. The performance indicators include at least one of query rate per second, average response time, maximum response time, minimum response time, concurrency and throughput.

[0054] In this embodiment, the automated testing tool is a visualization tool designed based on the pyQt development framework for managing and analyzing interface performance test results. The visualization interface covers performance indicator management, interface performance test result management, and trend analysis functions.

[0055] In terms of interface performance testing, we combined the Locust tool to perform interface performance testing. First, we created performance indicators for overall evaluation of test performance in the automated testing tool. For example, during the interface performance testing process, we focused on specific performance indicators such as average response time, maximum response time, minimum response time, concurrency, and throughput, and performed threshold management for these performance indicators, such as setting the average response time to 200ms and Qps (query rate per second) to 1000.

[0056] Step S2: Write interface test cases and import them into the automated testing tool to automatically generate performance test scripts.

[0057] In this embodiment, step S2 specifically includes:

[0058] Step S201: Write an interface test case through an Excel file. The fields required for writing an interface test case include: test case ID, module name, case name, request address, request type, request header, request parameters, and transfer parameters;

[0059] Step S202: Import the Excel file into the automated testing tool;

[0060] Step S203: The automated testing tool automatically parses the Excel file and generates a corresponding performance testing script.

[0061] Specifically, after the threshold of the performance indicator is set, the corresponding interface test case is written through an Excel file. The fields required for the interface test case include: test case ID, module name, case name, request address, request type, request header, request parameters, transfer parameters, etc. The written Excel file is imported into the automated testing tool. The automated testing tool parses the Excel file through the openpyxl tool of the python library and generates the corresponding performance test script.

[0062] In this embodiment, step S203 specifically includes:

[0063] Step S2031: extract each interface test case from the Excel file by row, group the interface test cases according to different modules, and the same module corresponds to a performance test script;

[0064] Step S2032: in each module, different interface request scripts are generated according to different request types, and parameter settings and variable transfers are performed according to the association relationship between interfaces to simulate the real interaction process between interfaces;

[0065] Step S2033: according to the preset script rules, the interface test cases belonging to the same module are generated into a performance test script, and different labels are added to the interface test cases according to different test case names.

[0066] Specifically, the interface test cases described in each row in the Excel file are first extracted, and then the interface test cases are grouped by module name.

[0067] In each module, different interface request scripts are generated according to different request types. Then, the interface request scripts are parameterized, different request parameters are passed into the request address and request body, and the request header is placed into the request header of the interface request script, and then the corresponding transfer parameters are parsed. For example, there are corresponding associations between interfaces, which need to be transferred according to variables, such as the transfer format of "${id}=["result"][0]["id"];…" First, split according to the ";" symbol, obtain the corresponding value of each variable id after the "=" symbol, and then extract the corresponding data in the corresponding response result according to this line of data, and then pass it to the following interface test case.

[0068] According to the preset script rules in the Locust tool, the corresponding performance test script is automatically generated. The interface test cases of the same module are generated into one test script, and then corresponding tags are added to the interface test cases according to the different names of the interface test cases.

[0069] Therefore, the present invention can combine interface test cases, directly parse interface test cases, and then automatically generate corresponding performance test scripts, thereby reducing the time for manually writing interface performance test scripts.

[0070] Step S3: Perform automated testing based on the performance test script, obtain the corresponding interface performance test results and perform visual display.

[0071] In this embodiment, step S3 specifically includes:

[0072] Step S301: Each time an automated test is executed, a corresponding interface performance test result will be generated according to the execution timestamp and different URL addresses;

[0073] Step S302: Based on the interface performance test results, obtain the execution timestamp, interface URL address, several performance indicator test result values, and whether each performance indicator test result value is within the threshold range set by the performance indicator, and use it as display data for the visualization chart and display the results.

[0074] Specifically, the Locust tool is used to execute the automatically generated performance test script to automatically obtain the corresponding interface performance test results. Each time an automated test is executed, the corresponding performance test results will be generated according to the execution timestamp and different URL addresses, and the results will be displayed in the form of a visual chart. The fields required for the chart to display data include: execution timestamp, interface URL address, test result value of the performance indicator, and whether each test result value is within the threshold range set by the performance indicator. There is no need for manual analysis to determine whether the performance indicator meets the threshold requirements.

[0075] Step S4: Based on the threshold of the performance indicator, the interface performance test results are automatically analyzed and the analysis results are visually managed.

[0076] In this embodiment, step S4 specifically includes:

[0077] Step S401: managing the interface performance test results of different modules and the threshold settings of performance indicators through a visual interface;

[0078] Step S402: automatically analyzing the interface performance test results of different modules, and visually managing the analysis results.

[0079] In this embodiment, step S402 specifically includes:

[0080] Select the time range and performance index in the visualization interface, aggregate the test result values ​​of the performance index obtained by the test, calculate the fluctuation of the test result values ​​of the performance index in different time periods, and visualize them in the form of a trend chart;

[0081] Based on the threshold setting of performance indicators, the normal fluctuation range of performance indicators is set in the trend chart;

[0082] If the overall fluctuation range of the performance indicator exceeds the normal fluctuation range, the abnormal performance indicator value and abnormal interface performance will be displayed in the trend chart.

[0083] Specifically, a visual interface is used to manage the interface performance test results of different modules and the thresholds of performance indicators, and then the interface performance test results of different modules are automatically analyzed and the analysis results are managed.

[0084] Specifically, the test results of multiple performance indicators in different time periods are aggregated over time for automatic analysis of the overall trend and visual display. Trend analysis uses days, weeks, and months as time units, calculates the fluctuations of different performance indicators in different time periods according to the selected time range, and visualizes them in the form of trend charts. Based on the threshold range set for the performance indicator, the corresponding normal fluctuation range is set in the trend chart. If the overall fluctuation of a performance indicator is greater than the set normal fluctuation range, it means that the performance indicator value and interface performance are abnormal, and further analysis is required.

[0085] Furthermore, the existing performance index test result data is fitted according to the time series analysis method, and the future trend is predicted through the prediction model. The calculated prediction value uses the mean square error function to converge and update the prediction model to ensure the accuracy of the model prediction data. The predicted data is automatically analyzed, such as the stability of the performance indicators and the automatic analysis of the overall performance.

[0086] In this embodiment, step S402 further specifically includes:

[0087] Execute the performance test script under different concurrency numbers to obtain the performance test results;

[0088] Based on the performance test results, get the average response time, query rate per second and CPU usage;

[0089] Compare the average response time, query rate per second and CPU usage at different concurrency numbers into a trend chart;

[0090] In the trend comparison chart, the optimal concurrency point is automatically found with the query conditions of minimum average response time, maximum query rate per second and CPU usage not exceeding the set threshold, indicating that at the optimal concurrency point, the average response time is optimal and the query rate per second is optimal.

[0091] Specifically, in addition to automatically analyzing the overall trend of a time period in the time dimension, you can also execute performance test scripts to obtain performance test results under different concurrency numbers, and automatically analyze the average response time and the optimal Qps achieved at a certain concurrency number. Specifically, the average response time, Qps value, and corresponding system resource data (such as CPU usage) of performance indicators are obtained under different concurrency numbers. The average response time, Qps, and CPU usage at different concurrency numbers form a trend comparison chart, and the optimal concurrency point is automatically found with the query conditions of minimum average response time, maximum query rate per second, and CPU usage not exceeding the set threshold, to indicate that under the concurrency number corresponding to the optimal concurrency point, the average response time is optimal and the Qps achieved is optimal.

[0092] It should be noted that the change in performance indicators is that as the number of concurrent requests increases, the average response time also increases, and the increase in the average response time is an exponential increase curve. When the number of concurrent requests increases to a large extent, there will be many requests to be processed per second, which will cause frequent switching of processes (threads), and the corresponding Qps value will not continue to grow, but will enter a stable or declining state after a period of time.

[0093] Therefore, after the interface performance test is completed, the performance test analysis results are managed in a visual chart format, and an overall statistical analysis is performed, such as an overall pass rate that meets the performance index requirements, to evaluate whether the system has met the predetermined performance index requirements, so that testers can intuitively and clearly understand the changes in system performance. At the same time, the overall performance test results are further automatically analyzed based on the trend of the performance indicators, which helps to quickly identify the changing trends of system performance, such as performance improvement, decline or fluctuation, making the test management work more rational by reducing the interference of human factors, thereby greatly reducing the cost of manpower to integrate and analyze data.

[0094] In summary, an interface performance test automation analysis method provided by an embodiment of the present invention is applied to interface performance testing in an automated testing tool, by creating at least one performance indicator of the interface performance test in the automated testing tool, and setting a threshold for the performance indicator, the performance indicator includes: query rate per second, average response time, maximum response time, minimum response time, concurrency and throughput at least one; write an interface test case and import it into the automated testing tool to automatically generate a performance test script; perform automated testing based on the performance test script, obtain the corresponding interface performance test results and perform visual display; based on the threshold of the performance indicator, automatically analyze the interface performance test results and perform visual management of the analysis results. The present invention realizes automated analysis of interface performance and obtains analysis results, as well as overall management and maintenance of performance test results, without the need to determine whether the performance indicator meets the limit value through manual analysis, reducing the time for manually writing interface performance test scripts and reducing labor costs. At the same time, the interface performance test results are managed in a visual manner, and overall statistical analysis is performed, making the test management work clearer and more intuitive, and comprehensively improving the overall efficiency of daily test management work.

[0095] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0096] In addition, some embodiments of the present application also provide an electronic device. The electronic device may be a digital computer in various forms, such as a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, etc. The electronic device may also be a mobile device in various forms, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices.

[0097] The electronic device comprises: one or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the interface performance test automation analysis method provided in any one or more of the above embodiments. Figure 3 An exemplary structural diagram of the electronic device is disclosed. Figure 3 As shown, the electronic device includes: one or more processors 1101, memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Among them, the components shown in this article, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described and / or required herein.

[0098] The electronic device may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0099] The input device 1103 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0100] To provide interaction with a user, the electronic device may be a computer. The computer has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0101] In the embodiments of the present application, a computer program / instruction is stored on a computer-readable medium, and when the computer program / instruction is executed by a processor, the steps of the interface performance test automation analysis method provided in any one or more of the above embodiments are implemented. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer-readable instructions.

[0102] The memory 1102 can be used as a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more embodiments in the embodiments of the present application.

[0103] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0104] It should be noted that more specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0105] Computer readable storage media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0106] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0107] In the above-described embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. For example, it can be implemented by using an application specific integrated circuit (ASIC), a general-purpose computer or any other similar hardware device. In certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0108] The computer program product provided in the embodiment of the present application includes one or more computer programs / instructions, and when the computer program / instructions are executed by the processor, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0109] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily mention changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-restrictive.

Claims

1. An automated analysis method for interface performance testing, characterized in that: Applied to interface performance testing in an automated testing tool, the method includes: Creating at least one performance indicator of the interface performance test in the automated testing tool, and setting a threshold for the performance indicator, the performance indicator comprising at least one of: query rate per second, average response time, maximum response time, minimum response time, concurrency, and throughput; Write interface test cases and import them into the automated testing tool to automatically generate performance test scripts; Perform automated testing based on the performance test script to obtain corresponding interface performance test results and perform visual display; Based on the threshold of the performance indicator, the interface performance test result is automatically analyzed and the analysis result is visually managed.

2. The interface performance test automation analysis method according to claim 1, characterized in that: The step of writing interface test cases and importing them into the automated testing tool to automatically generate performance test scripts includes: Write interface test cases through an Excel file. The fields required for writing the interface test cases include: test case ID, module name, case name, request address, request type, request header, request parameters, and transfer parameters; Importing the Excel file into the automated testing tool; The automated testing tool automatically parses the Excel file and generates the corresponding performance testing script.

3. The interface performance test automation analysis method according to claim 2, characterized in that: The step of the automated testing tool automatically parsing the Excel file and generating the corresponding performance testing script includes: Extract each interface test case from the Excel file by row, group the interface test cases according to different modules, and one module corresponds to one performance test script; In each of the modules, different interface request scripts are generated according to different request types, and parameter settings and variable transfers are performed according to the association relationship between the interfaces to simulate the real interaction process between the interfaces; According to preset script rules, interface test cases belonging to the same module are generated into one performance test script, and different labels are added to the interface test cases according to different test case names.

4. The interface performance test automation analysis method according to claim 1, characterized in that: The step of performing automated testing based on the performance test script, obtaining corresponding interface performance test results and performing visual display includes: Each time an automated test is executed, the corresponding interface performance test results will be generated based on the execution timestamp and different URL addresses; Based on the interface performance test results, the execution timestamp, interface URL address, several performance indicator test result values, and whether each performance indicator test result value is within the threshold range set by the performance indicator are obtained, and they are used as display data for the visual chart and the results are displayed.

5. The interface performance test automation analysis method according to claim 1, characterized in that: The step of automatically analyzing the interface performance test results based on the threshold of the performance indicator and visually managing the analysis results includes: Use a visual interface to manage the interface performance test results of different modules and the threshold settings of the performance indicators; The interface performance test results of different modules are automatically analyzed and the analysis results are visually managed.

6. The interface performance test automation analysis method according to claim 5, characterized in that: The step of automatically analyzing the interface performance test results of different modules and visually managing the analysis results includes: Select a time range and performance index in the visualization interface, aggregate the test result values ​​of the performance index obtained by the test, calculate the fluctuation of the test result values ​​of the performance index in different time periods, and visualize them in the form of a trend chart; Based on the threshold setting of the performance indicator, a normal fluctuation range of the performance indicator is set in the trend graph; If the overall fluctuation range of the performance indicator exceeds the normal fluctuation range, the performance indicator value abnormality and the interface performance abnormality are displayed in the trend graph.

7. The interface performance test automation analysis method according to claim 5, characterized in that: The step of automatically analyzing the interface performance test results of different modules and visually managing the analysis results also includes: Execute the performance test script under different concurrent numbers to obtain performance test results; Based on the performance test results, obtain the average response time, query rate per second and CPU usage; Form a trend comparison chart of the average response time, the query rate per second and the CPU usage rate at different concurrent numbers; In the trend comparison chart, the optimal concurrency point is automatically found with the query conditions of minimum average response time, maximum query rate per second and CPU usage not exceeding the set threshold, indicating that at the optimal concurrency point, the average response time is optimal and the query rate per second is optimal.

8. An electronic device, characterized in that: The electronic device comprises: One or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the steps of the interface performance test automation analysis method as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the interface performance test automation analysis method as described in any one of claims 1-7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the interface performance test automation analysis method as described in any one of claims 1-7 are implemented.

Citation Information

Cited By

  • Dynamic pressure self-adaptive interface performance automatic test method, device and equipment

    CN121636315A