WO2020233064A1 - Function test-based factor influence degree determination method and apparatus, and terminal device - Google Patents

Function test-based factor influence degree determination method and apparatus, and terminal device Download PDF

Info

Publication number
WO2020233064A1
WO2020233064A1 PCT/CN2019/121679 CN2019121679W WO2020233064A1 WO 2020233064 A1 WO2020233064 A1 WO 2020233064A1 CN 2019121679 W CN2019121679 W CN 2019121679W WO 2020233064 A1 WO2020233064 A1 WO 2020233064A1
Authority
WO
WIPO (PCT)
Prior art keywords
tested
function
environment
duration
program corresponding
Prior art date
Application number
PCT/CN2019/121679
Other languages
French (fr)
Chinese (zh)
Inventor
梅锦振华
孙锦程
徐志成
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020233064A1 publication Critical patent/WO2020233064A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Definitions

  • This application belongs to the field of data processing technology, and in particular relates to a method, a device, a terminal device, and a computer non-volatile readable storage medium for determining the degree of influence of a factor based on a function test.
  • the signal environment is usually replaced by manual movement.
  • a tester holds a terminal device for functional testing in places with weak signals, such as elevators, underground parking garages, or subways.
  • weak signals such as elevators, underground parking garages, or subways.
  • the network factors that cause weak signals are unclear and the specific values are uncertain, so the degree of influence of each network factor cannot be determined based on the implementation.
  • the prior art cannot determine the degree of influence of different network factors on the program corresponding to the function to be tested.
  • the embodiments of the present application provide a method, a device, a terminal device, and a computer non-volatile readable storage medium for determining the degree of influence of a factor based on a functional test, to solve the problem that the degree of influence of various network factors cannot be determined in the prior art.
  • the first aspect of the embodiments of the present application provides a method for determining the degree of influence of factors based on functional testing, including:
  • Acquire at least two sets of environmental parameters to be tested select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained.
  • the duration of the test corresponding to the environmental parameter to be tested wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
  • the second aspect of the embodiments of the present application provides a device for determining the degree of influence of a factor based on a function test, including:
  • the first execution unit is configured to configure the network environment as a standard environment according to preset standard environmental parameters, and execute the program corresponding to the function to be tested in the standard environment, and execute the program used to complete the program corresponding to the function to be tested
  • the duration is determined as the standard duration
  • the second execution unit is configured to obtain at least two sets of environmental parameters to be tested, select any one of the at least two sets as the target group, and configure the network environment as the target group according to the environmental parameters to be tested in the target group
  • the environment to be tested corresponding to the environmental parameter to be tested, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to execute the program corresponding to the function to be tested is determined as the test of the target group Duration, until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
  • An alarm value determination unit configured to determine a ratio between the test duration and the standard duration as an alert value, and establish a mapping relationship between the alert value and all the network factors corresponding to the test duration;
  • a sorting unit configured to perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting .
  • a third aspect of the embodiments of the present application provides a terminal device.
  • the terminal device includes a memory, a processor, and computer-readable instructions that are stored in the memory and run on the processor.
  • the processor The following steps are implemented when the computer-readable instruction is executed:
  • Acquire at least two sets of environmental parameters to be tested select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained.
  • the duration of the test corresponding to the environmental parameter to be tested wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
  • the fourth aspect of the embodiments of the present application provides a computer non-volatile readable storage medium, the computer non-volatile readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor When implementing the following steps:
  • Acquire at least two sets of environmental parameters to be tested select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained.
  • the duration of the test corresponding to the environmental parameter to be tested wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
  • the embodiment of the application configures the environment to be tested according to different network factors, obtains the test duration in the environment to be tested, and calculates the measurement value corresponding to each network factor according to the test duration. The factors are sorted, and all the network factors after sorting are finally output.
  • the embodiment of the application configures the environment to be tested related to the determined network factor, and analyzes the execution of the program corresponding to the function to be tested in the environment to be tested, and quantifies each The degree of influence of network factors realizes the accurate measurement of the degree of influence, which is convenient for testers to optimize the program corresponding to the function to be tested according to the degree of influence of different network factors.
  • FIG. 1 is an implementation flowchart of a method for determining the degree of influence of a factor based on a function test provided in Embodiment 1 of the present application;
  • FIG. 2 is an implementation flowchart of the method for determining the degree of influence of a factor based on a function test provided in Embodiment 2 of the present application;
  • FIG. 3 is an implementation flowchart of a method for determining the degree of influence of a factor based on a function test provided in Embodiment 3 of the present application;
  • FIG. 4 is a structural block diagram of a device for determining the degree of influence of a factor based on a function test according to a fourth embodiment of the present application;
  • FIG. 5 is a schematic diagram of a terminal device provided in Embodiment 5 of the present application.
  • Figure 1 shows the implementation process of the method for determining the degree of influence of factors based on functional testing provided by an embodiment of the present application, which is described in detail as follows:
  • the network environment is configured as a standard environment according to preset standard environmental parameters, and the program corresponding to the function to be tested is executed in the standard environment, and the time taken to execute the program corresponding to the function to be tested is determined as Standard duration.
  • the execution of the program corresponding to the function to be tested in the standard environment is first analyzed, specifically, according to the forecast Set the standard environment parameters to configure the network environment of the terminal device as a standard environment, and execute the program corresponding to the function to be tested in the standard environment, and obtain the time taken to execute the program corresponding to the function to be tested.
  • this step The obtained duration is named the standard duration.
  • the specific types of functions to be tested are not limited in the embodiments of this application.
  • the functions to be tested can be functions such as data statistics, step count monitoring, or online shopping.
  • the network factors in the embodiments of this application It specifically refers to the factors that cause weak signals, such as low bandwidth, high delay, or high packet loss rate.
  • Testers can predefine the types of network factors.
  • the above standard environmental parameters can be customized by the tester in advance, or after obtaining the expected network environment of the program corresponding to the function to be tested (such as 4G or Wi-Fi, etc.), the standard environmental parameters can be set to match the expected network environment.
  • the environmental parameters are the same.
  • the environmental parameters in the embodiments of this application include uplink bandwidth, downlink bandwidth, uplink packet loss rate, downlink packet loss rate, uplink delay, and downlink delay.
  • environmental parameters may also include More content related to the web.
  • the standard environment parameter in order to prevent the obtained standard duration from being affected by any network factor, can be set to be incompatible with all network factors.
  • the uplink bandwidth in the standard environment parameter can be set as 33000 kilobits per second (kbps)
  • downlink bandwidth is 40000kbps
  • uplink packet loss rate and downlink packet loss rate are both 0
  • uplink delay and downlink delay are both 1 millisecond
  • the standard environment configured according to this standard environment is similar
  • the operation of configuring the standard environment can be implemented based on open source network simulation tools. Through the above method, the accuracy of subsequent analysis based on the standard duration is improved.
  • At least two sets of environmental parameters to be tested are acquired, any one of the at least two sets is selected as a target group, and the network environment is configured as the environment to be tested according to the environmental parameters to be tested of the target group
  • the environment to be tested corresponding to the parameter, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to complete the program corresponding to the function to be tested is determined as the test duration of the target group until Until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor.
  • At least two sets of environmental parameters to be tested are preset in the embodiment of this application.
  • each set of environmental parameters to be tested corresponds to at least one network factor
  • all groups of environmental parameters to be tested cover all types of defined network factors.
  • the defined network factors include low bandwidth, high packet loss rate, and high latency
  • you can set a set of environmental parameters to be tested, ParameterA to correspond to the network factors of low bandwidth, and specifically set the uplink bandwidth in ParameterA to
  • the downlink bandwidth is set to 32kbps, and the rest of the content in ParameterA is set to be consistent with the standard environmental parameters (when the standard environmental parameters are the example in step S101, set the uplink packet loss rate and the downlink packet loss rate in ParameterA to both 0, both the upstream and downstream delays are 1 millisecond); set the network factor corresponding to another set of environmental parameters ParameterB to be high packet loss rate, specifically set both the upstream packet loss rate and the downstream packet loss rate in ParameterB 90%, set the rest of the content in ParameterB to be consistent with the standard environmental parameters; set the network factor corresponding to another set of environmental parameters to be tested ParameterC to be high latency, specifically set both the uplink and downlink delays in ParameterC For 350 milliseconds, set the rest of ParameterC to
  • network factors can be set to correspond to more different values (for example, the value corresponding to low bandwidth is set to 33kbps), and more can be defined.
  • Multiple network factors, such as subdividing upstream and downstream, are defined as network factors with low upstream bandwidth and network factors with low downstream bandwidth.
  • the environment parameters of the target group to be tested configure the network environment of the terminal device as the environment to be tested, execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration operation , Until the test duration corresponding to each group of environmental parameters to be tested is obtained.
  • the test duration corresponding to the environment to be tested is set to the preset The timeout period of. Since the environment to be tested is a weak signal environment, the program corresponding to the function to be tested may not be able to be executed. For this situation, the embodiment of this application presets a timeout period and sets the function to be tested in the environment to be tested After the corresponding program, if the program corresponding to the function to be tested has not been completed after the preset timeout period, the test duration corresponding to the environment to be tested is set to the preset timeout duration to facilitate subsequent calculations.
  • the ratio between the test duration and the standard duration is determined as an alarm value, and a mapping relationship between the alarm value and all the network factors corresponding to the test duration is established.
  • the ratio between the test duration and the standard duration is calculated, and the obtained ratio is named the alarm value.
  • the alarm value is mapped to all network factors corresponding to the test duration. relationship. For example, if the standard duration is 10 seconds, and a certain test duration is 20 seconds, the alarm value corresponding to the test duration is calculated to be 2.
  • S104 perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
  • the network factor corresponding to the tested environmental parameter ParameterD is FactorD
  • the network factor corresponding to the tested environmental parameter ParameterE is FactorE and FactorF
  • the network factor corresponding to the tested environmental parameter ParameterF is FactorF.
  • the obtained measurement value indicates the degree of influence of the corresponding network factor on the program corresponding to the function to be tested, and the higher the measurement value, the greater the degree of influence of the corresponding network factor. Therefore, all network factors are sorted based on the measurement value.
  • the sorting can be performed based on the order of the measurement value from large to small or from small to large.
  • the embodiment of the present application does not limit it, and finally outputs all the network factors after sorting.
  • Testers can optimize the code and function of the program corresponding to the function to be tested according to the sorted network factors to overcome the influence of the network factors with a greater degree of influence on the program corresponding to the function to be tested, and try to avoid the weak signal of the program corresponding to the function to be tested Unstable operation in the environment.
  • the network factors are sorted according to the order of the measured value, and all the network factors after sorting are located
  • the forefront network factor is the high downlink latency, and the tester can optimize the underlying code of the program corresponding to the function to be tested according to the network factor, which can specifically reduce the prompt content of the voting prompt or simplify the interactive authentication with the server Process etc.
  • the embodiment of the application deploys different environments to be tested and calculates the measurement values to quantify the degree of influence of different network factors on the program corresponding to the function to be tested, and realize the degree of influence Accurate determination.
  • Figure 2 shows a method for determining the degree of influence of a factor based on a function test after expansion on the basis of Embodiment 1 of the present application.
  • the embodiment of the present application provides an implementation flow chart of the method for determining the degree of influence of a factor based on functional testing. As shown in FIG. 2, the method for determining the degree of influence of the factor may include the following steps:
  • the function to be tested may be of different types.
  • the function to be tested may be a function that can be executed repeatedly, such as a voting function or a refresh function.
  • the standard environment and different functions to be tested can be directly configured Environment, and get the standard duration in the standard environment, and get the test duration in the environment to be tested.
  • the function to be tested may also be a function that cannot be executed again after execution.
  • the function to be tested is a function that jumps to page B by clicking a button on page A, because after executing the program corresponding to the function to be tested, the terminal The current page of the device is page B, and it is naturally impossible to click the button on page A in the terminal device.
  • the state of the terminal device before the execution of the program corresponding to the function to be tested is saved as an initial state.
  • the initial state may be a page state or a data state, etc., which is determined according to actual application scenarios.
  • the function to be tested is a page jump function
  • the initial state includes an initial page
  • the page return function is triggered to switch the current page to the initial page.
  • the saved initial state includes at least one initial page, and after detecting that the page jump function is executed, the page return function on the terminal device (which can be used for Page return control), switch the current page of the terminal device to the initial page.
  • the function to be tested is a data operation function
  • a first operation sentence corresponding to the data operation function is obtained, and a second operation sentence corresponding to the first operation sentence is created, wherein the execution result of the first operation sentence is the same as The execution result of the second operation statement is reversed; if it is detected that the data operation function is executed, the second operation statement is executed.
  • the function to be tested is a data operation function (its role is to operate on the front end of the terminal device or the data on the server, such as adding data or deleting data, etc.)
  • First obtain the first operation statement corresponding to the data operation function, which is used to be executed to realize the data operation function, and create a second operation statement corresponding to the first operation statement, where the execution of the first operation statement The result is the opposite of the execution result of the second operation statement.
  • the first operation statement is to delete data A in the server
  • the second operation statement is to add data A to the server.
  • the first operation statement and the second operation statement can be structured Query language (Structured Query Language (SQL) statements may also be other types of statements, which are not limited in the embodiment of the present application.
  • SQL Structured Query Language
  • the state of the application program before the execution of the program corresponding to the function to be tested is saved as the initial state, if it is detected that the program corresponding to the function to be tested is executed, the The current state of the application is rolled back to the initial state.
  • the embodiment of the present application uses a rollback operation to ensure that the subsequent execution of the program corresponding to the function to be tested is not affected by the previous execution result, which improves the application of determining the degree of influence of network factors Sex.
  • the process of executing the program corresponding to the function to be tested in a standard environment and determining the time taken to complete the program corresponding to the function to be tested as the standard time length is refined
  • a method for determining the degree of influence of factors based on functional testing is obtained later.
  • the embodiment of the present application provides an implementation flow chart of the method for determining the degree of influence of a factor based on functional testing. As shown in FIG. 3, the method for determining the degree of influence of the factor may include the following steps:
  • a preset function request and function response corresponding to the program corresponding to the function to be tested are acquired, and the program corresponding to the function to be tested is triggered in the standard environment, wherein the function request is The identifier for starting execution of the program corresponding to the function to be tested, and the function response is the identifier for completing execution of the program corresponding to the function to be tested.
  • the function request and function response corresponding to the program corresponding to the function to be tested can be preset, where the function request is the identification of the start of execution of the program corresponding to the function to be tested ,
  • the function response is the identification of the completion of the program execution corresponding to the function to be tested.
  • the program corresponding to the function to be tested is a function to access a certain website, and the program corresponding to the function to be tested is based on the HyperText Transfer Protocol (HyperText Transfer Protocol, HTTP) to achieve access
  • set the function response as an HTTP response message that contains a status code of 200 (status code 200 represents the success of this visit) Text.
  • the trigger operation of the program corresponding to the function to be tested can be specified in advance, such as triggering a preset control or executing a preset script file.
  • the function request and function response are captured from the data initiated and received by the terminal device.
  • the log of the terminal device can be obtained, and the function request and function response can be used as search conditions in the log.
  • crawling it can also be achieved based on a third-party data packet capturing tool such as Fidder. If the function request and function response corresponding to the program corresponding to the function to be tested are captured, the sending time of the function request and the receiving time of the function response are obtained, and the absolute value of the difference between the sending time and the receiving time is used as the standard duration , To output.
  • the test duration in the environment to be tested can also be determined by similar steps S301 to S302, that is, the program corresponding to the function to be tested is triggered in the environment to be tested. After the function request and the function response are obtained, the sending time of the function request and the receiving time of the function response are obtained, and the absolute value of the difference between the sending time and the receiving time is determined as the test duration.
  • the program corresponding to the function to be tested is triggered in the standard environment. If the function request and function response corresponding to the program corresponding to the function to be tested are captured, the function is acquired The sending time of the request and the receiving time of the function response, the absolute value of the difference between the sending time and the receiving time is determined as the standard duration. The embodiment of this application calculates the standard duration by capturing the function request and the function response, which improves The accuracy of the obtained standard duration.
  • FIG. 4 shows a structural block diagram of the device for determining the degree of influence of a factor based on a function test provided by an embodiment of the present application.
  • the device for determining the degree of influence of a factor includes:
  • the first execution unit 41 is configured to configure the network environment as a standard environment according to preset standard environmental parameters, and execute the program corresponding to the function to be tested in the standard environment, and execute the program corresponding to the function to be tested
  • the duration of is determined as the standard duration
  • the second execution unit 42 is configured to obtain at least two groups of environmental parameters to be tested, select any one of the at least two groups as a target group, and configure the network environment as the target group according to the environmental parameters to be tested in the target group.
  • the environment to be tested corresponding to the environmental parameter to be tested, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to execute the program corresponding to the function to be tested is determined as the target group
  • the test duration until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
  • the alarm value determining unit 43 is configured to determine the ratio between the test duration and the standard duration as an alert value, and establish a mapping relationship between the alert value and all the network factors corresponding to the test duration;
  • the sorting unit 44 is configured to perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the networks after sorting factor.
  • the device for determining the degree of influence of the factor further includes:
  • the saving unit is configured to save the state that the program corresponding to the function to be tested was in before execution as the initial state
  • the rollback unit is configured to roll back the current state to the initial state if it is detected that the program corresponding to the function to be tested has been executed in the standard environment or in the environment to be tested.
  • the rollback unit includes:
  • the switching unit is used to trigger the page return function to switch the current page to the initial page.
  • the rollback unit includes:
  • the creation unit is configured to obtain a first operation sentence corresponding to the data operation function, and create a second operation sentence corresponding to the first operation sentence, wherein the execution result of the first operation sentence corresponds to the first operation sentence The execution results of the two operation statements are reversed;
  • the statement execution unit is used to execute the second operation statement.
  • the first execution unit 41 includes:
  • the trigger unit is used to obtain preset function requests and function responses corresponding to the program corresponding to the function to be tested, and trigger the program corresponding to the function to be tested in the standard environment, wherein the function request is The identification of the start of execution of the program corresponding to the function to be tested, and the function response is the identification of the completion of execution of the program corresponding to the function to be tested;
  • the grabbing unit is configured to obtain the sending time of the function request and the receiving time of the function response if the function request and the function response are grabbed, and compare the sending time with the receiving time The absolute value of the difference between is determined as the standard duration.
  • the second execution unit 42 further includes:
  • the setting unit is configured to set the test duration corresponding to the environment to be tested to a preset timeout duration if the program corresponding to the function to be tested has not been completed after a preset timeout period.
  • the device for determining the degree of influence of a factor determines the degree of influence of the program corresponding to the function to be tested by the network factor in a quantitative manner, so that the tester can optimize the program corresponding to the function to be tested according to the degree of influence of different network factors.
  • Fig. 5 is a schematic diagram of a terminal device provided by an embodiment of the present application.
  • the terminal device 5 of this embodiment includes: a processor 50, a memory 51, and computer-readable instructions 52 stored in the memory 51 and running on the processor 50, such as a function test program .
  • the processor 50 executes the computer-readable instructions 52, the steps in the above-mentioned method embodiments for determining the degree of influence of factors based on functional tests are implemented, such as steps S101 to S104 shown in FIG. 1.
  • the processor 50 executes the computer-readable instruction 52
  • the function of each unit in the above-mentioned device embodiment for determining the degree of influence of the factor based on the function test is implemented, for example, the functions of the units 41 to 44 shown in FIG. 4.
  • the computer-readable instruction 52 may be divided into one or more units, and the one or more units are stored in the memory 51 and executed by the processor 50 to complete the application .
  • the one or more units may be an instruction segment of a series of computer-readable instructions capable of completing specific functions, and the instruction segment is used to describe the execution process of the computer-readable instruction 52 in the terminal device 5.
  • the computer-readable instruction 52 may be divided into a first execution unit, a second execution unit, an alarm value determination unit, and a sorting unit. The specific functions of each unit are as follows:
  • the first execution unit is configured to configure the network environment as a standard environment according to preset standard environmental parameters, and execute the program corresponding to the function to be tested in the standard environment, and execute the program used to complete the program corresponding to the function to be tested
  • the duration is determined as the standard duration
  • the second execution unit is configured to obtain at least two sets of environmental parameters to be tested, select any one of the at least two sets as the target group, and configure the network environment as the target group according to the environmental parameters to be tested in the target group
  • the environment to be tested corresponding to the environmental parameter to be tested, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to execute the program corresponding to the function to be tested is determined as the test of the target group Duration, until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
  • An alarm value determination unit configured to determine a ratio between the test duration and the standard duration as an alert value, and establish a mapping relationship between the alert value and all the network factors corresponding to the test duration;
  • a sorting unit configured to perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting .
  • the terminal device 5 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor 50 and a memory 51.
  • FIG. 5 is only an example of the terminal device 5, and does not constitute a limitation on the terminal device 5. It may include more or less components than shown in the figure, or a combination of certain components, or different components.
  • the terminal device may also include input and output devices, network access devices, buses, etc.
  • the so-called processor 50 may be a central processing unit (Central Processing Unit, CPU), it can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5.
  • the memory 51 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) equipped on the terminal device 5.
  • Smart Media Card, SMC Smart Media Card
  • SD Secure Digital
  • the memory 51 may also include both an internal storage unit of the terminal device 5 and an external storage device.
  • the memory 51 is used to store the computer readable instructions and other programs and data required by the terminal device.
  • the memory 51 can also be used to temporarily store data that has been output or will be output.
  • Non-volatile memory may include Read-Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory.
  • ROM Read-Only Memory
  • PROM Programmable ROM
  • EPROM Electrically Programmable ROM
  • EEPROM Electrically Erasable Programmable ROM
  • Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory.
  • RAM Random Access Memory
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present application is applicable to the technical field of data processing, and provides a function test-based factor influence degree determination method and apparatus, a terminal device, and a computer non-volatile readable storage medium. The method comprises: obtaining a standard duration for executing and completing a program corresponding to a function to be tested under a standard environment; selecting any one group of at least two groups of environment parameters to be tested as a target group; configuring a network environment into an environment to be tested according to said environment parameters of the target group; obtaining a test duration for executing and completing the program corresponding to said function under the environment to be tested until the test duration corresponding to each group of said environment parameters is obtained, wherein each group of said environment parameters corresponds to at least one network factor; determining an alarm value corresponding to the network factor according to the test duration; and performing mean value operation on all alarm values corresponding to each network factor to obtain a measurement value, and outputting all the network factors which are sorted according to the measurement value. The present application implements quantitative determination of the influence degree of the network factors.

Description

基于功能测试的因素影响程度确定方法、装置及终端设备Method, device and terminal equipment for determining factor influence degree based on function test
本申请要求于2019年05月21日提交中国专利局、申请号为201910424156.5、发明名称为“基于功能测试的因素影响程度确定方法、装置及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on May 21, 2019, the application number is 201910424156.5, and the invention title is "Methods, devices and terminal equipment for determining the degree of influence of factors based on functional testing", and its entire contents Incorporated in this application by reference.
技术领域Technical field
本申请属于数据处理技术领域,尤其涉及基于功能测试的因素影响程度确定方法、装置、终端设备以及计算机非易失性可读存储介质。This application belongs to the field of data processing technology, and in particular relates to a method, a device, a terminal device, and a computer non-volatile readable storage medium for determining the degree of influence of a factor based on a function test.
背景技术Background technique
随着软件技术的快速发展,终端设备上搭载的应用程序已可实现越来越多的功能,如数据统计、运动监测以及线上购物等。基于软件工程的基本思想,在应用程序的开发过程中,功能测试是其中必不可少的一环,而由于终端设备在使用过程中可能移动至信号较弱的地方,故功能测试需要在弱信号环境下进行。With the rapid development of software technology, the applications carried on terminal devices can already implement more and more functions, such as data statistics, exercise monitoring, and online shopping. Based on the basic idea of software engineering, functional testing is an indispensable part of the application development process, and since the terminal device may move to a place with a weak signal during use, the functional test needs to be performed on the weak signal Under the environment.
在现有技术中,通常是通过人工移动的方式来进行信号环境的更换,比如由测试人员手持终端设备在信号弱的地方如电梯、地下停车库或地铁上等进行功能测试,由于上述环境中导致弱信号的网络因素(如高时延或高丢包率等)不清楚且具体数值不确定,故无法根据执行情况来确定出各个网络因素的影响程度。综上,现有技术无法确定不同网络因素对待测功能对应的程序的影响程度。In the prior art, the signal environment is usually replaced by manual movement. For example, a tester holds a terminal device for functional testing in places with weak signals, such as elevators, underground parking garages, or subways. The network factors that cause weak signals (such as high latency or high packet loss rate, etc.) are unclear and the specific values are uncertain, so the degree of influence of each network factor cannot be determined based on the implementation. In summary, the prior art cannot determine the degree of influence of different network factors on the program corresponding to the function to be tested.
技术问题technical problem
本申请实施例提供了一种基于功能测试的因素影响程度确定方法、装置、终端设备以及计算机非易失性可读存储介质,以解决现有技术中无法确定各个网络因素的影响程度的问题。The embodiments of the present application provide a method, a device, a terminal device, and a computer non-volatile readable storage medium for determining the degree of influence of a factor based on a functional test, to solve the problem that the degree of influence of various network factors cannot be determined in the prior art.
技术解决方案Technical solutions
本申请实施例的第一方面提供了一种基于功能测试的因素影响程度确定方法,包括:The first aspect of the embodiments of the present application provides a method for determining the degree of influence of factors based on functional testing, including:
根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;Configure the network environment as a standard environment according to preset standard environment parameters, execute the program corresponding to the function to be tested in the standard environment, and determine the time taken to complete the program corresponding to the function to be tested as the standard time length;
获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;Acquire at least two sets of environmental parameters to be tested, select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained. The duration of the test corresponding to the environmental parameter to be tested, wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;Determining a ratio between the test duration and the standard duration as an alarm value, and establishing a mapping relationship between the alert value and all the network factors corresponding to the test duration;
对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。Perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
本申请实施例的第二方面提供了一种基于功能测试的因素影响程度确定装置,包括:The second aspect of the embodiments of the present application provides a device for determining the degree of influence of a factor based on a function test, including:
第一执行单元,用于根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;The first execution unit is configured to configure the network environment as a standard environment according to preset standard environmental parameters, and execute the program corresponding to the function to be tested in the standard environment, and execute the program used to complete the program corresponding to the function to be tested The duration is determined as the standard duration;
第二执行单元,用于获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;The second execution unit is configured to obtain at least two sets of environmental parameters to be tested, select any one of the at least two sets as the target group, and configure the network environment as the target group according to the environmental parameters to be tested in the target group The environment to be tested corresponding to the environmental parameter to be tested, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to execute the program corresponding to the function to be tested is determined as the test of the target group Duration, until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
告警值确定单元,用于将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;An alarm value determination unit, configured to determine a ratio between the test duration and the standard duration as an alert value, and establish a mapping relationship between the alert value and all the network factors corresponding to the test duration;
排序单元,用于对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。A sorting unit, configured to perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting .
本申请实施例的第三方面提供了一种终端设备,所述终端设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A third aspect of the embodiments of the present application provides a terminal device. The terminal device includes a memory, a processor, and computer-readable instructions that are stored in the memory and run on the processor. The processor The following steps are implemented when the computer-readable instruction is executed:
根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;Configure the network environment as a standard environment according to preset standard environment parameters, execute the program corresponding to the function to be tested in the standard environment, and determine the time taken to complete the program corresponding to the function to be tested as the standard time length;
获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;Acquire at least two sets of environmental parameters to be tested, select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained. The duration of the test corresponding to the environmental parameter to be tested, wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;Determining a ratio between the test duration and the standard duration as an alarm value, and establishing a mapping relationship between the alert value and all the network factors corresponding to the test duration;
对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。Perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
本申请实施例的第四方面提供了一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下步骤:The fourth aspect of the embodiments of the present application provides a computer non-volatile readable storage medium, the computer non-volatile readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor When implementing the following steps:
根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;Configure the network environment as a standard environment according to preset standard environment parameters, execute the program corresponding to the function to be tested in the standard environment, and determine the time taken to complete the program corresponding to the function to be tested as the standard time length;
获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;Acquire at least two sets of environmental parameters to be tested, select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained. The duration of the test corresponding to the environmental parameter to be tested, wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;Determining a ratio between the test duration and the standard duration as an alarm value, and establishing a mapping relationship between the alert value and all the network factors corresponding to the test duration;
对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。Perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
有益效果Beneficial effect
本申请实施例,本申请实施例根据不同的网络因素配置待测环境,获取在待测环境下的测试时长,从而根据测试时长计算出每个网络因素对应的衡量值,按照衡量值对所有网络因素进行排序,最终输出排序后的所有网络因素,本申请实施例通过配置与确定的网络因素相关的待测环境,并对待测环境下待测功能对应的程序的执行情况进行分析,量化了各个网络因素的影响程度,实现了对影响程度的精确测定,便于测试人员根据不同网络因素的影响程度来优化待测功能对应的程序。According to the embodiment of the application, the embodiment of the application configures the environment to be tested according to different network factors, obtains the test duration in the environment to be tested, and calculates the measurement value corresponding to each network factor according to the test duration. The factors are sorted, and all the network factors after sorting are finally output. The embodiment of the application configures the environment to be tested related to the determined network factor, and analyzes the execution of the program corresponding to the function to be tested in the environment to be tested, and quantifies each The degree of influence of network factors realizes the accurate measurement of the degree of influence, which is convenient for testers to optimize the program corresponding to the function to be tested according to the degree of influence of different network factors.
附图说明Description of the drawings
图1是本申请实施例一提供的基于功能测试的因素影响程度确定方法的实现流程图;FIG. 1 is an implementation flowchart of a method for determining the degree of influence of a factor based on a function test provided in Embodiment 1 of the present application;
图2是本申请实施例二提供的基于功能测试的因素影响程度确定方法的实现流程图;FIG. 2 is an implementation flowchart of the method for determining the degree of influence of a factor based on a function test provided in Embodiment 2 of the present application;
图3是本申请实施例三提供的基于功能测试的因素影响程度确定方法的实现流程图;FIG. 3 is an implementation flowchart of a method for determining the degree of influence of a factor based on a function test provided in Embodiment 3 of the present application;
图4是本申请实施例四提供的基于功能测试的因素影响程度确定装置的结构框图;FIG. 4 is a structural block diagram of a device for determining the degree of influence of a factor based on a function test according to a fourth embodiment of the present application;
图5是本申请实施例五提供的终端设备的示意图。FIG. 5 is a schematic diagram of a terminal device provided in Embodiment 5 of the present application.
本发明的实施方式Embodiments of the invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are proposed for a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of this application.
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions described in the present application, specific embodiments are used for description below.
图1示出了本申请实施例提供的基于功能测试的因素影响程度确定方法的实现流程,详述如下:Figure 1 shows the implementation process of the method for determining the degree of influence of factors based on functional testing provided by an embodiment of the present application, which is described in detail as follows:
在S101中,根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长。In S101, the network environment is configured as a standard environment according to preset standard environmental parameters, and the program corresponding to the function to be tested is executed in the standard environment, and the time taken to execute the program corresponding to the function to be tested is determined as Standard duration.
在本申请实施例中,为了判定不同的网络因素对终端设备上的待测功能对应的程序的影响程度,首先对待测功能对应的程序在标准环境下的执行情况进行分析,具体地,根据预设的标准环境参数将终端设备的网络环境配置为标准环境,并在标准环境下执行待测功能对应的程序,获取执行完成待测功能对应的程序所用的时长,为了便于区分,将本步骤中获取到的时长命名为标准时长。值得一提的是,本申请实施例对待测功能的具体类型并不做限定,比如待测功能可为数据统计、步数监测或线上购物等功能,并且,本申请实施例中的网络因素专指的是导致弱信号的因素,如低带宽、高时延或高丢包率等,可由测试人员预先定义网络因素的种类。上述的标准环境参数可由测试人员预先自定义设置,也可在获取到待测功能对应的程序的预期网络环境后(如4G或Wi-Fi等),将标准环境参数设置为与预期网络环境的环境参数相同。为了便于说明,假设本申请实施例中的环境参数包括上行带宽、下行带宽、上行丢包率、下行丢包率、上行时延以及下行时延,当然根据实际应用场景不同,环境参数还可包括与网络相关的更多的内容。In the embodiment of the present application, in order to determine the degree of influence of different network factors on the program corresponding to the function to be tested on the terminal device, the execution of the program corresponding to the function to be tested in the standard environment is first analyzed, specifically, according to the forecast Set the standard environment parameters to configure the network environment of the terminal device as a standard environment, and execute the program corresponding to the function to be tested in the standard environment, and obtain the time taken to execute the program corresponding to the function to be tested. In order to facilitate the distinction, this step The obtained duration is named the standard duration. It is worth mentioning that the specific types of functions to be tested are not limited in the embodiments of this application. For example, the functions to be tested can be functions such as data statistics, step count monitoring, or online shopping. Moreover, the network factors in the embodiments of this application It specifically refers to the factors that cause weak signals, such as low bandwidth, high delay, or high packet loss rate. Testers can predefine the types of network factors. The above standard environmental parameters can be customized by the tester in advance, or after obtaining the expected network environment of the program corresponding to the function to be tested (such as 4G or Wi-Fi, etc.), the standard environmental parameters can be set to match the expected network environment. The environmental parameters are the same. For the convenience of description, it is assumed that the environmental parameters in the embodiments of this application include uplink bandwidth, downlink bandwidth, uplink packet loss rate, downlink packet loss rate, uplink delay, and downlink delay. Of course, depending on actual application scenarios, environmental parameters may also include More content related to the web.
可选地,设置标准环境参数与所有的网络因素均不对应。在本申请实施例中,为了使获取到的标准时长不受任一个网络因素的影响,可设置标准环境参数与所有的网络因素均不对应,举例来说,可设置标准环境参数中的上行带宽为33000千比特每秒(kbps),下行带宽为40000kbps,上行丢包率和下行丢包率均为0,上行时延和下行时延均为1毫秒,则根据该标准环境配置出的标准环境类似于Wi-Fi环境,其中,配置标准环境的操作可基于开源的网络模拟工具实现。通过上述方法,提升了后续基于标准时长进行分析的准确性。Optionally, setting standard environmental parameters does not correspond to all network factors. In the embodiment of this application, in order to prevent the obtained standard duration from being affected by any network factor, the standard environment parameter can be set to be incompatible with all network factors. For example, the uplink bandwidth in the standard environment parameter can be set as 33000 kilobits per second (kbps), downlink bandwidth is 40000kbps, uplink packet loss rate and downlink packet loss rate are both 0, uplink delay and downlink delay are both 1 millisecond, then the standard environment configured according to this standard environment is similar In the Wi-Fi environment, the operation of configuring the standard environment can be implemented based on open source network simulation tools. Through the above method, the accuracy of subsequent analysis based on the standard duration is improved.
在S102中,获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素。In S102, at least two sets of environmental parameters to be tested are acquired, any one of the at least two sets is selected as a target group, and the network environment is configured as the environment to be tested according to the environmental parameters to be tested of the target group The environment to be tested corresponding to the parameter, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to complete the program corresponding to the function to be tested is determined as the test duration of the target group until Until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor.
与标准环境参数对应的,在本申请实施例中预先设置至少两组待测环境参数,为了分析不同网络因素对待测功能对应的程序的影响程度,限定每组待测环境参数对应至少一个网络因素,且所有组待测环境参数覆盖已定义的所有种类的网络因素。举例来说,在定义的网络因素包括低带宽、高丢包率和高时延的情况下,可设置一组待测环境参数ParameterA对应的网络因素为低带宽,具体将ParameterA中的上行带宽和下行带宽均设置为32kbps,将ParameterA中的其余内容设置为与标准环境参数一致(在标准环境参数为步骤S101中的例子的情况下,设置ParameterA中的上行丢包率和下行丢包率均为0,上行时延和下行时延均为1毫秒);设置另一组待测环境参数ParameterB对应的网络因素为高丢包率,具体将ParameterB中的上行丢包率和下行丢包率均设置为90%,将ParameterB中的其余内容设置为与标准环境参数一致;设置另一组待测环境参数ParameterC对应的网络因素为高时延,具体将ParameterC中的上行时延和下行时延均设置为350毫秒,将ParameterC中的其余内容设置为与标准环境参数一致。当然,以上仅为示例,并不构成对本申请实施例的限定,在实际应用场景中还可设置网络因素对应更多不同的数值(如设置低带宽对应的数值为33kbps),并且还可定义更多的网络因素,如细分上行和下行,定义为低上行带宽的网络因素和为低下行带宽的网络因素等。Corresponding to standard environmental parameters, at least two sets of environmental parameters to be tested are preset in the embodiment of this application. In order to analyze the influence of different network factors on the program corresponding to the function to be tested, it is limited that each set of environmental parameters to be tested corresponds to at least one network factor , And all groups of environmental parameters to be tested cover all types of defined network factors. For example, when the defined network factors include low bandwidth, high packet loss rate, and high latency, you can set a set of environmental parameters to be tested, ParameterA, to correspond to the network factors of low bandwidth, and specifically set the uplink bandwidth in ParameterA to The downlink bandwidth is set to 32kbps, and the rest of the content in ParameterA is set to be consistent with the standard environmental parameters (when the standard environmental parameters are the example in step S101, set the uplink packet loss rate and the downlink packet loss rate in ParameterA to both 0, both the upstream and downstream delays are 1 millisecond); set the network factor corresponding to another set of environmental parameters ParameterB to be high packet loss rate, specifically set both the upstream packet loss rate and the downstream packet loss rate in ParameterB 90%, set the rest of the content in ParameterB to be consistent with the standard environmental parameters; set the network factor corresponding to another set of environmental parameters to be tested ParameterC to be high latency, specifically set both the uplink and downlink delays in ParameterC For 350 milliseconds, set the rest of ParameterC to be consistent with standard environmental parameters. Of course, the above are only examples and do not constitute a limitation to the embodiments of this application. In actual application scenarios, network factors can be set to correspond to more different values (for example, the value corresponding to low bandwidth is set to 33kbps), and more can be defined. Multiple network factors, such as subdividing upstream and downstream, are defined as network factors with low upstream bandwidth and network factors with low downstream bandwidth.
在获取到预设的待测环境参数后,获取待测功能对应的程序在每一组待测环境参数对应的环境下的执行情况,具体选取至少两组中的任一组作为目标组,根据目标组的待测环境参数将终端设备的网络环境配置为待测环境,在待测环境下执行待测功能对应的程序,将执行完成待测功能对应的程序所用的时长确定为测试时长的操作,直到得到每组待测环境参数对应的测试时长为止。After obtaining the preset environmental parameters to be tested, obtain the execution status of the program corresponding to the function to be tested in the environment corresponding to each set of environmental parameters to be tested, and specifically select any one of at least two groups as the target group, according to The environment parameters of the target group to be tested configure the network environment of the terminal device as the environment to be tested, execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration operation , Until the test duration corresponding to each group of environmental parameters to be tested is obtained.
可选地,在待测环境下执行待测功能对应的程序之后,若经过预设的超时时间段待测功能对应的程序仍未执行完成,则将待测环境对应的测试时长设置为预设的超时时长。由于待测环境为弱信号环境,故待测功能对应的程序可能存在无法执行完成的情况,针对该情况,本申请实施例预先设置一个超时时间段,并设置在待测环境下执行待测功能对应的程序之后,若经过预设的超时时间段待测功能对应的程序仍未执行完成,则将待测环境对应的测试时长设置为预设的超时时长,便于进行后续计算。Optionally, after executing the program corresponding to the function to be tested in the environment to be tested, if the program corresponding to the function to be tested has not been executed after a preset timeout period, the test duration corresponding to the environment to be tested is set to the preset The timeout period of. Since the environment to be tested is a weak signal environment, the program corresponding to the function to be tested may not be able to be executed. For this situation, the embodiment of this application presets a timeout period and sets the function to be tested in the environment to be tested After the corresponding program, if the program corresponding to the function to be tested has not been completed after the preset timeout period, the test duration corresponding to the environment to be tested is set to the preset timeout duration to facilitate subsequent calculations.
在S103中,将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系。In S103, the ratio between the test duration and the standard duration is determined as an alarm value, and a mapping relationship between the alarm value and all the network factors corresponding to the test duration is established.
为了判断不同网络环境对待测功能对应的程序的影响程度,计算测试时长与标准时长之间的比值,将得到的比值命名为告警值,最终将告警值与该测试时长对应的所有网络因素建立映射关系。举例来说,标准时长为10秒,而得到的某个测试时长为20秒,则计算得到该测试时长对应的告警值为2。In order to judge the degree of influence of the program corresponding to the function under test in different network environments, the ratio between the test duration and the standard duration is calculated, and the obtained ratio is named the alarm value. Finally, the alarm value is mapped to all network factors corresponding to the test duration. relationship. For example, if the standard duration is 10 seconds, and a certain test duration is 20 seconds, the alarm value corresponding to the test duration is calculated to be 2.
在S104中,对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。In S104, perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
在计算出所有测试时长对应的告警值后,统计每个网络因素对应的所有告警值,并对每个网络因素对应的所有告警值进行均值运算得到衡量值,具体先计算出每个网络因素对应的所有告警值之和,再将求和的结果除以该网络因素在所有组待测环境参数中的对应次数。举例来说,待测环境参数ParameterD对应的网络因素为FactorD,待测环境参数ParameterE对应的网络因素为FactorE和FactorF,待测环境参数ParameterF对应的网络因素为FactorF,FactorD对应的所有告警值之和为3,FactorF对应的所有告警值之和为7,则可得到FactorD的对应次数为1,求得FactorD的衡量值为3/1=3,可得到FactorF的对应次数为2,求得FactorF的衡量值为7/2=3.5。值得一提的是,若某个网络因素不存在对应的衡量值,即待测功能对应的程序在该网络因素对应的待测环境下的测试时长与标准时长相同(或测试时长与标准时长之间的差值的绝对值小于延迟时长),则可将该网络因素对应的衡量值设置为零,便于进行排序。After calculating the alarm values corresponding to all test durations, count all the alarm values corresponding to each network factor, and perform the average operation on all the alarm values corresponding to each network factor to obtain the measured value. Specifically, first calculate the corresponding value of each network factor The sum of all alarm values of, and then divide the result of the sum by the corresponding times of the network factor in all groups of environmental parameters to be tested. For example, the network factor corresponding to the tested environmental parameter ParameterD is FactorD, the network factor corresponding to the tested environmental parameter ParameterE is FactorE and FactorF, and the network factor corresponding to the tested environmental parameter ParameterF is FactorF. The sum of all alarm values corresponding to FactorD If the sum of all alarm values corresponding to FactorF is 7, then the corresponding number of FactorD is 1, and the measurement value of FactorD is 3/1=3, and the corresponding number of FactorF is 2, and the corresponding number of FactorF is calculated. The measurement value is 7/2=3.5. It is worth mentioning that if there is no corresponding measurement value for a certain network factor, that is, the test duration of the program corresponding to the function to be tested in the environment to be tested corresponding to the network factor is the same as the standard duration (or the test duration and the standard duration are different The absolute value of the difference is less than the delay time), then the measurement value corresponding to the network factor can be set to zero, which is convenient for sorting.
得到的衡量值指示对应的网络因素对待测功能对应的程序的影响程度,衡量值越高,则对应的网络因素的影响程度越大。故基于衡量值对所有网络因素进行排序,排序可基于衡量值从大到小的顺序或从小到大的顺序进行,本申请实施例并不做限定,最终输出排序后的所有网络因素。The obtained measurement value indicates the degree of influence of the corresponding network factor on the program corresponding to the function to be tested, and the higher the measurement value, the greater the degree of influence of the corresponding network factor. Therefore, all network factors are sorted based on the measurement value. The sorting can be performed based on the order of the measurement value from large to small or from small to large. The embodiment of the present application does not limit it, and finally outputs all the network factors after sorting.
测试人员可根据排序后的网络因素对待测功能对应的程序进行代码及功能优化,以克服影响程度较大的网络因素对待测功能对应的程序的影响,尽量避免待测功能对应的程序在弱信号环境下运行不稳定的情况。举例来说,若待测功能为终端设备投票后服务器自动发送已投票提示的功能,且在本步骤中按照衡量值从大到小的顺序对网络因素进行排序,排序后的所有网络因素中位于前列的网络因素为下行高时延,测试人员便可根据该网络因素对该待测功能对应的程序的底层代码进行优化,具体可减少已投票提示的提示内容或者简化与服务器之间的交互认证过程等。Testers can optimize the code and function of the program corresponding to the function to be tested according to the sorted network factors to overcome the influence of the network factors with a greater degree of influence on the program corresponding to the function to be tested, and try to avoid the weak signal of the program corresponding to the function to be tested Unstable operation in the environment. For example, if the function to be tested is the function that the server automatically sends the voting reminder after the terminal device votes, and in this step, the network factors are sorted according to the order of the measured value, and all the network factors after sorting are located The forefront network factor is the high downlink latency, and the tester can optimize the underlying code of the program corresponding to the function to be tested according to the network factor, which can specifically reduce the prompt content of the voting prompt or simplify the interactive authentication with the server Process etc.
通过图1所示实施例可知,在本申请实施例中,通过获取待测功能对应的程序在标准环境下完整执行所用的标准时长,并获取待测功能对应的程序在不同待测环境下完整执行所用的测试时长,获取超过标准时长的测试时长对应的告警值,并将告警值与测试时长对应的所有网络因素建立映射关系,最后基于告警值计算出每个网络因素的衡量值,输出按照衡量值进行排序后的所有网络因素,本申请实施例通过部署不同的待测环境,并通过计算衡量值,对不同网络因素对待测功能对应的程序的影响程度进行了量化,实现了影响程度的精确测定。It can be seen from the embodiment shown in FIG. 1 that, in the embodiment of this application, the standard duration for the complete execution of the program corresponding to the function to be tested in the standard environment is obtained, and the program corresponding to the function to be tested is complete in different environments to be tested. Perform the test duration used, obtain the alarm value corresponding to the test duration exceeding the standard duration, and establish a mapping relationship between the alarm value and all network factors corresponding to the test duration, and finally calculate the measurement value of each network factor based on the alarm value, and the output is as per All network factors after the measurement values are sorted, the embodiment of the application deploys different environments to be tested and calculates the measurement values to quantify the degree of influence of different network factors on the program corresponding to the function to be tested, and realize the degree of influence Accurate determination.
图2所示,是在本申请实施例一的基础上进行扩展后得到的一种基于功能测试的因素影响程度确定方法。本申请实施例提供了基于功能测试的因素影响程度确定方法的实现流程图,如图2所示,该因素影响程度确定方法可以包括以下步骤:Figure 2 shows a method for determining the degree of influence of a factor based on a function test after expansion on the basis of Embodiment 1 of the present application. The embodiment of the present application provides an implementation flow chart of the method for determining the degree of influence of a factor based on functional testing. As shown in FIG. 2, the method for determining the degree of influence of the factor may include the following steps:
在S201中,将在所述待测功能对应的程序执行之前处于的状态保存为初始状态。In S201, the state before the execution of the program corresponding to the function to be tested is saved as the initial state.
在实际应用场景中,待测功能可能为不同类型的功能,比如待测功能可能为可重复执行的功能,比如投票功能或刷新功能,在该情况下,可直接配置标准环境和不同的待测环境,并在标准环境下获取标准时长,在待测环境下获取测试时长。待测功能也可能为执行后无法再度执行的功能,比如待测功能为点击页面A中的某个按钮,跳转至页面B的功能,由于在执行过一次待测功能对应的程序后,终端设备的当前页面为页面B,自然无法在终端设备中再点击页面A中的按钮。针对上述情况,在本申请实施例中,将终端设备在待测功能对应的程序执行之前处于的状态保存为初始状态,该初始状态可为页面状态或数据状态等,根据实际应用场景确定。In actual application scenarios, the function to be tested may be of different types. For example, the function to be tested may be a function that can be executed repeatedly, such as a voting function or a refresh function. In this case, the standard environment and different functions to be tested can be directly configured Environment, and get the standard duration in the standard environment, and get the test duration in the environment to be tested. The function to be tested may also be a function that cannot be executed again after execution. For example, the function to be tested is a function that jumps to page B by clicking a button on page A, because after executing the program corresponding to the function to be tested, the terminal The current page of the device is page B, and it is naturally impossible to click the button on page A in the terminal device. In view of the above situation, in the embodiment of the present application, the state of the terminal device before the execution of the program corresponding to the function to be tested is saved as an initial state. The initial state may be a page state or a data state, etc., which is determined according to actual application scenarios.
在S202中,若检测到在所述标准环境下或在所述待测环境下执行完毕所述待测功能对应的程序,则将当前状态回滚为所述初始状态。In S202, if it is detected that the program corresponding to the function to be tested has been executed in the standard environment or the environment to be tested, the current state is rolled back to the initial state.
若检测到在标准环境下或在待测环境下执行完毕待测功能对应的程序,由于在本申请实施例中待测功能为执行后无法再度执行的功能,故将当前状态回滚为初始状态,以使待测功能对应的程序能够支持重复执行。If it is detected that the program corresponding to the function to be tested is executed in the standard environment or the environment to be tested, since the function to be tested in the embodiment of this application is a function that cannot be executed again after execution, the current state is rolled back to the initial state , So that the program corresponding to the function to be tested can support repeated execution.
可选地,若待测功能为页面跳转功能,且初始状态包括一个初始页面,则在检测到该页面跳转功能执行完毕时,触发页面返回功能,将当前页面切换为初始页面。在待测功能为页面跳转功能的情况下,保存的初始状态至少包括一个初始页面,则在检测到该页面跳转功能执行完毕后,触发终端设备上的页面返回功能(可为用于进行页面返回的控件),将终端设备的当前页面切换为初始页面。Optionally, if the function to be tested is a page jump function, and the initial state includes an initial page, when it is detected that the page jump function is executed, the page return function is triggered to switch the current page to the initial page. When the function to be tested is a page jump function, the saved initial state includes at least one initial page, and after detecting that the page jump function is executed, the page return function on the terminal device (which can be used for Page return control), switch the current page of the terminal device to the initial page.
可选地,若待测功能为数据操作功能,则获取与数据操作功能对应的第一操作语句,并创建与第一操作语句对应的第二操作语句,其中,第一操作语句的执行结果与第二操作语句的执行结果相逆;若检测到该数据操作功能执行完毕,则执行第二操作语句。在待测功能为数据操作功能的情况下(其作用是对终端设备的前端或服务器上的数据进行操作,如添加数据的操作或删除数据的操作等),为了使数据操作功能能够重复执行,首先获取与数据操作功能对应的第一操作语句,该第一操作语句用于被执行以实现数据操作功能,并创建与第一操作语句对应的第二操作语句,其中,第一操作语句的执行结果与第二操作语句的执行结果相逆,比如第一操作语句为删除服务器中的数据A,则第二操作语句为向服务器增加数据A,第一操作语句和第二操作语句可为结构化查询语言(Structured Query Language,SQL)语句,也可为其他类型的语句,本申请实施例对此不做限定。若检测到该数据操作功能执行完毕,则执行第二操作语句,从而消除因执行该数据操作功能造成的执行结果。Optionally, if the function to be tested is a data operation function, a first operation sentence corresponding to the data operation function is obtained, and a second operation sentence corresponding to the first operation sentence is created, wherein the execution result of the first operation sentence is the same as The execution result of the second operation statement is reversed; if it is detected that the data operation function is executed, the second operation statement is executed. When the function to be tested is a data operation function (its role is to operate on the front end of the terminal device or the data on the server, such as adding data or deleting data, etc.), in order to enable the data operation function to be executed repeatedly, First, obtain the first operation statement corresponding to the data operation function, which is used to be executed to realize the data operation function, and create a second operation statement corresponding to the first operation statement, where the execution of the first operation statement The result is the opposite of the execution result of the second operation statement. For example, the first operation statement is to delete data A in the server, and the second operation statement is to add data A to the server. The first operation statement and the second operation statement can be structured Query language (Structured Query Language (SQL) statements may also be other types of statements, which are not limited in the embodiment of the present application. If it is detected that the execution of the data operation function is completed, the second operation statement is executed, thereby eliminating the execution result caused by the execution of the data operation function.
通过图2所示实施例可知,在本申请实施例中,将应用程序在待测功能对应的程序执行之前处于的状态保存为初始状态,若检测到待测功能对应的程序执行完毕,则将应用程序的当前状态回滚为初始状态,本申请实施例通过回滚操作保证后续执行待测功能对应的程序的执行过程不受前次的执行结果影响,提升了确定网络因素的影响程度的适用性。It can be seen from the embodiment shown in FIG. 2 that in the embodiment of the present application, the state of the application program before the execution of the program corresponding to the function to be tested is saved as the initial state, if it is detected that the program corresponding to the function to be tested is executed, the The current state of the application is rolled back to the initial state. The embodiment of the present application uses a rollback operation to ensure that the subsequent execution of the program corresponding to the function to be tested is not affected by the previous execution result, which improves the application of determining the degree of influence of network factors Sex.
图3所示,是在本申请实施例一的基础上,对在标准环境下执行待测功能对应的程序,将执行完成待测功能对应的程序所用的时长确定为标准时长的过程进行细化后得到的一种基于功能测试的因素影响程度确定方法。本申请实施例提供了基于功能测试的因素影响程度确定方法的实现流程图,如图3所示,该因素影响程度确定方法可以包括以下步骤:As shown in Figure 3, on the basis of the first embodiment of this application, the process of executing the program corresponding to the function to be tested in a standard environment and determining the time taken to complete the program corresponding to the function to be tested as the standard time length is refined A method for determining the degree of influence of factors based on functional testing is obtained later. The embodiment of the present application provides an implementation flow chart of the method for determining the degree of influence of a factor based on functional testing. As shown in FIG. 3, the method for determining the degree of influence of the factor may include the following steps:
在S301中,获取预设的与所述待测功能对应的程序对应的功能请求与功能应答,并在所述标准环境下触发所述待测功能对应的程序,其中,所述功能请求为所述待测功能对应的程序开始执行的标识,所述功能应答为所述待测功能对应的程序执行完成的标识。In S301, a preset function request and function response corresponding to the program corresponding to the function to be tested are acquired, and the program corresponding to the function to be tested is triggered in the standard environment, wherein the function request is The identifier for starting execution of the program corresponding to the function to be tested, and the function response is the identifier for completing execution of the program corresponding to the function to be tested.
在本申请实施例中,为了提升获取到的标准时长的准确性,可预先设置与待测功能对应的程序对应的功能请求与功能应答,其中功能请求为待测功能对应的程序开始执行的标识,功能应答为待测功能对应的程序执行完成的标识。举例来说,若待测功能对应的程序为访问某个网址的功能,且待测功能对应的程序基于超文本传输协议(HyperText Transfer Protocol,HTTP)实现访问,则可设置功能请求为包含该网址的HTTP请求报文,并设置功能应答为包含为200的状态码(状态码为200,代表本次访问成功)的HTTP响应报文。在确定了功能请求和功能应答后,触发待测功能对应的程序,待测功能对应的程序的触发操作可预先指定,如触发某个预设的控件或执行预设的脚本文件等。In this embodiment of the application, in order to improve the accuracy of the obtained standard duration, the function request and function response corresponding to the program corresponding to the function to be tested can be preset, where the function request is the identification of the start of execution of the program corresponding to the function to be tested , The function response is the identification of the completion of the program execution corresponding to the function to be tested. For example, if the program corresponding to the function to be tested is a function to access a certain website, and the program corresponding to the function to be tested is based on the HyperText Transfer Protocol (HyperText Transfer Protocol, HTTP) to achieve access, you can set the function request as an HTTP request message that contains the URL, and set the function response as an HTTP response message that contains a status code of 200 (status code 200 represents the success of this visit) Text. After the function request and function response are determined, the program corresponding to the function to be tested is triggered. The trigger operation of the program corresponding to the function to be tested can be specified in advance, such as triggering a preset control or executing a preset script file.
在S302中,若抓取到所述功能请求和所述功能应答,则获取所述功能请求的发送时间,并获取所述功能应答的接收时间,将所述发送时间与所述接收时间之间的差值的绝对值确定为所述标准时长。In S302, if the function request and the function response are captured, the sending time of the function request and the receiving time of the function response are obtained, and the time between the sending time and the receiving time is obtained. The absolute value of the difference of is determined as the standard duration.
在触发待测功能对应的程序的同时,在终端设备发起和接收的数据中抓取功能请求和功能应答,其中,可获取终端设备的日志,并在日志中以功能请求和功能应答作为搜索条件进行抓取,也可基于第三方的数据包抓取工具如Fidder实现抓取。若抓取到与待测功能对应的程序对应的功能请求和功能应答,则获取功能请求的发送时间以及功能应答的接收时间,将发送时间与接收时间之间的差值的绝对值作为标准时长,进行输出。与标准环境同样地,在网络环境为待测环境时,同样可通过类似步骤S301~S302的方式确定待测环境下的测试时长,即在待测环境下触发待测功能对应的程序,若抓取到功能请求和功能应答,则获取功能请求的发送时间以及功能应答的接收时间,将该发送时间与该接收时间之间的差值的绝对值确定为测试时长。While triggering the program corresponding to the function to be tested, the function request and function response are captured from the data initiated and received by the terminal device. Among them, the log of the terminal device can be obtained, and the function request and function response can be used as search conditions in the log. For crawling, it can also be achieved based on a third-party data packet capturing tool such as Fidder. If the function request and function response corresponding to the program corresponding to the function to be tested are captured, the sending time of the function request and the receiving time of the function response are obtained, and the absolute value of the difference between the sending time and the receiving time is used as the standard duration , To output. Similar to the standard environment, when the network environment is the environment to be tested, the test duration in the environment to be tested can also be determined by similar steps S301 to S302, that is, the program corresponding to the function to be tested is triggered in the environment to be tested. After the function request and the function response are obtained, the sending time of the function request and the receiving time of the function response are obtained, and the absolute value of the difference between the sending time and the receiving time is determined as the test duration.
通过图3所示实施例可知,在本申请实施例中,在标准环境下触发待测功能对应的程序,若抓取到与待测功能对应的程序对应的功能请求和功能应答,则获取功能请求的发送时间以及功能应答的接收时间,将发送时间与接收时间之间的差值的绝对值确定为标准时长,本申请实施例通过抓取功能请求和功能应答的方式计算标准时长,提升了获取到的标准时长的准确性。It can be seen from the embodiment shown in FIG. 3 that, in the embodiment of this application, the program corresponding to the function to be tested is triggered in the standard environment. If the function request and function response corresponding to the program corresponding to the function to be tested are captured, the function is acquired The sending time of the request and the receiving time of the function response, the absolute value of the difference between the sending time and the receiving time is determined as the standard duration. The embodiment of this application calculates the standard duration by capturing the function request and the function response, which improves The accuracy of the obtained standard duration.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
对应于上文实施例所述的功能测试方法,图4示出了本申请实施例提供的基于功能测试的因素影响程度确定装置的结构框图,参照图4,该因素影响程度确定装置包括:Corresponding to the functional test method described in the above embodiment, FIG. 4 shows a structural block diagram of the device for determining the degree of influence of a factor based on a function test provided by an embodiment of the present application. Referring to FIG. 4, the device for determining the degree of influence of a factor includes:
第一执行单元41,用于根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;The first execution unit 41 is configured to configure the network environment as a standard environment according to preset standard environmental parameters, and execute the program corresponding to the function to be tested in the standard environment, and execute the program corresponding to the function to be tested The duration of is determined as the standard duration;
第二执行单元42,用于获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;The second execution unit 42 is configured to obtain at least two groups of environmental parameters to be tested, select any one of the at least two groups as a target group, and configure the network environment as the target group according to the environmental parameters to be tested in the target group. The environment to be tested corresponding to the environmental parameter to be tested, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to execute the program corresponding to the function to be tested is determined as the target group The test duration until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
告警值确定单元43,用于将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;The alarm value determining unit 43 is configured to determine the ratio between the test duration and the standard duration as an alert value, and establish a mapping relationship between the alert value and all the network factors corresponding to the test duration;
排序单元44,用于对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。The sorting unit 44 is configured to perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the networks after sorting factor.
可选地,因素影响程度确定装置还包括:Optionally, the device for determining the degree of influence of the factor further includes:
保存单元,用于将所述待测功能对应的程序执行之前处于的状态保存为初始状态;The saving unit is configured to save the state that the program corresponding to the function to be tested was in before execution as the initial state;
回滚单元,用于若检测到在所述标准环境下或在所述待测环境下执行完毕所述待测功能对应的程序,则将当前状态回滚为所述初始状态。The rollback unit is configured to roll back the current state to the initial state if it is detected that the program corresponding to the function to be tested has been executed in the standard environment or in the environment to be tested.
可选地,若待测功能为页面跳转功能,且初始状态包括一个初始页面,则回滚单元包括:Optionally, if the function to be tested is a page jump function, and the initial state includes an initial page, the rollback unit includes:
切换单元,用于触发页面返回功能,将当前页面切换为所述初始页面。The switching unit is used to trigger the page return function to switch the current page to the initial page.
可选地,若待测功能为数据操作功能,则回滚单元包括:Optionally, if the function to be tested is a data operation function, the rollback unit includes:
创建单元,用于获取与所述数据操作功能对应的第一操作语句,并创建与所述第一操作语句对应的第二操作语句,其中,所述第一操作语句的执行结果与所述第二操作语句的执行结果相逆;The creation unit is configured to obtain a first operation sentence corresponding to the data operation function, and create a second operation sentence corresponding to the first operation sentence, wherein the execution result of the first operation sentence corresponds to the first operation sentence The execution results of the two operation statements are reversed;
语句执行单元,用于执行所述第二操作语句。The statement execution unit is used to execute the second operation statement.
可选地,第一执行单元41包括:Optionally, the first execution unit 41 includes:
触发单元,用于获取预设的与所述待测功能对应的程序对应的功能请求与功能应答,并在所述标准环境下触发所述待测功能对应的程序,其中,所述功能请求为所述待测功能对应的程序开始执行的标识,所述功能应答为所述待测功能对应的程序执行完成的标识;The trigger unit is used to obtain preset function requests and function responses corresponding to the program corresponding to the function to be tested, and trigger the program corresponding to the function to be tested in the standard environment, wherein the function request is The identification of the start of execution of the program corresponding to the function to be tested, and the function response is the identification of the completion of execution of the program corresponding to the function to be tested;
抓取单元,用于若抓取到所述功能请求和所述功能应答,则获取所述功能请求的发送时间,并获取所述功能应答的接收时间,将所述发送时间与所述接收时间之间的差值的绝对值确定为所述标准时长。The grabbing unit is configured to obtain the sending time of the function request and the receiving time of the function response if the function request and the function response are grabbed, and compare the sending time with the receiving time The absolute value of the difference between is determined as the standard duration.
可选地,第二执行单元42还包括:Optionally, the second execution unit 42 further includes:
设置单元,用于若经过预设的超时时间段所述待测功能对应的程序仍未执行完成,则将所述待测环境对应的所述测试时长设置为预设的超时时长。The setting unit is configured to set the test duration corresponding to the environment to be tested to a preset timeout duration if the program corresponding to the function to be tested has not been completed after a preset timeout period.
因此,本申请实施例提供的因素影响程度确定装置通过量化的方式确定网络因素对待测功能对应的程序的影响程度,便于测试人员根据不同网络因素的影响程度对待测功能对应的程序进行优化。Therefore, the device for determining the degree of influence of a factor provided in the embodiment of the present application determines the degree of influence of the program corresponding to the function to be tested by the network factor in a quantitative manner, so that the tester can optimize the program corresponding to the function to be tested according to the degree of influence of different network factors.
图5是本申请实施例提供的终端设备的示意图。如图5所示,该实施例的终端设备5包括:处理器50、存储器51以及存储在所述存储器51中并可在所述处理器50上运行的计算机可读指令52,例如功能测试程序。所述处理器50执行所述计算机可读指令52时实现上述各个基于功能测试的因素影响程度确定方法实施例中的步骤,例如图1所示的步骤S101至S104。或者,所述处理器50执行所述计算机可读指令52时实现上述各基于功能测试的因素影响程度确定装置实施例中各单元的功能,例如图4所示单元41至44的功能。Fig. 5 is a schematic diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 5, the terminal device 5 of this embodiment includes: a processor 50, a memory 51, and computer-readable instructions 52 stored in the memory 51 and running on the processor 50, such as a function test program . When the processor 50 executes the computer-readable instructions 52, the steps in the above-mentioned method embodiments for determining the degree of influence of factors based on functional tests are implemented, such as steps S101 to S104 shown in FIG. 1. Alternatively, when the processor 50 executes the computer-readable instruction 52, the function of each unit in the above-mentioned device embodiment for determining the degree of influence of the factor based on the function test is implemented, for example, the functions of the units 41 to 44 shown in FIG. 4.
示例性的,所述计算机可读指令52可以被分割成一个或多个单元,所述一个或者多个单元被存储在所述存储器51中,并由所述处理器50执行,以完成本申请。所述一个或多个单元可以是能够完成特定功能的一系列计算机可读指令的指令段,该指令段用于描述所述计算机可读指令52在所述终端设备5中的执行过程。例如,所述计算机可读指令52可以被分割成第一执行单元、第二执行单元、告警值确定单元以及排序单元,各单元具体功能如下:Exemplarily, the computer-readable instruction 52 may be divided into one or more units, and the one or more units are stored in the memory 51 and executed by the processor 50 to complete the application . The one or more units may be an instruction segment of a series of computer-readable instructions capable of completing specific functions, and the instruction segment is used to describe the execution process of the computer-readable instruction 52 in the terminal device 5. For example, the computer-readable instruction 52 may be divided into a first execution unit, a second execution unit, an alarm value determination unit, and a sorting unit. The specific functions of each unit are as follows:
第一执行单元,用于根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;The first execution unit is configured to configure the network environment as a standard environment according to preset standard environmental parameters, and execute the program corresponding to the function to be tested in the standard environment, and execute the program used to complete the program corresponding to the function to be tested The duration is determined as the standard duration;
第二执行单元,用于获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;The second execution unit is configured to obtain at least two sets of environmental parameters to be tested, select any one of the at least two sets as the target group, and configure the network environment as the target group according to the environmental parameters to be tested in the target group The environment to be tested corresponding to the environmental parameter to be tested, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to execute the program corresponding to the function to be tested is determined as the test of the target group Duration, until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
告警值确定单元,用于将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;An alarm value determination unit, configured to determine a ratio between the test duration and the standard duration as an alert value, and establish a mapping relationship between the alert value and all the network factors corresponding to the test duration;
排序单元,用于对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。A sorting unit, configured to perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting .
所述终端设备5可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器50、存储器51。本领域技术人员可以理解,图5仅仅是终端设备5的示例,并不构成对终端设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。The terminal device 5 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art can understand that FIG. 5 is only an example of the terminal device 5, and does not constitute a limitation on the terminal device 5. It may include more or less components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
所称处理器50可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 50 may be a central processing unit (Central Processing Unit, CPU), it can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器51可以是所述终端设备5的内部存储单元,例如终端设备5的硬盘或内存。所述存储器51也可以是所述终端设备6的外部存储设备,例如所述终端设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card,FC)等。进一步地,所述存储器51还可以既包括所述终端设备5的内部存储单元也包括外部存储设备。所述存储器51用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器51还可用于暂时地存储已经输出或者将要输出的数据。The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) equipped on the terminal device 5. Card, Flash Card (Flash Card, FC), etc. Further, the memory 51 may also include both an internal storage unit of the terminal device 5 and an external storage device. The memory 51 is used to store the computer readable instructions and other programs and data required by the terminal device. The memory 51 can also be used to temporarily store data that has been output or will be output.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机非易失性可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile computer. In a readable storage medium, when the computer-readable instructions are executed, they may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include Read-Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种基于功能测试的因素影响程度确定方法,其特征在于,包括:A method for determining the degree of influence of factors based on functional testing, which is characterized in that it includes:
    根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;Configure the network environment as a standard environment according to preset standard environment parameters, execute the program corresponding to the function to be tested in the standard environment, and determine the time taken to complete the program corresponding to the function to be tested as the standard time length;
    获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;Acquire at least two sets of environmental parameters to be tested, select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group. Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained. The duration of the test corresponding to the environmental parameter to be tested, wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
    将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;Determining a ratio between the test duration and the standard duration as an alarm value, and establishing a mapping relationship between the alert value and all the network factors corresponding to the test duration;
    对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。Perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
  2. 如权利要求1所述的因素影响程度确定方法,其特征在于,还包括:The method for determining the degree of influence of a factor according to claim 1, further comprising:
    将在所述待测功能对应的程序执行之前处于的状态保存为初始状态;Saving the state before the execution of the program corresponding to the function to be tested as the initial state;
    若检测到在所述标准环境下或在所述待测环境下执行完毕所述待测功能对应的程序,则将当前状态回滚为所述初始状态。If it is detected that the program corresponding to the function to be tested has been executed in the standard environment or in the environment to be tested, the current state is rolled back to the initial state.
  3. 如权利要求2所述的因素影响程度确定方法,其特征在于,若所述待测功能为页面跳转功能,且所述初始状态包括一个初始页面,则所述将当前状态回滚为所述初始状态,包括:The method for determining the degree of influence of a factor according to claim 2, wherein if the function to be tested is a page jump function, and the initial state includes an initial page, then the current state is rolled back to the The initial state, including:
    触发页面返回功能,将当前页面切换为所述初始页面。The page return function is triggered to switch the current page to the initial page.
  4. 如权利要求2所述的因素影响程度确定方法,其特征在于,若所述待测功能为数据操作功能,则所述将当前状态回滚为所述初始状态,包括:The method for determining the degree of influence of a factor according to claim 2, wherein if the function to be tested is a data operation function, the rolling back the current state to the initial state comprises:
    获取与所述数据操作功能对应的第一操作语句,并创建与所述第一操作语句对应的第二操作语句,其中,所述第一操作语句的执行结果与所述第二操作语句的执行结果相逆;Acquire the first operation sentence corresponding to the data operation function, and create a second operation sentence corresponding to the first operation sentence, wherein the execution result of the first operation sentence is the same as the execution of the second operation sentence Opposite results
    执行所述第二操作语句。Execute the second operation statement.
  5. 如权利要求1所述的因素影响程度确定方法,其特征在于,所述在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长,包括:The method for determining the degree of influence of a factor according to claim 1, wherein the execution of the program corresponding to the function to be tested in the standard environment determines the time taken to complete the program corresponding to the function to be tested as the standard Duration, including:
    获取预设的与所述待测功能对应的程序对应的功能请求与功能应答,并在所述标准环境下触发所述待测功能对应的程序,其中,所述功能请求为所述待测功能对应的程序开始执行的标识,所述功能应答为所述待测功能对应的程序执行完成的标识;Obtain a preset function request and function response corresponding to the program corresponding to the function under test, and trigger the program corresponding to the function under test in the standard environment, wherein the function request is the function under test The identification of the start of execution of the corresponding program, and the function response is the identification of the completion of execution of the program corresponding to the function to be tested;
    若抓取到所述功能请求和所述功能应答,则获取所述功能请求的发送时间,并获取所述功能应答的接收时间,将所述发送时间与所述接收时间之间的差值的绝对值确定为所述标准时长。If the function request and the function response are captured, the sending time of the function request and the receiving time of the function response are obtained, and the difference between the sending time and the receiving time is calculated The absolute value is determined as the standard duration.
  6. 如权利要求1所述的因素影响程度确定方法,其特征在于,所述在所述待测环境下执行所述待测功能对应的程序之后,还包括:The method for determining the degree of influence of a factor according to claim 1, wherein after executing the program corresponding to the function to be tested in the environment to be tested, the method further comprises:
    若经过预设的超时时间段所述待测功能对应的程序仍未执行完成,则将所述待测环境对应的所述测试时长设置为预设的超时时长。If the program corresponding to the function to be tested has not been completed after a preset timeout period, the test duration corresponding to the environment to be tested is set to the preset timeout duration.
  7. 一种基于功能测试的因素影响程度确定装置,其特征在于,包括:A device for determining the degree of influence of a factor based on a function test is characterized in that it includes:
    第一执行单元,用于根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;The first execution unit is configured to configure the network environment as a standard environment according to preset standard environmental parameters, and execute the program corresponding to the function to be tested in the standard environment, and execute the program used to complete the program corresponding to the function to be tested The duration is determined as the standard duration;
    第二执行单元,用于获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;The second execution unit is configured to obtain at least two sets of environmental parameters to be tested, select any one of the at least two sets as the target group, and configure the network environment as the target group according to the environmental parameters to be tested in the target group The environment to be tested corresponding to the environmental parameter to be tested, and the program corresponding to the function to be tested is executed in the environment to be tested, and the time taken to execute the program corresponding to the function to be tested is determined as the test of the target group Duration, until the test duration corresponding to each group of the environmental parameters to be tested is obtained, wherein each group of the environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
    告警值确定单元,用于将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;An alarm value determination unit, configured to determine a ratio between the test duration and the standard duration as an alert value, and establish a mapping relationship between the alert value and all the network factors corresponding to the test duration;
    排序单元,用于对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。A sorting unit, configured to perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting .
  8. 根据权利要求7所述的因素影响程度确定装置,其特征在于,所述因素影响程度确定装置还包括:The device for determining the degree of influence of a factor according to claim 7, wherein the device for determining the degree of influence of a factor further comprises:
    保存单元,用于将所述待测功能对应的程序执行之前处于的状态保存为初始状态;The saving unit is configured to save the state that the program corresponding to the function to be tested was in before execution as the initial state;
    回滚单元,用于若检测到在所述标准环境下或在所述待测环境下执行完毕所述待测功能对应的程序,则将当前状态回滚为所述初始状态。The rollback unit is configured to roll back the current state to the initial state if it is detected that the program corresponding to the function to be tested has been executed in the standard environment or in the environment to be tested.
  9. 一种终端设备,其特征在于,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device, which is characterized by comprising a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor executes the computer-readable instructions as follows step:
    根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;Configure the network environment as a standard environment according to preset standard environment parameters, execute the program corresponding to the function to be tested in the standard environment, and determine the time taken to complete the program corresponding to the function to be tested as the standard time length;
    获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;Acquire at least two sets of environmental parameters to be tested, select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group. Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained. The duration of the test corresponding to the environmental parameter to be tested, wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
    将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;Determining a ratio between the test duration and the standard duration as an alarm value, and establishing a mapping relationship between the alert value and all the network factors corresponding to the test duration;
    对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。Perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
  10. 如权利要求9所述的终端设备,其特征在于,所述处理器执行所述计算机可读指令时还实现如下步骤:9. The terminal device of claim 9, wherein the processor further implements the following steps when executing the computer-readable instruction:
    将在所述待测功能对应的程序执行之前处于的状态保存为初始状态;Saving the state before the execution of the program corresponding to the function to be tested as the initial state;
    若检测到在所述标准环境下或在所述待测环境下执行完毕所述待测功能对应的程序,则将当前状态回滚为所述初始状态。If it is detected that the program corresponding to the function to be tested has been executed in the standard environment or in the environment to be tested, the current state is rolled back to the initial state.
  11. 如权利要求10所述的终端设备,其特征在于,若所述待测功能为页面跳转功能,且所述初始状态包括一个初始页面,则所述将当前状态回滚为所述初始状态,包括:The terminal device of claim 10, wherein if the function to be tested is a page jump function, and the initial state includes an initial page, then the current state is rolled back to the initial state, include:
    触发页面返回功能,将当前页面切换为所述初始页面。The page return function is triggered to switch the current page to the initial page.
  12. 如权利要求10所述的终端设备,其特征在于,若所述待测功能为数据操作功能,则所述将当前状态回滚为所述初始状态,包括:The terminal device of claim 10, wherein if the function to be tested is a data operation function, the rolling back the current state to the initial state includes:
    获取与所述数据操作功能对应的第一操作语句,并创建与所述第一操作语句对应的第二操作语句,其中,所述第一操作语句的执行结果与所述第二操作语句的执行结果相逆;Acquire the first operation sentence corresponding to the data operation function, and create a second operation sentence corresponding to the first operation sentence, wherein the execution result of the first operation sentence is the same as the execution of the second operation sentence Opposite results
    执行所述第二操作语句。Execute the second operation statement.
  13. 根据权利要求9所述的终端设备,其特征在于,所述在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长,包括:The terminal device according to claim 9, wherein the execution of the program corresponding to the function to be tested in the standard environment, and determining the time used to complete the program corresponding to the function to be tested as the standard time length includes :
    获取预设的与所述待测功能对应的程序对应的功能请求与功能应答,并在所述标准环境下触发所述待测功能对应的程序,其中,所述功能请求为所述待测功能对应的程序开始执行的标识,所述功能应答为所述待测功能对应的程序执行完成的标识;Obtain a preset function request and function response corresponding to the program corresponding to the function under test, and trigger the program corresponding to the function under test in the standard environment, wherein the function request is the function under test The identification of the start of execution of the corresponding program, and the function response is the identification of the completion of execution of the program corresponding to the function to be tested;
    若抓取到所述功能请求和所述功能应答,则获取所述功能请求的发送时间,并获取所述功能应答的接收时间,将所述发送时间与所述接收时间之间的差值的绝对值确定为所述标准时长。If the function request and the function response are captured, the sending time of the function request and the receiving time of the function response are obtained, and the difference between the sending time and the receiving time is calculated The absolute value is determined as the standard duration.
  14. 根据权利要求9所述的终端设备,其特征在于,所述在所述待测环境下执行所述待测功能对应的程序之后,所述处理器执行所述计算机可读指令时还实现如下步骤:The terminal device according to claim 9, wherein after the program corresponding to the function to be tested is executed in the environment to be tested, the processor further implements the following steps when executing the computer-readable instruction :
    若经过预设的超时时间段所述待测功能对应的程序仍未执行完成,则将所述待测环境对应的所述测试时长设置为预设的超时时长。If the program corresponding to the function to be tested has not been completed after a preset timeout period, the test duration corresponding to the environment to be tested is set to the preset timeout duration.
  15. 一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer non-volatile readable storage medium, the computer non-volatile readable storage medium storing computer readable instructions, wherein the computer readable instructions are executed by a processor to implement the following steps:
    根据预设的标准环境参数将网络环境配置为标准环境,并在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长;Configure the network environment as a standard environment according to preset standard environment parameters, execute the program corresponding to the function to be tested in the standard environment, and determine the time taken to complete the program corresponding to the function to be tested as the standard time length;
    获取至少两组待测环境参数,选取至少两组中的任一组作为目标组,根据所述目标组的所述待测环境参数将所述网络环境配置为所述待测环境参数对应的待测环境,并在所述待测环境下执行所述待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为所述目标组的测试时长,直到得到每组所述待测环境参数对应的所述测试时长为止,其中,每组所述待测环境参数对应至少一个网络因素,所述网络因素为弱信号因素;Acquire at least two sets of environmental parameters to be tested, select any one of the at least two groups as the target group, and configure the network environment as the target group corresponding to the environmental parameters to be tested according to the environmental parameters to be tested in the target group. Test environment, and execute the program corresponding to the function to be tested in the environment to be tested, and determine the duration of execution of the program corresponding to the function to be tested as the test duration of the target group, until the test duration of each group is obtained. The duration of the test corresponding to the environmental parameter to be tested, wherein each group of environmental parameters to be tested corresponds to at least one network factor, and the network factor is a weak signal factor;
    将所述测试时长与所述标准时长之间的比值确定为告警值,并将所述告警值与所述测试时长对应的所有所述网络因素建立映射关系;Determining a ratio between the test duration and the standard duration as an alarm value, and establishing a mapping relationship between the alert value and all the network factors corresponding to the test duration;
    对每个所述网络因素对应的所有所述告警值进行均值运算得到衡量值,按照所述衡量值对所有所述网络因素进行排序,并输出排序后的所有所述网络因素。Perform an average operation on all the alarm values corresponding to each of the network factors to obtain a measurement value, sort all the network factors according to the measurement value, and output all the network factors after sorting.
  16. 根据权利要求15所述的计算机非易失性可读存储介质,其特征在于,所述将监控到的所述触摸事件添加至目标事件集,包括:The computer non-volatile readable storage medium according to claim 15, wherein the adding the monitored touch event to a target event set comprises:
    确定所述目标事件集内的交互事件,其中,所述交互事件用于在被执行时触发与服务器之间的交互;Determine the interaction events in the target event set, where the interaction event is used to trigger an interaction with the server when executed;
    所述在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,包括:The switching the source network environment to the target network environment in the environment set to be tested during the execution of the target event set includes:
    若检测到正在执行所述交互事件,则将所述源网络环境切换至所述待测环境集内的所述目的网络环境。If it is detected that the interaction event is being executed, the source network environment is switched to the destination network environment in the set of environments to be tested.
  17. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,若所述待测功能为页面跳转功能,且所述初始状态包括一个初始页面,则所述将当前状态回滚为所述初始状态,包括:The computer non-volatile readable storage medium according to claim 16, wherein if the function to be tested is a page jump function, and the initial state includes an initial page, then the current state is returned to Rolling is the initial state, including:
    触发页面返回功能,将当前页面切换为所述初始页面。The page return function is triggered to switch the current page to the initial page.
  18. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,若所述待测功能为数据操作功能,则所述将当前状态回滚为所述初始状态,包括:The computer non-volatile readable storage medium according to claim 16, wherein if the function to be tested is a data operation function, the rolling back the current state to the initial state comprises:
    获取与所述数据操作功能对应的第一操作语句,并创建与所述第一操作语句对应的第二操作语句,其中,所述第一操作语句的执行结果与所述第二操作语句的执行结果相逆;Acquire the first operation sentence corresponding to the data operation function, and create a second operation sentence corresponding to the first operation sentence, wherein the execution result of the first operation sentence is the same as the execution of the second operation sentence Opposite results
    执行所述第二操作语句。Execute the second operation statement.
  19. 根据权利要求15所述的计算机非易失性可读存储介质,其特征在于,所述在所述标准环境下执行待测功能对应的程序,将执行完成所述待测功能对应的程序所用的时长确定为标准时长,包括:The computer non-volatile readable storage medium according to claim 15, wherein the execution of the program corresponding to the function to be tested in the standard environment will execute the program used to complete the program corresponding to the function to be tested The duration is determined as the standard duration, including:
    获取预设的与所述待测功能对应的程序对应的功能请求与功能应答,并在所述标准环境下触发所述待测功能对应的程序,其中,所述功能请求为所述待测功能对应的程序开始执行的标识,所述功能应答为所述待测功能对应的程序执行完成的标识;Obtain a preset function request and function response corresponding to the program corresponding to the function under test, and trigger the program corresponding to the function under test in the standard environment, wherein the function request is the function under test The identification of the start of execution of the corresponding program, and the function response is the identification of the completion of execution of the program corresponding to the function to be tested;
    若抓取到所述功能请求和所述功能应答,则获取所述功能请求的发送时间,并获取所述功能应答的接收时间,将所述发送时间与所述接收时间之间的差值的绝对值确定为所述标准时长。If the function request and the function response are captured, the sending time of the function request and the receiving time of the function response are obtained, and the difference between the sending time and the receiving time is calculated The absolute value is determined as the standard duration.
  20. 根据权利要求15所述的计算机非易失性可读存储介质,其特征在于,所述在所述待测环境下执行所述待测功能对应的程序之后,所述计算机可读指令被处理器执行时还实现如下步骤:The computer non-volatile readable storage medium according to claim 15, wherein after the program corresponding to the function to be tested is executed in the environment to be tested, the computer readable instructions are executed by the processor The following steps are also implemented during execution:
    若经过预设的超时时间段所述待测功能对应的程序仍未执行完成,则将所述待测环境对应的所述测试时长设置为预设的超时时长。If the program corresponding to the function to be tested has not been completed after a preset timeout period, the test duration corresponding to the environment to be tested is set to the preset timeout duration.
PCT/CN2019/121679 2019-05-21 2019-11-28 Function test-based factor influence degree determination method and apparatus, and terminal device WO2020233064A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910424156.5 2019-05-21
CN201910424156.5A CN110245076A (en) 2019-05-21 2019-05-21 Method, apparatus and terminal device are determined based on the factor influence degree of functional test

Publications (1)

Publication Number Publication Date
WO2020233064A1 true WO2020233064A1 (en) 2020-11-26

Family

ID=67884707

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121679 WO2020233064A1 (en) 2019-05-21 2019-11-28 Function test-based factor influence degree determination method and apparatus, and terminal device

Country Status (2)

Country Link
CN (1) CN110245076A (en)
WO (1) WO2020233064A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778768A (en) * 2021-08-24 2021-12-10 深圳市联影高端医疗装备创新研究院 Reconstruction server testing method and device, computer equipment and storage medium
CN113806151A (en) * 2021-09-07 2021-12-17 深圳宝新创科技股份有限公司 Time sequence parameter determination method, device, electronic equipment and system
CN115686984A (en) * 2022-12-29 2023-02-03 江西萤火虫微电子科技有限公司 Board card function testing method and device, computer and readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245076A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 Method, apparatus and terminal device are determined based on the factor influence degree of functional test

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170132111A1 (en) * 2013-06-20 2017-05-11 Microsoft Technology Licensing, Llc Monitoring mobile application performance
CN108733568A (en) * 2018-05-25 2018-11-02 平安科技(深圳)有限公司 Application testing method, device, equipment and readable storage medium storing program for executing
CN110232022A (en) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 Network environment test method, device and terminal device
CN110245076A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 Method, apparatus and terminal device are determined based on the factor influence degree of functional test

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8601439B2 (en) * 2010-12-09 2013-12-03 Microsoft Corporation Networked program dependency compatibility analysis
CN106102143B (en) * 2016-05-31 2020-01-14 Oppo广东移动通信有限公司 Application processing method and device
CN109086211B (en) * 2018-08-22 2023-04-07 平安科技(深圳)有限公司 Method and device for processing simulation network exception, computer equipment and storage medium
CN109240924B (en) * 2018-09-03 2024-03-08 中国平安人寿保险股份有限公司 Application program testing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170132111A1 (en) * 2013-06-20 2017-05-11 Microsoft Technology Licensing, Llc Monitoring mobile application performance
CN108733568A (en) * 2018-05-25 2018-11-02 平安科技(深圳)有限公司 Application testing method, device, equipment and readable storage medium storing program for executing
CN110232022A (en) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 Network environment test method, device and terminal device
CN110245076A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 Method, apparatus and terminal device are determined based on the factor influence degree of functional test

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778768A (en) * 2021-08-24 2021-12-10 深圳市联影高端医疗装备创新研究院 Reconstruction server testing method and device, computer equipment and storage medium
CN113806151A (en) * 2021-09-07 2021-12-17 深圳宝新创科技股份有限公司 Time sequence parameter determination method, device, electronic equipment and system
CN113806151B (en) * 2021-09-07 2024-01-02 深圳宝新创信息技术有限公司 Time sequence parameter determining method, device, electronic equipment and system
CN115686984A (en) * 2022-12-29 2023-02-03 江西萤火虫微电子科技有限公司 Board card function testing method and device, computer and readable storage medium
CN115686984B (en) * 2022-12-29 2023-04-07 江西萤火虫微电子科技有限公司 Board card function testing method and device, computer and readable storage medium

Also Published As

Publication number Publication date
CN110245076A (en) 2019-09-17

Similar Documents

Publication Publication Date Title
WO2020233064A1 (en) Function test-based factor influence degree determination method and apparatus, and terminal device
WO2021174694A1 (en) Operation and maintenance monitoring method and apparatus based on data center, device, and storage medium
WO2016192488A1 (en) Rolling release assessment method, device, and system
US8996921B2 (en) Indicating coverage of Web application testing
CN108415804B (en) Method for acquiring information, terminal device and computer readable storage medium
CN107609028B (en) Method and device for determining low-efficiency SQL statement
JP6564532B2 (en) System and method for annotating client-server transactions
CN107085549B (en) Method and device for generating fault information
CN111106976B (en) Detection method and device for CDN network, electronic equipment and readable storage medium
CN111124702A (en) Performance data acquisition method, device and computer readable storage medium
WO2020233065A1 (en) Network environment testing method and apparatus, and terminal device
US20190386909A1 (en) Method and program product for a private performance network with geographical load simulation
CN111522711A (en) Data monitoring processing system, method, execution end, monitoring end and electronic equipment
CN111078478A (en) Server stress testing method and device and computer readable storage medium
WO2021196454A1 (en) Data detection method and device, and server and readable storage medium
CN102880698B (en) A kind of crawl website defining method and device
CN115271736A (en) Method, device, equipment, storage medium and product for verifying transaction consistency
CN110633412A (en) Page stay intention analysis method and device, computer equipment and storage medium
CN113938408A (en) Data traffic testing method and device, server and storage medium
CN110874475A (en) Vulnerability mining method, vulnerability mining platform and computer readable storage medium
CN117040799A (en) Page interception rule generation and page access control method and device and electronic equipment
CN110825603A (en) Page first loading time determining method and device, electronic equipment and storage medium
CN110580211A (en) Monitoring method, device, keyboard and storage medium
CN107317723B (en) Data processing method and server
CN116319416A (en) Performance test method and device suitable for multi-node block chain system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19929302

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19929302

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 05/04/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19929302

Country of ref document: EP

Kind code of ref document: A1