Software testing method and device, electronic equipment and storage medium
Analyzing and comparing instruction features of complex software with simpler software for performance testing addresses the inefficiency of traditional software testing on multiple CPU platforms, improving efficiency and accuracy.
Patent Information
- Application Number
- CN202510796661.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-06-13
AI Technical Summary
The testing efficiency of the software to be tested is low, especially when the complexity is high, it needs to be adjusted for different CPU platforms, resulting in inefficient testing.
By obtaining the instruction feature data of the software to be tested and the instruction feature data of the simulation software, calculating the similarity between the two, selecting the simulation software with the most similar instruction features for performance testing, and using its test results as the performance test results of the software to be tested, avoiding actual deployment on different CPU platforms.
It improves the efficiency of software testing, reduces hardware resource investment and test cycle, and improves the accuracy and adaptation accuracy of test results, and is suitable for software testing of various complexities.
Smart Images

Figure CN120316017A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technologies, and in particular, to a software testing method, an apparatus, an electronic device, and a storage medium. Background Art
[0002] With the wide application of software in various fields, its complexity and scale are constantly increasing. In order to ensure the quality of software, performance testing of the software is required.
[0003] In the related technologies of software testing, the software to be tested is usually actually deployed to different Central Processing Units (CPUs) for performance testing. When the complexity of the software to be tested is relatively high, the compatibility between the software to be tested and different CPU platforms is different, and the software to be tested needs to be adjusted for different CPU platforms, resulting in low testing efficiency of the software to be tested. Summary of the Invention
[0004] The present application provides a software testing method, an apparatus, an electronic device, and a storage medium, so as to at least solve the problem of low testing efficiency of the software to be tested in the related technologies.
[0005] The present application provides a software testing method, including: Obtaining first instruction feature data of the software to be tested, and obtaining second instruction feature data corresponding to at least two simulation softwares; the software to be tested is a software with a complexity greater than a first preset threshold, and the simulation software is a software with a complexity less than or equal to the first preset threshold; Calculating the similarity between each second instruction feature data and the first instruction feature data respectively to obtain a first similarity between each second instruction feature data and the first instruction feature data; When the maximum value in the first similarities is greater than a second preset threshold, performing performance testing on the target simulation software corresponding to the maximum value to obtain a target performance test result corresponding to the target simulation software; Determining the target performance test result as the performance test result of the software to be tested.
[0006] The present application further provides a software testing apparatus, including: An obtaining unit, configured to obtain first instruction feature data of the software to be tested, and obtain second instruction feature data corresponding to at least two simulation softwares; the software to be tested is a software with a complexity greater than a first preset threshold, and the simulation software is a software with a complexity less than or equal to the first preset threshold; A calculating unit, configured to calculate the similarity between each second instruction feature data and the first instruction feature data respectively to obtain a first similarity between each second instruction feature data and the first instruction feature data; A test unit, configured to perform a performance test on a target simulation software corresponding to the maximum value when the maximum value in the first similarity is greater than a second preset threshold, so as to obtain a target performance test result corresponding to the target simulation software; A determination unit, configured to determine the target performance test result as the performance test result of the software to be tested.
[0007] This application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above software testing methods when executing the computer program.
[0008] This application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above software testing methods are implemented.
[0009] This application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of any of the above software testing methods are implemented.
[0010] Through this application, by obtaining the first instruction feature data of the software to be tested with a complexity greater than a first preset threshold and the second instruction feature data of at least two simulation software with a complexity less than or equal to the first preset threshold, then calculating the instruction feature similarity between each simulation software and the software to be tested respectively, finding the target simulation software with the second feature instruction feature most similar to the first instruction feature data, performing a performance test on the target simulation software, and determining the performance test result of the target simulation software as the performance test result of the software to be tested, it is not necessary to deploy the software to be tested with a complexity greater than the first preset threshold on different central processing unit platforms for testing, and use the simulation software with a complexity less than or equal to the first preset threshold to replace the software to be tested for testing, which improves the testing efficiency. Therefore, the technical problem of low testing efficiency of the software to be tested can be solved, and the technical effect of improving the testing efficiency of the software to be tested can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] To more clearly illustrate the embodiments of this application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0012] Figure 1 It is a schematic flowchart of a software testing method provided by an embodiment of this application; Figure 2 It is a schematic flowchart of the whole process of a software testing provided by an embodiment of this application; Figure 3 A structural schematic diagram of a software testing device provided by an embodiment of the present application; Figure 4 A structural schematic diagram of another software testing device provided by an embodiment of the present application. Specific embodiments
[0013] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0014] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0015] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0016] In combination with the specific application environment architecture or specific hardware architecture on which the execution of the software testing method depends, the specific application environment architecture or specific hardware architecture will be described herein.
[0017] An embodiment of the present application provides a software testing method, and the method will be described in detail in combination with the execution process of the software testing method.
[0018] Figure 1 A flowchart of a software testing method provided by an embodiment of the present application.
[0019] As Figure 1 shown, the method includes the following steps: Step 101, obtaining first instruction feature data of the software to be tested, and obtaining second instruction feature data corresponding to at least two simulation softwares respectively; the software to be tested is a software with a complexity greater than a first preset threshold, and the simulation software is a software with a complexity less than or equal to the first preset threshold.
[0020] The software to be tested refers to the software that needs to be performance - tested during the software development process. Its complexity is usually relatively high. For example, a large - scale database management system software contains numerous functional modules and complex business logics. Instruction feature data refers to the feature information of the instructions executed by the software during operation, including the operation type of the instruction, the operation frequency, and the address distribution of the instruction. In the embodiments of the present application, the instruction feature data can be obtained by classifying and statistically analyzing the Central Processing Unit (CPU) cycle occupancy ratio data of each instruction in the software, and is used to describe the instruction running status data during software operation. For example, the instruction CPU cycle occupancy ratio: the proportion of time consumed by the instruction when running on the CPU, which is statistically analyzed using the performance analysis (perf) tool with the CPU cycle as the count.
[0021] The simulation software refers to the software that has similar functions to the software to be tested, but its complexity is relatively low or simplified. The simulation software is designed to simulate different instruction features, and its complexity is relatively low, less than or equal to the first preset threshold, and can be used to replace the software to be tested for testing in performance testing. The simulation software can be the Standard Performance Evaluation Corporation (SPEC) processor performance benchmark program.
[0022] Complexity refers to the evaluation criteria for measuring the complexity of software. The dimensions of the evaluation criteria include but are not limited to the code scale of the software, the structural complexity, and the degree of dependence on third - party libraries. The higher the complexity, the more complex the software; the lower the complexity, the simpler the software. For the sake of easy understanding, an example is provided: the larger the code scale of the software, the higher the complexity of the software. The first preset threshold refers to the threshold for quantitatively evaluating the complexity of the software. The first preset threshold can be any value, and the embodiments of the present application do not limit the threshold value of the first preset threshold.
[0023] Analyze the software to be tested using a dedicated runtime software instruction profiling method. The runtime software instruction profiling method will monitor and record the instruction execution situation of the software to be tested in real - time during its operation, so as to obtain the first instruction feature data of the software to be tested. The runtime software instruction profiling method does not depend on a specific software architecture, can profile open - source and closed - source software, and has a wide range of applications.
[0024] For a series of at least two alternative simulation software, use the same tools and methods as those for profiling the instructions of the software to be tested. The selection of the simulation software needs to have a certain degree of extensiveness and representativeness, covering software of different types and application fields, so as to increase the possibility of finding a simulation software with a high similarity to the software to be tested.
[0025] To facilitate a better understanding of the method for analyzing running-state software instructions, an example is provided. The software to be tested is made to run normally, and then the method for analyzing running-state software instructions is used to obtain the instruction feature data of the software to be tested, including the proportion of various instruction categories and other required data, such as frequency calculation. During the analysis process, the instructions of the software to be tested are sorted according to different classification methods, such as arithmetic operation instructions, logical operation instructions, data transfer instructions, etc. according to instruction functions; sorting and statistics are carried out according to the instruction execution frequency. In this way, the instruction features of the software to be tested are obtained comprehensively and meticulously. The proportion data of instruction categories is shown in the following table: Table 1
[0026] The simulation software is made to run normally, and then the same method for analyzing instructions is used to obtain the instruction feature data of each simulation software, which is composed of the same proportion data of instruction categories as those in the software to be tested above. The instruction features obtained by analyzing each simulation software are also sorted and statistically analyzed to form a description system similar to the instruction features of the software to be tested for subsequent similarity calculation. Taking the proportion data of instruction categories as an example, the proportion data of instruction categories is shown in the following table: Table 2
[0027] By obtaining the instruction feature data of the software to be tested and the simulation software, simulation software with instruction features similar to those of the software to be tested can be quickly screened for performance testing, without the need to conduct long-term actual deployment and testing for each software to be tested, shortening the testing cycle and improving the testing efficiency.
[0028] Step 102: Calculate the similarity between each second instruction feature data and the first instruction feature data respectively to obtain the first similarity between each second instruction feature data and the first instruction feature data.
[0029] Similarity calculation refers to quantitatively evaluating the similarity degree between the first instruction feature data and the second instruction feature data through a specific algorithm or formula, and calculating a value to represent their similarity. Its value range is usually between [0,1], and the larger the value, the higher the similarity.
[0030] A variety of mathematical algorithms are used to calculate the similarity between the instruction feature data of the software to be tested and the simulation software. These include but are not limited to calculating variance, Euclidean distance, coefficient of determination, cosine similarity, and Pearson correlation coefficient.
[0031] The software to be tested and the simulation software respectively execute a same or similar set of test cases, and during this process, their instruction feature data is collected. To ensure the consistency and comparability of the data, all the instruction feature data needs to be standardized. The standardization process includes removing irrelevant data, normalizing the index range, etc., to ensure the accuracy of subsequent calculations. To calculate the similarity between the first instruction feature data and the second instruction feature data, an appropriate similarity calculation method can be selected. Several commonly used methods are as follows: Euclidean distance: Calculate the distance between two data vectors. The smaller the value, the higher the similarity. Cosine similarity: Determine their similarity by calculating the angle between the data vectors. The closer the value is to 1, the more similar the two are. Pearson correlation coefficient: Evaluate the similarity by calculating the linear correlation between two data sets. Similarity calculation process: For each set of second instruction feature data (data of the simulation software), calculate the similarity with the corresponding first instruction feature data (data of the software to be tested). After calculating the similarity between each set of second instruction feature data and the corresponding first instruction feature data, the obtained result is the first similarity between each pair of data. This similarity value represents the degree of similarity between the software to be tested and the simulation software in terms of specific performance indicators. After calculating the similarity between all data pairs, statistically analyze these similarity values to identify the differences and similarities between the software to be tested and the simulation software. If the similarity is high, it means the behavior of the simulation software is relatively close to that of the software to be tested; if the similarity is low, it means there are significant differences in performance indicators between the two, and the software to be tested may need to be further optimized.
[0032] By calculating the similarity between the second instruction feature data and the first instruction feature data, the simulation software with the highest similarity to the instruction features of the software to be tested can be accurately selected, thereby ensuring that the subsequent performance test results have high reference value and effectively avoiding test result deviations caused by selecting an inappropriate simulation software.
[0033] Step 103, in the case where the maximum value in the first similarity is greater than the second preset threshold, perform a performance test on the target simulation software corresponding to the maximum value to obtain the target performance test result corresponding to the target simulation software.
[0034] The target simulation software refers to the simulation software among multiple simulation software whose similarity between the second instruction feature data and the first instruction feature data of the software to be tested reaches the maximum value. The target performance test result refers to the performance evaluation data obtained by performing a performance test on the target simulation software, including but not limited to indicators such as response time, throughput, and resource occupancy rate.
[0035] After calculating the first similarity between each simulation software and the software to be tested, compare these similarity values. When the maximum value in the first similarities is greater than the second preset threshold, filter out the simulation software with the maximum similarity value and determine it as the target simulation software. Deploy the target simulation software in a test environment that matches the target running environment of the software to be tested, such as the same hardware configuration, operating system version, etc. Use professional performance testing tools to perform performance testing on the target simulation software. According to the expected usage scenarios and performance metric requirements of the software to be tested, set the specific scenarios and parameters for the performance testing. For example, simulate a certain number of concurrent users accessing the target simulation software and set different load intensities and test durations. Start the performance testing tool and perform performance testing on the target simulation software according to the set test scenarios and parameters. During the testing process, collect various performance metric data of the target simulation software in real time, such as response time, throughput, CPU usage rate, memory occupancy rate, etc. After the testing is completed, the performance testing tool automatically generates a performance test report, which includes performance metric data, performance trend charts, and performance bottleneck analysis of the target simulation software under different test scenarios, etc.
[0036] By performing performance testing on the target simulation software, since its instruction characteristics are the most similar to those of the software to be tested, the test results can more accurately reflect the performance of the software to be tested in the actual running environment, providing a more targeted basis for software performance optimization and tuning.
[0037] Step 104, determine the target performance test result as the performance test result of the software to be tested.
[0038] Among multiple simulation software, according to the similarity calculation results, find the target simulation software with the highest similarity to the software to be tested. Directly use the various performance metric data obtained from the performance testing of the target simulation software as the performance test result of the software to be tested. For example, if the performance test result of the target simulation software shows that its response time is 500 milliseconds, throughput is 1000 per second, and the CPU usage rate for transactions is 60%, then determine these values as the performance test result of the software to be tested.
[0039] Since the performance test result of the target simulation software is directly used, it saves the time and resources for performing performance testing on other simulation software and improves the efficiency of the entire testing process.
[0040] Through this application, since the first instruction feature data of the software to be tested with a complexity greater than the first preset threshold and the second instruction feature data of at least two simulation softwares with a complexity less than or equal to the first preset threshold are obtained, then the instruction feature similarity between each simulation software and the software to be tested is calculated respectively, and the target simulation software with the second feature instruction feature most similar to the first instruction feature data is found. The performance test of the target simulation software is carried out, and the performance test result of the target simulation software is determined as the performance test result of the software to be tested. It is not necessary to deploy the software to be tested with a complexity greater than the first preset threshold on different central processing unit platforms for testing. Instead, the simulation software with a complexity less than or equal to the first preset threshold is used to replace the software to be tested for testing, which improves the test efficiency. Therefore, the technical problem of low test efficiency of the software to be tested can be solved, and the technical effect of improving the test efficiency of the software to be tested can be achieved.
[0041] As a refinement of step 102, when calculating the similarity between each second instruction feature data and the first instruction feature data respectively to obtain the first similarity between each second instruction feature data and the first instruction feature data, the following methods can be used but are not limited to: obtaining the first weights corresponding to at least two preset similarity algorithms; at least two preset similarity algorithms include at least two of a preset variance algorithm, a preset Euclidean distance algorithm, and a preset coefficient of determination algorithm; using at least two preset similarity algorithms to calculate the similarity between each second instruction feature data and the first instruction feature data respectively to obtain the second similarity between each second instruction feature data and the first instruction feature data; calculating the first similarity according to the first weight and the second similarity.
[0042] The first weight refers to the numerical weight preset for measuring the importance of different similarity algorithms in the comprehensive calculation of the first similarity. Different similarity algorithms may have different applicability and accuracy for different types of instruction feature data. Therefore, corresponding weights need to be assigned according to the actual situation to reflect the relative importance of each algorithm in the comprehensive calculation. The preset similarity algorithm refers to the algorithm preset for calculating the similarity between instruction feature data, including a preset variance algorithm, a preset Euclidean distance algorithm, a preset coefficient of determination algorithm, etc. These algorithms quantify the similarity between instruction feature data from different perspectives and mathematical models. The second similarity refers to the basic similarity value between the second instruction feature data of each simulation software and the first instruction feature data of the software to be tested calculated by using each preset similarity algorithm respectively. The first similarity refers to the final similarity value obtained by weighted calculation on the basis of comprehensively considering the calculation results of each preset similarity algorithm and their corresponding first weights, and is used to measure the overall similarity degree between the simulation software and the software to be tested in terms of instruction features.
[0043] Determine the target test scenario of the software to be tested: For example, the software to be tested is a software system for financial transactions, which mainly operates in scenarios with high-frequency trading and intensive data processing. Find the mapping relationship to determine the first weight: According to the pre-established mapping relationship between the test scenario and the second weight, find the corresponding target second weight. Suppose in the financial high-frequency trading scenario, the preset variance algorithm weight is 0.4, the preset Euclidean distance algorithm weight is 0.3, and the preset coefficient of determination algorithm weight is 0.3. Determine these weights as the first weights. Calculate the second similarity using the preset similarity algorithm: Preset variance algorithm: Calculate the difference between the same-type data in the second instruction feature data and the first instruction feature data, perform the sum of squares operation and then divide by the number of types to obtain the variance value. Use this variance value to measure the similarity between the two. The smaller the variance, the higher the similarity. Preset Euclidean distance algorithm: Take the square root of the sum of squares of the differences of each type of instruction feature data to obtain the Euclidean distance. The smaller the distance, the higher the similarity. Convert the distance to a similarity value. Preset coefficient of determination algorithm: Determine the coefficient of determination value by calculating the correlation between the second instruction feature data and the first instruction feature data. This value measures the closeness of the linear relationship between the two, and its value range is between [0, 1]. The larger the value, the higher the similarity. For example, use statistical software or mathematical formulas to calculate the coefficient of determination between the simulated software instruction feature data and the software instruction feature data to be tested, and use it as the second similarity.
[0044] Calculate the first similarity according to the first weight and the second similarity: Calculate the weighted similarity of each algorithm: Multiply the second similarity calculated by each preset similarity algorithm by its corresponding first weight. For example, the second similarity calculated by the preset variance algorithm is 0.7, and its first weight is 0.4, then the weighted similarity is 0.7 × 0.4 = 0.28; the second similarity calculated by the preset Euclidean distance algorithm is 0.6, and its first weight is 0.3, then the weighted similarity is 0.6 × 0.3 = 0.18; the second similarity calculated by the preset coefficient of determination algorithm is 0.8, and its first weight is 0.3, then the weighted similarity is 0.8 × 0.3 = 0.24. Aggregate the weighted similarities to obtain the first similarity: Perform a summation operation on the weighted similarities of each algorithm to obtain the final first similarity. For example, 0.28 + 0.18 + 0.24 = 0.7, that is, the first similarity between this simulated software and the software to be tested is 0.7.
[0045] Comprehensively applying multiple preset similarity algorithms and assigning corresponding weights for calculation fully considers the advantages and applicability of different algorithms in different scenarios, can more comprehensively and accurately evaluate the similarity of the simulated software and the software to be tested in terms of instruction features, avoids the biases and limitations that may be brought by a single algorithm, and improves the reliability and effectiveness of the similarity calculation results.
[0046] As a refinement of the above embodiments, when calculating the first similarity according to the first weight and the second similarity, the following methods can be used but are not limited to: respectively performing a product calculation on the first weight and the corresponding second similarity to obtain a first product result of the first weight and the corresponding second similarity; at least two first product results corresponding between each second instruction feature data and the first instruction feature data; respectively performing a summation calculation on at least two first product results corresponding between each second instruction feature data and the first instruction feature data to obtain the first similarity between each second instruction feature data and the first instruction feature data.
[0047] For ease of understanding, an example is provided to determine the first weight and the second similarity: Assume that the second similarities between the second instruction feature data of a certain simulation software and the first instruction feature data of the software to be tested are calculated as 0.7, 0.6, and 0.8 respectively through a preset variance algorithm, a preset Euclidean distance algorithm, and a preset coefficient of determination algorithm, and the corresponding first weights are 0.4, 0.3, and 0.3 respectively.
[0048] Calculate the first product result: Multiply each first weight by the corresponding second similarity respectively to obtain the first product result. For the preset variance algorithm, the first product result is 0.7×0.4 = 0.28; the first product result corresponding to the preset Euclidean distance algorithm is 0.6×0.3 = 0.18; the first product result corresponding to the preset coefficient of determination algorithm is 0.8×0.3 = 0.24. In this way, three first product results are obtained: 0.28, 0.18, and 0.24. Add these three first product results, 0.28 + 0.18 + 0.24 = 0.7, to obtain the first similarity between the second instruction feature data of the simulation software and the first instruction feature data of the software to be tested as 0.7.
[0049] The comprehensive similarity scores of each simulation software and the software to be tested are obtained through weighted calculation. For example, if in a certain scenario, the influence of the instruction execution frequency on performance analysis is relatively large, then when calculating the comprehensive similarity, the weight of the algorithm related to the instruction execution frequency (such as the variance algorithm calculated based on the instruction execution frequency) is set relatively high. Then, sort according to the score, and select the simulation software with the highest score as the best simulation software. After determining the best simulation software, perform performance tests on it on different CPU platforms, and simulate and infer the performance performance of the software to be tested on the corresponding CPU platform through the performance test results of the best simulation software on different CPUs and platforms.
[0050] By multiplying the second similarity calculated by different similarity algorithms with the corresponding weights and then summing them up, it is possible to effectively integrate the advantages of multiple algorithms, give full play to the evaluation characteristics of each algorithm in different aspects, and make the finally obtained first similarity more comprehensively and accurately reflect the similarity between the simulation software and the software to be tested, avoiding the one-sidedness that may be caused by a single algorithm.
[0051] As a refinement of the above embodiment, when performing the similarity calculation between each second instruction feature data and the first instruction feature data by using at least two preset similarity algorithms to obtain the second similarity between each second instruction feature data and the first instruction feature data, the following implementation methods can be adopted but are not limited to: using the preset variance algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data to obtain the second similarity corresponding to the preset variance algorithm; using the preset Euclidean distance algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data to obtain the second similarity corresponding to the preset Euclidean distance algorithm; using the preset coefficient of determination algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data to obtain the second similarity corresponding to the preset coefficient of determination algorithm; the second similarity between each second instruction feature data and the first instruction feature data includes the second similarity corresponding to the preset variance algorithm, the second similarity corresponding to the preset Euclidean distance algorithm, and the second similarity corresponding to the preset coefficient of determination algorithm.
[0052] The preset variance algorithm is a statistical method for measuring the degree of difference between two sets of data, which is used here to calculate the degree of difference between the second instruction feature data and the first instruction feature data, and the similarity is obtained through specific conversion. The preset Euclidean distance algorithm is a calculation method based on the distance between two points in geometric space, which is used to measure the distance between the second instruction feature data and the first instruction feature data in multi-dimensional space. The smaller the distance, the higher the similarity. The preset coefficient of determination algorithm is a statistical index for evaluating the correlation between variables, which is used to measure the linear correlation degree between the second instruction feature data and the first instruction feature data, and its value range is between [0, 1]. The larger the value, the stronger the correlation and the higher the similarity. The second similarity refers to the basic similarity value between the second instruction feature data of each simulation software and the first instruction feature data of the software to be tested calculated by using each preset similarity algorithm respectively.
[0053] Different similarity algorithms may have their own advantages in different scenarios. By using multiple algorithms simultaneously, it is possible to better adapt to various different test scenarios and requirements, making the entire software testing method more flexible and widely applicable.
[0054] As a refinement of the above embodiments, when calculating the similarity between each second instruction feature data and the first instruction feature data using the preset variance algorithm to obtain the second similarity corresponding to the preset variance algorithm, the following methods can be adopted but are not limited to: obtaining the first type of data in the first instruction feature data, the second type of data in each second instruction feature data, and obtaining the number of types of the first type of data and the second type of data; calculating the difference between the first type of data of the same type in each second instruction feature data and the first instruction feature data and the corresponding second type of data of the same type to obtain at least two first difference results between each second instruction feature data and the first instruction feature data; calculating the second similarity corresponding to the preset variance algorithm according to the number of types and at least two first difference results.
[0055] The first type of data / second type of data respectively refer to specific types of instruction feature data in the first instruction feature data of the software to be tested and the second instruction feature data of the simulation software. For example, the proportion of arithmetic operation instructions, the proportion of logical operation instructions, etc. The number of types refers to the number of types of instruction feature data participating in the calculation. For example, if three types of arithmetic operation instructions, logical operation instructions, and data transfer instructions are considered, the number of types is 3. The first difference result refers to the difference between the first type of data and the second type of data of the same type, which is used for subsequent variance calculation.
[0056] The calculation formula of the preset variance algorithm can be implemented by formula (1):
[0057] Wherein, The second similarity corresponding to the preset variance algorithm, is the number of types of the first type of data and the second type of data, is the second type of data, is the first type of data, is the first difference result, is the first square result, is the first sum result.
[0058] The variance algorithm is sensitive to the fluctuations of data and can effectively capture the subtle changes in the proportion of different types of data, thus more accurately reflecting the similarity between software instruction features.
[0059] As a refinement of the above embodiments, when calculating the second similarity corresponding to the preset variance algorithm according to the number of types and at least two first difference results, it can be implemented in but not limited to the following ways, including: respectively squaring at least two first difference results to obtain first square results corresponding to each of the at least two first difference results; performing a summation calculation on the first square results corresponding to each of the at least two first difference results to obtain a first summation result; and performing a quotient calculation on the first summation result and the number of types to obtain the second similarity corresponding to the preset variance algorithm.
[0060] Specifically, the implementation process of this embodiment is a literal description of formula (1). Taking the first instruction feature data of the software to be tested as the target, calculate the instruction feature similarity between each simulation software and it respectively. Taking variance calculation as an example, first, for the data under the same classification of the software to be tested and the simulation software. Then calculate the variance of the two data sequences. The smaller the variance value, the closer the execution frequencies of the two are under this instruction classification, and the higher the similarity.
[0061] As a refinement of the above embodiments, when calculating the second similarity corresponding to the preset Euclidean distance algorithm by calculating the similarity between each second instruction feature data and the first instruction feature data using the preset Euclidean distance algorithm, it can be implemented in but not limited to the following ways, including: calculating the square root of the first summation result to obtain the second similarity corresponding to the preset Euclidean distance algorithm.
[0062] The calculation formula of the preset Euclidean distance algorithm can be implemented by formula (2):
[0063] where is the second similarity corresponding to the preset Euclidean distance algorithm, is the number of types of the first type of data and the second type of data, is the second type of data, is the first type of data, is the first difference result, is the first summation result.
[0064] For the calculation of the Euclidean distance, multiple dimensions of the instruction feature data (such as instruction type distribution, execution frequency, execution duration, etc.) are regarded as coordinates in a multi-dimensional space, and the Euclidean distance between the software to be tested and the simulation software in this multi-dimensional space is calculated to measure the similarity. The shorter the distance, the higher the similarity.
[0065] The preset Euclidean distance algorithm is more sensitive to outliers in the data, can effectively capture large differences in the instruction feature data, and thus provides more accurate results for similarity evaluation.
[0066] As a refinement of the above embodiments, when calculating the similarity between each second instruction feature data and the first instruction feature data using the preset coefficient of determination algorithm to obtain the second similarity corresponding to the preset coefficient of determination algorithm, the following methods can be used but are not limited to, including: obtaining the average value data of the second type of data; calculating the second similarity corresponding to the preset coefficient of determination algorithm according to the average value data and the first summation result.
[0067] The calculation formula of the preset coefficient of determination algorithm can be implemented by formula (3):
[0068] Wherein, is the second similarity corresponding to the preset coefficient of determination algorithm, is the number of types of the first type of data and the second type of data, is the second type of data, is the first type of data, is the first difference result, is the second difference result, is the average value data of the second type of data, is the first squared result, is the second squared result, is the first summation result, is the second summation result.
[0069] Combined with other similarity algorithms (such as variance algorithm and Euclidean distance algorithm), it can evaluate the similarity between instruction feature data from multiple perspectives and improve the accuracy and reliability of the entire similarity calculation method.
[0070] As a refinement of the above embodiments, when calculating the second similarity corresponding to the preset coefficient of determination algorithm according to the average value data and the first summation result, the following methods can be used but are not limited to, including: performing difference calculations on all the second type of data in each second instruction feature data with the average value data respectively to obtain at least two second difference results between all the second type of data in each second instruction feature data and the average value data; calculating the second similarity corresponding to the preset coefficient of determination algorithm according to the at least two second difference results and the first summation result.
[0071] Specifically, the implementation process of this embodiment is a literal description of formula (3). The coefficient of determination evaluates the fitting degree of the simulation software to the software under test as a whole. The closer the value is to 1, the higher the similarity between the two.
[0072] As a refinement of the above embodiments, when calculating the second similarity corresponding to the preset determination coefficient algorithm according to at least two second difference results and the first summation result, the following implementation manners can be adopted but are not limited thereto, including: respectively performing a square calculation on at least two second difference results to obtain second square results corresponding to the at least two second difference results respectively; performing a summation calculation on the second square results corresponding to the at least two second difference results respectively to obtain a second summation result; performing a quotient calculation on the first summation result and the second summation result to obtain the second similarity corresponding to the preset determination coefficient algorithm.
[0073] Specifically, the implementation process of this embodiment is a literal description of formula (3).
[0074] As a refinement of the above embodiments, when obtaining the first weights corresponding to at least two preset similarity algorithms respectively, the following implementation manners can be adopted but are not limited thereto, including: obtaining the target test scenario of the software to be tested; according to the mapping relationship established in advance between the test scenario and the second weight, looking up the target second weight corresponding to the target test scenario; the target second weight includes the second weights corresponding to at least two preset similarity algorithms respectively; determining the target second weight as the first weight.
[0075] The second weight refers to the weight value associated with the target test scenario, which is determined by the mapping relationship established in advance between the test scenario and the weight, and represents the importance degree of different similarity algorithms to the target test scenario during the test. The second weight is the basis for calculating the first weight. The target test scenario refers to the selected test scenario in the software to be tested, which is usually used to evaluate the performance and functions of the software in a specific environment. The target test scenario may cover different software function modules, input data, user operations, etc. The mapping relationship refers to the relationship mapping rule between the target test scenario and the second weight. This rule defines the change of different test scenarios in the second weight value, and the corresponding weight is looked up according to this rule.
[0076] By analyzing the requirement document, design document and usage instruction of the software to be tested, its target test scenario is determined. For example, the software to be tested is a software system for financial transactions, and its target test scenario is a high-frequency financial transaction scenario. Looking up the mapping relationship to determine the target second weight: in the preset mapping relationship table, look up the corresponding target second weight according to the target test scenario. For example, it is stipulated in the mapping relationship table that in the high-frequency financial transaction scenario, the weight of the variance algorithm is 0.4, the weight of the Euclidean distance algorithm is 0.3, and the weight of the determination coefficient algorithm is 0.3. Determining the first weight: directly determine the found target second weight as the first weight in the current test task.
[0077] It supports flexibly adjusting the weight of the similarity algorithm according to different test scenarios, enabling the entire software testing method to adapt to various specific test requirements and enhancing the flexibility and adaptability of the test strategy.
[0078] To facilitate a better understanding of the entire process of software testing, as Figure 2 shown, Figure 2 This is a schematic flowchart of the entire process of a software testing provided by an embodiment of the present application. First, the software to be tested is subjected to instruction analysis to obtain the first instruction feature data. Then, each simulation software is subjected to instruction analysis to obtain the second instruction feature data of each simulation software. The similarity between the first instruction feature data and the second instruction feature data of each simulation software is calculated, and the simulation software corresponding to the maximum similarity value is determined as the target simulation software. The target simulation software is subjected to performance testing to obtain the target performance test result of the target simulation software, or according to the mapping relationship established in advance between the simulation software and the performance test result, the target performance test result of the target simulation software is searched for, and the target performance test result is determined as the performance test result of the software to be tested.
[0079] First, in terms of reducing implementation costs, traditional methods require actual deployment testing on the target CPU platform, which means purchasing CPUs of different models, building an adapted server environment, and investing a large amount of funds in hardware procurement, installation and commissioning, and subsequent maintenance. For example, to test the performance of a software on multiple CPUs with different architectures, it may cost hundreds of thousands of yuan to purchase the corresponding hardware devices. However, the present invention does not require deployment on the actual target CPU platform. Only instruction analysis and similarity calculation of the software to be tested and the simulation software need to be performed in a conventional environment, significantly reducing the investment in hardware resources and remarkably reducing the implementation cost. This enables enterprises and research institutions to carry out software performance analysis without bearing high hardware purchase costs and to carry out relevant work at a lower cost. Especially for small teams or startups with limited budgets, it has extremely high practical value.
[0080] Secondly, the test cycle is significantly shortened. In the traditional method, since the deployment testing on the target CPU platform involves complex processes such as hardware construction, software adaptation, and long-term operation to obtain stable data, the entire test cycle may be as long as several weeks or even months. For example, for the performance testing of large-scale distributed software, only the construction of the hardware environment may take several days, and the test running stage requires continuous operation for several weeks to collect sufficient data. However, through runtime instruction feature analysis, the present invention can quickly complete instruction analysis and similarity calculation in a conventional environment, perform performance testing after determining the simulation software, and the entire process is relatively simple and efficient. The test cycle can be shortened to several days or even shorter. This speeds up the process of software performance analysis, enabling developers to obtain analysis results faster and timely optimize and adjust the software, improving the efficiency of software development and iteration.
[0081] Furthermore, the adaptation accuracy has been significantly improved. By obtaining instruction-level data based on the running state, it can truly reflect the instruction behavior and characteristics of the software during actual operation. Traditional static code analysis only infers instruction behavior from the code structure and cannot take into account the dynamic changes in instructions caused by factors such as data input and environmental changes during actual operation. The present invention accurately grasps the actual situation of the software during operation by capturing the instruction characteristics in real time, making the performance speculation based on the simulation software more accurate. For example, for some software with complex business logic and diverse data inputs, the present invention can more accurately find similar simulation software according to the instruction characteristics in the running state under different inputs, and then more accurately predict the performance of the software to be tested, providing a more reliable basis for software optimization.
[0082] In addition, the present application has achieved a breakthrough in binary compatibility. By matching instruction characteristics, it has successfully solved the problem of the lack of effective analysis means for non-open-source binary programs. In the past, due to the lack of source code, it was extremely difficult to analyze the performance of non-open-source binary programs. However, the present application infers the performance of non-open-source binary programs on different platforms by finding simulation software with similar instruction characteristics and using the analysis results of the simulation software, realizing cross-platform simulation. This is of great significance for the performance analysis of many commercial software and software that is not open source due to intellectual property protection, broadens the application scope of performance analysis technology, helps to tap the performance potential of such software, and improves its overall quality.
[0083] Finally, the flexible extension mechanism established in the present application supports the hybrid matching of the SPEC CPU standard suite and customized test cases, greatly improving flexibility. In special fields such as aerospace and medical equipment, software has unique performance requirements, and general test suites cannot meet their customized analysis requirements. The present application allows for the flexible selection of some test cases in the standard suite according to the characteristics of software in special fields and combines them with customized test cases for performance analysis. For example, in the performance analysis of flight control software in the aerospace field, customized test cases for key functions such as flight data processing and real-time response can be added on the basis of the SPEC CPU standard suite to achieve a comprehensive and accurate performance evaluation of the software in this field, meeting the diverse needs of software performance analysis in different fields.
[0084] The embodiments of the present application also provide a software testing device. Figure 3 The following is a schematic structural diagram of a software testing device provided by an embodiment of the present application, as Figure 3 shown, including: An acquisition unit 21, configured to acquire first instruction feature data of the software to be tested, and acquire second instruction feature data corresponding to each of at least two simulation softwares; the software to be tested is a software with a complexity greater than a first preset threshold, and the simulation software is a software with a complexity less than or equal to the first preset threshold; A calculation unit 22, configured to calculate the similarity between each second instruction feature data and the first instruction feature data respectively, to obtain a first similarity between each second instruction feature data and the first instruction feature data; A test unit 23, configured to perform a performance test on the target simulation software corresponding to the maximum value when the maximum value in the first similarities is greater than a second preset threshold, to obtain a target performance test result corresponding to the target simulation software; A determination unit 24, configured to determine the target performance test result as the performance test result of the software to be tested.
[0085] Through this application, since the first instruction feature data of the software to be tested with a complexity greater than the first preset threshold and the second instruction feature data of at least two simulation softwares with a complexity less than or equal to the first preset threshold are acquired, and then the instruction feature similarity between each simulation software and the software to be tested is calculated respectively, the target simulation software with the second feature instruction feature most similar to the first instruction feature data is found, the performance test is performed on the target simulation software, and the performance test result of the target simulation software is determined as the performance test result of the software to be tested. There is no need to deploy the software to be tested with a complexity greater than the first preset threshold on different central processing unit platforms for testing. Instead, the simulation software with a complexity less than or equal to the first preset threshold is used to replace the software to be tested for testing, which improves the test efficiency. Therefore, the technical problem of low test efficiency of the software to be tested can be solved, and the technical effect of improving the test efficiency of the software to be tested can be achieved.
[0086] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the calculation unit 22 includes: An acquisition module 221, configured to acquire first weights corresponding to at least two preset similarity algorithms; the at least two preset similarity algorithms include at least two of a preset variance algorithm, a preset Euclidean distance algorithm, and a preset coefficient of determination algorithm; A calculation module 222, configured to use at least two preset similarity algorithms to calculate the similarity between each second instruction feature data and the first instruction feature data respectively, to obtain a second similarity between each second instruction feature data and the first instruction feature data; The calculation module 222 is further configured to calculate the first similarity according to the first weights and the second similarities.
[0087] Further, in a possible implementation manner of this embodiment, asFigure 4 As shown, the computing module 222 is further configured to: Respectively perform a product calculation on the first weight and the corresponding second similarity to obtain a first product value result of the first weight and the corresponding second similarity; at least two first product value results corresponding between each second instruction feature data and the first instruction feature data; Respectively perform an addition calculation on at least two first product value results corresponding between each second instruction feature data and the first instruction feature data to obtain a first similarity between each second instruction feature data and the first instruction feature data.
[0088] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the computing module 222 is further configured to: Use a preset variance algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset variance algorithm; Use a preset Euclidean distance algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset Euclidean distance algorithm; Use a preset coefficient of determination algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset coefficient of determination algorithm; The second similarity between each second instruction feature data and the first instruction feature data includes the second similarity corresponding to the preset variance algorithm, the second similarity corresponding to the preset Euclidean distance algorithm, and the second similarity corresponding to the preset coefficient of determination algorithm.
[0089] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the computing module 222 is further configured to: Obtain the first type of data in the first instruction feature data, the second type of data in each second instruction feature data, and obtain the type quantity of the first type of data and the second type of data; Perform a difference calculation on the first type of data of the same type and the corresponding second type of data of the same type between each second instruction feature data and the first instruction feature data to obtain at least two first difference results between each second instruction feature data and the first instruction feature data; Calculate the second similarity corresponding to the preset variance algorithm according to the type quantity and at least two first difference results.
[0090] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the computing module 222 is further configured to: Square at least two first difference results respectively to obtain the first square results corresponding to the at least two first difference results respectively; Sum up the first square results corresponding to the at least two first difference results respectively to obtain a first sum result; Divide the first sum result by the number of types to obtain a second similarity corresponding to a preset variance algorithm.
[0091] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the calculation module 222 is further configured to: Calculate the square root of the first sum result to obtain a second similarity corresponding to a preset Euclidean distance algorithm.
[0092] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the calculation module 222 is further configured to: Obtain the average value data of the second type of data; Calculate a second similarity corresponding to a preset coefficient of determination algorithm according to the average value data and the first sum result.
[0093] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the calculation module 222 is further configured to: Calculate the difference between all the second type of data in each second instruction feature data and the average value data respectively to obtain at least two second difference results between all the second type of data in each second instruction feature data and the average value data; Calculate a second similarity corresponding to a preset coefficient of determination algorithm according to the at least two second difference results and the first sum result.
[0094] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the calculation module 222 is further configured to: Square at least two second difference results respectively to obtain the second square results corresponding to the at least two second difference results respectively; Sum up the second square results corresponding to the at least two second difference results respectively to obtain a second sum result; Divide the first sum result by the second sum result to obtain a second similarity corresponding to a preset coefficient of determination algorithm.
[0095] Further, in a possible implementation manner of this embodiment, as Figure 4 shown, the acquisition module 221 is further configured to: Obtain the target test scenario of the software to be tested; According to the mapping relationship established in advance between the test scenarios and the second weights, search for the target second weight corresponding to the target test scenario; the target second weight includes the second weights corresponding to at least two preset similarity algorithms respectively; Determine the target second weight as the first weight.
[0096] For the descriptions of the features in the embodiments corresponding to the software testing device, reference can be made to the relevant descriptions in the embodiments corresponding to the software testing method, which will not be elaborated here one by one.
[0097] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above software testing method embodiments.
[0098] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above software testing method embodiments when running.
[0099] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs that can store computer programs.
[0100] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above software testing method embodiments.
[0101] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps in any of the above software testing method embodiments.
[0102] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0103] The above has introduced in detail a software testing method, device, electronic device, and storage medium provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A software testing method, characterized in that Including: Obtaining first instruction feature data of the software to be tested, and obtaining second instruction feature data corresponding to at least two simulation softwares respectively; The software to be tested is a software with a complexity greater than a first preset threshold, and the simulation software is a software with a complexity less than or equal to the first preset threshold; Calculating the similarity between each of the second instruction feature data and the first instruction feature data respectively to obtain a first similarity between each of the second instruction feature data and the first instruction feature data; When the maximum value in the first similarities is greater than a second preset threshold, performing a performance test on the target simulation software corresponding to the maximum value to obtain a target performance test result corresponding to the target simulation software; Determining the target performance test result as the performance test result of the software to be tested.
2. The software testing method according to claim 1, wherein The calculating the similarity between each of the second instruction feature data and the first instruction feature data respectively to obtain a first similarity between each of the second instruction feature data and the first instruction feature data includes: Obtaining first weights corresponding to at least two preset similarity algorithms; the at least two preset similarity algorithms include at least two of a preset variance algorithm, a preset Euclidean distance algorithm, and a preset determination coefficient algorithm; Using at least two preset similarity algorithms to calculate the similarity between each of the second instruction feature data and the first instruction feature data respectively to obtain a second similarity between each of the second instruction feature data and the first instruction feature data; Calculating the first similarity according to the first weights and the second similarities.
3. The software testing method according to claim 2, wherein The calculating the first similarity according to the first weights and the second similarities includes: Performing a product calculation on the first weights and the corresponding second similarities respectively to obtain a first product result of the first weights and the corresponding second similarities; at least two first product results corresponding to each of the second instruction feature data and the first instruction feature data; Performing a summation calculation on at least two first product results corresponding to each of the second instruction feature data and the first instruction feature data respectively to obtain a first similarity between each of the second instruction feature data and the first instruction feature data.
4. The software testing method according to claim 2, wherein The using at least two preset similarity algorithms to calculate the similarity between each of the second instruction feature data and the first instruction feature data respectively to obtain a second similarity between each of the second instruction feature data and the first instruction feature data includes: Using the preset variance algorithm to calculate the similarity between each of the second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset variance algorithm; Using the preset Euclidean distance algorithm to calculate the similarity between each of the second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset Euclidean distance algorithm; Using the preset coefficient of determination algorithm, calculate the similarity between each of the second instruction feature data and the first instruction feature data to obtain the second similarity corresponding to the preset coefficient of determination algorithm; The second similarity between each of the second instruction feature data and the first instruction feature data includes the second similarity corresponding to the preset variance algorithm, the second similarity corresponding to the preset Euclidean distance algorithm, and the second similarity corresponding to the preset coefficient of determination algorithm.
5. The software testing method according to claim 4, wherein, The calculating the similarity between each of the second instruction feature data and the first instruction feature data using the preset variance algorithm to obtain the second similarity corresponding to the preset variance algorithm includes: Obtain the first type of data in the first instruction feature data, the second type of data in each second instruction feature data, and obtain the number of types of the first type of data and the second type of data; Perform a difference calculation on the first type of data of the same type in each second instruction feature data and the second type of data of the corresponding same type in the first instruction feature data to obtain at least two first difference results between each second instruction feature data and the first instruction feature data; Calculate the second similarity corresponding to the preset variance algorithm according to the number of types and the at least two first difference results.
6. The software testing method according to claim 5, characterized in that, The calculating the second similarity corresponding to the preset variance algorithm according to the number of types and the at least two first difference results includes: Square each of the at least two first difference results to obtain the first squared result corresponding to each of the at least two first difference results; Perform a summation calculation on the first squared results corresponding to each of the at least two first difference results to obtain a first summation result; Perform a division calculation on the first summation result and the number of types to obtain the second similarity corresponding to the preset variance algorithm.
7. The software testing method according to claim 6, wherein The calculating the similarity between each of the second instruction feature data and the first instruction feature data using the preset Euclidean distance algorithm to obtain the second similarity corresponding to the preset Euclidean distance algorithm includes: Perform a square root calculation on the first summation result to obtain the second similarity corresponding to the preset Euclidean distance algorithm.
8. The software testing method according to claim 6, characterized in that, The calculating the similarity between each of the second instruction feature data and the first instruction feature data using the preset coefficient of determination algorithm to obtain the second similarity corresponding to the preset coefficient of determination algorithm includes: Obtain the average value data of the second type of data; Calculate the second similarity corresponding to the preset coefficient of determination algorithm according to the average value data and the first summation result.
9. The software testing method according to claim 8, wherein The calculating the second similarity corresponding to the preset coefficient of determination algorithm according to the average value data and the first summation result includes: Perform a difference calculation on all the second type of data in each second instruction feature data and the average value data respectively to obtain at least two second difference results between all the second type of data in each second instruction feature data and the average value data; Calculate a second similarity corresponding to the preset coefficient of determination algorithm according to the at least two second difference results and the first summation result.
10. The software testing method according to claim 9, wherein The calculating the second similarity corresponding to the preset coefficient of determination algorithm according to the at least two second difference results and the first summation result includes: Perform a square calculation on each of the at least two second difference results to obtain second square results respectively corresponding to the at least two second difference results; Perform a summation calculation on the second square results respectively corresponding to the at least two second difference results to obtain a second summation result; Perform a quotient calculation on the first summation result and the second summation result to obtain the second similarity corresponding to the preset coefficient of determination algorithm.
11. The software testing method according to claim 2, wherein The obtaining the first weight corresponding to each of the at least two preset similarity algorithms includes: Obtain a target test scenario of the software to be tested; According to a pre-established mapping relationship between the test scenario and the second weight, look up a target second weight corresponding to the target test scenario; the target second weight includes second weights corresponding to each of the at least two preset similarity algorithms; Determine the target second weight as the first weight.
12. A software testing device, characterized in that, Includes: An obtaining unit, configured to obtain first instruction feature data of the software to be tested and obtain second instruction feature data respectively corresponding to at least two simulation softwares; The software to be tested is a software with a complexity greater than a first preset threshold, and the simulation software is a software with a complexity less than or equal to the first preset threshold; A calculating unit, configured to perform a similarity calculation between each of the second instruction feature data and the first instruction feature data respectively to obtain a first similarity between each of the second instruction feature data and the first instruction feature data; A testing unit, configured to perform a performance test on a target simulation software corresponding to the maximum value in the case that the maximum value in the first similarities is greater than a second preset threshold to obtain a target performance test result corresponding to the target simulation software; A determining unit, configured to determine the target performance test result as the performance test result of the software to be tested.
13. An electronic device, characterized in that, Includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the software testing method according to any one of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program, when executed by a processor, implements the steps of the software testing method according to any one of claims 1 to 11.
15. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the software testing method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method and device for carrying out CPU test on domestic servers by utilizing SPEC CPU
CN106951349A
Automatic software deployment method and device
CN107247610A
Server energy consumption test method and device, electronic equipment and storage medium
CN117009200A
Virtual simulation method, device and equipment based on Autosar architecture
CN118708488A
Cited By
Internet of Things equipment access method and device, electronic equipment and storage medium
CN121530935A
Iot device access method and apparatus, electronic device, and storage medium
CN121530935B