CN111314160B - Testing method and device for application duration statistical function - Google Patents

Testing method and device for application duration statistical function Download PDF

Info

Publication number
CN111314160B
CN111314160B CN201811518397.8A CN201811518397A CN111314160B CN 111314160 B CN111314160 B CN 111314160B CN 201811518397 A CN201811518397 A CN 201811518397A CN 111314160 B CN111314160 B CN 111314160B
Authority
CN
China
Prior art keywords
application
function
type
scenes
duration
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201811518397.8A
Other languages
Chinese (zh)
Other versions
CN111314160A (en
Inventor
付海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201811518397.8A priority Critical patent/CN111314160B/en
Publication of CN111314160A publication Critical patent/CN111314160A/en
Application granted granted Critical
Publication of CN111314160B publication Critical patent/CN111314160B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Abstract

The invention discloses a testing method and device for an application duration statistical function, electronic equipment and a computer readable storage medium. The method comprises the following steps: determining effective function scenes of each application; generating test cases respectively corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications; after the test cases corresponding to the effective function scenes of each application are executed, acquiring the use duration of each application counted by the application duration counting function; and comparing the sum of the preset execution duration in the test case corresponding to the effective function scene of each application with the use duration of the corresponding application counted by the obtained application duration counting function, and judging whether the application duration counting function is accurate or not. Therefore, in the technical scheme, the test is only carried out aiming at the effective function scenes of each application, the accuracy of the application time length counting function can be accurately judged, the test accuracy is improved, and the misjudgment is prevented.

Description

Testing method and device for application duration statistical function
Technical Field
The invention relates to the technical field of computers, in particular to a testing method and device for an application duration statistical function, electronic equipment and a computer readable storage medium.
Background
Nowadays, home firewalls have implemented monitoring of the usage of applications by devices accessing internet via routing, such as the internet access of children and old people at home, which applications are used, how long they have been used, etc. that parents are interested in. From the perspective before fire prevention, monitoring of application use duration of the internet access device needs to be achieved by using an application duration counting function in the firewall. In order to ensure the accuracy of the application duration counting function of the firewall, the application duration counting function of the firewall needs to be tested before the application duration counting function of the firewall is put into use.
At present, when the application duration statistical function is tested, each function scenario of the application is traversed, but for some function scenarios, the application statistical function cannot be counted, for example, the function scenario does not generate network traffic. During testing, if these functional scenes are also tested, the test may be misjudged and the test may be inaccurate. In view of the above situation, how to accurately test the application time length statistical function is an urgent problem to be solved.
Disclosure of Invention
In view of the above, the present invention has been made to provide a testing method, apparatus, electronic device and computer-readable storage medium for an application duration statistic function that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a method for testing an application duration statistic function, wherein the method includes:
determining effective function scenes of each application;
generating test cases corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications;
after the test cases respectively corresponding to the effective function scenes of each application are executed, acquiring the use duration of each application counted by the application duration counting function;
and comparing the sum of preset execution time lengths in the test cases respectively corresponding to the effective function scenes of each application with the obtained use time lengths of the corresponding applications counted by the application time length counting function, and judging whether the application time length counting function is accurate or not.
Optionally, the determining the effective functional scenario of each application includes:
determining a first type of application according to the interface characteristics of each application;
determining each function scene of the first type of application;
testing each functional scene, and counting the network flow of each functional scene;
and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold value, and if so, determining that the functional scene is an effective functional scene of the first type of application.
Optionally, the testing each functional scenario, and the counting network traffic of each functional scenario includes:
the method comprises the steps that requests in the process of carrying out UI automatic testing on various functional scenes are subjected to packet capturing through an agent tool;
and according to the request obtained by packet capturing, counting the network flow of each functional scene.
Optionally, the preset threshold is determined according to a statistical range applicable to the application duration statistical function.
Optionally, the method further comprises:
determining a second type of application according to the interface characteristics of each application;
the generating, according to the determined effective function scenes of each application, test cases corresponding to the effective function scenes of each application respectively includes:
for the first type of application, generating test cases of UI automatic tests corresponding to the effective function scenes of the first type of application according to the determined effective function scenes of the first type of application;
and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
Optionally, the method further comprises:
and outputting the judgment result of the application time length counting function.
According to another aspect of the present invention, there is provided a test apparatus using a duration statistic function, wherein the apparatus includes:
a determining unit adapted to determine valid functional scenarios of the applications;
the generating unit is suitable for generating test cases corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications;
the obtaining unit is suitable for obtaining the service time of each application counted by the application time counting function after executing the test case corresponding to the effective function scene of each application;
and the judging unit is suitable for comparing the sum of the preset execution time lengths in the test cases respectively corresponding to the effective function scenes of each application with the obtained use time lengths of the corresponding applications counted by the application time length counting function, and judging whether the application time length counting function is accurate or not.
Alternatively, the first and second liquid crystal display panels may be,
the determining unit is suitable for determining the first type of application according to the interface characteristics of each application; determining each function scene of the first type of application; testing each function scene, and counting the network flow of each function scene; and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold, and if so, determining that the functional scene is an effective functional scene of the first type of application.
Alternatively, the first and second liquid crystal display panels may be,
the determining unit is suitable for capturing the request in the process of carrying out UI automatic test on each function scene through an agent tool; and according to the request obtained by packet capturing, counting the network flow of each functional scene.
Optionally, the preset threshold is determined according to a statistical range applicable to the application duration statistical function.
Alternatively,
the determining unit is further adapted to determine a second type of application according to the interface features of the applications;
the generating unit is suitable for generating test cases of the UI automatic tests corresponding to the effective function scenes of the first type of application according to the determined effective function scenes of the first type of application; and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
Optionally, the apparatus further comprises:
and the output unit is suitable for outputting the judgment result of the application duration counting function.
According to still another aspect of the present invention, there is provided an electronic apparatus, wherein the electronic apparatus includes:
a processor; and the number of the first and second groups,
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform a method according to the foregoing.
According to yet another aspect of the present invention, there is provided a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the aforementioned method.
According to the technical scheme of the invention, the effective function scenes of each application are determined; generating test cases respectively corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications; after the test cases corresponding to the effective function scenes of each application are executed, acquiring the use duration of each application counted by the application duration counting function; and comparing the sum of the preset execution time lengths in the test cases respectively corresponding to the effective function scenes of each application with the obtained use time lengths of the corresponding applications counted by the application time length counting function, and judging whether the application time length counting function is accurate or not. Therefore, the technical scheme only tests the effective function scenes of all the applications, can accurately judge the accuracy of the application time length counting function, improves the test accuracy and prevents misjudgment.
The above description is only an overview of the technical solutions of the present invention, and the present invention can be implemented in accordance with the content of the description so as to make the technical means of the present invention more clearly understood, and the above and other objects, features, and advantages of the present invention will be more clearly understood.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow diagram illustrating a method for testing using a duration statistics function according to one embodiment of the present invention;
FIG. 2 is a flow diagram illustrating a method for testing using a duration statistics function according to another embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a testing apparatus applying a time counting function according to an embodiment of the present invention;
FIG. 4 shows a schematic structural diagram of an electronic device according to one embodiment of the invention;
fig. 5 shows a schematic structural diagram of a computer-readable storage medium according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flowchart illustrating a testing method using a duration statistic function according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S110, determining an effective functional scene of each application.
The application duration statistics is performed according to the generated network traffic of the application, and in order to ensure that the function scenarios used in the test are consistent with the function scenarios obtained by the application duration statistics function statistics, the effective function scenarios of each application are determined, that is, the application duration is determined according to which function scenarios generate the network traffic when the application duration is counted. In a particular embodiment, the active functional scenarios include the functional scenarios of the applications that primarily generate traffic. For example, a browsing scene of a video in a video application.
And step S120, generating test cases respectively corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications.
In order to test the effective function scenes of each application, test cases corresponding to the effective function scenes of each application need to be generated, that is, for one application, each effective function scene needs to be tested.
Step S130, after executing the test cases corresponding to the effective function scenes of each application, obtaining the usage duration of each application counted by the application duration counting function.
When the test case is executed, the application time length counting function can carry out corresponding time length counting. In order to test the application duration counting function, the usage duration of each application counted by the application duration counting function needs to be obtained. The application duration statistical function is used for counting the total application duration, that is, the counted total duration of the test case execution corresponding to each effective function scenario of the application.
Step S140, comparing the sum of the preset execution durations in the test cases corresponding to the effective function scenes of each application with the obtained usage duration of the corresponding application counted by the application duration counting function, and determining whether the application duration counting function is accurate.
Because the application duration statistics function is the total duration of the execution of the test cases corresponding to each effective function scenario of the application, when determining whether the application duration statistics function is accurate, the sum of the preset execution durations of the test cases corresponding to each effective function scenario of the application needs to be determined. For example, the execution time of the test case of 3 effective function scenarios of an application is 1 minute (min), 10min and 5min, respectively, and it is determined whether the usage time of the application counted by the obtained application time counting function is 16min, if so, the application time counting function is accurate, and if not, the application time counting function is not accurate.
Therefore, in the technical scheme, the test is only carried out aiming at the effective function scenes of each application, the accuracy of the application time length counting function can be accurately judged, the test accuracy is improved, and the misjudgment is prevented.
In an embodiment of the present invention, the determining the effective functional scenario of each application in step S110 of the method shown in fig. 1 includes: determining a first type of application according to the interface characteristics of each application; determining each function scene of the first type of application; testing each functional scene, and counting the network flow of each functional scene; and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold, and if so, determining that the functional scene is an effective functional scene of the first type of application.
In each application, the characteristics of the interfaces of some applications are suitable for random clicking, and corresponding responses can be triggered, such as video application, taobao application and the like; there are also some applications where the interface is not suitable for random clicking, and only a specific location of the interface is clicked to trigger a corresponding response, such as a WeChat application, a game application, etc. Then, for the applications suitable for random click, all the functional scenarios may generate corresponding network traffic, and all the functional scenarios may be determined to be valid functional scenarios, while some of the functional scenarios not suitable for random click applications do not generate network traffic or generate network traffic smaller than enough to enable the application duration counting function to perform duration counting. Therefore, for the latter, the corresponding scheme is given in the present embodiment to determine the effective functional scenario thereof. Applications that are not suitable for random clicking are of the first type. And testing each function scene of each application in the first type of application, judging whether the network flow generated by each function scene is greater than or equal to a threshold value, and considering the function scene which is judged to be the function scene with the statistical duration only, namely the effective function scene for testing.
Specifically, the above testing each functional scenario, and the counting network traffic of each functional scenario includes: the method comprises the steps that requests in the process of carrying out UI automatic testing on various functional scenes are subjected to packet capturing through an agent tool; and according to the request obtained by packet capturing, counting the network flow of each functional scene.
The proxy tool here includes an Anyproxy proxy tool or a tcpdump proxy tool. Because the first type of application is not suitable for random clicks, UI automation testing is required.
Specifically, the preset threshold is determined according to a statistical range applicable to the application duration statistical function.
When the application duration counting function counts the application use duration, the application use duration is counted according to the generated network traffic of the application, that is, according to the network traffic generated when the function scene of the network traffic can be generated in the application is used. Not all functional scenarios in an application generate network traffic. During testing, if a functional scenario that does not generate network traffic is also tested, the testing may be inaccurate. Then, for the above situation, the preset threshold is determined according to the statistical range of the application duration statistical function, so that the consistency of the function scenario used in the test and the function scenario counted by the application duration statistical function can be ensured, and the accuracy of the test can be ensured.
Further, on the basis of the above embodiment, the method shown in fig. 1 further includes: and determining the second type of application according to the interface characteristics of the applications.
In step S120 of the method shown in fig. 1, generating test cases corresponding to the effective function scenes of each application according to the determined effective function scenes of each application includes: for the first type of application, generating test cases of UI automation tests respectively corresponding to the effective function scenes of the first type of application according to the determined effective function scenes of the first type of application; and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
If the first type of application is not suitable for random clicking, UI automation test is required; the second type of application is suitable for random clicks, and the monkey test can be performed. Therefore, when testing, the corresponding test case can be generated.
In one embodiment of the present invention, the method shown in fig. 1 further comprises: and outputting the judgment result of the application time length statistic function.
In order to enable a tester to obtain a test result in time or enable a developer applying the time length counting function to obtain a message indicating whether the function is accurate or not in time, in the embodiment, after judging whether the application time length counting function is accurate or not, a judgment result is output through a specified path, such as a mail, a short message and the like.
Fig. 2 is a flowchart illustrating a testing method using a duration statistic function according to another embodiment of the present invention. As shown in fig. 2, for the first type of application, step S210, performing a UI automation test on the first application; step S220, packet capturing is carried out through an Anyproxy agent tool or a tcpdump agent tool, and the size X of network traffic generated by each functional scene is calculated; step S230, judging whether X is greater than or equal to a preset threshold value Y; step S240, if not, determining the scene is an invalid function scene; step S250, if judging yes, determining the scene is an effective function scene; step S260, executing duration N on the effective function scene; for the second type of application. For the second type of application, in step S270, the monkey test is performed on the second type of application, and the execution duration N is set. The web server obtains the execution duration N.
In step S280, the web server obtains the time length M counted by the application time length counting function in the router log. Step S290, judging whether N is equal to M; step S211, if the judgment is no, the application time length counting function is determined to be inaccurate; in step S212, if yes, it is determined that the application duration counting function is accurate.
FIG. 3 is a schematic diagram of a testing apparatus applying a duration statistic function according to an embodiment of the present invention; as shown in fig. 3, the testing apparatus 300 applying the time counting function includes:
the determining unit 310 is adapted to determine valid functional scenarios of the applications.
The application duration statistics is performed according to the generated network traffic of the application, and in order to ensure that the function scenarios used in the test are consistent with the function scenarios obtained by the application duration statistics function statistics, the effective function scenarios of each application are determined, that is, the application duration is determined according to which function scenarios generate the network traffic when the application duration is counted. In a particular embodiment, the active functional scenarios include the functional scenarios of the applications that are primarily generating traffic. For example, a browsing scene of a video in a video application.
The generating unit 320 is adapted to generate test cases corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications.
In order to test the effective function scenes of each application, test cases corresponding to the effective function scenes of each application need to be generated, that is, for one application, each effective function scene needs to be tested.
The obtaining unit 330 is adapted to obtain the use duration of each application counted by the application duration counting function after executing the test case corresponding to each effective function scenario of each application.
When the test case is executed, the application of the time length counting function can carry out corresponding time length counting. In order to test the application duration counting function, the usage duration of each application counted by the application duration counting function needs to be obtained. The application duration statistical function is used for counting the application duration of the application, which is the total duration of the application, that is, the total duration of the test case corresponding to each effective function scenario of the application during execution.
The determining unit 340 is adapted to compare the sum of the preset execution durations in the test cases corresponding to the effective function scenarios of the applications with the obtained usage durations of the applications counted by the application duration counting function, and determine whether the application duration counting function is accurate.
Because the application duration statistics function is the total duration of the execution of the test cases corresponding to each effective function scenario of the application, when determining whether the application duration statistics function is accurate, the sum of the preset execution durations of the test cases corresponding to each effective function scenario of the application needs to be determined. For example, the execution time of the test case of 3 effective function scenarios of an application is 1 minute (min), 10min and 5min, respectively, and it is determined whether the usage time of the application counted by the obtained application time counting function is 16min, if so, the application time counting function is accurate, and if not, the application time counting function is not accurate.
Therefore, in the technical scheme, the test is only carried out aiming at the effective function scenes of each application, the accuracy of the application time length counting function can be accurately judged, the test accuracy is improved, and the misjudgment is prevented.
In an embodiment of the present invention, the determining unit 310 shown in fig. 3 is adapted to determine the first type of application according to the interface characteristics of each application; determining each function scene of the first type of application; testing each functional scene, and counting the network flow of each functional scene; and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold, and if so, determining that the functional scene is an effective functional scene of the first type of application.
In each application, the interface characteristics of some applications are suitable for random clicking, and corresponding responses can be triggered, such as video application, taobao application and the like; there are also some applications where the interface is not suitable for random clicking, and only a specific location of the interface is clicked to trigger a corresponding response, such as a WeChat application, a game application, etc. Then, for the applications suitable for random click, the functional scenarios may all generate corresponding network traffic, and all of the functional scenarios may be determined to be valid functional scenarios, while some of the functional scenarios not suitable for random click may not generate network traffic or generate network traffic that is smaller than enough to enable the application duration counting function to perform duration counting. Therefore, for the latter, the corresponding scheme is given in the present embodiment to determine the effective functional scenario thereof. Applications that are not suitable for random clicking are of the first type. And testing each function scene of each application in the first type of application, judging whether the network flow generated by each function scene is greater than or equal to a threshold value, and considering the function scene which is judged to be the function scene with the statistical duration only, namely the effective function scene for testing.
Specifically, the determining unit 310 is adapted to perform packet capturing on the request in the UI automation test process of each function scenario through an agent; and according to the request obtained by packet capturing, counting the network flow of each functional scene.
The proxy tool here includes an Anyproxy proxy tool or a tcpdump proxy tool. Because the first type of application is not suitable for random clicks, UI automation testing is required.
Specifically, the preset threshold is determined according to a statistical range applicable to the application duration statistical function.
When the application duration counting function is used for counting the application duration, the counting is performed according to the generated network traffic of the application, that is, according to the network traffic generated when the function scene capable of generating the network traffic in the application is used. Not all functional scenarios in an application generate network traffic. During testing, if a functional scenario that network traffic will not be generated is also tested, the testing may be inaccurate. Then, for the above situation, the preset threshold is determined according to the statistical range of the application duration statistical function, so that the consistency of the function scenario used in the test and the function scenario counted by the application duration statistical function can be ensured, and the accuracy of the test can be ensured.
Further, on the basis of the above embodiment, the determining unit 310 shown in fig. 3 is further adapted to determine the second type of application according to the interface features of each application.
The generating unit 320 is adapted to generate, for the first type of application, test cases of the UI automation test corresponding to the effective function scenes of the first type of application according to the determined effective function scenes of the first type of application; and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
If the first type of application is not suitable for random clicking, UI automation test is required; the second type of application is suitable for random clicking, and the monkey test can be performed. Therefore, when testing, the corresponding test case can be generated.
In one embodiment of the present invention, the apparatus shown in fig. 3 further comprises:
and the output unit is suitable for outputting the judgment result of the application time length counting function.
In order to enable a tester to obtain a test result in time or enable a developer applying the time length counting function to obtain a message indicating whether the function is accurate in time, in the embodiment, after judging whether the application time length counting function is accurate, a judgment result is output through a specified path, such as an email, a short message and the like.
In summary, according to the technical solution of the present invention, the effective functional scenes of each application are determined; generating test cases respectively corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications; after the test cases corresponding to the effective function scenes of each application are executed, acquiring the use duration of each application counted by the application duration counting function; and comparing the sum of the preset execution duration in the test case corresponding to the effective function scene of each application with the use duration of the corresponding application counted by the obtained application duration counting function, and judging whether the application duration counting function is accurate or not. Therefore, in the technical scheme, the test is only carried out aiming at the effective function scenes of each application, the accuracy of the application time length counting function can be accurately judged, the test accuracy is improved, and the misjudgment is prevented.
It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may also be used with the teachings herein. The required structure for constructing an arrangement of this type will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of the testing apparatus, the electronic device and the computer-readable storage medium applying the duration statistics functionality according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the invention. The electronic device 400 conventionally comprises a processor 410 and a memory 420 arranged to store computer-executable instructions (program code). The memory 420 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. The memory 420 has a memory space 430 that stores program code 440 for performing any of the method steps shown in fig. 1 and in various embodiments. For example, the memory space 430 for the program code may include respective program codes 440 for implementing respective steps in the above method. The program code can be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. Such a computer program product is generally a computer-readable storage medium 500 such as described in fig. 5. The computer-readable storage medium 500 may have memory segments, memory spaces, etc. arranged similarly to the memory 420 in the electronic device of fig. 4. The program code may be compressed, for example, in a suitable form. In general, the memory unit stores program code 510 for performing the steps of the method according to the invention, i.e. program code readable by a processor such as 410, which when run by an electronic device causes the electronic device to perform the steps of the method described above.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses A1 and a testing method for an application duration statistical function, wherein the method comprises the following steps:
determining effective function scenes of each application;
generating test cases respectively corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications;
after the test cases corresponding to the effective function scenes of each application are executed, acquiring the use duration of each application counted by the application duration counting function;
and comparing the sum of the preset execution duration in the test case corresponding to the effective function scene of each application with the obtained use duration of the corresponding application counted by the application duration counting function, and judging whether the application duration counting function is accurate or not.
The method according to A2 and A1, wherein the determining the effective functional scenario of each application includes:
determining a first type of application according to the interface characteristics of each application;
determining each function scene of the first type of application;
testing each function scene, and counting the network flow of each function scene;
and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold, and if so, determining that the functional scene is an effective functional scene of the first type of application.
A3, the method as in A2, wherein the testing each functional scenario, and the counting network traffic of each functional scenario includes:
the method comprises the steps that requests in the process of carrying out UI automatic testing on various functional scenes are subjected to packet capturing through an agent tool;
and according to the request obtained by packet capturing, counting the network flow of each functional scene.
The method A4, as described in A3, wherein the preset threshold is determined according to a statistical range applicable to the application duration statistical function.
The method as in A2, wherein the method further comprises:
determining a second type of application according to the interface characteristics of each application;
the generating of the test cases respectively corresponding to the effective function scenes of each application according to the determined effective function scenes of each application comprises:
for the first type of application, generating test cases of UI automatic tests corresponding to the effective function scenes of the first type of application according to the determined effective function scenes of the first type of application;
and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
The method A6, as stated in A1, wherein the method further comprises:
and outputting the judgment result of the application duration counting function.
The invention also discloses B7 and a testing device with the application time length statistic function, wherein the device comprises:
a determining unit adapted to determine valid functional scenarios of the applications;
the generating unit is suitable for generating test cases corresponding to the effective function scenes of the applications according to the determined effective function scenes of the applications;
the obtaining unit is suitable for obtaining the service time of each application counted by the application time counting function after executing the test cases respectively corresponding to the effective function scenes of each application;
and the judging unit is suitable for comparing the sum of the preset execution time lengths in the test cases respectively corresponding to the effective function scenes of each application with the obtained use time lengths of the corresponding applications counted by the application time length counting function, and judging whether the application time length counting function is accurate or not.
B8. The apparatus of B7, wherein,
the determining unit is suitable for determining the first type of application according to the interface characteristics of each application; determining each function scene of the first type of application; testing each functional scene, and counting the network flow of each functional scene; and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold, and if so, determining that the functional scene is an effective functional scene of the first type of application.
B9. The apparatus according to B8, wherein,
the determining unit is suitable for performing packet capturing on the requests in the process of performing UI automatic test on each function scene through the agent tool; and according to the request obtained by packet capturing, counting the network flow of each functional scene.
The device according to B10 or B9, wherein the preset threshold is determined according to a statistical range to which the application duration statistical function is applicable.
B11, the device as in B8, wherein,
the determining unit is further adapted to determine a second type of application according to the interface characteristics of each application;
the generating unit is suitable for generating test cases of the UI automatic tests corresponding to the effective function scenes of the first type of application according to the determined effective function scenes of the first type of application; and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
B12. The apparatus as in B7, wherein the apparatus further comprises:
and the output unit is suitable for outputting the judgment result of the application duration counting function.
The invention also discloses C13 and electronic equipment, wherein the electronic equipment comprises:
a processor; and the number of the first and second groups,
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform a method according to any one of A1 to A6.
The invention also discloses D14, a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any one of A1-A6.

Claims (14)

1. A test method applying a time length statistic function is provided, wherein the method comprises the following steps:
determining effective function scenes corresponding to different types of applications, wherein the different types of applications comprise a first type of application and a second type of application;
generating test cases respectively corresponding to the effective function scenes of the different types of applications according to the determined effective function scenes and the application classes corresponding to the different types of applications;
after the test cases respectively corresponding to the effective function scenes of the different types of applications are executed, acquiring the use duration of each application counted by the application duration counting function;
and comparing the sum of preset execution time lengths in the test cases respectively corresponding to the effective function scenes of the different types of applications with the obtained use time length of the corresponding application counted by the application time length counting function, and judging whether the application time length counting function is accurate or not.
2. The method of claim 1, wherein the determining valid functionality scenarios for different types of applications comprises:
determining the first type of application and the second type of application according to the interface characteristics of the different types of applications;
determining each function scene of the first type of application;
testing each function scene, and counting the network flow of each function scene;
and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold value, and if so, determining that the functional scene is an effective functional scene of the first type of application.
3. The method of claim 2, wherein the testing each functional scenario, and the counting network traffic of each functional scenario comprises:
the method comprises the steps that requests in the process of carrying out UI automatic testing on all function scenes are subjected to packet capturing through an agent tool;
and according to the request obtained by packet capturing, counting the network flow of each functional scene.
4. The method according to claim 3, wherein the preset threshold is determined according to a statistical range to which the application duration statistical function is applicable.
5. The method of claim 1, wherein,
the generating, according to the determined effective function scenarios corresponding to the different types of applications, test cases respectively corresponding to the effective function scenarios of the different types of applications includes:
for the first type of application, generating test cases of UI automation tests corresponding to the effective function scenes of the first type of application respectively according to the determined effective function scenes of the first type of application;
and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
6. The method of claim 1, wherein the method further comprises:
and outputting the judgment result of the application time length counting function.
7. A test apparatus using a duration statistic function, wherein the apparatus comprises:
the device comprises a determining unit, a judging unit and a judging unit, wherein the determining unit is suitable for determining effective function scenes corresponding to different types of applications, and the different types of applications comprise a first type of application and a second type of application;
the generating unit is suitable for generating test cases respectively corresponding to the effective function scenes of the different types of applications according to the determined effective function scenes and the application categories corresponding to the different types of applications;
the obtaining unit is suitable for obtaining the service time of each application counted by the application time counting function after executing the test cases respectively corresponding to the effective function scenes of the different types of applications;
and the judging unit is suitable for comparing the sum of the preset execution durations in the test cases respectively corresponding to the effective function scenes of the applications of different types with the obtained use duration of the corresponding application counted by the application duration counting function, and judging whether the application duration counting function is accurate or not.
8. The apparatus of claim 7, wherein,
the determining unit is suitable for determining the first type of application and the second type of application according to the interface characteristics of the different types of applications; determining each function scene of the first type of application; testing each functional scene, and counting the network flow of each functional scene; and judging whether the network flow of each counted functional scene is greater than or equal to a preset threshold value, and if so, determining that the functional scene is an effective functional scene of the first type of application.
9. The apparatus of claim 8, wherein,
the determining unit is suitable for capturing the request in the process of carrying out UI automatic test on each function scene through an agent tool; and according to the request obtained by packet capturing, counting the network flow of each functional scene.
10. The apparatus of claim 9, wherein the preset threshold is determined according to a statistical range to which the application duration statistical function is applicable.
11. The apparatus of claim 7, wherein,
the generating unit is suitable for generating test cases of the UI automatic tests corresponding to the effective function scenes of the first type of application according to the determined effective function scenes of the first type of application for the first type of application; and for the second type of application, generating test cases of monkey tests corresponding to the functional scenes of the second type of application according to the functional scenes of the second type of application.
12. The apparatus of claim 7, wherein the apparatus further comprises:
and the output unit is suitable for outputting the judgment result of the application duration counting function.
13. An electronic device, wherein the electronic device comprises:
a processor; and the number of the first and second groups,
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any one of claims 1 to 6.
14. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-6.
CN201811518397.8A 2018-12-12 2018-12-12 Testing method and device for application duration statistical function Active CN111314160B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811518397.8A CN111314160B (en) 2018-12-12 2018-12-12 Testing method and device for application duration statistical function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811518397.8A CN111314160B (en) 2018-12-12 2018-12-12 Testing method and device for application duration statistical function

Publications (2)

Publication Number Publication Date
CN111314160A CN111314160A (en) 2020-06-19
CN111314160B true CN111314160B (en) 2023-02-17

Family

ID=71146525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811518397.8A Active CN111314160B (en) 2018-12-12 2018-12-12 Testing method and device for application duration statistical function

Country Status (1)

Country Link
CN (1) CN111314160B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577472A (en) * 2015-12-15 2016-05-11 北京奇虎科技有限公司 Data acquisition test method and device
CN106708697A (en) * 2016-09-29 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting applications used by user
CN108513166A (en) * 2018-03-01 2018-09-07 世纪龙信息网络有限责任公司 Video length statistical method, device and computer equipment
CN108763076A (en) * 2018-05-22 2018-11-06 深圳乐信软件技术有限公司 A kind of Software Automatic Testing Method, device, equipment and medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140280913A1 (en) * 2013-03-15 2014-09-18 Moki Mobility, Inc. Device and settings management platform
US10031841B2 (en) * 2013-06-26 2018-07-24 Sap Se Method and system for incrementally updating a test suite utilizing run-time application executions

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577472A (en) * 2015-12-15 2016-05-11 北京奇虎科技有限公司 Data acquisition test method and device
CN106708697A (en) * 2016-09-29 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting applications used by user
CN108513166A (en) * 2018-03-01 2018-09-07 世纪龙信息网络有限责任公司 Video length statistical method, device and computer equipment
CN108763076A (en) * 2018-05-22 2018-11-06 深圳乐信软件技术有限公司 A kind of Software Automatic Testing Method, device, equipment and medium

Also Published As

Publication number Publication date
CN111314160A (en) 2020-06-19

Similar Documents

Publication Publication Date Title
CN109062809B (en) Online test case generation method and device and electronic equipment
CN108345642B (en) Method, storage medium and server for crawling website data by proxy IP
RU2628127C2 (en) Method and device for identification of user behavior
CN109241343B (en) System, method and device for identifying brush amount user
US10135862B1 (en) Testing security incident response through automated injection of known indicators of compromise
WO2017113677A1 (en) User behavior data processing method and system
CN110830986B (en) Method, device, equipment and storage medium for detecting abnormal behavior of Internet of things card
CN110782374A (en) Electronic evidence obtaining method and system based on block chain
CN108390856B (en) DDoS attack detection method and device and electronic equipment
CN111163067B (en) Safety testing method and device and electronic equipment
CN110879781B (en) Program debugging method, device, electronic equipment and computer readable storage medium
CN110401580B (en) Webpage state monitoring method based on heartbeat mechanism and related equipment
CN109302423B (en) Vulnerability scanning capability testing method and device
CN109889511B (en) Process DNS activity monitoring method, equipment and medium
CN109560976B (en) Message delay monitoring method and device
CN112165517B (en) Return source detection method and device, storage medium and electronic equipment
CN106713242B (en) Data request processing method and processing device
CN106998336B (en) Method and device for detecting user in channel
CN114157568B (en) Browser secure access method, device, equipment and storage medium
CN112511535A (en) Equipment detection method, device, equipment and storage medium
CN109062793B (en) Test method and device of roller control and electronic equipment
CN108153654B (en) Log collection method and device
CN114301800A (en) Network equipment quality difference analysis method and device
CN111314160B (en) Testing method and device for application duration statistical function
CN108282446A (en) Identify the method and apparatus of scanner

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant