Software testing method and device, electronic device and storage medium
By calculating the similarity of the instruction characteristics of the software to be tested and the simulation software to be tested, selecting the simulation software with the most similar instruction characteristics for performance testing, solving the problem of low testing efficiency of the software to be tested on different CPU platforms, and achieving efficient and accurate test results.
Patent Information
- Application Number
- CN202510796661.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-06-13
AI Technical Summary
In the prior art, the testing efficiency of the software to be tested is low, especially when the complexity is high, and adjustments are needed for different CPU platforms, resulting in low testing efficiency.
By obtaining the instruction feature data of the software to be tested and 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 of tests on different CPU platforms.
It improves the efficiency of software testing, reduces hardware resource investment and test cycle, and improves test accuracy and adaptability.
Smart Images

Figure CN120316017B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a software testing method and device, an electronic device, and a storage medium. Background Art
[0002] With the widespread application of software in various fields, its complexity and scale are constantly increasing. In order to ensure the quality of the software, it is necessary to perform performance testing on the software.
[0003] In software testing technologies, the software to be tested is usually deployed to different central processing units (CPUs) for performance testing. When the complexity of the software to be tested is large, the compatibility of the software to be tested with different CPU platforms varies. 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 and apparatus, an electronic device, and a storage medium to at least solve the problem of low testing efficiency of the software to be tested in the related art.
[0005] This application provides a software testing method, including:
[0006] Obtaining first instruction feature data of the software to be tested, and obtaining second instruction feature data corresponding to each of at least two simulation software; the software to be tested is software having a complexity greater than a first preset threshold, and the simulation software is software having a complexity less than or equal to the first preset threshold;
[0007] 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;
[0008] When the maximum value in the first similarity is greater than the second preset threshold, a performance test is performed on the target simulation software corresponding to the maximum value to obtain a target performance test result corresponding to the target simulation software;
[0009] The target performance test result is determined as the performance test result of the software to be tested.
[0010] This application also provides a software testing device, comprising:
[0011] an acquisition unit, configured to acquire first instruction characteristic data of the software to be tested, and to acquire second instruction characteristic data corresponding to each of at least two simulation software programs; the software to be tested is software having a complexity greater than a first preset threshold, and the simulation software is software having a complexity less than or equal to the first preset threshold;
[0012] a calculation unit, configured to respectively calculate a similarity 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;
[0013] A testing unit, configured to, when a maximum value in the first similarity is greater than a second preset threshold, perform a performance test on a target simulation software corresponding to the maximum value, and obtain a target performance test result corresponding to the target simulation software;
[0014] The determination unit is used to determine the target performance test result as the performance test result of the software to be tested.
[0015] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned software testing methods when executing the computer program.
[0016] The present 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-mentioned software testing methods are implemented.
[0017] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned software testing methods when executed by a processor.
[0018] Through the present application, by obtaining the first instruction feature data of the software to be tested whose complexity is greater than the first preset threshold and the second instruction feature data of at least two simulation software whose complexity is less than or equal to the first preset threshold, and then calculating the instruction feature similarity between each simulation software and the software to be tested respectively, finding the target simulation software whose second feature instruction feature is most similar to the first instruction feature data feature, performing performance testing 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, there is no need to deploy the software to be tested whose complexity is greater than the first preset threshold on different central processing unit platforms for testing, and using the simulation software whose complexity is less than or equal to the first preset threshold to replace the software to be tested for testing, thereby improving 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
[0019] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0020] Figure 1 A flowchart of a software testing method provided in an embodiment of the present application;
[0021] Figure 2 A flowchart of the entire process of software testing provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of the structure of a software testing device provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of another software testing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0025] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0026] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0027] In conjunction 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 is described herein.
[0028] The embodiments of the present application provide a software testing method, and the method is described in detail in conjunction with the execution process of the software testing method.
[0029] Figure 1 A flowchart of a software testing method provided in an embodiment of the present application.
[0030] like Figure 1 As shown, the method comprises the following steps:
[0031] Step 101, obtain first instruction feature data of the software to be tested, and obtain second instruction feature data corresponding to at least two simulation software respectively; the software to be tested is software with complexity greater than a first preset threshold, and the simulation software is software with complexity less than or equal to the first preset threshold.
[0032] The software to be tested refers to software that needs to be performance tested during the software development process. Its complexity is usually relatively large. For example, a large database management system software contains numerous functional modules and complex business logic. Instruction feature data refers to the characteristic information of the instructions executed by the software during operation, including the operation type, operation frequency, and address distribution of the instructions. In the embodiment of the present application, the instruction feature data can be obtained by classifying and counting the central processing unit (CPU) cycle ratio data of each instruction in the software, and is used to describe the running status of the instructions when the software is running. For example, the instruction CPU cycle ratio is the ratio of time spent on the CPU by using the performance analysis (perf) tool with CPU cycles as the count.
[0033] Simulation software refers to software that has similar functions to the software to be tested, but is less complex or more simplified. Simulation software is software designed to simulate different instruction characteristics. Its complexity is relatively low, less than or equal to a first preset threshold, and can be used to replace the software to be tested in performance testing. The simulation software can be a processor performance benchmark program (Standard Performance Evaluation Corporation, SPEC).
[0034] Complexity refers to the criterion for measuring the complexity of software. The dimensions of the criterion include but are not limited to the code size, structural complexity, and dependency on third-party libraries of the software. The higher the complexity, the more complex the software, and the lower the complexity, the simpler the software. For ease of understanding, an example is provided. The larger the code size 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. The embodiment of the present application does not limit the threshold of the first preset threshold.
[0035] The software under test is analyzed using a specialized runtime software instruction profiling method. This method monitors and records instruction execution in real time during the software under test, generating first instruction signature data. This method is independent of a specific software architecture and can analyze both open-source and closed-source software, making it widely applicable.
[0036] A series of at least two candidate simulation software programs are processed using the same tools and methods used for instruction analysis of the software under test. The selection of simulation software should be comprehensive and representative, covering software of different types and application areas, to increase the likelihood of finding simulation software with high similarity to the software under test.
[0037] In order to facilitate a better understanding of the running software instruction analysis method, an example is provided to make the software to be tested run normally, and then the running software instruction analysis method 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 transmission instructions, etc. according to the instruction function; sorting and statistics are performed according to the instruction execution frequency, etc. In this way, the instruction characteristics of the software to be tested are obtained comprehensively and meticulously. The proportion data of instruction categories are shown in the following table:
[0038] Table 1
[0039]
[0040] Each simulation software was run normally, and then the same instruction analysis method was used to obtain instruction feature data for each simulation software. The composition of the instruction category proportion data in the above-mentioned test software was the same. The instruction features obtained from the analysis of each simulation software were also classified, organized, and counted to form a description system similar to the instruction features of the test software, so as to facilitate subsequent similarity calculation. Taking the instruction category proportion data as an example, the instruction category proportion data is shown in the following table:
[0041] Table 2
[0042]
[0043] By obtaining the instruction feature data of the software to be tested and the simulation software, we can quickly screen out simulation software with similar instruction features to the software to be tested for performance testing. This eliminates the need for long-term actual deployment and testing of each software to be tested, shortening the test cycle and improving test efficiency.
[0044] Step 102 : 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.
[0045] Similarity calculation refers to the quantitative evaluation of the similarity between the first instruction feature data and the second instruction feature data through a specific algorithm or formula, and the calculation of a numerical value to represent their similarity. The value range is usually between [0,1]. The larger the value, the higher the similarity.
[0046] Use various mathematical algorithms to calculate the similarity between the instruction feature data of the software under test and the simulation software. These include but are not limited to calculating variance, Euclidean distance and coefficient of determination, cosine similarity, and Pearson correlation coefficient.
[0047] The software under test and the simulation software each execute the same or similar test case, collecting their instruction signature data during the process. To ensure data consistency and comparability, all instruction signature data must be normalized. Standardization includes removing irrelevant data and normalizing the indicator range to ensure the accuracy of subsequent calculations. To calculate the similarity between the first and second instruction signature data, an appropriate similarity calculation method can be selected. Commonly used methods include: Euclidean distance: Calculates the distance between two data vectors; smaller values indicate higher similarity. Cosine similarity: Determines similarity by calculating the angle between the data vectors; closer to 1, greater similarity. Pearson correlation coefficient: Evaluates similarity between two data sets by calculating the linear correlation between them. Similarity calculation process: For each set of second instruction signature data (the simulation software's data), a similarity is calculated with the corresponding first instruction signature data (the software under test's data). The result of this similarity calculation is the first similarity between each pair of data. This similarity value indicates the degree of similarity between the software under test and the simulation software on a specific performance metric. After calculating the similarity between all data pairs, we statistically analyze these similarity values to identify differences and similarities between the software under test and the simulation software. A high similarity indicates that the simulation software's behavior closely resembles the software under test; a low similarity indicates significant performance differences between the two, potentially requiring further optimization of the software under test.
[0048] 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 feature of the software to be tested can be accurately screened out, thereby ensuring that the subsequent performance test results have a high reference value and effectively avoiding test result deviations caused by selecting inappropriate simulation software.
[0049] Step 103 , when the maximum value in the first similarity is greater than a second preset threshold, a performance test is performed on the target simulation software corresponding to the maximum value to obtain a target performance test result corresponding to the target simulation software.
[0050] The target simulation software refers to the simulation software whose second instruction signature data has the highest similarity with the first instruction signature data of the software under test among multiple simulation software. The target performance test results refer to the performance evaluation data obtained from the performance test of the target simulation software, including but not limited to indicators such as response time, throughput, and resource utilization.
[0051] After calculating the first similarity between each simulated software and the software to be tested, these similarity values are compared. If the maximum value among the first similarities is greater than a second preset threshold, the simulated software with the maximum similarity value is selected and determined to be the target simulated software. The target simulated software is deployed in a test environment that matches the target operating environment of the software to be tested, such as the same hardware configuration and operating system version. A professional performance testing tool is used to perform a performance test on the target simulated software. Based on the expected usage scenarios and performance indicator requirements of the software to be tested, the specific scenarios and parameters for the performance test are set. For example, a certain number of concurrent users can be simulated accessing the target simulated software, with different load intensities and test durations. The performance testing tool is launched and the target simulated software is performance tested according to the set test scenarios and parameters. During the test, various performance indicator data of the target simulated software, such as response time, throughput, CPU utilization, and memory usage, are collected in real time. After the test is completed, the performance testing tool automatically generates a performance test report that includes performance indicator data of the target simulated software under different test scenarios, performance trend charts, and performance bottleneck analysis.
[0052] By performing performance testing on the target simulation software, since its instruction characteristics are most similar to the software to be tested, the test results can more accurately reflect the performance of the software to be tested in the actual operating environment, providing a more targeted basis for software performance optimization and tuning.
[0053] Step 104: determine the target performance test result as the performance test result of the software to be tested.
[0054] Based on the similarity calculation results, the target simulation software with the highest similarity to the software under test is found among multiple simulation software. The performance metrics obtained from the performance test of the target simulation software are directly used as the performance test results of the software under test. For example, if the performance test results of the target simulation software show a response time of 500 milliseconds, a throughput of 1000 transactions per second, and a transaction CPU utilization rate of 60%, these values are determined as the performance test results of the software under test.
[0055] Since the performance test results of the target simulation software are directly used, the time and resources for performance testing of other simulation software are saved, and the efficiency of the entire testing process is improved.
[0056] Through the present application, by obtaining the first instruction feature data of the software to be tested whose complexity is greater than the first preset threshold and the second instruction feature data of at least two simulation software whose complexity is less than or equal to the first preset threshold, and then calculating the instruction feature similarity between each simulation software and the software to be tested respectively, finding the target simulation software whose second feature instruction feature is most similar to the first instruction feature data feature, performing performance testing 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, there is no need to deploy the software to be tested whose complexity is greater than the first preset threshold on different central processing unit platforms for testing, and using the simulation software whose complexity is less than or equal to the first preset threshold to replace the software to be tested for testing, thereby improving 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.
[0057] As a refinement of step 102, when performing similarity calculations 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, it can be implemented in but not limited to the following manner, including: 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 the at least two preset similarity algorithms, performing similarity calculations between each second instruction feature data and the first instruction feature data to obtain the second similarity between each second instruction feature data and the first instruction feature data; and calculating the first similarity based on the first weight and the second similarity.
[0058] The first weight refers to a pre-set numerical weight used to measure 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, they need to be assigned corresponding weights based on actual conditions to reflect the relative importance of each algorithm in the comprehensive calculation. The preset similarity algorithm refers to a pre-determined algorithm used to calculate the similarity between instruction feature data, including a preset variance algorithm, a preset Euclidean distance algorithm, and a preset coefficient of determination algorithm. These algorithms quantitatively evaluate 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 simulated software and the first instruction feature data of the software under test, calculated using each preset similarity algorithm. The first similarity refers to the final similarity value obtained through a weighted calculation based on the calculation results of each preset similarity algorithm and its corresponding first weight. It is used to measure the overall similarity between the simulated software and the software under test in terms of instruction features.
[0059] Determine the target test scenario for the software to be tested: For example, the software to be tested is a software system for financial transactions, primarily operating in high-frequency trading and data-intensive scenarios. Determine the first weight by searching for a mapping relationship: Based on the pre-established mapping relationship between the test scenario and the second weight, find the corresponding target second weight. Assume that in a high-frequency financial 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. These weights are determined as the first weight. Calculate the second similarity using a preset similarity algorithm: The preset variance algorithm calculates the difference between the second instruction feature data and the data of the same type in the first instruction feature data, squares them, and divides them by the number of types to obtain a variance value. This variance value is used to measure the similarity between the two. The smaller the variance, the higher the similarity. The preset Euclidean distance algorithm calculates the square root of the square root of the difference between the instruction feature data of each type to obtain the Euclidean distance. The smaller the distance, the higher the similarity. The distance is converted into a similarity value. Preset Coefficient of Determination Algorithm: This algorithm calculates the correlation between the second instruction signature data and the first instruction signature data to determine the coefficient of determination. This value measures the closeness of the linear relationship between the two and ranges from [0, 1]. A larger value indicates higher similarity. For example, statistical software or a mathematical formula can be used to calculate the coefficient of determination between the instruction signature data of the simulated software and the instruction signature data of the software to be tested, and this value is used as the second similarity.
[0060] Calculate the first similarity based on 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, if the second similarity calculated by the preset variance algorithm is 0.7 and its first weight is 0.4, the weighted similarity is 0.7×0.4=0.28; if the second similarity calculated by the preset Euclidean distance algorithm is 0.6 and its first weight is 0.3, the weighted similarity is 0.6×0.3=0.18; if the second similarity calculated by the preset coefficient of determination algorithm is 0.8 and its first weight is 0.3, the weighted similarity is 0.8×0.3=0.24. Summarize the weighted similarities to obtain the first similarity: Summing the weighted similarities of each algorithm to obtain the final first similarity. For example, 0.28+0.18+0.24=0.7, which means the first similarity between the simulation software and the software to be tested is 0.7.
[0061] By comprehensively using multiple preset similarity algorithms and assigning them corresponding weights for calculation, the advantages and applicability of different algorithms in different scenarios are fully considered. This can more comprehensively and accurately evaluate the similarity in instruction features between the simulation software and the software to be tested, avoiding the deviations and limitations that may be brought about by a single algorithm, and improving the reliability and effectiveness of the similarity calculation results.
[0062] As a refinement of the above embodiment, when calculating the first similarity based on the first weight and the second similarity, it can be implemented in but not limited to the following manner, including: respectively performing product calculations 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 to each second instruction feature data and the first instruction feature data; respectively adding up the at least two first product value results corresponding to 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.
[0063] For ease of understanding, an example is provided to determine the first weight and the second similarity: assuming that the second similarities between the second instruction feature data of a simulation software and the first instruction feature data of the software to be tested are calculated to be 0.7, 0.6, and 0.8 respectively through the preset variance algorithm, the preset Euclidean distance algorithm, and the preset determination coefficient algorithm, and the corresponding first weights are 0.4, 0.3, and 0.3 respectively.
[0064] Calculate the first product value result: Multiply each first weight by the corresponding second similarity to obtain the first product value result. For the preset variance algorithm, the first product value result is 0.7×0.4=0.28; the first product value result corresponding to the preset Euclidean distance algorithm is 0.6×0.3=0.18; and the first product value result corresponding to the preset coefficient of determination algorithm is 0.8×0.3=0.24. In this way, three first product value results are obtained: 0.28, 0.18, and 0.24. Add these three first product value results, 0.28+0.18+0.24=0.7, and 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 is 0.7.
[0065] A weighted calculation is used to determine the overall similarity score between each simulation software and the software under test. For example, if instruction execution frequency significantly influences performance analysis in a particular scenario, algorithms related to instruction execution frequency (such as variance algorithms based on instruction execution frequency) are weighted higher when calculating the overall similarity. The simulation software is then ranked based on the scores, and the highest-scoring simulation software is selected as the optimal simulation software. After determining the optimal simulation software, performance testing is performed on different CPU platforms. The performance test results of the optimal simulation software on these different CPUs and platforms are used to simulate and infer the performance of the software under test on the corresponding CPU platform.
[0066] By multiplying the second similarities calculated by different similarity algorithms with the corresponding weights and then adding them up, we can effectively integrate the advantages of multiple algorithms and give full play to the evaluation characteristics of each algorithm in different aspects, so that the final first similarity can 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.
[0067] As a refinement of the above embodiment, when executing at least two preset similarity algorithms to calculate the similarity between each second instruction feature data and the first instruction feature data respectively, and obtaining the second similarity between each second instruction feature data and the first instruction feature data, it can be implemented in but not limited to the following ways, including: using a preset variance algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data, and obtaining the second similarity corresponding to the preset variance algorithm; using a preset Euclidean distance algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data, and obtaining the second similarity corresponding to the preset Euclidean distance algorithm; using a preset determination coefficient algorithm to calculate the similarity between each second instruction feature data and the first instruction feature data, and obtaining the second similarity corresponding to the preset determination coefficient 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 determination coefficient algorithm.
[0068] The preset variance algorithm is a statistical method used to measure the degree of difference between two sets of data. Here, it is used to calculate the degree of difference between the second instruction feature data and the first instruction feature data, and obtain the similarity through a specific transformation. The preset Euclidean distance algorithm is a calculation method based on the distance between two points in a geometric space. It is used to measure the distance between the second instruction feature data and the first instruction feature data in a multidimensional space. The smaller the distance, the higher the similarity. The preset determination coefficient algorithm is a statistical indicator used to evaluate the correlation between variables. It is used to measure the degree of linear correlation between the second instruction feature data and the first instruction feature data. The 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 using each preset similarity algorithm.
[0069] Different similarity algorithms may have their own advantages in different scenarios. By using multiple algorithms at the same time, we can better adapt to various testing scenarios and requirements, making the entire software testing method more flexible and widely applicable.
[0070] As a refinement of the above embodiment, when executing a 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, it can be implemented in but not limited to the following manner, including: obtaining the first type data in the first instruction feature data, the second type data in each second instruction feature data, and obtaining the number of types of the first type data and the second type data; performing a difference calculation between each second instruction feature data and the first type data of the same type and the corresponding second type data of the 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; and calculating the second similarity corresponding to the preset variance algorithm based on the number of types and the at least two first difference results.
[0071] The first type of data and the second type of data refer to specific types of instruction feature data within the first instruction feature data of the software to be tested and the second instruction feature data of the simulation software, respectively. For example, the percentage of arithmetic operation instructions and the percentage of logical operation instructions. The number of types refers to the number of types of instruction feature data involved in the calculation. For example, if 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 in the subsequent variance calculation.
[0072] The calculation formula of the preset variance algorithm can be implemented by formula (1):
[0073]
[0074] in, The second similarity corresponding to the preset variance algorithm, is the number of types of first type data and second type data, For the second type of data, For the first type of data, is the first difference result, is the first square result, is the first summation result.
[0075] The variance algorithm is more sensitive to data fluctuations and can effectively capture subtle changes in the proportions of different types of data, thereby more accurately reflecting the similarities between software instruction features.
[0076] As a refinement of the above embodiment, when calculating the second similarity corresponding to the preset variance algorithm based on the number of types and at least two first difference results, it can be implemented in but not limited to the following manner, including: squaring the at least two first difference results respectively to obtain the first square results corresponding to the at least two first difference results; adding the first square results corresponding to the at least two first difference results to obtain a first sum result; and calculating the quotient of the first sum result and the number of types to obtain the second similarity corresponding to the preset variance algorithm.
[0077] Specifically, the implementation process of this embodiment is a textual description of formula (1). Taking the first instruction feature data of the software to be tested as the target, the similarity of the instruction features of each simulated software with it is calculated. Taking variance calculation as an example, the software to be tested and the simulated software are first classified into the same category. Then, the variance of the two data sequences is calculated. The smaller the variance value, the closer the execution frequency of the two under this instruction category is, and the higher the similarity.
[0078] As a refinement of the above embodiment, when executing 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, it can be implemented by but not limited to the following methods, including: performing a square root calculation on the first sum result to obtain the second similarity corresponding to the preset Euclidean distance algorithm.
[0079] The calculation formula of the preset Euclidean distance algorithm can be implemented by formula (2):
[0080]
[0081] in, is the second similarity corresponding to the preset Euclidean distance algorithm, is the number of types of first type data and second type data, For the second type of data, For the first type of data, is the first difference result, is the first summation result.
[0082] For the calculation of Euclidean distance, multiple dimensions of instruction feature data (such as instruction type distribution, execution frequency, execution time, etc.) are regarded as coordinates in a multidimensional space. The similarity is measured by calculating the Euclidean distance between the software to be tested and the simulation software in the multidimensional space. The shorter the distance, the higher the similarity.
[0083] The preset Euclidean distance algorithm is more sensitive to outliers in the data and can effectively capture larger differences in instruction feature data, thereby providing more accurate results for similarity evaluation.
[0084] As a refinement of the above embodiment, when executing the preset determination coefficient 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 determination coefficient algorithm, it can be implemented by but not limited to the following methods, including: obtaining the average value data of the second type of data; calculating the second similarity corresponding to the preset determination coefficient algorithm based on the average value data and the first addition result.
[0085] The calculation formula of the preset determination coefficient algorithm can be implemented by formula (3):
[0086]
[0087] in, is the second similarity corresponding to the preset determination coefficient algorithm, is the number of types of first type data and second type data, For the second type of data, For 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 square result, is the second square result, is the first summation result, is the second summation result.
[0088] When used in combination with other similarity algorithms (such as the variance algorithm and the Euclidean distance algorithm), it is possible to evaluate the similarity between instruction feature data from multiple perspectives, thereby improving the accuracy and reliability of the entire similarity calculation method.
[0089] As a refinement of the above embodiment, when calculating the second similarity corresponding to the preset determination coefficient algorithm based on the average value data and the first summation result, it can be implemented in but not limited to the following manner, including: performing difference calculation on all the second type 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 data in each second instruction feature data and the average value data; and calculating the second similarity corresponding to the preset determination coefficient algorithm based on the at least two second difference results and the first summation result.
[0090] Specifically, the implementation process of this embodiment is a textual description of formula (3). The determination coefficient evaluates the degree of fit between the simulation software and the software to be tested. The closer the value is to 1, the higher the similarity between the two.
[0091] As a refinement of the above embodiment, when calculating the second similarity corresponding to the preset determination coefficient algorithm based on at least two second difference results and the first addition result, it can be implemented in but not limited to the following manner, including: squaring the at least two second difference results respectively to obtain the second square results corresponding to the at least two second difference results; adding the second square results corresponding to the at least two second difference results to obtain the second addition result; calculating the quotient of the first addition result and the second addition result to obtain the second similarity corresponding to the preset determination coefficient algorithm.
[0092] Specifically, the implementation process of this embodiment is a textual description of formula (3).
[0093] As a refinement of the above embodiment, when executing to obtain the first weight corresponding to each of at least two preset similarity algorithms, it can be implemented in but not limited to the following manner, including: obtaining the target test scenario of the software to be tested; searching for the target second weight corresponding to the target test scenario based on the pre-established mapping relationship between the test scenario and the second weight; the target second weight includes the second weight corresponding to each of at least two preset similarity algorithms; and determining the target second weight as the first weight.
[0094] The second weight refers to the weight value associated with the target test scenario, which is determined by the pre-established mapping relationship between the test scenario and the weight, and represents the degree of importance of different similarity algorithms to the target test scenario during the test process. The second weight is the basis for calculating the first weight. The target test scenario refers to the test scenario selected in the software to be tested, which is usually used to evaluate the performance and function of the software in a specific environment. The target test scenario may cover different software functional 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 changes in the second weight value for different test scenarios, and searches for the corresponding weight according to this rule.
[0095] By analyzing the requirements documents, design documents, and instructions for use of the software to be tested, its target test scenario is determined. For example, if the software to be tested is a software system for financial transactions, its target test scenario is a high-frequency financial transaction scenario. Find the mapping relationship to determine the target second weight: In the preset mapping relationship table, find the corresponding target second weight based on the target test scenario. For example, the mapping relationship table stipulates 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 coefficient of determination algorithm is 0.3. Determine the first weight: Directly determine the found target second weight as the first weight in the current test task.
[0096] It supports flexible adjustment of similarity algorithm weights according to different test scenarios, so that the entire software testing method can adapt to various specific testing requirements, enhancing the flexibility and adaptability of the testing strategy.
[0097] In order to better understand the entire process of software testing, Figure 2 As shown, Figure 2 A flow chart of the entire process of software testing provided in an embodiment of the present application, first, instruction analysis is performed on the software to be tested to obtain first instruction feature data, then instruction analysis is performed on each simulation software to obtain second instruction feature data of each simulation software, similarity calculation is performed on the first instruction feature data and the second instruction feature data of each simulation software, the simulation software corresponding to the maximum value in the similarity is determined as the target simulation software, performance testing is performed on the target simulation software to obtain the target performance test result of the target simulation software, or the target performance test result of the target simulation software is found according to the pre-established mapping relationship between the simulation software and the performance test result, and the target performance test result is determined as the performance test result of the software to be tested.
[0098] First, in terms of reducing implementation costs, traditional methods require actual deployment and testing on the target CPU platform, which means purchasing different types of CPUs, building an adaptive server environment, and investing a lot of money in hardware procurement, installation and debugging, and subsequent maintenance. For example, in order to test the performance of a software on a variety of CPUs with different architectures, it may cost hundreds of thousands of yuan to purchase the corresponding hardware equipment. However, the present invention does not need to be deployed on the actual target CPU platform, but only needs to perform instruction analysis and similarity calculation on the software to be tested and the simulation software under a conventional environment, which greatly reduces the investment in hardware resources and significantly reduces the implementation cost. This allows enterprises and research institutions to conduct software performance analysis without having to bear the high cost of hardware purchases, and can carry out related work at a lower cost. It has extremely high practical value, especially for small teams or start-ups with limited budgets.
[0099] Secondly, the test cycle can be greatly shortened. Under the traditional method, since the deployment test 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, it may take several days to build the hardware environment alone, and the test operation phase may need to last for several weeks to collect enough data. The present invention analyzes the characteristics of running state instructions, quickly completes instruction analysis and similarity calculation under normal circumstances, and performs performance testing after determining the simulation software. The whole process is relatively simple and efficient, and the test cycle can be shortened to several days or even shorter. It speeds up the process of software performance analysis, enables developers to obtain analysis results more quickly, optimize and adjust the software in a timely manner, and improves the efficiency of software development and iteration.
[0100] Furthermore, the adaptation accuracy is significantly improved. Based on the instruction-level data obtained in the running state, the instruction behavior and characteristics of the software during actual operation can be truly reflected. Traditional static code analysis only infers instruction behavior from the code structure, and cannot take into account the dynamic changes of 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 at runtime by capturing the running state instruction characteristics in real time, making the performance speculation based on the simulated 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 based on the running state instruction characteristics under different inputs, and then more accurately predict the performance of the software to be tested, providing a more reliable basis for software optimization.
[0101] In addition, this application achieves a breakthrough in binary compatibility. By matching instruction signatures, it successfully solves the problem of lacking effective analysis methods for closed-source binary programs. In the past, performance analysis of closed-source binary programs was difficult due to the lack of source code. However, this application achieves cross-platform simulation by finding simulation software with similar instruction signatures and using the analysis results of the simulation software to infer the performance of closed-source binary programs on different platforms. 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. It broadens the application scope of performance analysis technology, helps to tap the performance potential of such software, and improves its overall quality.
[0102] Finally, the flexible extension mechanism established by this application supports the mixing and matching of SPEC CPU standard suites and customized test cases, which greatly improves flexibility. In special fields, such as aerospace, medical equipment, etc., software has unique performance requirements, and general test suites cannot meet their customized analysis requirements. This application allows for the flexible selection of some test cases in the standard suite based on the characteristics of software in special fields, and combines 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 different fields for software performance analysis.
[0103] The embodiment of the present application also provides a software testing device, Figure 3 A schematic diagram of the structure of a software testing device provided in an embodiment of the present application is shown in FIG. Figure 3 Shown, including:
[0104] The acquisition unit 21 is configured to acquire first instruction feature data of the software to be tested, and to acquire second instruction feature data corresponding to each of at least two simulation software programs; the software to be tested is software having a complexity greater than a first preset threshold, and the simulation software is software having a complexity less than or equal to the first preset threshold;
[0105] a calculation unit 22, configured to calculate a 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;
[0106] The testing unit 23 is configured to, when the maximum value in the first similarity is greater than a second preset threshold, perform a performance test on the target simulation software corresponding to the maximum value, and obtain a target performance test result corresponding to the target simulation software;
[0107] The determining unit 24 is configured to determine the target performance test result as the performance test result of the software to be tested.
[0108] Through the present application, by obtaining the first instruction feature data of the software to be tested whose complexity is greater than the first preset threshold and the second instruction feature data of at least two simulation software whose complexity is less than or equal to the first preset threshold, and then calculating the instruction feature similarity between each simulation software and the software to be tested respectively, finding the target simulation software whose second feature instruction feature is most similar to the first instruction feature data feature, performing performance testing 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, there is no need to deploy the software to be tested whose complexity is greater than the first preset threshold on different central processing unit platforms for testing, and using the simulation software whose complexity is less than or equal to the first preset threshold to replace the software to be tested for testing, thereby improving 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.
[0109] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation unit 22 includes:
[0110] An acquisition module 221 is configured to acquire first weights corresponding to at least two preset similarity algorithms, wherein 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;
[0111] a calculation module 222 configured to calculate a similarity between each second instruction feature data and the first instruction feature data using at least two preset similarity algorithms, to obtain a second similarity between each second instruction feature data and the first instruction feature data;
[0112] The calculation module 222 is further configured to calculate the first similarity according to the first weight and the second similarity.
[0113] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0114] Performing product calculations on the first weight and the corresponding second similarity respectively to obtain first product value results of the first weight and the corresponding second similarity; at least two first product value results corresponding to each second instruction feature data and the first instruction feature data;
[0115] At least two first product value results corresponding to each second instruction feature data and the first instruction feature data are respectively added and calculated to obtain a first similarity between each second instruction feature data and the first instruction feature data.
[0116] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0117] Using a preset variance algorithm, calculating 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;
[0118] Using a preset Euclidean distance algorithm, a similarity calculation is performed between each second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset Euclidean distance algorithm;
[0119] Using a preset determination coefficient algorithm, calculating the similarity between each second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset determination coefficient algorithm;
[0120] The second similarity between each second instruction feature data and the first instruction feature data includes a second similarity corresponding to a preset variance algorithm, a second similarity corresponding to a preset Euclidean distance algorithm, and a second similarity corresponding to a preset determination coefficient algorithm.
[0121] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0122] Obtaining first type data in the first instruction characteristic data, second type data in each second instruction characteristic data, and obtaining the number of types of the first type data and the second type data;
[0123] Performing difference calculation between each second instruction feature data and first type data of the same type and corresponding second type data of the 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;
[0124] A second similarity corresponding to a preset variance algorithm is calculated according to the number of types and the at least two first difference results.
[0125] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0126] Performing square calculations on the at least two first difference results respectively to obtain first square results corresponding to the at least two first difference results;
[0127] Adding the first square results corresponding to the at least two first difference results to obtain a first sum result;
[0128] The quotient of the first summation result and the number of types is calculated to obtain a second similarity corresponding to the preset variance algorithm.
[0129] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0130] A square root calculation is performed on the first summation result to obtain a second similarity corresponding to a preset Euclidean distance algorithm.
[0131] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0132] Obtain average value data of the second type of data;
[0133] A second similarity corresponding to a preset determination coefficient algorithm is calculated according to the average value data and the first summation result.
[0134] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0135] Performing difference calculations on all the second type 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 data in each second instruction feature data and the average value data;
[0136] A second similarity corresponding to a preset determination coefficient algorithm is calculated according to the at least two second difference results and the first summation result.
[0137] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the calculation module 222 is further used for:
[0138] Performing square calculations on the at least two second difference results respectively to obtain second square results corresponding to the at least two second difference results;
[0139] Adding the second square results corresponding to the at least two second difference results to obtain a second sum result;
[0140] A quotient is calculated by calculating the first summation result and the second summation result to obtain a second similarity corresponding to a preset determination coefficient algorithm.
[0141] Furthermore, in a possible implementation of this embodiment, as Figure 4 As shown, the acquisition module 221 is further used for:
[0142] Obtain the target test scenario for the software to be tested;
[0143] According to the pre-established mapping relationship between the test scenario and the second weight, searching 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;
[0144] The target second weight is determined as the first weight.
[0145] For the description of the features in the embodiment corresponding to the software testing device, reference can be made to the relevant description of the embodiment corresponding to the software testing method, which will not be repeated here.
[0146] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above software testing method embodiments.
[0147] 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 of any of the above software testing method embodiments when running.
[0148] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0149] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above software testing method embodiments are implemented.
[0150] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned software testing method embodiments are implemented.
[0151] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0152] The above is a detailed introduction to a software testing method and device, electronic device, and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A software testing method, characterized in that: include: Acquire first instruction characteristic data of the software to be tested, and acquire second instruction characteristic data corresponding to at least two simulation software respectively; The software to be tested is software with a complexity greater than a first preset threshold, and the simulation software is software with a complexity less than or equal to the first preset threshold; respectively calculating a similarity between each of the second instruction feature data and the first instruction feature data to obtain a first similarity between each of the second instruction feature data and the first instruction feature data; When the maximum value among 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; The target performance test result is determined as the performance test result of the software to be tested.
2. The software testing method according to claim 1, wherein: The performing similarity calculation 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 includes: Obtaining first weights corresponding to at least two preset similarity algorithms, wherein 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; Using at least two preset similarity algorithms, respectively calculate the similarity between each second instruction feature data and the first instruction feature data to obtain a second similarity between each second instruction feature data and the first instruction feature data; The first similarity is calculated according to the first weight and the second similarity.
3. The software testing method according to claim 2, characterized in that: Calculating the first similarity according to the first weight and the second similarity includes: respectively performing product calculations on the first weight and the corresponding second similarity to obtain first product value results of the first weight and the corresponding second similarity; and at least two first product value results corresponding to each second instruction feature data and the first instruction feature data; At least two first product value results corresponding to each second instruction feature data and the first instruction feature data are respectively added and calculated to obtain a first similarity between each 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 respectively calculate the similarity between each second instruction feature data and the first instruction feature data to obtain the second similarity between each second instruction feature data and the first instruction feature data includes: Using the preset variance algorithm, calculating 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; Using the preset Euclidean distance algorithm, calculating 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; Using the preset determination coefficient algorithm, calculating the similarity between each second instruction feature data and the first instruction feature data to obtain a second similarity corresponding to the preset determination coefficient algorithm; The second similarity between each of the second instruction feature data and the first instruction feature data includes a second similarity corresponding to the preset variance algorithm, a second similarity corresponding to the preset Euclidean distance algorithm, and a second similarity corresponding to the preset determination coefficient algorithm.
5. The software testing method according to claim 4, characterized in that: The 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 includes: Obtaining first type data in the first instruction characteristic data, second type data in each of the second instruction characteristic data, and obtaining the number of types of the first type data and the second type data; Performing difference calculation between each of the second instruction feature data and the first type data of the same type and the corresponding second type data of the same type in the first instruction feature data, to obtain at least two first difference results between each of the second instruction feature data and the first instruction feature data; A second similarity corresponding to the preset variance algorithm is calculated 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: 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: Performing square calculations on the at least two first difference results respectively to obtain first square results corresponding to the at least two first difference results; Adding the first square results corresponding to the at least two first difference results to obtain a first summation result; A quotient of the first summation result and the number of types is calculated to obtain a second similarity corresponding to the preset variance algorithm.
7. The software testing method according to claim 6, characterized in that: The 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 includes: A square root calculation is performed on the first summation result to obtain a second similarity corresponding to the preset Euclidean distance algorithm.
8. The software testing method according to claim 6, wherein: The using the preset determination coefficient 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 determination coefficient algorithm includes: Obtaining average value data of the second type of data; A second similarity corresponding to the preset determination coefficient algorithm is calculated according to the average value data and the first addition result.
9. The software testing method according to claim 8, characterized in that: Calculating the second similarity corresponding to the preset determination coefficient algorithm based on the average value data and the first addition result includes: Performing difference calculations on all second type data in each second instruction feature data and the average value data, respectively, to obtain at least two second difference results between all second type data in each second instruction feature data and the average value data; A second similarity corresponding to the preset determination coefficient algorithm is calculated according to the at least two second difference results and the first summation result.
10. The software testing method according to claim 9, characterized in that: Calculating the second similarity corresponding to the preset determination coefficient algorithm according to the at least two second difference results and the first summation result includes: Performing square calculations on the at least two second difference results respectively to obtain second square results corresponding to the at least two second difference results; Adding the second square results corresponding to the at least two second difference results to obtain a second sum result; A quotient is calculated by calculating the first summation result and the second summation result to obtain a second similarity corresponding to the preset determination coefficient algorithm.
11. The software testing method according to claim 2, wherein: The obtaining of first weights corresponding to at least two preset similarity algorithms includes: Obtaining a target test scenario for the software to be tested; According to the pre-established mapping relationship between the test scenario and the second weight, searching 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; The target second weight is determined as the first weight.
12. A software testing device, characterized in that: include: an acquiring unit, configured to acquire first instruction characteristic data of the software to be tested, and acquire second instruction characteristic data corresponding to at least two simulation software respectively; The software to be tested is software with a complexity greater than a first preset threshold, and the simulation software is software with a complexity less than or equal to the first preset threshold; a calculation unit, configured to respectively calculate a similarity 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; a testing unit configured to, when a maximum value among the first similarities is greater than a second preset threshold, perform a performance test on a target simulation software corresponding to the maximum value, and obtain a target performance test result corresponding to the target simulation software; A determining unit is 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: include: Memory for storing computer programs; 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 The computer-readable storage medium stores a computer program, 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 When the computer program is executed by a processor, the steps of the software testing method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method and device for carrying out CPU test on domestic servers by utilizing SPEC CPU
CN106951349A
Virtual simulation method, device and equipment based on Autosar architecture
CN118708488A