Method and device for testing compatibility of application program based on conflict possibility
Through the application compatibility testing method based on conflict possibility, directed graphs and simulated execution techniques are used to identify resource occupancy conflict paths, solving the problem of inefficiency of traditional testing methods and achieving the effect of quickly discovering compatibility problems.
Patent Information
- Application Number
- CN202411382730.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
With the increase in the types of intelligent measurement terminal applications, traditional compatibility testing methods are inefficient, resulting in long test time and compatibility issues cannot be detected quickly.
Adopt the application compatibility test method based on conflict possibility, obtain the directed graph of application tests, simulate the combination of execution functions, determine the resource occupancy conflict score, find the target functional test path with the greatest probability of resource occupancy conflict, and conduct targeted compatibility test.
It improves the efficiency of application compatibility testing, reduces waste of test resources, can quickly discover compatibility issues of applications to be tested, and optimizes the testing process.
Smart Images

Figure CN119271561A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium and computer program product for testing application compatibility based on conflict possibility. Background Art
[0002] With the rapid expansion of power grid services and the continuous enhancement of their functions, the measurement terminal, as the core link of the power grid measurement system, has become more and more intelligent and platform-oriented, and the number of applications installed in the intelligent measurement terminal has also increased. These applications must undergo rigorous testing before deployment, and compatibility is a key test content.
[0003] Traditional compatibility testing solutions usually include two approaches. One is to randomly and concurrently execute functional modules in different applications under different test conditions to detect whether there are compatibility issues between different applications under test. The other is to pre-screen test scenarios and application running states that are likely to cause compatibility issues under different test conditions, reduce the combination of test conditions, and conduct targeted compatibility testing.
[0004] However, as the types of applications installed in smart measurement terminals increase with the development of new functions, and each application is composed of multiple different functional modules, the number of functional combinations that need to be tested will increase dramatically. Using the above traditional solutions for compatibility testing requires a lot of time, resulting in low efficiency in application compatibility testing. Summary of the invention
[0005] Based on this, it is necessary to provide an application compatibility testing method, apparatus, computer device, computer-readable storage medium and computer program product based on conflict possibility that can improve the efficiency of application compatibility testing in order to address the above technical problems.
[0006] In a first aspect, the present application provides an application compatibility testing method based on conflict possibility, comprising:
[0007] Obtain an application test directed graph, wherein each node of the application test directed graph represents a set of function combinations, each of the function combinations is an arrangement and combination of functions between multiple application programs to be tested, and the edges of the directed graph represent transfer directions between the function combinations;
[0008] For each group of function combinations, simulate and execute the functions in the function combination to determine the resource occupation conflict score of the function combination, where the resource occupation conflict score is used to characterize the resource occupation conflict probability;
[0009] Based on the resource occupancy conflict score of each of the function combinations, finding a target function test path with the highest probability of resource occupancy conflict from the application test directed graph;
[0010] Based on the target function test path, compatibility testing is performed on the plurality of application programs to be tested.
[0011] In one embodiment, the simulating execution of the functions in the function combination to determine the resource occupation conflict probability of the function combination includes:
[0012] Obtaining the generation time distribution and service time distribution of the resource occupation request corresponding to each function in the function combination;
[0013] According to the generation time distribution, the service time distribution, and the preset service strategy, simulate and execute each function in the function combination to determine the resource occupation data of each function;
[0014] The resource occupation conflict score of the function combination is determined according to the resource occupation data of each of the functions and a preset scoring mechanism.
[0015] In one embodiment, for each of the functions, the resource usage data of the function is determined based on the following steps:
[0016] Simulate the execution of the function to determine the resource occupancy of the first type of resources and the number of resource accesses of the second type of resources of the function;
[0017] The resource occupancy data of the function is determined according to the resource occupancy of the first type of resources and the number of resource accesses of the second type of resources.
[0018] In one embodiment, the resource occupancy of the first type of resources includes a resource occupancy ratio of the first type of resources; and determining the resource occupancy conflict score of the function combination according to the resource occupancy data of each of the functions and a preset scoring mechanism includes:
[0019] Determining the sum of the resource occupancy ratios of the functions in the function combination according to the resource occupancy ratio of the first type of resources;
[0020] Determining a resource occupancy conflict score of the first type of resources of the function combination according to the sum of the resource occupancy ratios and the preset scoring mechanism;
[0021] Determining a request queuing status of the second type of resource according to the resource access times of the functions in the function combination;
[0022] Determine a resource occupation conflict score of the second type of resource of the function combination based on the request queuing situation and the preset scoring mechanism;
[0023] The resource occupation conflict score of the function combination is determined according to the resource occupation conflict score of the first type of resources, the resource occupation conflict score of the second type of resources, and a preset weight.
[0024] In one embodiment, the step of finding a target function test path with the maximum resource occupation conflict probability from the application test directed graph based on the resource occupation conflict probability of each function combination includes:
[0025] Determining a set of functional test paths based on the application test directed graph;
[0026] A target functional test path with the highest probability of resource occupation conflict is screened out from the functional test path set.
[0027] In one of the embodiments, after selecting the target functional test path with the highest probability of resource occupation conflict from the functional test path set, the method further comprises:
[0028] Determine the function test paths that contain unselected function combinations in the remaining function test paths as a new function test path set, and return to the step of screening out the target function test path with the highest probability of resource occupation conflict from the function test path set until there are no unselected function combinations in the remaining function test paths, thereby obtaining a plurality of the target function test paths;
[0029] The compatibility test of the plurality of application programs to be tested is performed based on the target function test path, including:
[0030] Based on the multiple target function test paths, compatibility testing is performed on the multiple application programs to be tested.
[0031] In one embodiment, the compatibility test of the plurality of application programs to be tested based on the target functional test path includes:
[0032] Generate a test instruction sequence according to the target function test path;
[0033] Execute the test instruction sequence to perform compatibility test on the application to be tested, and obtain resource usage when different application to be tested are running concurrently;
[0034] A compatibility test log is generated based on the resource usage.
[0035] In a second aspect, the present application further provides an application compatibility testing device based on conflict possibility, comprising:
[0036] A data acquisition module is used to acquire an application test directed graph, wherein each node of the application test directed graph represents a set of function combinations, each of the function combinations is an arrangement and combination of functions between multiple application programs to be tested, and the edges of the directed graph represent transfer directions between the function combinations;
[0037] A simulation execution module, used for simulating the execution of functions in each group of function combinations, and determining a resource occupation conflict score of the function combination, wherein the resource occupation conflict score is used to characterize a resource occupation conflict probability;
[0038] A path search module, configured to search the target function test path with the highest probability of resource occupation conflict from the application test directed graph based on the resource occupation conflict scores of the function combinations;
[0039] A compatibility testing module is used to perform compatibility testing on the plurality of application programs to be tested based on the target function test path.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps in any of the above-mentioned application compatibility testing method embodiments based on conflict possibility.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in any of the above-mentioned application compatibility testing method embodiments based on conflict possibility.
[0042] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in any of the above-mentioned application compatibility testing method embodiments based on conflict possibility.
[0043] The above-mentioned application compatibility testing method, device, computer equipment, computer-readable storage medium and computer program product based on conflict possibility are different from traditional solutions. This solution represents a large number of function combinations in different application programs to be tested in the form of an application test directed graph, so that the originally disordered and complicated function combinations are systematized and organized, and it is not easy to miss function combinations or repeat the test of function combinations in the subsequent testing process, thereby improving the testing efficiency; further, by simulating the execution of functions in the function combination, it is possible to estimate which function combinations may cause resource occupation conflict events before the actual test, and determine the resource occupation conflict score of the function combination based on this, and then, according to the resource occupation conflict score, find the target function test path with the highest probability of resource occupation conflict from the application test directed graph, and finally, according to the target function test path, perform compatibility testing on multiple application programs to be tested, so as to focus on and give priority to testing these high-risk combination paths. This targeted testing method can more quickly discover compatibility issues of different application programs to be tested, reduce the waste of testing resources, and improve testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0045] FIG1 is an application environment diagram of an application program compatibility testing method based on conflict possibility in one embodiment;
[0046] Figure 2 A flowchart of a method for testing application compatibility based on conflict possibility in one embodiment;
[0047] Figure 3 A flowchart of an application compatibility testing method based on conflict possibility in another embodiment;
[0048] Figure 4 A flowchart of the steps of determining a resource occupation conflict score in one embodiment;
[0049] Figure 5 is a flowchart of a method for testing application compatibility based on conflict possibility in yet another embodiment;
[0050] Figure 6 A flowchart of a method for testing application compatibility based on conflict possibility in a detailed embodiment;
[0051] Figure 7 A structural block diagram of an application program compatibility testing device based on conflict possibility in one embodiment;
[0052] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] The application compatibility testing method based on conflict possibility provided in the embodiment of the present application can be applied to the application environment shown in FIG1 . In which, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers.
[0055] Specifically, the staff uploads the application test directed graph to the server 104 through the terminal 102, or the server 104 directly obtains the application test directed graph from the data storage system. Further, the server 104 simulates the execution of the functions in each group of function combinations, and determines the resource occupation conflict score of the function combination, wherein the resource occupation conflict score is used to characterize the probability of resource occupation conflict, and based on the resource occupation conflict score of each function combination, finds the target function test path with the maximum probability of resource occupation conflict from the application test directed graph, and performs compatibility test on multiple application programs to be tested based on the target function test path.
[0056] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0057] In an exemplary embodiment, Figure 2As shown, a method for testing application compatibility based on conflict possibility is provided, and the method is applied to the server 104 in FIG. 1 as an example for description, including the following steps:
[0058] S100, obtaining an application test directed graph.
[0059] Among them, the application test directed graph is a data structure composed of nodes and edges. Each node of the application test directed graph represents a set of function combinations, and each function combination is an arrangement and combination of functions between multiple applications to be tested. The edge of the application test directed graph represents the transfer direction between the function combinations. For example, if there are nodes 1 and node 2 in the application test directed graph, where the function combination represented by node 1 is {not running, B1}, and the function combination represented by node 2 is {not running, B2}, B1 represents entering the login interface of application B, and B2 represents entering the setting interface of application B. The edge from node 1 to node 2 represents the system transferring from "application A is not running, entering the login interface of application B" to "application A is not running, entering the setting interface of application B".
[0060] Exemplarily, the application test directed graph can be constructed based on the following steps: First, for each application to be tested, the startup, end and calling relationship between all functions of the application to be tested are represented as a directed graph Fi, i=1~I, where I is the number of applications to be tested. Specifically, each function of the application to be tested is taken as a node of the directed graph Fi, and a node indicating that the application to be tested is not running is added to the directed graph Fi. The edge of the directed graph Fi indicates that there is a transfer relationship between the functions represented by the two nodes, and the direction of the edge indicates that the node of a certain function points to the node representing another function to which it can be transferred. Then, the application test directed graph F is initialized as the directed graph of the application to be tested F1, i=2 is initialized, the combination of all node functions in F and Fi is listed, and a new directed graph T is established. Each node in T is a combination of node functions in F and Fi. When all functions in the function combination represented by a node of T can be transferred from the functions in the function combination represented by another node, the two nodes are connected with an edge, and the transfer direction of the function combination represented by the node is indicated. Furthermore, let F=T, i=i+1, list the combinations of all node functions in F and Fi, and construct a new directed graph. The application test directed graph F is updated in this way in a cycle until all functions of the application to be tested are included in the application test directed graph F, and the final application test directed graph is obtained.
[0061] Take two applications A and B to be tested as examples. Application A contains two parallel functions, A1 and A2. The application ends after running A1 or A2. Application B contains two serial functions, B1 and B2. B2 is the next layer function called by B1. The application ends after running B2. Then the function combination between application A and application B is: {A not run, B not run}, {A not run, B1}, {A not run, B2}, {A1, B not run}, {A1, B1}, {A1, B2}, {A2, B not run}, {A2, B1}, {A2, B2}.
[0062] S200 , for each group of function combinations, simulate and execute the functions in the function combination to determine the resource occupation conflict score of the function combination.
[0063] The resource occupancy conflict score can be used to characterize the occupancy of system resources when the functions in the function combination are executed concurrently, and can also characterize the probability of system resource occupancy when the functions in the function combination are executed concurrently. Exemplarily, the resource occupancy conflict score can be considered as a quantitative indicator of the degree of conflict caused by competing for the same resources when the functions in the function combination are executed concurrently. The higher the score, the greater the probability of resource occupancy conflict.
[0064] Specifically, the resource occupancy conflict score can be determined based on the degree of overlap of resource occupancy. For example, if the two functions "user login" and "load user information" are executed concurrently, and both functions occupy more CPU resources, then the resource occupancy conflict score of the function combination containing the above two functions will be higher. By simulating the execution of each function in the function combination, the access and occupancy degree of each function to different system resources can be quickly determined, and then it can be analyzed whether the system will have resource occupancy conflict events when different functions are executed concurrently, and different function combinations can be scored to obtain the resource occupancy conflict scores of each function combination.
[0065] S300, based on the resource occupancy conflict scores of each function combination, find a target function test path with the highest probability of resource occupancy conflict from the application test directed graph.
[0066] The target function test path is used to represent the path from the start node to the end node in the application test directed graph, which represents the execution order of the function combinations of different application programs under test in the actual execution process. Each node on the target function test path represents a set of function combinations, and the edges used to connect the nodes are used to represent the execution order of the functions in the concurrently executed function combinations.
[0067] Specifically, the larger the resource occupancy conflict score of a functional test path, the greater the probability of a resource occupancy conflict event occurring when the functions of the functional combination are executed concurrently in the functional test path. This functional combination is exactly the one that needs to be focused on and tested. Therefore, finding the target functional test path with the largest sum of the resource occupancy conflict scores of each functional combination from the application test directed graph can efficiently screen out the functional combinations that require key compatibility testing, thereby concentrating test resources on the functional test paths that are most likely to have compatibility issues, thereby improving test efficiency.
[0068] Exemplarily, assuming that the resource occupancy conflict scores of the function combinations {A1, B1}, {A2, B1}, {A1, B2}, {A2, B2} are 0.8, 0.1, 0.5, 0.6 respectively, the resource occupancy conflict scores of all function test paths in the application test directed graph can be obtained. Path 1: Start->{A1, B1}->End: 0.8; Path 2: Start->A1->{A2, B1}->End: 0.1; Path 3: Start->B1->{A1, B2}->End: 0.5; Path 4: Start->{A1, B1}->{A2, B1}->End: 0.9; Path 5: Start->{A1, B1}->{A1, B2}->End: 1.3; Path 6: Start->{A1, B1}->{A2, B2}->End: 1.4; Path 7: Start->{A1, B1}->{A2, B1}->{A2, B2}->End: 1.5; Path 8 Start->{A1, B1}->{A1, B2}->{A2, B2}->End: 1.9. In summary, it can be seen that the sum of the resource occupation conflict scores of the function combination in path 8 is the largest, so path 8 is used as the target function test path.
[0069] S400, based on the target functional test path, performs compatibility test on multiple application programs to be tested.
[0070] Among them, compatibility testing is used to verify the compatibility of an application with other applications, operating systems, hardware, or different versions of software in a specific environment.
[0071] Specifically, a test instruction is generated for each group of function combinations in the target function test path. The test instruction is used to indicate the concurrent execution of the functions in the function combination. Since there are multiple function combinations, multiple test instructions are generated accordingly to form a test instruction sequence. The target function test path indicates the execution order of the test instructions in the test instruction sequence, for example, from the start node to the end node, and the test instructions corresponding to each node in the target function test path are executed in sequence.
[0072] During actual testing, multiple applications to be tested are first loaded and configured into the test environment, and the test instruction sequence is executed in sequence, and each function combination on the target function test path is executed concurrently in sequence. The performance of each application to be tested is observed and recorded, such as whether the application crashes or deadlocks, whether the response time is within an acceptable range, whether unexpected resource contention occurs, etc., to complete the compatibility test of multiple applications to be tested.
[0073] The above-mentioned application compatibility testing method, device, computer equipment, computer-readable storage medium and computer program product based on conflict possibility are different from traditional solutions. This solution represents a large number of function combinations in different application programs to be tested in the form of an application test directed graph, so that the originally disordered and complicated function combinations are systematized and organized, and it is not easy to miss function combinations or repeat the test of function combinations in the subsequent testing process, thereby improving the testing efficiency; further, by simulating the execution of functions in the function combination, it is possible to estimate which function combinations may cause resource occupation conflict events before the actual test, and determine the resource occupation conflict score of the function combination based on this, and then, according to the resource occupation conflict score, find the target function test path with the highest probability of resource occupation conflict from the application test directed graph, and finally, according to the target function test path, perform compatibility testing on multiple application programs to be tested, so as to focus on and give priority to testing these high-risk combination paths. This targeted testing method can more quickly discover compatibility issues of different application programs to be tested, reduce the waste of testing resources, and improve testing efficiency.
[0074] In one embodiment, Figure 3 As shown, S200 includes:
[0075] S210, obtaining the generation time distribution and service time distribution of the resource occupation request corresponding to each function in the function combination.
[0076] S220, simulating the execution of each function in the function combination according to the generation time distribution, the service time distribution, and the preset service strategy, and determining the resource occupation data of each function.
[0077] S230, determining a resource occupation conflict score of the function combination according to the resource occupation data of each function and a preset scoring mechanism.
[0078] Among them, resource occupation request refers to the resources that a function requests to be allocated to the system during execution, such as CPU, memory, I / O, database, interface, etc. The generation time distribution refers to the probability distribution of the time interval for initiating resource occupation requests when the function is executed. For example, a function sends a resource occupation request every few seconds during execution. This time interval can follow a certain statistical distribution, such as exponential distribution. Service time distribution refers to the probability distribution of the length of time a function uses resources after obtaining resources during execution, such as exponential distribution, normal distribution, etc. The generation time distribution, service time distribution, and preset service strategy of the resource occupation requests corresponding to each function can be represented by a resource occupation model.
[0079] For example, for each function, the occupation of system resources when the function is executed under different test conditions is recorded respectively. The above test conditions include: CPU, memory, hard disk parameters and load device type and quantity, etc. System resources include hard disk, database, system API, input and output ports, upstream and downstream interfaces, etc. The process of modeling the resource occupation of each function under a certain test condition to obtain a resource occupation model can be: using the A / S / C / K / N / D six-tuple model in queuing theory to model, where A is the distribution of arrival requests, S is the distribution of service time, C is the number of servers in the queuing system, K is the maximum length of the queue in the queuing system, N is the total number of requests, and D is the service scheduling policy of the request. For example, the access of a certain function module to a certain system API can be described by a simplified six-tuple model - M / M / 1 model, that is, the time interval between arrival requests is exponentially distributed (M), the service time is exponentially distributed (M), one server (1), infinite waiting queue length, infinite number of requests, first-come-first-served scheduling policy, and exponential distribution is used to fit the time interval between arrival requests and service time of the above API. Exemplarily, in this embodiment, the generation time distribution of resource occupation requests when executing a function may be an exponential distribution, a Poisson distribution, or other distributions, and the service time distribution of the server processing resource occupation requests may also be an exponential distribution, a Poisson distribution, or other distributions. The service policy of the server may be that there is only one server, the number of queues for resource occupation requests is unlimited, the queue time is unlimited, and priority is given to resource occupation requests that arrive first.
[0080] Specifically, based on the generation time distribution, service time distribution, and preset service strategy in the resource occupancy model of each function, each function in the function combination is simulated and executed, and the resource occupancy data of each function can be determined, such as the resource occupancy of memory and CPU, the access to database, upstream and downstream interfaces, etc. Further, according to the resource occupancy data of each function and the preset scoring mechanism, the resource occupancy conflict score of the function combination is determined. For example, when executing a function in the function combination, the memory occupancy reaches 80%, and when executing another function in the function combination, the memory occupancy reaches 70%, which means that when the two functions are executed concurrently, a resource occupancy conflict event is likely to occur, and accordingly, the resource occupancy conflict score of the function combination is high.
[0081] In this embodiment, the resource occupancy conflict score of the function combination is determined by executing the functions in the function combination and based on the system resource occupancy when the functions are executed separately, thereby quantifying the compatibility risk of the system when the functions of the function combination are concurrently executed, and more intuitively evaluating the impact of different function combinations on system resources, thereby improving the efficiency of compatibility detection.
[0082] In one embodiment, Figure 4 As shown, S220 includes:
[0083] S221, simulating the execution of a function to determine the resource occupancy of the first type of resources of the function and the number of resource accesses of the second type of resources.
[0084] S222: Determine resource occupancy data of the function according to the resource occupancy of the first type of resources and the number of resource accesses of the second type of resources.
[0085] The first type of resources include but are not limited to CPU, memory, bandwidth and other resources, and the second type of resources include but are not limited to hard disk, database, system API, input and output ports, uplink and downlink interfaces and other resources. The occupation of the first type of resources can be expressed by the amount, time or percentage of resource occupation, and the resource access times of the second type of resources refer to the frequency of resource access during the execution of the function, such as the number of database queries, the number of hard disk reads and writes, etc.
[0086] Specifically, during the simulation execution of a function, the system will monitor the resource usage of the first type of resources in real time. For example, if a function requires a large number of computing operations during execution, the system will record how much CPU time it occupies or the proportion of memory resources it occupies. In addition, the system will also monitor the number of resource accesses to the second type of resources in real time. For example, when a function is executed, it may need to frequently access the hard disk to read data, or frequently access network resources to download data. The system will record the number of resource accesses to the second type of resources.
[0087] Furthermore, the resource occupancy data of the function is determined based on the resource occupancy of the first type of resources and the resource access times of the second type of resources. Specifically, the usage of different types of resources can be quantified and weighted to evaluate the resource occupancy data of the system when executing the function. For example, assuming that under the current test conditions, the compatibility test of the application to be tested pays more attention to the occupancy rate of memory resources, so a higher weight can be set for the occupancy rate of memory resources, and a lower weight can be set for the resource access times of hard disk resources, and finally the overall resource occupancy data is obtained by weighted calculation.
[0088] In this embodiment, by determining the resource usage data when the function is executed, the resource usage of the system under different function combinations can be more comprehensively understood, so that the resource contention situation of each application under test during the compatibility test process can be more accurately and efficiently identified, thereby obtaining more accurate compatibility test results.
[0089] In one embodiment, Figure 4 As shown, the resource occupancy of the first type of resources includes the resource occupancy ratio of the first type of resources, and S230 includes:
[0090] S231, determining the sum of the resource occupancy ratios of the functions in the function combination according to the resource occupancy ratio of the first type of resources.
[0091] S232: Determine a resource occupation conflict score of the first type of resources of the function combination according to the sum of the resource occupation ratios and a preset scoring mechanism.
[0092] S233: Determine the request queuing status of the second type of resources according to the resource access times of the functions in the function combination.
[0093] S234: Determine the resource occupation conflict score of the second type of resources of the function combination based on the request queuing situation and a preset scoring mechanism.
[0094] S235 , determining a resource occupation conflict score of the function combination according to the resource occupation conflict score of the first type of resources, the resource occupation conflict score of the second type of resources, and a preset weight.
[0095] Among them, the resource occupancy ratio refers to the ratio of the first type of resources (such as CPU, memory) occupied by the functional module during operation, which is usually expressed as the percentage of the resources used by the function to the total system resources. In addition, because the resource occupancy ratio of the first type of resources (such as CPU, memory) is different when the same function is executed under different test conditions, in this embodiment, the maximum, minimum or average value of the resource occupancy ratio of the first type of resources (such as CPU, memory) when the function is executed under different test conditions can be used as the resource occupancy ratio of the function to the first type of resources. The request queuing situation refers to that when multiple functions are executed concurrently, the second type of resources (such as database, interface, etc.) may be accessed at the same time. Due to limited resources, request waiting or queuing phenomena may occur, which can be described by indicators such as queue length and waiting time.
[0096] Specifically, for a certain function combination, the resource occupation conflict score of the first type of resources of the function combination can be determined based on the sum of the resource occupation ratios of the first type of resources of all functions in the function combination, combined with a preset scoring mechanism, so as to quantify the severity of the resource occupation conflict of the first type of resources. The higher the score, the greater the risk of resource occupation conflict. It should be noted that the preset scoring mechanism can be a mapping relationship for mapping the sum of resource occupation ratios to the resource occupation conflict score. For example, when the sum of resource occupation ratios is between 0% and 50%, the resource occupation conflict score is 0.3 (indicating low risk); when it is between 50% and 80%, the resource occupation conflict score is 0.6 (indicating medium risk); and when it exceeds 80%, the resource occupation conflict score is 1 (indicating high risk).
[0097] Furthermore, for the second type of resources, based on the number of resource accesses to the second type of resources when each function is executed separately, evaluate whether request queuing will occur when these functions are executed concurrently. For example, if a database can only process 10 queries within a certain period of time, 10 query requests are initiated to the database when function A is executed separately, and 10 query requests are initiated to the database when function B is executed separately, then when function A and function B are executed concurrently, request queuing is likely to occur. For example, if the service time distribution of an API is the same for all functions in a certain function combination, and the generation time distribution of resource occupation requests for all functions in the function combination is exponentially distributed, then the exponential distribution parameters corresponding to each function can be added together to obtain the time interval distribution of resource occupation requests reaching the above API, which is also an exponential distribution. Further analysis shows that the waiting queue length is: ,in and They are all parameters for the time interval distribution of resource occupation requests arriving at the above API. The request queuing situation can be quantified through the waiting queue length. Finally, according to the request queuing situation that occurs when the functions in the function combination are executed concurrently, combined with the preset scoring mechanism, the resource occupation conflict score of the second type of resources in the function combination can be determined.
[0098] After obtaining the resource occupancy conflict score of the first type of resources and the resource occupancy conflict score of the second type of resources, combined with the preset resource weights, the final resource occupancy conflict score of the function combination can be obtained, which is used to evaluate the degree of resource occupancy conflict when each function in the function combination is executed concurrently.
[0099] In this embodiment, by determining the resource occupancy ratio of the first type of resources and the request queuing status of the second type of resources, the resource occupancy conflict risk of the system when executing multiple functions concurrently can be quantitatively evaluated, thereby improving the efficiency of subsequent compatibility testing.
[0100] In one embodiment, Figure 5 As shown, S300 includes:
[0101] S310, determining a set of functional test paths based on the application test directed graph.
[0102] S320, screening out a target functional test path with the highest probability of resource occupation conflict from the functional test path set.
[0103] Exemplarily, by traversing the test directed graph of the application, all functional test paths from the start node to the end node can be identified to obtain a set of functional test paths. For example, if a simple application test directed graph contains four nodes A, B, C, and D, and the connection order of the edges is A→B→C→D and A→C→D, then the set of functional test paths from the start node A to the end node D will include two functional test paths: "A→B→C→D" and "A→C→D", constituting the set of functional test paths.
[0104] Furthermore, for each functional test path in the functional test path set, the resource occupancy conflict score that may be caused is calculated. The specific calculation process has been explained in detail in the above embodiment and will not be repeated here. Finally, the functional test path with the largest resource occupancy conflict is screened out as the target functional test path.
[0105] In this embodiment, by screening out the target functional test paths with the highest probability of resource occupation conflict, the test resources can be concentrated on the functional test paths that may cause compatibility issues, thereby improving the compatibility test efficiency.
[0106] In one embodiment, Figure 5As shown, after S320, the method further includes:
[0107] S330: Determine the functional test paths that contain unselected functional combinations among the remaining functional test paths as a new functional test path set.
[0108] S340, determining whether there is any unselected function combination in the remaining function test paths, and if so, returning to step S320 until there is no unselected function combination in the remaining function test paths, thereby obtaining a plurality of target function test paths.
[0109] S400 includes: S410, performing compatibility testing on multiple application programs to be tested based on multiple target function test paths.
[0110] The unselected functional combination refers to the functional combination that has not been covered by the target functional test path. Following the above embodiment, after the target functional test path is screened, the remaining functional test paths in the functional test path set are determined as a new functional test path set.
[0111] Furthermore, it is first necessary to check whether there are any functional combinations in the remaining functional test paths that have not been covered by the target functional test path. If so, the functional test path with the highest probability of resource occupation conflict is re-screened from the remaining functional test paths and used as the target functional test path until all functional combinations are covered, and finally multiple target functional test paths can be obtained.
[0112] Finally, the multiple target function test paths obtained have a high probability of resource occupation conflict and have covered all untested function combinations. Based on the multiple target function test paths, a compatibility test is performed on the application to be tested. The specific testing process has been explained in detail in the above embodiments and will not be repeated here.
[0113] In this embodiment, through repeated iteration and screening, multiple target function test paths with high probability of resource occupation conflict and covering all untested function combinations are screened out as much as possible as the basis for compatibility testing. This allows each function combination to be evaluated and tested for resource conflicts, and gives priority to testing those function combinations with relatively high probability of resource occupation conflict, thereby improving the efficiency and comprehensiveness of compatibility testing.
[0114] In one embodiment, S400 includes: generating a test instruction sequence according to a target functional test path, executing the test instruction sequence, performing compatibility testing on the application to be tested, obtaining resource usage when different application to be tested are running concurrently, and generating a compatibility test log according to the resource usage.
[0115] Among them, the test instruction sequence refers to the instruction list generated to test the function combination in the target function test path. These instructions specify the order and operation steps of the test execution. Then, the actual test operation is performed according to the generated test instruction sequence, such as starting the application to be tested, and executing each test operation in turn according to the instruction sequence. The occupation of system resources by multiple applications to be tested during the execution process is recorded, including but not limited to the resource occupation ratio of the CPU and memory, the number of resource accesses to the database, hard disk, and network resources. Finally, a compatibility test log is generated, which records the resource occupation under each target function test path, including but not limited to the test steps, resource usage data, error reports, etc. during the compatibility test process, so as to identify compatibility problems that arise when different applications to be tested run concurrently.
[0116] In this embodiment, a corresponding test instruction sequence is generated according to the target function test path, and the test instruction sequence is executed to perform a compatibility test on the application to be tested. The compatibility test log finally generated records the possible compatibility issues in detail, and provides an accurate basis for subsequent work team members to optimize the application and troubleshoot problems.
[0117] In order to make a clearer description of the application program compatibility testing method based on conflict possibility provided by the present application, the following is a specific embodiment and the attached Figure 6 To illustrate, this specific embodiment includes the following steps:
[0118] S601, obtain the application test directed graph, the generation time distribution and service time distribution of the resource occupancy request corresponding to each function in the function combination, simulate the execution of the function, and determine the resource occupancy ratio of the first type of resources of the function and the resource access times of the second type of resources.
[0119] S602, determining the sum of the resource occupancy ratios of the functions in the function combination according to the resource occupancy ratio of the first type of resources, and determining the resource occupancy conflict score of the first type of resources in the function combination according to the sum of the resource occupancy ratios and a preset scoring mechanism.
[0120] S603, determining the request queuing status of the second type of resources according to the resource access times of the functions in the function combination, and determining the resource occupation conflict score of the second type of resources of the function combination based on the request queuing status and a preset scoring mechanism.
[0121] S604, determining the resource occupancy conflict score of the function combination according to the resource occupancy conflict score of the first type of resources, the resource occupancy conflict score of the second type of resources, and the preset weight, and determining the function test path set based on the application test directed graph.
[0122] S605 , screening out the target functional test path with the highest probability of resource occupation conflict from the functional test path set, and determining the functional test paths containing unselected functional combinations among the remaining functional test paths as a new functional test path set.
[0123] S606, determine whether there is any unselected function combination in the remaining function test paths, if so, return to step S605 until there is no unselected function combination in the remaining function test paths, and obtain multiple target function test paths.
[0124] S607, generating a test instruction sequence according to the target function test path, executing the test instruction sequence, performing compatibility test on the application to be tested, obtaining resource usage of different application to be tested when running concurrently, and generating a compatibility test log according to the resource usage.
[0125] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0126] Based on the same inventive concept, the embodiment of the present application also provides an application compatibility testing device based on conflict possibility for implementing the application compatibility testing method based on conflict possibility involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more application compatibility testing device embodiments based on conflict possibility provided below can refer to the limitations of the application compatibility testing method based on conflict possibility above, and will not be repeated here.
[0127] In an exemplary embodiment, Figure 7 As shown, an application compatibility testing device 700 based on conflict possibility is provided, comprising: a data acquisition module 710, a simulation execution module 720, a path search module 730 and a compatibility testing module 740, wherein:
[0128] The data acquisition module 710 is used to acquire the application test directed graph, each node of the application test directed graph represents a set of function combinations, each function combination is an arrangement and combination of functions between multiple application programs to be tested, and the edge of the directed graph represents the transfer direction between the function combinations.
[0129] The simulation execution module 720 is used to simulate the execution of the functions in each group of function combinations and determine the resource occupation conflict score of the function combination, where the resource occupation conflict score is used to represent the probability of resource occupation conflict.
[0130] The path search module 730 is used to find the target function test path with the highest probability of resource occupation conflict from the application test directed graph based on the resource occupation conflict score of each function combination.
[0131] The compatibility testing module 740 is used to perform compatibility testing on multiple application programs to be tested based on the target functional testing path.
[0132] In one embodiment, the simulation execution module 720 is also used to obtain the generation time distribution and service time distribution of the resource occupancy requests corresponding to each function in the function combination, and simulate the execution of each function in the function combination based on the generation time distribution, service time distribution, and a preset service policy to determine the resource occupancy data of each function, and determine the resource occupancy conflict score of the function combination based on the resource occupancy data of each function and a preset scoring mechanism.
[0133] In one embodiment, the simulation execution module 720 is also used to simulate the execution function, determine the resource occupancy of the first type of resources of the function, and the number of resource accesses of the second type of resources, and determine the resource occupancy data of the function based on the resource occupancy of the first type of resources and the number of resource accesses of the second type of resources.
[0134] In one embodiment, the resource occupancy of the first type of resources includes the resource occupancy ratio of the first type of resources. The simulation execution module 720 is also used to determine the sum of the resource occupancy ratios of the functions in the function combination according to the resource occupancy ratio of the first type of resources, determine the resource occupancy conflict score of the first type of resources in the function combination according to the sum of the resource occupancy ratios and a preset scoring mechanism, determine the request queuing situation of the second type of resources according to the number of resource accesses of the functions in the function combination, determine the resource occupancy conflict score of the second type of resources in the function combination based on the request queuing situation and the preset scoring mechanism, and determine the resource occupancy conflict score of the function combination according to the resource occupancy conflict score of the first type of resources, the resource occupancy conflict score of the second type of resources, and the preset weight.
[0135] In one embodiment, the path search module 730 is further used to determine a set of functional test paths based on the application test directed graph, and to filter out a target functional test path with the highest probability of resource occupation conflict from the set of functional test paths.
[0136] In one embodiment, the application compatibility testing device 700 based on the possibility of conflict is also used to determine the functional test paths containing unselected functional combinations in the remaining functional test paths as a new functional test path set, and control the path search module 730 to perform the step of filtering out the target functional test paths with the highest probability of resource occupation conflict from the functional test path set again, until there are no unselected functional combinations in the remaining functional test paths, and multiple target functional test paths are obtained. The compatibility testing module 740 is also used to perform compatibility testing on multiple application programs to be tested based on multiple target functional test paths.
[0137] In one embodiment, the compatibility testing module 740 is also used to generate a test instruction sequence according to the target function test path, execute the test instruction sequence, perform compatibility testing on the application to be tested, obtain the resource usage of different applications to be tested when running concurrently, and generate a compatibility testing log based on the resource usage.
[0138] Each module in the application compatibility testing device 700 based on the possibility of conflict can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0139] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as an application test directed graph. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for testing application compatibility based on the possibility of conflict is implemented.
[0140] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0141] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in any of the above-mentioned application compatibility testing method embodiments based on conflict possibility are implemented.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in any of the above-mentioned application compatibility testing method embodiments based on conflict possibility are implemented.
[0143] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in any of the above-mentioned application compatibility testing method embodiments based on conflict possibility.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0145] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0146] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0147] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for testing application compatibility based on conflict possibility, characterized in that: The method comprises: Obtain an application test directed graph, wherein each node of the application test directed graph represents a set of function combinations, each of the function combinations is an arrangement and combination of functions between multiple application programs to be tested, and the edges of the directed graph represent transfer directions between the function combinations; For each group of function combinations, simulate and execute the functions in the function combination to determine the resource occupation conflict score of the function combination, where the resource occupation conflict score is used to characterize the resource occupation conflict probability; Based on the resource occupancy conflict score of each of the function combinations, finding a target function test path with the highest probability of resource occupancy conflict from the application test directed graph; Based on the target function test path, compatibility testing is performed on the plurality of application programs to be tested.
2. The method according to claim 1, characterized in that The simulating and executing the functions in the function combination to determine the resource occupation conflict probability of the function combination includes: Obtaining the generation time distribution and service time distribution of the resource occupation request corresponding to each function in the function combination; According to the generation time distribution, the service time distribution, and the preset service strategy, simulate and execute each function in the function combination to determine the resource occupation data of each function; The resource occupation conflict score of the function combination is determined according to the resource occupation data of each of the functions and a preset scoring mechanism.
3. The method according to claim 2, characterized in that For each of the functions, the resource usage data of the function is determined based on the following steps: Simulate the execution of the function to determine the resource occupancy of the first type of resources and the number of resource accesses of the second type of resources of the function; The resource occupancy data of the function is determined according to the resource occupancy of the first type of resources and the number of resource accesses of the second type of resources.
4. The method according to claim 3, characterized in that The resource occupancy of the first type of resources includes the resource occupancy ratio of the first type of resources; the determining the resource occupancy conflict score of the function combination according to the resource occupancy data of each function and a preset scoring mechanism includes: Determining the sum of the resource occupancy ratios of the functions in the function combination according to the resource occupancy ratio of the first type of resources; Determining a resource occupancy conflict score of the first type of resources of the function combination according to the sum of the resource occupancy ratios and the preset scoring mechanism; Determining a request queuing status of the second type of resource according to the resource access times of the functions in the function combination; Determine a resource occupation conflict score of the second type of resource of the function combination based on the request queuing situation and the preset scoring mechanism; The resource occupation conflict score of the function combination is determined according to the resource occupation conflict score of the first type of resources, the resource occupation conflict score of the second type of resources, and a preset weight.
5. The method according to any one of claims 1 to 4, characterized in that: The resource occupation conflict probability based on each of the function combinations, finding a target function test path with the maximum resource occupation conflict probability from the application test directed graph, comprises: Determining a set of functional test paths based on the application test directed graph; A target functional test path with the highest probability of resource occupation conflict is screened out from the functional test path set.
6. The method according to claim 5, characterized in that After selecting the target functional test path with the highest probability of resource occupation conflict from the functional test path set, the method further includes: Determine the function test paths that contain unselected function combinations in the remaining function test paths as a new function test path set, and return to the step of screening out the target function test path with the highest probability of resource occupation conflict from the function test path set until there are no unselected function combinations in the remaining function test paths, thereby obtaining a plurality of the target function test paths; The compatibility test of the plurality of application programs to be tested is performed based on the target function test path, including: Based on the multiple target function test paths, compatibility testing is performed on the multiple application programs to be tested.
7. The method according to any one of claims 1 to 4, characterized in that: The compatibility test of the plurality of application programs to be tested is performed based on the target function test path, including: Generate a test instruction sequence according to the target function test path; Execute the test instruction sequence to perform compatibility test on the application to be tested, and obtain resource usage when different application to be tested are running concurrently; A compatibility test log is generated based on the resource usage.
8. An application compatibility testing device based on conflict possibility, characterized in that: The device comprises: A data acquisition module is used to acquire an application test directed graph, wherein each node of the application test directed graph represents a set of function combinations, each of the function combinations is an arrangement and combination of functions between multiple application programs to be tested, and the edges of the directed graph represent transfer directions between the function combinations; A simulation execution module, used for simulating the execution of functions in each group of function combinations, and determining a resource occupation conflict score of the function combination, wherein the resource occupation conflict score is used to characterize a resource occupation conflict probability; A path search module, configured to search the target function test path with the highest probability of resource occupation conflict from the application test directed graph based on the resource occupation conflict scores of the function combinations; A compatibility testing module is used to perform compatibility testing on the plurality of application programs to be tested based on the target function test path.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.