Application program testing method and device, equipment and medium

By generating random number sequences to build a complex network environment, the problem of performance fluctuations in the existing technology of applications in complex network environments is solved, and the test coverage and stability are improved.

CN118916270APending Publication Date: 2024-11-08BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410947543.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

In complex network environments such as elevators and subways, the performance of the application may fluctuate abnormally or even crash. The existing technology test covers fewer network scenarios and cannot effectively simulate real usage scenarios.

Method used

By obtaining network setting parameters and random number seeds, a random number sequence is generated, and a variety of network environment configuration data is built to build the target network environment, test the application, and enhance network scenario coverage.

Benefits of technology

By randomizing the network environment, the network scenarios covered by the test are enriched, the differences between tests and real usage scenarios are reduced, and the stability and performance of the application in complex network environments are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916270A_ABST
    Figure CN118916270A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to an application program testing method and device, equipment and a medium, and the method comprises the steps: obtaining a network setting parameter and a random number seed for a target application program, the network setting parameter being used for setting a combination of a plurality of basic network environments; generating a target random number sequence according to the random number seed, and determining target network environment configuration data according to the target random number sequence and the network setting parameters; and constructing a target network environment for the to-be-tested device comprising the target application program based on the target network environment configuration data, and testing the target application program in the target network environment. By adopting the technical scheme, the combination of the plurality of basic network environments is randomized through the random number seed, so that more complex and diversified network environments are constructed, network scenes covered by testing the application program are enriched, the coverage degree of the network scenes is improved, and the test efficiency is improved. And the difference between the test and the real use scene of the application program is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment and medium for testing an application program. Background Art

[0002] With the iteration of application versions, the performance of applications in normal network environments is becoming more and more excellent. However, in more complex network environments such as elevators, subways, and trains, the performance of applications may fluctuate abnormally or even crash. There is a problem in related technologies that the test covers few network scenarios. Summary of the invention

[0003] In order to solve the above technical problems, the present disclosure provides a method, device, equipment and medium for testing an application.

[0004] The present disclosure provides a method for testing an application program, the method comprising:

[0005] Acquire network setting parameters and random number seeds for a target application, wherein the network setting parameters are used to set a combination of multiple basic network environments;

[0006] Generate a target random number sequence according to the random number seed, and determine target network environment configuration data according to the target random number sequence and the network setting parameters;

[0007] A target network environment is constructed for the device under test including the target application based on the target network environment configuration data, and the target application under the target network environment is tested.

[0008] The present disclosure also provides a device for testing an application program, the device comprising:

[0009] An acquisition module, used to acquire network setting parameters and random number seeds for a target application, wherein the network setting parameters are used to set a combination of multiple basic network environments;

[0010] A data determination module, configured to generate a target random number sequence according to the random number seed, and determine target network environment configuration data according to the target random number sequence and the network setting parameters;

[0011] The program testing module is used to build a target network environment for the device under test including the target application program based on the target network environment configuration data, and to test the target application program under the target network environment.

[0012] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement a testing method for an application as provided in an embodiment of the present disclosure.

[0013] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the test method of the application program provided by the embodiment of the present disclosure.

[0014] The technical solution provided by the embodiment of the present disclosure has the following advantages over the prior art: the test solution for the application provided by the embodiment of the present disclosure obtains the network setting parameters and random number seeds for the target application, wherein the network setting parameters are used to set the combination of multiple basic network environments; generates a target random number sequence according to the random number seed, and determines the target network environment configuration data according to the target random number sequence and the network setting parameters; constructs a target network environment for the device under test including the target application based on the target network environment configuration data, and tests the target application under the target network environment. By adopting the above technical solution, the network setting parameters are randomized by the random number sequence generated by the random number seed to obtain the network environment configuration data, and the target network environment used for the application test is constructed based on the network environment configuration data, and the combination of multiple basic network environments is randomized by the random number seed, so as to construct a more complex and diverse network environment, enrich the network scenarios covered by the application test, improve the coverage of the network scenarios, and reduce the difference between the test and the actual use scenarios of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0016] Figure 1 A flowchart of a method for testing an application program provided by an embodiment of the present disclosure;

[0017] Figure 2 A schematic diagram of hardware connection based on edge nodes provided in an embodiment of the present disclosure;

[0018] Figure 3 A schematic diagram of generating network setting parameters provided by an embodiment of the present disclosure;

[0019] Figure 4A schematic diagram of a setting page for a basic network environment in a cloud testing platform provided in an embodiment of the present disclosure;

[0020] Figure 5 A flowchart of another application testing method provided by an embodiment of the present disclosure;

[0021] Figure 6 A schematic diagram of testing a target application provided by an embodiment of the present disclosure;

[0022] Figure 7 A schematic diagram of a method for testing an application program provided by an embodiment of the present disclosure;

[0023] Figure 8 A flowchart of another application testing method provided by an embodiment of the present disclosure;

[0024] Fig. 9 A schematic diagram of determining network performance parameters provided by an embodiment of the present disclosure;

[0025] Fig.10 A schematic diagram of another method for determining network performance parameters provided by an embodiment of the present disclosure;

[0026] Fig.11 A schematic diagram of determining online network performance data provided by an embodiment of the present disclosure;

[0027] Fig.12 A schematic diagram of generating alarm information provided by an embodiment of the present disclosure;

[0028] Fig.13 A schematic diagram of a page architecture of a settings page provided in an embodiment of the present disclosure;

[0029] Fig.14 A schematic diagram of the structure of a testing device for an application program provided in an embodiment of the present disclosure;

[0030] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0032] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0033] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0034] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0035] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0037] With the iteration of software versions, applications can access the Internet or mobile programs smoothly and quickly in a normal network environment, showing relatively excellent performance. However, in more complex network environments such as elevators, subways, and trains, the performance of applications may fluctuate abnormally or even crash, thereby reducing the user experience.

[0038] In the related technology, before the application is launched, the application can be tested in a configured network environment, and the network control system is used to control the test equipment to configure the weak network environment, and the application is tested in the weak network environment. However, the network scenarios covered by this test are still relatively small, which is quite different from the real scenario.

[0039] In order to solve the above problems, the embodiments of the present disclosure provide a method for testing an application program, which is introduced below in conjunction with specific embodiments.

[0040] Figure 1The present invention provides a flowchart of a method for testing an application program, which can be executed by a testing device or an edge node service of the application program, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method includes:

[0041] Step 101: Obtain network setting parameters and random number seeds for a target application, wherein the network setting parameters are used to set a combination of multiple basic network environments.

[0042] Among them, the target application may be an application that needs to be tested in different network environments, which network environments particularly include weak network environments, and the version of the target application may be a test version that has not been officially launched. This embodiment does not limit the type of the target application. For example, the type of the target application may include short video and / or office. The random number seed may be an initial value for inputting a random number generator to generate a pseudo-random number. The random number output by the random number generator can be controlled based on the random number seed. When the random number seed is the same, the random number output by the random number generator is the same. This embodiment does not limit the specific value of the random number seed. In the disclosed embodiment, the random number refers to a pseudo-random number, which will not be repeated below.

[0043] The basic network environment may be a model generated by simulating and modeling network conditions in different states and / or different scenarios. The states may include a normal network state, a weak network environment state, etc. The scenarios may include an elevator scenario, a basement scenario, etc. The embodiments of the present disclosure may use the basic network environment as a basis to construct a more complex network environment that is more in line with real scenarios.

[0044] The network setting parameters may be related parameters set for the current test process of the target application for building the network environment in which the device under test is located. The device under test is installed with the target application. The network setting parameters may be used to set multiple basic network environments and switching between the multiple basic network environments. In some embodiments of the present disclosure, the network setting parameters include multiple specific basic network environments, network performance parameters of each basic network environment, jitter parameters and occurrence probability, switching time between two basic network environments in multiple basic network environments, and total test duration.

[0045] Among them, the network performance parameter may be a parameter that characterizes the network performance of the network environment. The jitter parameter may be an adjustment base value that is numerically adjusted based on the network performance parameter. The types of the network performance parameter and the jitter parameter may correspond one to one. The occurrence probability may be the probability that the basic network model is selected. The switching time may be the length of time it takes to perform a transition switch between two network models that are adjacent in time sequence. The total test duration may be the total length of time it takes to test the target application.

[0046] In some embodiments of the present disclosure, the network performance parameters include at least one of the following: duration, uplink and downlink bandwidth, uplink and downlink packet loss rate, uplink and downlink delay; the jitter parameters include at least one of the following: duration jitter value, uplink and downlink bandwidth jitter value, uplink and downlink packet loss rate jitter value, uplink and downlink delay jitter value.

[0047] The duration may be the length of time that the basic network environment continues to appear, and the duration jitter value may be an adjustment base value for numerical adjustment based on the duration.

[0048] The uplink and downlink bandwidths may include uplink bandwidth and downlink bandwidth. The uplink bandwidth may be the data transmission rate when data is sent from the device under test to the network under the basic network environment. The downlink bandwidth may be the data transmission rate when data is sent from the network to the device under test under the basic network environment. The uplink and downlink bandwidth jitter values ​​may include uplink bandwidth jitter values ​​and downlink bandwidth jitter values. The uplink bandwidth jitter value may be an adjustment base value for numerical adjustment based on the uplink bandwidth. The downlink bandwidth jitter value may be an adjustment base value for numerical adjustment based on the downlink bandwidth.

[0049] The uplink and downlink packet loss rates may include an uplink packet loss rate and a downlink packet loss rate. The uplink packet loss rate may be the percentage of data packets lost when data is sent from the device under test to the network under the basic network environment. The downlink packet loss rate may be the percentage of data packets lost when data is sent from the network to the device under test under the basic network environment. The uplink and downlink packet loss rate jitter values ​​may include an uplink packet loss rate jitter value and a downlink packet loss rate jitter value. The uplink packet loss rate jitter value may be an adjustment base value for numerical adjustment based on the uplink packet loss rate, and the downlink packet loss rate jitter value may be an adjustment base value for numerical adjustment based on the downlink packet loss rate.

[0050] The uplink and downlink delays may include uplink delay and downlink delay. The uplink delay may be the time required for data to be transmitted from the device under test to the network under the basic network environment. The downlink delay may be the time required for data to be transmitted from the network to the device under test under the basic network environment. The uplink and downlink delay jitter values ​​may include an uplink delay jitter value and a downlink delay jitter value. The uplink delay jitter value may be an adjustment base value for numerical adjustment based on the uplink delay, and the downlink delay jitter value may be an adjustment base value for numerical adjustment based on the downlink delay.

[0051] In the disclosed embodiment, the test method of the application can be applied to the edge node service in the edge node, and the edge node can be a device node located at the edge of the network for creating a corresponding network environment for the device to be tested. This embodiment does not limit the device type of the edge node, for example, the edge node can be a personal computer.

[0052] Figure 2 A schematic diagram of hardware connection based on edge nodes provided in an embodiment of the present disclosure is provided. Figure 2 In the example, the network card can be a Gigabit Universal Serial Bus network card, and the router and the device under test communicate through a wireless network connection. Figure 2 As shown, the edge node is connected to broadband, and the edge node shares the network with the router through the network card, and the router provides the network to the device under test through the wireless network connection. Optionally, the edge node can be configured with a display compatible with it, so that the edge node and the display can be well adapted, reducing the operation and maintenance costs.

[0053] In the embodiment of the present disclosure, a cloud testing platform located in the cloud is pre-set. Figure 3 A schematic diagram of generating network setting parameters provided by an embodiment of the present disclosure, such as Figure 3 As shown, the tester performs a setting operation for network setting parameters on the cloud testing platform, and the setting operation may include selecting multiple basic network environments, setting network performance parameters and occurrence probabilities of the basic network environments, setting switching time, setting the total duration of the test, etc. In response to the setting operation, the cloud testing platform generates network setting parameters corresponding to multiple basic network environments, and stores the network setting parameters in a cloud database corresponding to the cloud testing platform.

[0054] Figure 4 A schematic diagram of a setting page of a basic network environment in a cloud testing platform provided in an embodiment of the present disclosure, such as Figure 4 As shown, the above setting operation can be implemented based on the setting page, on which a single basic network environment can be set, and the basic network environment serial number (ID), name, duration, number of associated devices to be tested, configuration number, downlink bandwidth, downlink delay, downlink packet loss rate, uplink speed, uplink delay, uplink packet loss rate, etc. can be displayed. Based on the setting page, the above parameters can also be edited and deleted.

[0055] The cloud testing platform can also generate random number seeds. After generating network setting parameters and random number seeds, the cloud testing platform sends the network setting parameters and the random number seeds to the test device of the application through the first preset interface. The test device of the application obtains the network setting parameters and the random number seeds, and then returns the start time point of the subsequent test of the target application to the cloud testing platform after starting to test the target application, and stores the start time point, network setting parameters, random number seeds, etc. for subsequent backtracking. Among them, there are many types of the first preset interface, which are not limited in this embodiment. For example, the first preset interface can be a hypertext transfer protocol interface.

[0056] Step 102: Generate a target random number sequence according to the random number seed, and determine target network environment configuration data according to the target random number sequence and network setting parameters.

[0057] The target random number sequence may be a sequence of multiple random numbers generated according to a random number seed and arranged in chronological order, and the target random number sequence may be used to randomize multiple basic network environments and / or to randomize the combination of the multiple basic network environments. The target network environment configuration data may be data for constructing the network environment in which the target application is located during subsequent testing.

[0058] In the disclosed embodiment, the application test device can generate random numbers based on the random number seed, and arrange the generated random numbers in the generation order to obtain a target random number sequence. Based on the target random number sequence, the selection order of the basic network environment is determined, the network performance parameters of the basic network environment are randomized, the switching time is randomized, and the target network environment configuration data is generated in combination with the total test duration.

[0059] In some embodiments of the present disclosure, a target random number sequence is generated according to a random number seed, including: at an initial time point and a switching time point, inputting the random number seed into a random number generator to generate a random number set; and combining multiple random number sets to obtain a target random number sequence.

[0060] The initial time point may be a time point for determining the first basic network environment. Optionally, the switching time point is a time point for switching between different basic network environments, and the number of switching time points is at least one. The switching time point may be a starting time point for switching between two sequentially adjacent basic network environments, and the switching time point may be the end time within the configuration duration of the previous basic network environment in the two adjacent basic network environments.

[0061] The random number generator may be a software tool for generating random numbers. Optionally, the random number set includes a preset number of random numbers. This embodiment does not limit the preset number, for example, the preset number may be 9. The target random number sequence may be a sequence consisting of multiple random number sets in a time order.

[0062] In this embodiment, the application test device can receive the random number seed sent by the cloud testing platform, and use the random number seed as the seed of the random number generator to generate a random number set. The application test device performs time sequence sorting on multiple random number sets to obtain a target random number sequence. Subsequently, the application test device determines the order in which the basic network environment appears and how to perform randomized adjustment on the basic network environment based on the target random number sequence.

[0063] In the above scheme, the generation of random number sets is realized based on the random number generator, and multiple random number sets are combined to obtain the target random number sequence. Since the random number generated by the random number generator is random and reproducible, it creates a basis for traceability.

[0064] Figure 5 A flowchart of another application testing method provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, in some embodiments of the present disclosure, determining the target network environment configuration data according to the target random number sequence and the network setting parameters includes:

[0065] Step 501: extract a corresponding random number set from a target random number sequence at an initial time point and a switching time point.

[0066] In this embodiment, the application program testing device may extract a random number set generated at the initial time point or the switching time point from the target random number sequence when the initial time point or the switching time point is reached.

[0067] Step 502: Determine a first basic network environment from multiple basic network environments according to the environment random number in the random number set and the occurrence probability of each basic network environment.

[0068] The environment random number may be a random number used to select a basic network environment, and the value of the environment random number may be between 0 and the accumulated value of the occurrence probability, and random switching between different network environments is achieved based on the environment random number. The first basic network environment may be a basic network environment selected at the current initial time point or the current switching time point.

[0069] In this embodiment, the application testing device can extract the environment random number from the random number set and obtain multiple occurrence probabilities corresponding to multiple basic environment networks, and select the first basic network environment from multiple initial network environments based on the environment random number and the occurrence probability.

[0070] In some embodiments of the present disclosure, a first basic network environment is determined from multiple basic network environments based on an environmental random number in a random number set and the occurrence probability of each basic network environment, including: converting the occurrence probability of each basic network environment into a target cumulative probability series; determining a corresponding probability interval in the target cumulative probability series based on the environmental random number, and determining the basic network environment corresponding to the probability interval as the first basic network environment.

[0071] The target cumulative probability sequence may be a probability sequence obtained by sequentially adding up a plurality of sequentially arranged occurrence probabilities in the order in which they are arranged. The probability interval may be an interval that includes the environment random number.

[0072] In the disclosed embodiment, the test device of the application program can sort the occurrence probabilities of each basic network environment to obtain an occurrence probability sequence. For each element in the occurrence probability sequence, the element and other elements before the element are numerically accumulated to obtain the element in the target cumulative probability sequence corresponding to the element. The above processing is performed for each element in the occurrence probability sequence to obtain the element in the target cumulative probability sequence corresponding to each element in the occurrence probability sequence, and then the target cumulative probability sequence is obtained. For the basic network environment corresponding to the first occurrence probability in the occurrence probability sequence, the element corresponding to the basic network environment in the target cumulative probability sequence (i.e., the smallest element in the target cumulative probability sequence) is used as the right endpoint of the probability interval, and 0 is used as the left endpoint of the probability interval to obtain the probability interval corresponding to the basic network environment. For the non-first basic network environment in the occurrence probability sequence, the element corresponding to the basic network environment in the target cumulative probability sequence is used as the right endpoint of the probability interval, and the previous element of the element is used as the left endpoint of the probability interval to obtain the probability interval of the basic network environment.

[0073] Further, the probability interval containing the environment random number is determined as the probability interval corresponding to the environment random number, and the basic network environment corresponding to the probability interval is determined as the first basic network environment.

[0074] For example, if there are basic network environments M1, M2, and M3, and their corresponding occurrence probabilities are 10, 10, and 80, respectively, then the target cumulative probability series is [10, 20, 100]. If the environment random number is 9, then the corresponding probability interval is [0, 10], and the basic network environment M1 is determined as the first basic network environment; if the environment random number is 99, then the corresponding probability interval is [20, 100], and the basic network environment M3 is determined as the first basic network environment.

[0075] Step 503: Determine the network performance parameters of the current fluctuating network environment according to the performance random number in the random number set and the network performance parameters and jitter parameters of the first basic network environment.

[0076] The performance random number may be a random number used to perform random adjustment on network performance parameters, and the performance random number may be a standard normal distribution random number.

[0077] The type of the performance random number may correspond to the type of the network performance parameter one-to-one. For example, the duration may correspond to the duration random number, and the duration random number may be used to perform randomized fine-tuning on the continuous event. The uplink and downlink bandwidths may correspond to the uplink and downlink bandwidth random numbers, and the uplink and downlink bandwidth random numbers may include the uplink bandwidth random number and the downlink bandwidth random number. The uplink bandwidth random number may be used to perform randomized fine-tuning on the uplink bandwidth, and the downlink bandwidth random number may be used to perform randomized fine-tuning on the downlink bandwidth. The uplink and downlink packet loss rates may correspond to the uplink and downlink packet loss rate random numbers. The uplink and downlink packet loss rate random numbers may include the uplink packet loss rate random number and the downlink packet loss rate random number, and the uplink packet loss rate random number may be used to perform randomized fine-tuning on the uplink packet loss rate, and the downlink packet loss rate random number may be used to perform randomized fine-tuning on the downlink packet loss rate. The uplink and downlink delays may correspond to the uplink and downlink delay random numbers. The uplink and downlink delay random numbers may include the uplink delay random number and the downlink delay random number, and the uplink delay random number may be used to perform randomized fine-tuning on the uplink delay, and the downlink delay random number may be used to perform randomized fine-tuning on the downlink delay.

[0078] The fluctuating network environment may be a network environment obtained by performing up and down fluctuation processing on the above basic network environment, and multiple fluctuating network environments may be combined into a target network environment. The current fluctuating network environment may be a network environment currently obtained by performing fluctuation processing on the first basic network environment, and the fluctuation processing may include jitter processing according to jitter parameters and random processing according to performance random numbers.

[0079] In this embodiment, the test device of the application can extract the performance random number from the random number set, and for each performance random number, determine the network performance parameter and jitter parameter corresponding to its type. Based on the performance random number and the jitter parameter, the network performance parameter is subjected to fluctuation fine-tuning through a preset fluctuation fine-tuning formula to obtain the corresponding network performance parameter in the current fluctuating network environment.

[0080] Among them, the fluctuation fine-tuning formula can be set according to user needs, etc., and this embodiment does not limit it. For example, if the network performance parameters of the first basic network environment include uplink bandwidth, the uplink bandwidth in the network performance parameters of the current fluctuating network environment determined according to the uplink bandwidth jitter value and the uplink bandwidth random number can be one of the following: uplink bandwidth + uplink bandwidth random number * uplink bandwidth jitter value, uplink bandwidth - uplink bandwidth random number * uplink bandwidth jitter value, uplink bandwidth + uplink bandwidth random number + uplink bandwidth jitter value, uplink bandwidth - uplink bandwidth random number - uplink bandwidth jitter value, uplink bandwidth - (1 + uplink bandwidth random number * uplink bandwidth jitter value), uplink bandwidth + (1 + uplink bandwidth random number * uplink bandwidth jitter value).

[0081] For example, if there are basic network environments M1, M2, and M3, and the network performance parameters corresponding to the above basic network environments are:

[0082] Basic network environment M1: Uplink bandwidth is 100, downlink bandwidth is 100, uplink packet loss rate is 10%, downlink packet loss rate is 10%, uplink delay is 10, downlink delay is 10, duration is 50;

[0083] Basic network environment M2: Uplink bandwidth is 200, downlink bandwidth is 200, uplink packet loss rate is 20%, downlink packet loss rate is 20%, uplink delay is 20, downlink delay is 20, and duration is 50;

[0084] Basic network environment M3: uplink bandwidth is 300, downlink bandwidth is 300, uplink packet loss rate is 30%, downlink packet loss rate is 30%, uplink delay is 30, downlink delay is 30, and duration is 50.

[0085] Taking the basic network environment M1 as an example, the current fluctuating network environment derived from the basic network environment M1 combined with the performance random number and the jitter parameter may include one or more of the current fluctuating network environment M1-1, the current fluctuating network environment M1-2, and the current fluctuating network environment M1-3. The network performance parameters corresponding to the above current fluctuating network environments are:

[0086] Current fluctuating network environment M1-1: Uplink bandwidth is 140, downlink bandwidth is 120, uplink packet loss rate is 16%, downlink packet loss rate is 26%, uplink delay is 15, downlink delay is 1, and duration is 100;

[0087] Current fluctuating network environment M1-2: Uplink bandwidth is 60, downlink bandwidth is 110, uplink packet loss rate is 17%, downlink packet loss rate is 9%, uplink delay is 19, downlink delay is 18, and duration is 90;

[0088] The current fluctuating network environment is M1-3: the upstream bandwidth is 80, the downstream bandwidth is 80, the upstream packet loss rate is 27%, the downstream packet loss rate is 8%, the upstream delay is 34, the downstream delay is 13, and the duration is 40.

[0089] The above-mentioned current fluctuating network environment is only an example. In this embodiment, due to the introduction of performance random numbers, there are multiple network performance parameters of the current fluctuating environment that can be determined based on the network performance parameters of the first basic network environment, which enriches the types of network environments.

[0090] Step 504: Determine the switching time between the current fluctuating network environment and the next fluctuating network environment according to the switching random number in the random number set and the switching time between the first basic network environment and the second basic network environment.

[0091] The switching random number may be a random number used to randomly adjust the switching time. The second basic network environment may be a basic network environment whose timing is one of the first basic network environment.

[0092] The next fluctuating network environment may be a fluctuating network environment whose time sequence is the next of the current fluctuating network environment, and the next fluctuating network environment may be a network environment obtained by performing fluctuation processing on the second basic network environment. The network performance parameters of the next fluctuating network environment may be determined according to the performance random number corresponding to the second basic network environment, the network performance parameters of the second basic network environment, and the jitter parameters.

[0093] In this embodiment, the test device of the application can extract the switching random number from the random number set, and obtain the switching time corresponding to the first basic network environment, input the switching random number and the switching time into the time fine-tuning formula, and obtain the switching time between the current fluctuating network environment and the next fluctuating network environment. When switching between the current fluctuating network environment and the next fluctuating network environment, first determine the next fluctuating network environment, and each network performance parameter is slowly switched within the switching time. Taking the uplink bandwidth as an example, if the uplink bandwidth corresponding to the current fluctuating network environment is 10, and the uplink bandwidth corresponding to the next fluctuating network environment is 20, if the switching time is 5s, then the uplink bandwidth is slowly adjusted from 10 to 20 within 5s.

[0094] The time fine-tuning formula may be set according to user needs, etc., and this embodiment does not limit it. For example, the time fine-tuning formula may include performing a preset calculation on the random number and the switching time corresponding to the first basic network environment, and this embodiment does not limit the preset calculation. For example, the preset calculation may include one or more of addition, subtraction, multiplication, division, and remainder.

[0095] Taking the basic network model including basic network model M1, basic network model M2, and basic network model M3 as an example, a network model switching between the basic network models may include: basic network model M1 switching to any one of basic network model M1, basic network model M2, and basic network model M3, basic network model M2 switching to any one of basic network model M1, basic network model M2, and basic network model M3, and basic network model M3 switching to any one of basic network model M1, basic network model M2, and basic network model M3, for a total of 9 cases. The basic network model can derive multiple fluctuating network models, so the number of cases of a network model switching between the current fluctuating network environment and the next fluctuating network environment is much greater than 9, which greatly enriches the number of switching between network environments.

[0096] Step 505: Combine the network performance parameters of the current fluctuating network environment corresponding to the initial time point and the switching time point and the switching time between the current fluctuating network environment and the next fluctuating network environment to obtain target network environment configuration data.

[0097] In this embodiment, the testing device of the application can combine the network performance parameters of the current fluctuating network environment corresponding to the initial time point and each switching time point, as well as the switching time points between the current fluctuating network environment and the next fluctuating network environment in a time sequence to obtain the target network environment configuration data.

[0098] In the above scheme, random adjustment of selecting the basic network environment is implemented based on the environment random number, random adjustment of network performance parameters is implemented based on the performance random number, and random adjustment of switching time between fluctuating network environments is implemented based on the switching random number, thereby realizing random adjustment of the entire process of determining the network environment, improving the richness of the network environment, and realizing the simulation of more complex network scenarios.

[0099] Step 103: construct a target network environment for the device under test including the target application based on the target network environment configuration data, and test the target application under the target network environment.

[0100] The target network environment may be a network environment finally determined to be used for testing the target application.

[0101] In the disclosed embodiment, after determining the target network environment configuration value, the application program test device can sequentially construct the corresponding fluctuating network environment according to the network performance parameters recorded in the target network environment configuration data, and complete the switching between two fluctuating network environments within the switching time for adjacent fluctuating network environments, thereby realizing the construction of the target network environment. When the device under test is in the target network environment, the application program test device tests the target application program in the device under test.

[0102] Figure 6 A schematic diagram of testing a target application provided by an embodiment of the present disclosure, such as Figure 6 As shown, the network agent can be used to maintain the configuration status of the edge node to ensure the correct execution of the network environment configuration data. The network agent also supports the distribution of network environment configuration data through the local interface. The edge node service can be used to monitor the status of the edge node and manage and distribute the network environment configuration data distributed remotely. Optionally, the edge node can also have a multi-tunnel function and / or a task work process. The multi-tunnel service can reduce latency and achieve high-reliability network configuration data distribution. The edge node service can be upgraded through the task work process.

[0103] like Figure 6 As shown, if the edge node service executes the test method of the application, calls the second preset interface to implement the call to the edge node service through the network agent, the edge node service calls the speed limit script, converts the input target network configuration data into a system command that can be run by the edge node system, and inputs the system command into the system core to implement the setting of the target network configuration data. The Internet accesses the system core in the form of a restricted network. The system core adjusts the restricted network based on the target network configuration data, builds a target network environment, and receives and sends network packets with the test equipment under the target network environment.

[0104] Figure 7 A schematic diagram of a method for testing an application program provided by an embodiment of the present disclosure is shown in FIG. Figure 7 As shown, the edge node service executes the test method of the application. The user can input the network setting parameters into the cloud testing platform. The cloud testing platform sends the network setting parameters to the edge node service. The edge node service determines the target network environment configuration data based on the random seed and the network setting parameters, and builds the target network environment based on the target network environment configuration data. The edge node tests the target application in the device under test with the target network environment as a weak network environment. In addition, the edge node service stores the random number seed and the initial time point when the target network environment starts to be constructed in the database.

[0105] The test scheme for the application provided by the embodiment of the present disclosure obtains the network setting parameters and random number seeds for the target application, wherein the network setting parameters are used to set the combination of multiple basic network environments; generates a target random number sequence according to the random number seed, and determines the target network environment configuration data according to the target random number sequence and the network setting parameters; constructs a target network environment for the device under test including the target application based on the target network environment configuration data, and tests the target application under the target network environment. The above technical scheme is adopted to randomize the network setting parameters through the random number sequence generated by the random number seed to obtain the network environment configuration data, and construct the target network environment used for the application test based on the network environment configuration data, and the combination of multiple basic network environments is randomized through the random number seed, so as to construct a more complex and diverse network environment, enrich the network scenarios covered by the application test, improve the coverage of the network scenarios, and reduce the difference between the test and the actual use scenarios of the application.

[0106] Figure 8 A flowchart of another application testing method provided by the embodiment of the present disclosure is shown as follows: Figure 8 As shown, in some embodiments of the present disclosure, after testing the target application in the target network environment, the method for testing the application further includes:

[0107] Step 801: When a target application triggers a preset abnormal condition, the abnormal time point, the network setting parameters of the target application and the random number seed are obtained.

[0108] The preset abnormal condition may be a pre-set condition that indicates an abnormal situation of the target application, and this embodiment does not limit the abnormal situation. For example, the abnormal situation may include application freezing, automatic exit of the application, etc. The abnormal time point may be the triggering time point of the preset abnormal condition.

[0109] In the disclosed embodiment, the device under test can report program performance parameters to the test device of the application in real time, and the test device of the application obtains the program performance parameters and analyzes the program performance parameters to determine whether the target application triggers a preset abnormal condition. If so, the abnormal time point, the network setting parameters corresponding to the target network environment where the target application is located, and the random number seed are obtained. Among them, the program performance parameters can be parameters that characterize the current operating performance of the target application. Step 801 can be performed by a performance analysis system, which can be a system built into the edge node service, or set independently of the edge node service.

[0110] Step 802: Based on the abnormal time point, the network setting parameters of the target application and the random number seed, the network performance parameters of the fluctuating network environment at the abnormal time point are obtained by restoration.

[0111] In this embodiment, the application test device can restore the network environment based on the network setting parameters of the target application and the random number seed, obtain the target network environment where the device under test is located, and determine the abnormal time period including the abnormal time point, determine the fluctuating network environment in the target network environment according to the abnormal time period, and obtain the fluctuating network model that takes effect before and after the abnormal time point. The length of the abnormal time period is not limited in this embodiment.

[0112] Fig. 9 A schematic diagram of determining network performance parameters provided by an embodiment of the present disclosure, such as Fig. 9 As shown, during the process of testing the target application in the device under test, the device under test reports the network performance parameters to the edge node service in real time, and the edge node service reports the network performance parameters to the cloud testing platform. The performance analysis system detects the program performance parameters of the target application in real time. If the preset abnormal condition is triggered, the timestamp determined when the preset abnormal condition is triggered is used as the abnormal time point, and the network setting parameters and random number seed of the target application and the device number of the device under test are obtained. Furthermore, the cloud testing platform can obtain the network performance parameters before and after the abnormal time point and the effective fluctuating network environment according to the abnormal time point.

[0113] Step 803: Display the network performance parameters of the fluctuating network environment at the abnormal time point.

[0114] In this embodiment, the application program testing device can obtain the network performance parameters of the fluctuating network environment at the abnormal time point, generate test data based on the network performance parameters, and display the test data. Fig. 9 As shown, the performance analysis system can generate test data including network performance parameters, and obtain a test report corresponding to the test data through manual or automated analysis. The test may include one or more of network performance parameters, analysis of causes that trigger preset abnormal conditions, and application optimization strategies.

[0115] Fig.10 A schematic diagram of another method for determining network performance parameters provided by an embodiment of the present disclosure, such as Fig.10As shown, the tester can set the network setting parameters and send the weak network test task to the cloud testing platform. After receiving the weak network test task, the cloud testing platform sends the weak network test task to the edge node. After receiving the weak network test task, the edge node establishes the corresponding target network environment and tests the target application in the target network environment. During the test, the edge node can generate packet capture data including abnormal time points, network setting parameters, random number seeds, etc., and send the packet capture data to the cloud testing platform. The cloud testing platform performs cloud analysis on the packet capture data and returns the network performance parameters in the visual interface. In addition, the tester can trace back the corresponding fluctuating network environment.

[0116] In the above scheme, when the preset abnormal conditions are detected, the abnormal time point, network setting parameters, and random number seeds are captured, and the network environment is traced back based on the above captured data, and the network performance parameters under the corresponding network environment are determined, so that testers can analyze in a more fine-grained manner to view the specific time points of degradation of the target application in a weak network environment, creating a foundation for discovering hidden defects.

[0117] In some embodiments of the present disclosure, the testing method of the application further includes: multiple basic network environments are constructed based on at least one of online network performance data of the target application, special scenario network performance data, and preset function parameter values.

[0118] Among them, the online network performance data can be the network performance data of the current network environment obtained by the user when the user uses the application; wherein the network performance data can correspond one-to-one with the type of network performance parameter, and the difference between the network performance data and the network performance parameter may include units and / or storage formats.

[0119] Fig.11 A schematic diagram of determining online network performance data provided by an embodiment of the present disclosure. In this embodiment, as Fig.11 As shown, during the operation of the application, the user of the application can initiate an online request. The cloud of the application responds to the online request, collects network performance data of the network environment where the application is currently located, clusters and grades the network conditions based on the collected network performance data, and sends the clustered and graded network performance data to the cloud testing platform. The cloud testing platform performs unit conversion and / or storage format conversion on the network performance data to obtain network performance parameters, builds a single basic network environment based on the network performance parameters, and stores the basic network environment. Among them, the online request can be a Hypertext Transfer Protocol request.

[0120] The special scenario network performance data may be network performance data collected in a special scenario, and the special scenario network performance data may be data that changes in a special scenario, and the special scenario may be a scenario with a special network environment, for example, the special scenario may include a weak network scenario. Taking the uplink bandwidth data as an example, the uplink bandwidth data may be uplink bandwidth data that changes in the weak network scenario. Among them, the weak network scenario may be a scenario with poor network performance, and the weak network scenario includes but is not limited to one or more of a subway, an elevator, a basement, and a cafeteria.

[0121] In this embodiment, since the network performance of the device is affected by factors such as time, space, and mobile communication technology generation, in order to simulate the network environment in different weak network scenarios to observe the performance of the target application in different weak network scenarios, the network environment acquisition device is placed in different weak network scenarios in advance to capture network packets including network performance data of special scenarios. The network packets are analyzed, and the network performance data of special scenarios in the network packets are converted into network performance data.

[0122] For example, the tester can bring a collection device into a weak network scenario and use the application in the collection device to simulate the user's operation, so that the collection device can send and receive network packets. During the operation period, the tester captures the product corresponding to the network packet and uploads the product to the cloud testing platform. The cloud testing platform extracts the special scenario network performance data in the network packet and converts the format of the special scenario network performance data to obtain network performance parameters. Subsequently, based on the network performance parameters, the basic network environment of the weak network scenario can be constructed to fuzzy.

[0123] The preset function parameter value may be a value corresponding to a network setting parameter constructed according to the preset function. This implementation does not limit the preset function, for example, the preset function may include one or more of a sine function, a cosine function, and a function with a normal distribution.

[0124] In this embodiment, the tester can call the function interface of the cloud testing platform and input the preset function into the cloud testing platform. The cloud testing platform determines the preset function parameter value that changes over time based on the preset function, and then builds the corresponding basic network environment based on the preset function parameter value.

[0125] The above scheme provides a variety of ways to build a basic network environment. The online network performance data meets the user's collection needs for the network environment during the use of the application. The special scenario network performance data meets the collection needs for the network environment in special scenarios. The preset function parameter values ​​meet the collection needs for the network environment with special network performance changes.

[0126] In some embodiments of the present disclosure, the testing method of the application further includes: obtaining device information of the test device, and if the device information includes abnormal information, generating alarm information of the test device according to the abnormal information; wherein the test device includes an edge node and a device to be tested.

[0127] Fig.12 A schematic diagram of generating alarm information provided by an embodiment of the present disclosure, such as Fig.12 As shown, the network agent can collect information from edge nodes and devices under test, obtain device information, and upload the device information and tracking point information to the alarm platform. The alarm platform determines whether the device information includes abnormal information based on the pre-set alarm rules. If so, an alarm message is issued; if not, it returns to continue to obtain device information to achieve continuous inspection and reporting.

[0128] The alarm rule may be a rule indicating that the test device cannot operate normally, and this embodiment does not limit the alarm rule. For example, the alarm rule may include at least one of the following: if the number of devices under test actually connected to the router is greater than a preset number threshold, it is determined that the alarm rule is satisfied; if the network speed of the edge node is less than a preset network speed threshold, it is determined that the alarm rule is satisfied; if the device under test or the edge node is offline, it is determined that the alarm rule is satisfied.

[0129] In the above solution, abnormal detection of edge nodes and devices under test is achieved, and timely feedback of the situation is provided through alarm information, which facilitates operation and maintenance personnel to solve online problems in a timely manner, reducing the time loss caused by device abnormalities. It also avoids the impact of device abnormalities on the target application test and improves the reliability of the target application test.

[0130] Next, the testing method of the application program in the embodiment of the present disclosure is further described through a specific example.

[0131] Fig.13 A schematic diagram of a page architecture of a setting page provided in an embodiment of the present disclosure, such as Fig.13 As shown, through the visual setting page on the cloud testing platform, the router configuration can be displayed and modified. The router configuration can include the region where the router is located, the universal unique identifier, the node status, the connected device, the wireless network connection information, the router editing, etc. Based on the router configuration, the device under test can be connected to the deployed router.

[0132] For a single basic network environment, you can edit and display one or more of the following settings on the settings page: upstream bandwidth, downstream bandwidth, upstream delay, downstream delay, upstream packet loss rate, downstream packet loss rate, configuration duration, waveform visualization, associated devices, and editing permissions. This enables the rapid construction of a single basic network environment, laying the foundation for subsequent task delivery and testing of target applications.

[0133] For the combined basic network environment, the combined basic network environment can be obtained by combining multiple single basic network environments, and the combined basic network environment can be obtained based on one or more of special scenario network performance data, preset function parameter values, and online network performance data.

[0134] For the permission management of the basic network environment, testers can set up a public basic network environment and a private basic network environment. The basic network environment that can be set with this permission can include a single basic network environment and / or a combined basic network environment. In addition, each basic network environment is stored to generate more complex network scenarios later. Based on the basic network environment, the network environment can be traced, which is convenient for testers to trace a time node in the network environment. The public basic network environment is a basic network environment that can be viewed by all testers. Through the public permission setting, the better basic network environment is displayed to other testers, so that more testers can use the basic network environment to simulate weak network scenarios. The private basic network environment can obtain better privacy protection and realize the construction of a complete, reliable and secure weak network scenario.

[0135] Regarding the rights management of routers, authorized testers can obtain one or more information including the router's universal unique identification code, location, creator, update time, permission configuration, and list mechanism.

[0136] In some embodiments of the present disclosure, the testing method of the application may include:

[0137] Step a1, based on the online network performance data of the target application, construct multiple basic network environments, and obtain network setting parameters determined based on the basic network environments.

[0138] Specifically, the cloud side of the application can classify network performance parameters according to user requests. The cloud testing platform converts the network performance parameters into a basic network environment through unit conversion and storage format conversion, and stores the basic network environment.

[0139] Testers use the cloud testing platform to specify the combination of multiple basic network environments, the probability of occurrence of each basic network environment, the duration of each basic network environment, jitter parameters, network performance parameters, switching time between basic network environments, and the total test duration to generate network setting parameters.

[0140] Step a2, obtain a random number seed, generate a target random number sequence according to the random number seed, determine the order of appearance of the basic network environment according to the environmental random number of the random number set in the target random number sequence, convert the basic network environment into a fluctuating network environment, and determine the switching time between the fluctuating network environments, and combine to obtain the target environment configuration data.

[0141] Specifically, the cloud testing platform can generate a random number seed and transmit the network setting parameters to the edge node service of the edge node through the Hypertext Transfer Protocol interface. The edge node service returns the initial starting point for starting the task and stores the network setting parameters and the initial time point.

[0142] The edge node service uses the random number seed as the seed of the random number generator to obtain a random number set. The edge node service determines the order of appearance of the basic network environment and the fluctuating network environment corresponding to the basic network environment through the corresponding random number set.

[0143] The process of generating target environment configuration data may include the following steps:

[0144] Step b1: The edge node extracts an environment random number from a random number set, and determines a first basic network environment according to the environment random number.

[0145] Specifically, the occurrence probability of each basic network environment is converted into a target cumulative probability series. For example, the occurrence probabilities of 10, 10, and 80 are converted into a target cumulative probability series [10, 20, 100]. Furthermore, the probability interval corresponding to the environment random number in the target cumulative probability series is determined, and the basic network environment corresponding to the probability interval is determined as the first basic network environment. For example, if the environment random number is 9, the first basic network environment is determined as the first basic network environment; if the environment random number is 99, the last basic network environment is determined as the first basic network environment.

[0146] Step b2, determining the network performance parameters of the current fluctuating network environment according to the performance random numbers in the random number set and the network performance parameters and jitter parameters of the first basic network environment.

[0147] Specifically, the edge node service extracts 7 standard normal distribution random numbers from the random number set, namely 7 performance random numbers, which include uplink and downlink bandwidth random numbers, uplink and downlink packet loss rate random numbers, uplink and downlink delay random numbers, and duration random numbers. Combined with the above random numbers, jitter values, and network performance parameters of the first basic network environment, the corresponding network performance parameters of the current fluctuating network environment are determined.

[0148] Step b3: Determine the switching time corresponding to the current fluctuating network environment according to the switching random number in the random number set and the switching time corresponding to the first basic network environment.

[0149] Specifically, the edge node service extracts the switching random number from the random number set, and the edge node service determines the switching time corresponding to the current fluctuating network environment through the switching random number and the switching time corresponding to the basic network environment. At the starting time point of the switching time corresponding to the current fluctuating network environment, the next fluctuating network environment is first determined based on a similar method to the above steps b1-b2, and each network performance parameter is slowly switched. For example, if the uplink bandwidth of the current fluctuating network environment is 10, the uplink bandwidth of the next fluctuating network environment is 20, and the switching time corresponding to the current fluctuating network environment is 5 seconds, then the uplink bandwidth is slowly changed from 10 to 20 within 5 seconds.

[0150] Step b4, continue to execute the above steps b1-b3 until the total test duration is reached.

[0151] Step a3: construct a target network environment for the device under test based on the target network environment configuration data, and test the target application in the target network environment.

[0152] Step a4: During the test, the performance analysis system automatically detects program performance parameters. If preset abnormal conditions such as video freeze and abnormal application exit are triggered, the current timestamp is used as the abnormal time point, and the fluctuating network environment is backtracked based on the abnormal time point.

[0153] Specifically, the performance analysis system will trigger the preset abnormal conditions with the abnormal time point and device number to the cloud testing platform. The cloud testing platform matches the network performance parameters of the device before and after the abnormal time point from the database, and obtains the network setting parameters and random number seeds. The cloud testing platform restores the fluctuating network environment before and after the abnormal time point based on the network setting parameters, random number seeds, and abnormal time point. Among them, due to the characteristics of random numbers, when the random number seeds are consistent, the random number set generated subsequently is fixed.

[0154] Step a5: Analyze the causes of abnormalities based on the network performance parameters of the fluctuating network environment and provide optimization tests.

[0155] For example, if a good network environment switches to a poor network environment, the target application will experience lag, and subsequent optimization will be performed for this scenario to improve the user experience.

[0156] The application testing method provided by the embodiment of the present disclosure achieves coverage of more network scenarios, has rich network environment simulation capabilities, simulates a more realistic network environment, increases the probability of discovering problems before the application goes online, creates a foundation for solving defects before the application goes online, and improves the user experience after the application goes online. Flexible weak network environment configuration is achieved through a visual settings page. Coverage of a larger area and connection of a larger number of devices to be tested can be achieved. Through the public basic network environment, a good basic network environment can be shared, which helps to discover defects in the application and increase the credibility of the test data. By storing the basic network environment and random number seeds, a foundation is created for backtracking, and fine-grained automated processing of the application test process is achieved. Persistent detection of the device to be tested is achieved, manual router configuration is eliminated, and human resources are saved.

[0157] Fig.14 This is a schematic diagram of the structure of a testing device for an application provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device, for example, it can be configured in an edge node service. Fig.14 As shown, the test fixture for this application includes:

[0158] An acquisition module 1401 is used to acquire network setting parameters and a random number seed for a target application, wherein the network setting parameters are used to set a combination of multiple basic network environments;

[0159] The data determination module 1402 is used to generate a target random number sequence according to the random number seed, and determine target network environment configuration data according to the target random number sequence and the network setting parameters;

[0160] The program testing module 1403 is used to build a target network environment for the device under test including the target application program based on the target network environment configuration data, and to test the target application program under the target network environment.

[0161] In some embodiments of the present disclosure, the data determination module 1402 includes:

[0162] A set generation submodule, used for inputting the random number seed into a random number generator to generate a random number set at an initial time point and a switching time point;

[0163] The set combination submodule is used to combine multiple random number sets to obtain the target random number sequence.

[0164] In some embodiments of the present disclosure, the switching time point is a time point for switching between different basic network environments, the number of the switching time points is at least one, and the random number set includes a preset number of random numbers.

[0165] In some embodiments of the present disclosure, the network setting parameters include a specific plurality of basic network environments, network performance parameters of each of the basic network environments, jitter parameters and occurrence probability, switching time between any two of the plurality of basic network environments, and the total duration of the test.

[0166] In some embodiments of the present disclosure, the data determination module 1402 includes:

[0167] A set extraction submodule, used to extract a corresponding random number set from the target random number sequence at an initial time point and a switching time point;

[0168] An environment determination submodule, configured to determine a first basic network environment from the multiple basic network environments according to the environment random number in the random number set and the occurrence probability of each of the basic network environments;

[0169] A parameter determination submodule, used to determine the network performance parameters of the current fluctuating network environment according to the performance random number in the random number set and the network performance parameters and jitter parameters of the first basic network environment;

[0170] a time determination submodule, configured to determine a switching time between the current fluctuating network environment and a next fluctuating network environment according to a switching random number in the random number set and a switching time between the first basic network environment and the second basic network environment;

[0171] The data combination submodule is used to combine the network performance parameters of the current fluctuating network environment corresponding to the initial time point and the switching time point and the switching time between the current fluctuating network environment and the next fluctuating network environment to obtain the target network environment configuration data.

[0172] In some embodiments of the present disclosure, the environment determination submodule includes:

[0173] Converting the occurrence probability of each of the basic network environments into a target cumulative probability series;

[0174] A corresponding probability interval is determined in the target cumulative probability sequence according to the environment random number, and a basic network environment corresponding to the probability interval is determined as the first basic network environment.

[0175] In some embodiments of the present disclosure, the network performance parameter includes at least one of the following: duration, uplink and downlink bandwidth, uplink and downlink packet loss rate, uplink and downlink delay;

[0176] The jitter parameter includes at least one of the following: duration jitter value, uplink and downlink bandwidth jitter value, uplink and downlink packet loss rate jitter value, and uplink and downlink delay jitter value.

[0177] In some embodiments of the present disclosure, the testing device of the application further includes:

[0178] An exception triggering module, used for obtaining an exception time point, network setting parameters of the target application and a random number seed when the target application triggers a preset exception condition after testing the target application in the target network environment;

[0179] An exception handling module, used for restoring the network performance parameters of the fluctuating network environment at the abnormal time point based on the abnormal time point, the network setting parameters of the target application and the random number seed;

[0180] The parameter display module is used to display the network performance parameters of the fluctuating network environment at the abnormal time point.

[0181] In some embodiments of the present disclosure, the multiple basic network environments are constructed based on at least one of online network performance data of the target application, special scenario network performance data, and preset function parameter values.

[0182] The application testing device provided in the embodiments of the present disclosure can execute the application testing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0183] A computer program product comprises a computer program / instruction, which implements the steps of the above-mentioned application program testing method when executed by a processor.

[0184] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.

[0185] The following specific reference Fig.15 , which shows a schematic diagram of the structure of an electronic device 1500 suitable for implementing the embodiment of the present disclosure. The electronic device 1500 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.15The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0186] like Fig.15 As shown, the electronic device 1500 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 1501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1502 or a program loaded from a storage device 1508 into a random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the electronic device 1500 are also stored. The processing device 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0187] Typically, the following devices may be connected to the I / O interface 1505: an input device 1506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1509. The communication device 1509 may allow the electronic device 1500 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.15 The electronic device 1500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0188] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1509, or installed from a storage device 1508, or installed from a ROM 1502. When the computer program is executed by the processing device 1501, the above-mentioned functions defined in the test method of the application program of the embodiment of the present disclosure are executed.

[0189] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0190] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0191] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0192] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains network setting parameters and random number seeds for a target application, wherein the network setting parameters are used to set a combination of multiple basic network environments; generates a target random number sequence according to the random number seed, and determines target network environment configuration data according to the target random number sequence and the network setting parameters; builds a target network environment for the device under test including the target application based on the target network environment configuration data, and tests the target application under the target network environment.

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

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

[0195] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0196] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0197] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0198] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

[0199] processor;

[0200] a memory for storing instructions executable by the processor;

[0201] The processor is used to read the executable instructions from the memory and execute the instructions to implement any application testing method provided in the present disclosure.

[0202] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute any of the application program testing methods provided by the present disclosure.

[0203] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0204] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0205] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0206] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for testing an application, characterized in that: include: Acquire network setting parameters and random number seeds for a target application, wherein the network setting parameters are used to set a combination of multiple basic network environments; Generate a target random number sequence according to the random number seed, and determine target network environment configuration data according to the target random number sequence and the network setting parameters; A target network environment is constructed for the device under test including the target application based on the target network environment configuration data, and the target application under the target network environment is tested.

2. The method according to claim 1, characterized in that Generating a target random number sequence according to the random number seed includes: At an initial time point and a switching time point, inputting the random number seed into a random number generator to generate a random number set; The target random number sequence is obtained by combining a plurality of the random number sets.

3. The method according to claim 2, characterized in that The switching time point is a time point for switching between different basic network environments, the number of the switching time point is at least one, and the random number set includes a preset number of random numbers.

4. The method according to claim 1, characterized in that: The network setting parameters include a specific plurality of basic network environments, network performance parameters of each of the basic network environments, jitter parameters and occurrence probability, switching time between any two of the basic network environments in the plurality of basic network environments, and a total test duration.

5. The method according to claim 4, characterized in that Determining target network environment configuration data according to the target random number sequence and the network setting parameters includes: At an initial time point and a switching time point, extracting a corresponding random number set from the target random number sequence; Determine a first basic network environment from the multiple basic network environments according to the environment random number in the random number set and the occurrence probability of each of the basic network environments; Determine the network performance parameters of the current fluctuating network environment according to the performance random number in the random number set and the network performance parameters and jitter parameters of the first basic network environment; Determining a switching time between the current fluctuating network environment and a next fluctuating network environment according to a switching random number in the random number set and a switching time between the first basic network environment and the second basic network environment; The network performance parameters of the current fluctuating network environment corresponding to the initial time point and the switching time point and the switching time between the current fluctuating network environment and the next fluctuating network environment are combined to obtain the target network environment configuration data.

6. The method according to claim 5, characterized in that Determining a first basic network environment from the multiple basic network environments according to the environment random number in the random number set and the occurrence probability of each of the basic network environments includes: Converting the occurrence probability of each of the basic network environments into a target cumulative probability series; A corresponding probability interval is determined in the target cumulative probability sequence according to the environment random number, and a basic network environment corresponding to the probability interval is determined as the first basic network environment.

7. The method according to claim 4, characterized in that The network performance parameters include at least one of the following: duration, uplink and downlink bandwidth, uplink and downlink packet loss rate, and uplink and downlink delay; The jitter parameter includes at least one of the following: duration jitter value, uplink and downlink bandwidth jitter value, uplink and downlink packet loss rate jitter value, and uplink and downlink delay jitter value.

8. The method according to claim 1, characterized in that After testing the target application in the target network environment, the method further includes: When the target application triggers a preset abnormal condition, obtaining the abnormal time point, the network setting parameters of the target application and the random number seed; Based on the abnormal time point, the network setting parameters of the target application and the random number seed, the network performance parameters of the fluctuating network environment at the abnormal time point are obtained by restoration; The network performance parameters of the fluctuating network environment at the abnormal time point are displayed.

9. The method according to claim 1, characterized in that: The multiple basic network environments are constructed based on at least one of the online network performance data of the target application, the special scenario network performance data, and the preset function parameter values.

10. A testing device for an application, characterized in that: include: An acquisition module, used to acquire network setting parameters and random number seeds for a target application, wherein the network setting parameters are used to set a combination of multiple basic network environments; A data determination module, configured to generate a target random number sequence according to the random number seed, and determine target network environment configuration data according to the target random number sequence and the network setting parameters; The program testing module is used to build a target network environment for the device under test including the target application program based on the target network environment configuration data, and to test the target application program under the target network environment.

11. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the test method of the application program described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the test method of the application program described in any one of claims 1 to 9.

Citation Information

Cited By

  • Weak network testing method and device for application program and medium

    CN120017564A