Performance defect detection method and device, equipment, storage medium and program product
By performing performance analysis and bytecode enhancement on the stress test data of the target application, and combining machine learning models and JVM technology, the problem of accurately locating performance defects using overall application stress test data is solved, achieving more efficient performance defect detection and location.
Patent Information
- Application Number
- CN202410533399.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-10-31
AI Technical Summary
In existing technologies, stress test data based on the entire application is insufficient to accurately locate performance defects, resulting in low efficiency in performance defect detection and a significant waste of human resources and time.
By acquiring stress test data from the target application, performance analysis is performed to initially locate clusters of performance defects. Bytecode enhancement is then used to process the target code segment, and secondary stress test data is used for detection. Combined with machine learning models and JVM technology, performance defects are precisely located.
It improved the accuracy of performance defect detection, reduced human resources and time costs, and increased the iteration efficiency of application products.
Smart Images

Figure CN120872802A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information technology application technology, and in particular to a method, apparatus, equipment, storage medium and program product for detecting performance defects. Background Technology
[0002] In related technologies, performance testing tools are typically used to perform stress tests on internet applications to obtain stress test data, thereby locating performance defects and achieving application performance defect detection. However, it is difficult to accurately locate performance defects based on stress test data of the entire application. Summary of the Invention
[0003] The main objective of this application is to provide a method, apparatus, device, storage medium, and program product for detecting performance defects, aiming to solve the technical problem that it is difficult to accurately locate performance defects based on stress test data of the overall application.
[0004] To achieve the above objectives, this application proposes a performance defect detection method, comprising:
[0005] Obtain the initial stress test data for the target application;
[0006] Performance analysis was performed on the first stress test data to identify clusters of performance defects.
[0007] Initially locate the target code segment corresponding to each performance defect in the performance defect cluster;
[0008] The target code segment is subjected to bytecode enhancement processing to obtain the enhanced code segment;
[0009] Based on the second stress test data of the enhanced code segment, target performance defects in the target application are detected.
[0010] In one embodiment, the stress test data includes multiple performance-related data sequences;
[0011] The steps for performance analysis of the first stress test data to obtain the performance defect cluster include:
[0012] For each first performance-related data sequence in the first stress test data, the performance index value corresponding to the first performance-related data sequence is compared with the preset benchmark index value;
[0013] If the performance index value is lower than the preset benchmark index value, then obtain the defect data sequence corresponding to the performance index value.
[0014] For each defect data in the defect data sequence, determine the data label of the defect data to obtain the data label sequence;
[0015] Based on all data label sequences, obtain the performance defect cluster.
[0016] In one embodiment, the step of determining the data label of defective data includes:
[0017] The majority voting algorithm is used to determine the data labels for defective data.
[0018] In one embodiment, the step of obtaining the performance defect cluster based on all data tag sequences includes:
[0019] Based on the correlation between defect data sequences and performance defects, determine the priority order of the data label sequences corresponding to the defect data sequences;
[0020] Based on the priority order and the sequence of all data labels, construct a performance defect cluster.
[0021] In one embodiment, before the step of determining the priority order of the data tag sequences corresponding to the defect data sequences based on the correlation between the defect data sequences and performance defects, the method further includes:
[0022] The correlation of each defect data sequence is determined using a pre-defined support vector machine model.
[0023] In one embodiment, the step of obtaining the defect data sequence corresponding to the performance index value includes:
[0024] Obtain the initial defect data sequence corresponding to the performance index values;
[0025] Data cleaning and normalization are performed on all initial defect data sequences to obtain the defect data sequence.
[0026] Furthermore, to achieve the above objectives, this application also proposes a performance defect detection device, which includes:
[0027] The acquisition module is used to acquire the initial stress test data of the target application.
[0028] The first analysis module is used to perform performance analysis on the first stress test data to obtain the performance defect cluster.
[0029] The initial location module is used to initially locate the target code segment corresponding to each performance defect in the performance defect cluster.
[0030] The enhancement module is used to perform bytecode enhancement processing on the target code segment to obtain the enhanced code segment;
[0031] The second analysis module is used to detect target performance defects in the target application based on the second stress test data of the enhanced code segment.
[0032] In addition, to achieve the above objectives, this application also proposes a performance defect detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the performance defect detection method described above.
[0033] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the performance defect detection method described above.
[0034] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the performance defect detection method described above.
[0035] One or more technical solutions proposed in this application have at least the following technical effects:
[0036] This application provides a performance defect detection method, apparatus, device, storage medium, and program product, which acquires first stress test data of a target application; performs performance analysis on the first stress test data to obtain a performance defect cluster; initially locates the target code segment corresponding to each performance defect in the performance defect cluster; performs bytecode enhancement processing on the target code segment to obtain the enhanced code segment; and detects the target performance defect of the target application based on the second stress test data of the enhanced code segment.
[0037] Therefore, this application uses stress test data of the target application to initially locate target code segments that may have performance defects, and then uses stress test data of the target code segments to perform performance defect detection of the target application. Compared with performance defect detection based on stress test data of the entire application, performance defect detection based on stress test data of the target code segments can more accurately detect and locate performance defects of the target application, thus improving the accuracy of performance defect detection. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0040] Figure 1This is a flowchart illustrating an embodiment of the performance defect detection method of this application.
[0041] Figure 2 This is a schematic diagram of the module structure of the performance defect detection device according to an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the performance defect detection method in this application embodiment.
[0043] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0044] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0045] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0046] The main solution of this application embodiment is: to obtain first stress test data of the target application; to perform performance analysis on the first stress test data to obtain a cluster of performance defects; to initially locate the target code segment corresponding to each performance defect in the cluster of performance defects; to perform bytecode enhancement processing on the target code segment to obtain the enhanced code segment; and to detect the performance defects of the target application based on the second stress test data of the enhanced code segment.
[0047] In related technologies, with the rapid development of the internet, application products are iterating and changing rapidly, especially with the advent of the Web 3.0 era, which places increasingly higher demands on the performance of application products. Although current internet-based technology products and auxiliary IT systems can be stress-tested and their performance metrics analyzed using various performance testing tools, the analysis process still relies on architects and development engineers manually injecting tags to locate performance defects. This consumes significant human resources and time, greatly reducing the iteration efficiency of application products and hindering their evolution and upgrades. Furthermore, it is difficult to accurately locate performance defects based on overall application stress test data.
[0048] This application provides a solution to obtain first stress test data of a target application; perform performance analysis on the first stress test data to obtain a cluster of performance defects; initially locate the target code segment corresponding to each performance defect in the cluster; perform bytecode enhancement processing on the target code segment to obtain the enhanced code segment; and detect the target performance defects of the target application based on the second stress test data of the enhanced code segment.
[0049] Therefore, this application uses stress test data of the target application to initially locate target code segments that may have performance defects, and then uses stress test data of the target code segments to perform performance defect detection of the target application. Compared with performance defect detection based on stress test data of the entire application, performance defect detection based on stress test data of the target code segments can more accurately detect and locate performance defects of the target application, thus improving the accuracy of performance defect detection.
[0050] Furthermore, this application can also analyze stress test data through machine learning models to detect performance defects in target applications. Compared with manual analysis of performance defects, it does not require a large amount of human resources and time, thus improving the iteration efficiency of application products and promoting the evolution and upgrading of application products.
[0051] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or performance defect detection device capable of performing the above functions. The following description uses a performance defect detection device as an example to illustrate this embodiment and the subsequent embodiments.
[0052] Based on this, embodiments of this application provide a performance defect detection method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the performance defect detection method of this application.
[0053] In this embodiment, the performance defect detection method includes steps S100 to S300:
[0054] Step S100: Obtain the first stress test data of the target application.
[0055] It should be noted that the target application can be any application to be tested for performance defects. Initial stress test data can be obtained by performing stress tests on the target application using performance testing tools.
[0056] Step S200: Perform performance analysis on the first stress test data to obtain the performance defect cluster.
[0057] It should be noted that a performance defect cluster may include at least one performance defect that may exist in the target application.
[0058] In this embodiment, a large-scale performance detection model can be pre-built and trained. This model is then used to perform performance analysis on the first stress test data to identify performance defect clusters. The model architecture and training method of the large-scale performance detection model can be determined based on actual usage.
[0059] In one specific implementation, a large model architecture based on the Transformer structure can be selected, and a modified version of the SGD (Stochastic Gradient Descent) algorithm based on backpropagation can be chosen to construct and train the performance detection large model. During training, the performance of the performance detection large model can be improved by adjusting hyperparameters and the learning rate. To reduce the size and computational cost of the large model, model compression and pruning techniques can be employed for compression. Furthermore, during and after training, accuracy, recall, and F1 score can be used as evaluation metrics to measure the performance of the performance detection large model.
[0060] In one feasible implementation, the stress test data includes multiple performance-related data sequences, and step S200 may include steps A210 to A220:
[0061] Step A210: For each first performance-related data sequence in the first stress test data, compare the performance index value corresponding to the first performance-related data sequence with the preset benchmark index value.
[0062] It should be noted that stress test data can include performance-related data sequences from at least two dimensions, such as server resource consumption ratio, network bandwidth utilization, middleware processing time, application node processing logic and response time, database disk consumption, and SQL (Structured Query Language) statement processing rate. Different dimensions of performance-related data may affect different performance metrics of the target application.
[0063] Different performance indicators correspond to different preset benchmark values, which are determined based on actual usage requirements. By comparing the performance indicator values corresponding to each first performance-related data sequence in the first stress test data with the preset benchmark values, it can be determined whether each first performance-related data sequence causes the target application to produce corresponding performance defects.
[0064] Step A220: If the performance index value is lower than the preset benchmark index value, then obtain the defect data sequence corresponding to the performance index value.
[0065] It should be noted that if the performance index value corresponding to a certain first performance-related data sequence is lower than the preset benchmark index value, it means that the first performance-related data sequence causes the target application to produce a corresponding performance defect, and then the first performance-related data sequence is regarded as a defect data sequence.
[0066] In one feasible implementation, step A220 may include: obtaining the initial defect data sequence corresponding to the performance index value; and performing data cleaning and normalization processing on all initial defect data sequences to obtain the defect data sequence.
[0067] It should be noted that, in order to ensure that the stress test data meets the quality and consistency requirements of the performance testing model, the initial defect data sequence corresponding to the performance index value that is lower than the preset benchmark index value can be cleaned and normalized in advance. This will fill in the missing values in the initial defect data sequence, eliminate noise data, identify or delete outliers and solve inconsistencies, thereby achieving the goals of standardizing the data format, cleaning up abnormal data, correcting errors and removing duplicate data.
[0068] In this embodiment, the equal-depth binning method is used for data cleaning.
[0069] In the specific implementation, for the initial defect data sequence of each dimension, the initial defect data in the initial defect data sequence is binned according to a preset number of record rows. Each bin contains the same preset number of first defect data, and the preset number of record rows is called the bin depth. For the first defect data in each bin, according to a preset classification standard, all the first defect data in that bin are divided into multiple classes, and first defect data outside of multiple classes are removed, thus achieving data cleaning. The preset number of record rows and the preset classification standard can be set according to actual usage requirements.
[0070] In addition, in this embodiment, a discrete standardization method is used to perform a linear transformation on each second defect data in the cleaned defect data sequence, so that the value of the second defect data is mapped to the range [0.1-1], thereby realizing the normalization processing of the cleaned defect data sequence.
[0071] In the specific implementation, Formula 1 is used to normalize the cleaned defect data sequence to obtain the final defect data sequence. Formula 1 is as follows:
[0072]
[0073] X is the cleaned defect data sequence, X max X represents the maximum value in the cleaned defect data sequence. min This represents the minimum value in the cleaned defect data sequence.
[0074] Step A230: For each defect data in the defect data sequence, determine the data label of the defect data to obtain the data label sequence.
[0075] Understandably, data tags can be used to identify the code location where performance defects caused by defective data occur. A large-scale performance inspection model can determine the data tags for each defective data point in a defective data sequence, resulting in a data tag sequence.
[0076] In one feasible implementation, step A230 may include: using a majority voting algorithm to determine the data label of the defective data.
[0077] In this embodiment, the quality of defective data can be evaluated using a majority voting (MV) algorithm to determine the data label of each defective data in the defective data sequence.
[0078] In the specific implementation, if there are m text annotation tasks in the defect data sequence of each dimension, then each text annotation task corresponds to a binary classification, and the defect data sequence [m] to be annotated is... a m b Assign data to n employees (there are m employees in total, n / leqm), for a given defect data m. a The annotation results for each employee are as follows: Based on the labeling results of n employees The final data label of the defect data can be inferred.
[0079] Step A240: Obtain the performance defect cluster based on all data label sequences.
[0080] It is understandable that the data tag sequences corresponding to all defective data sequences constitute a performance defect cluster.
[0081] In one possible implementation, step A240 may include:
[0082] Step A241: Determine the priority order of the data tag sequences corresponding to the defect data sequences based on the correlation between the defect data sequences and the performance defects.
[0083] Step A242: Construct a performance defect cluster based on all data label sequences according to priority order.
[0084] It is understandable that defect data sequences of different dimensions have varying degrees of impact on performance defects, resulting in different correlations between them. When constructing a performance defect cluster, the influence of correlation can be considered. All data label sequences can be sorted according to their priority based on their impact on performance defects to construct the cluster.
[0085] In one feasible implementation, prior to step A241, the performance defect detection method may further include: using a preset support vector machine model to determine the correlation of each defect data sequence.
[0086] In this embodiment, the preset support vector machine model can be a pre-built and trained support vector machine model. For a defect data sequence, the preset support vector machine model can determine the relevance Y of each defect data sequence X.
[0087] Understandably, during the training of a pre-defined support vector machine (SVM) model, the model needs to learn a set of linear coefficients W that can accurately predict the relevance Y of each defect data sequence X. For example, given two defect data sequence samples X1 and X2, with a relevance Y1 of 3 and a relevance Y2 of 5 (Y2 being greater than Y1), training the SVM model using these samples allows it to learn a set of linear coefficients W that transforms X1 into Y1 and X2 into Y2, enabling the model to determine the priority order of X1 and X2. Here, the relevance is the dot product of the defect data sequence and the linear coefficients. In practical applications, the pre-defined SVM model needs to predict the relevance of multiple defect data sequences. Therefore, during training, it can be configured to allow for a certain level of error, training a set of linear coefficients W to accurately predict the order relationship between multiple defect data sequence samples, and maximizing the reach of the hyperplane defined by this set of linear coefficients W to the boundaries of the data on both sides.
[0088] The above is only one possible implementation of step S200 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S200.
[0089] Step S300: Initially locate the target code segment corresponding to each performance defect in the performance defect cluster.
[0090] It should be noted that the large-scale performance detection model can identify potential performance defects in a target application based on performance defect clusters, and preliminarily locate the target code segments where each performance defect is located. Each target code segment can contain at least one performance defect; that is, the number of target code segments can be at least one.
[0091] Step S400: Perform bytecode enhancement processing on the target code segment to obtain the enhanced code segment.
[0092] Step S500: Detect target performance defects in the target application based on the second stress test data of the enhanced code segment.
[0093] In this embodiment, the performance testing tool can perform secondary stress testing on the target code segment. During the secondary stress testing, JVM (Java Virtual Machine) technology and bytecode enhancement technology can be used to proxy and monitor the second stress test data of the target code segment. The second stress test data is then input into the performance detection model for analysis to further detect at least one target performance defect in the target application and locate the position of the target performance defect in the target code segment.
[0094] It's important to note that JVM technology enables intelligent diagnostics of target code segments. These intelligent diagnostic items primarily include attributes such as [Defect Impact], [Diagnostic Logic], [Solution], and [Risk Level], implemented by running diagnostic code written in the [Diagnostic Logic]. Real-time JVM analysis tasks include three types: threads, memory, and hot methods. Offline analysis tasks mainly focus on memory and thread dump files. Performance testing tools create and distribute tasks based on the process dimension of the target code segment. The JVMTI agent, implemented using JVMTI technology, can efficiently and quickly crawl stress test data from the target code segment. By monitoring relevant JVM events, real-time stress test data such as GC (Garbage Collection) occurrence time, GC frequency, thread creation and exit can be obtained for analyzing the resource usage of the target code segment. Through the async interface provided by the Hotspot JVM, combined with relevant data from Linux kernel signals and the proc file system, the Java stack running on the CPU within the JVM can be captured in real time, allowing monitoring and acquisition of hot stacks and hot methods in the target code segment.
[0095] In practice, real-time analysis can be implemented in Java at the module level.
[0096] During real-time thread analysis, the system reads process-related thread information from the proc file system according to a preset cycle and encapsulates it into Os Thread info. It obtains a list of newly created or destroyed threads from the thread agent and updates the mapping relationship between lwpid and threadid. The thread list obtained from Os is divided into three parts, mainly returning the running status and thread information where the stack may be found in the JVM. This forms the second stress test data required for the final real-time thread analysis and is output to the performance detection model.
[0097] During real-time memory analysis, memory metrics data are obtained through MxBean according to a preset cycle. If the target JDK version OpenJDK is lower than 1.6, GC data is obtained through perfData. This forms the second stress test data required for the final real-time memory analysis and is output to the performance testing model.
[0098] When performing real-time analysis of hotspot methods, file socket data is monitored according to a preset period to form the second stress test data required for the final real-time analysis of hotspot methods, which is then output to the performance testing model.
[0099] It should be noted that the preset period is set according to actual usage requirements, for example, 5 seconds. Data collection for real-time analysis of hotspot methods is primarily concentrated in the JVMTI agent corresponding to the CPU, generally implemented using a sampling method. To avoid SafePoint issues, it is ultimately implemented based on JVMTI + signal handlers + AsyncGetCallTrace. For J9 JVMs, bytecode enhancement technology is also relied upon.
[0100] In addition, by using bytecode enhancement technology to dynamically instrument the target code segment, the execution stack of the target code segment can be obtained, and the execution count and execution time of any JAVA method can be monitored, as well as the execution time of each method inside the target JAVA method can be tracked.
[0101] In the specific implementation, when performing secondary stress testing on the target code segment, the bytecode is intercepted and modified before loading the class file; all classes that have already been loaded are retrieved; all classes that have been initialized (those that have executed the `clinit` method, which is a subset of the above) are retrieved; the size of a certain object is retrieved; a certain JAR is added to the bootstrap classpath for synchronous loading with high priority; a certain JAR is added to the classpath for AppClassLoader to load; and prefixes are set for certain native methods, mainly for rule matching when searching for native methods. The core implementation of this part is implemented in a JavaAgent called Wizard (Java Agent).
[0102] Understandably, based on bytecode enhancement technology, for a running target code segment, it is possible to perform decompilation (jad), redefine, method execution time tracing (trace), method call frequency tracing (monitor), and method call stack analysis without restarting the target process of the target code segment. The core logic of issuing commands to the target process, collecting data, and processing data is all within the Process Client. The Process Client can be an NIO socket client, and it also registers the function of listening for readable events to collect and report data within a selector.
[0103] In one feasible implementation, after step S500, the performance defect detection method may further include: optimizing the target application and / or stress testing environment based on the target performance defect to improve the performance metrics of the target application and / or stress testing environment.
[0104] This embodiment provides a performance defect detection method. By using stress test data of the target application, the method initially locates target code segments that may have performance defects. Then, it performs a second stress test on the target code segments to detect performance defects in the target application. Compared to performance defect detection based on stress test data of the entire application, performance defect detection based on stress test data of the target code segments can more accurately detect and locate performance defects in the target application, thus improving the accuracy of performance defect detection.
[0105] Furthermore, this embodiment can also analyze stress test data through machine learning models to detect performance defects in the target application. Compared with manual analysis of performance defects, it does not require a lot of human resources and time, thus improving the iteration efficiency of application products and promoting the evolution and upgrading of application products.
[0106] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the performance defect detection method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0107] This application also provides a performance defect detection device, please refer to... Figure 2 The performance defect detection device may include:
[0108] Module 10 is used to acquire the first stress test data of the target application.
[0109] The first analysis module 20 is used to perform performance analysis on the first stress test data to obtain a cluster of performance defects.
[0110] The initial location module 30 is used to initially locate the target code segment corresponding to each performance defect in the performance defect cluster.
[0111] Enhancement module 40 is used to perform bytecode enhancement processing on the target code segment to obtain the enhanced code segment.
[0112] The second analysis module 50 is used to detect target performance defects in the target application based on the second stress test data of the enhanced code segment.
[0113] The performance defect detection device provided in this application, employing the performance defect detection method described in the above embodiments, can solve the technical problem that it is difficult to accurately locate performance defects based on stress test data of the overall application. Compared with related technologies, the beneficial effects of the performance defect detection device provided in this application are the same as those of the performance defect detection method provided in the above embodiments, and other technical features in the performance defect detection device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0114] This application provides a performance defect detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the performance defect detection method in Embodiment 1 above.
[0115] The following is for reference. Figure 3 The diagram illustrates a structural schematic suitable for implementing the performance defect detection device of the embodiments of this application. The performance defect detection device in the embodiments of this application may include, but is not limited to, mobile terminals such as laptops, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), etc., and fixed terminals such as desktop computers. Figure 3 The performance defect detection device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0116] like Figure 3As shown, the performance defect detection device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the performance defect detection device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the performance defect detection device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows performance defect detection devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0117] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0118] The performance defect detection device provided in this application, employing the performance defect detection method described in the above embodiments, can solve the technical problem that it is difficult to accurately locate performance defects based on stress test data of the overall application. Compared with related technologies, the beneficial effects of the performance defect detection device provided in this application are the same as those of the performance defect detection method provided in the above embodiments, and other technical features of this performance defect detection device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0119] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0120] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0121] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the performance defect detection method described in the above embodiments.
[0122] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0123] The aforementioned computer-readable storage medium may be included in the performance defect detection device; or it may exist independently and not assembled into the performance defect detection device.
[0124] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by a performance defect detection device, the performance defect detection device causes the following: to acquire first stress test data of the target application; to perform performance analysis on the first stress test data to obtain a performance defect cluster; to initially locate the target code segment corresponding to each performance defect in the performance defect cluster; to perform bytecode enhancement processing on the target code segment to obtain an enhanced code segment; and to detect the target performance defect of the target application based on second stress test data of the enhanced code segment.
[0125] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0126] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0127] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0128] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described performance defect detection method. This solves the technical problem that it is difficult to accurately locate performance defects based on stress test data from the overall application. Compared with related technologies, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the performance defect detection method provided in the above embodiments, and will not be repeated here.
[0129] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the performance defect detection method described above.
[0130] The computer program product provided in this application can solve the technical problem that it is difficult to accurately locate performance defects based on stress test data of the overall application. Compared with related technologies, the beneficial effects of the computer program product provided in this application are the same as those of the performance defect detection method provided in the above embodiments, and will not be repeated here.
[0131] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for detecting performance defects, characterized in that, The method includes: Obtain the initial stress test data for the target application; Performance analysis is performed on the first stress test data to obtain a cluster of performance defects. Initially locate the target code segment corresponding to each performance defect in the aforementioned performance defect cluster; The target code segment is subjected to bytecode enhancement processing to obtain the enhanced code segment; Based on the second stress test data of the enhanced code segment, target performance defects of the target application are detected.
2. The method as described in claim 1, characterized in that, Stress test data includes multiple performance-related data sequences; The step of performing performance analysis on the first stress test data to obtain the performance defect cluster includes: For each first performance-related data sequence in the first stress test data, the performance index value corresponding to the first performance-related data sequence is compared with the preset benchmark index value; If the performance index value is lower than the preset benchmark index value, then the defect data sequence corresponding to the performance index value is obtained; For each defect data in the defect data sequence, a data label is determined for the defect data to obtain a data label sequence; The performance defect cluster is obtained based on all the data label sequences.
3. The method as described in claim 2, characterized in that, The step of determining the data label of the defective data includes: The data label of the defective data is determined using a majority voting algorithm.
4. The method as described in claim 2, characterized in that, The step of obtaining the performance defect cluster based on all the data tag sequences includes: Based on the correlation between the defect data sequence and the performance defect, determine the priority order of the data tag sequences corresponding to the defect data sequence; The performance defect cluster is constructed according to the priority order described above and based on all the data tag sequences described above.
5. The method as described in claim 4, characterized in that, Before the step of determining the priority order of the data tag sequences corresponding to the defect data sequence based on the correlation between the defect data sequence and the performance defect, the method further includes: The correlation of each defect data sequence is determined using a pre-defined support vector machine model.
6. The method as described in claim 2, characterized in that, The step of obtaining the defect data sequence corresponding to the performance index value includes: Obtain the initial defect data sequence corresponding to the performance index value; Data cleaning and normalization are performed on all the initial defect data sequences to obtain the defect data sequences.
7. A performance defect detection device, characterized in that, The device includes: The acquisition module is used to acquire the initial stress test data of the target application. The first analysis module is used to perform performance analysis on the first stress test data to obtain a cluster of performance defects. The initial location module is used to initially locate the target code segment corresponding to each performance defect in the performance defect cluster. The enhancement module is used to perform bytecode enhancement processing on the target code segment to obtain the enhanced code segment; The second analysis module is used to detect target performance defects in the target application based on the second stress test data of the enhanced code segment.
8. A performance defect detection device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the performance defect detection method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the performance defect detection method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the performance defect detection method as described in any one of claims 1 to 6.