Background
The application stability test technology is substantially different from the traditional stability test technology, and most of the traditional stability test technology executes tests based on the bottom layer module, so that the system stability test related to actual user experience cannot be directly concerned. In addition, the conventional stability testing technology does not focus on some specific functions in some operating systems, and cannot test the stability of some operating systems sufficiently comprehensively.
The invention discloses a method and a device for testing android application stability (application number CN201410211591.7) in Chinese invention patent, which relates to the field of terminal application testing and is used for solving the problems of incomplete test coverage of a monkey tool, high maintenance cost and low reusability of the monkey tool, and the method comprises the following steps: determining a test type and data to be tested according to a preset configuration item, wherein the test type comprises a monkey test and/or a monkey yrner test; if the test type is monkey test, carrying out monkey test on the data to be tested according to each test parameter in the monkey test statement; and if the test type is the monkeyyrner test, performing the monkeyyrner test on the data to be tested according to each script statement in each monkeyyrner test statement. The method is only suitable for the android mobile terminal, and desktop systems such as a Linux operating system and the like are not considered.
The Chinese invention patent 'a server stability test method' (application number CN201911090823.7) provides a server stability test method, which carries out continuous and stable pressure test, gradual pressure test, test data collection and analysis and output analysis results by creating a topological environment simulating the actual application scene of a client, can evaluate the support conditions of various configurations to fault-tolerant and high-availability scenes by simulating the actual scene of the client, and can check the stability of service in the client application scene. The application solves the problem of server stability testing, but does not consider application-level based stability testing.
The Chinese patent of invention 'method and server for testing stability of server' (application number CN201710316288.7) provides a method and server for testing stability of server, the method includes: the server stability test method comprises the steps that a server hardware stability test instruction set and an operating system software stability test set are arranged on a server, the server tests the stability of the server by automatically running the test set, the server stability test problem is solved, and the fields of a universal desktop and a server operating system are not considered.
The Chinese invention patent 'GUI automated testing method and system' (application number CN201710618522.1) discloses a GUI automated testing method and system, which can rapidly complete the deployment and implementation of GUI automated testing only by editing/modifying test cases, bring great convenience to the implementation of GUI automated testing and save a large amount of cost. However, the invention is only suitable for functional tests and does not consider application stability tests.
In summary, there is currently a lack of methods for application stability testing.
Disclosure of Invention
In order to solve the above problems, the present invention provides an application stability testing method, including the steps of:
configuring application stability testing software on an operating system;
starting the application stability testing software;
configuring test information on the application stability test software;
the application stability testing software schedules the test configuration;
the application stability testing software executes the test configuration;
and the application stability testing software outputs a testing report.
Preferably, the configuring test information on the application stability test software includes the steps of:
configuring a total test time on the application stability test software;
configuring an action interval time on the application stability test software;
configuring an application program list on the application stability test software;
configuring the corresponding test action number of each application on the application stability test software;
configuring the corresponding maximum opening number of each application on the application stability test software;
and configuring the maximum opening number of all applications on the application stability test software.
Preferably, the scheduling the test configuration by the application stability test software comprises the steps of:
acquiring configuration information;
selecting an application to be tested;
grouping applications to be tested based on the configuration information;
selecting a respective test action for each application within a packet based on the configuration information;
acquiring an application ID of each application and a corresponding test action ID;
acquiring application IDs of all applications in each group and corresponding test action IDs;
a test run code for each packet is generated.
Preferably, the grouping of the applications to be tested based on the configuration information comprises the steps of:
acquiring an application program list and the maximum opening number M of all applications in the configuration information;
presetting A empty groups;
randomly distributing all the application programs in the application program list into A empty groups to obtain A groups; wherein the number N of applications in each group satisfies: n is more than or equal to 1 and less than or equal to M, and A, M and N are positive integers;
acquiring the corresponding maximum opening number K of each application in the configuration information;
configuring an application program of each group in the A groups; wherein, the number B of each application program in each group and the total number C of all application programs satisfy: b is more than or equal to 1 and less than or equal to K, C is more than or equal to 1 and less than or equal to M, and B, C and K are positive integers.
Preferably, said selecting a respective test action for each application within a packet based on said configuration information comprises the steps of:
obtaining a grouping result;
acquiring the test action number P corresponding to each application in the group;
acquiring a test action library;
randomly selecting Q test actions from the test action library; wherein Q is more than or equal to 1 and less than or equal to P, and Q is a positive integer;
and mapping each application and the Q corresponding test actions to form a test action dictionary.
Preferably, the executing of the test configuration by the application stability test software comprises the steps of:
acquiring a group and a corresponding test operation code;
acquiring a test action dictionary corresponding to each application in the group;
acquiring total test time, action interval time and the corresponding maximum opening number of each application in the configuration information;
starting all application programs in each group according to the groups and the test operation codes;
and executing a test action on each application in each group according to the total test time, the action interval time and the corresponding maximum opening number.
Preferably, the executing of the test configuration by the application stability test software comprises the steps of:
performing the test motion encoding on all applications within the packet;
judging whether the total test time is reached;
if yes, collecting test information;
if not, judging whether the current test operation code has unexecuted test action;
if yes, switching to an application program corresponding to the test action, and executing the test action;
if not, judging whether all the test action codes are executed;
if yes, returning to the step of obtaining the grouping and the corresponding test operation coding;
and if not, executing the next test code adjacent to the current test code.
Preferably, the outputting the test report by the application stability test software comprises the following steps:
acquiring all test information;
and printing and outputting the test information.
The application stability testing method provided by the application has the following beneficial effects:
(1) the method is applied to a domestic Galaxy kylin operating system, and fills up the vacancy of application-level stability test in a Linux operating system;
(2) paying attention to the application-level stability test, namely the real experience aspect in the user operation process, and expanding the operating system test technology paying attention to the user experience aspect;
(3) the method for testing the stability of the cross-architecture platform is satisfied by adopting python language coding;
(4) the stability test method for the application of various scenes can be constructed and accords with the actual experience stability test method of the user;
(5) and the running test is performed in a running coding mode, so that various scene tests can be conveniently reproduced.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
As shown in fig. 1, in the embodiment of the present application, the present invention provides an application stability testing method, including the steps of:
s1: configuring application stability testing software on an operating system;
s2: starting the application stability testing software;
s3: configuring test information on the application stability test software;
s4: the application stability testing software schedules the test configuration;
s5: the application stability testing software executes the test configuration;
s6: and the application stability testing software outputs a testing report.
When the stability test method is used for testing the stability of the application, firstly, application stability test software is configured on an operating system, wherein the operating system can be a Windows system, a Linux system, an operating system developed by foreign companies, a domestic operating system, such as a domestic Galaxy kylin operating system; the application stability test software can be the existing test software or the software developed by a tester according to the test requirement. When testing, starting application stability testing software on an operating system, then configuring testing information on the application stability testing software, scheduling the testing configuration by the application stability testing software, executing the testing configuration to test the application, and finally outputting a testing report by the application stability testing software for a tester to analyze the stability of the application by reference. The method provided by the application adopts python language coding, and meets the stability test requirement on the cross-architecture platform.
In this embodiment of the present application, the configuring test information on the application stability test software includes:
configuring a total test time on the application stability test software;
configuring an action interval time on the application stability test software;
configuring an application program list on the application stability test software;
configuring the corresponding test action number of each application on the application stability test software;
configuring the corresponding maximum opening number of each application on the application stability test software;
and configuring the maximum opening number of all applications on the application stability test software.
Specifically, in the embodiment of the present application, the test information includes: the test system comprises a total test time, an action interval time, an application program list, the corresponding test action number of each application, the corresponding maximum opening number of each application and the maximum opening number of all applications. The total test time represents the total duration of the test in the test; the action interval time represents the time length between two adjacent test actions; the application list represents a list of applications under test; the corresponding test action number of each application indicates that the corresponding test action number is configured for each application, and the test action numbers corresponding to each application can be the same or different; the corresponding maximum opening number of each application indicates that a corresponding maximum opening number is configured for each application, the maximum opening number of all applications indicates that a maximum opening number is configured for all applications, and the two configurations are grouped and configured according to each other when the applications are grouped. When the maximum opening number is reached, the application is not opened any more in the subsequent testing process; when this maximum number of opens is reached, no application is opened again in the subsequent testing process.
In this embodiment of the present application, the scheduling the test configuration by the application stability test software includes:
acquiring configuration information;
selecting an application to be tested;
grouping applications to be tested based on the configuration information;
selecting a respective test action for each application within a packet based on the configuration information;
acquiring an application ID of each application and a corresponding test action ID;
acquiring application IDs of all applications in each group and corresponding test action IDs;
a test run code for each packet is generated.
In the embodiment of the application, first, configuration information, that is, total test time, action interval time, an application program list, a corresponding test action number of each application, a corresponding maximum opening number of each application, and a maximum opening number of all applications, is obtained, and then, an application to be tested is selected from the application program list, where the selection rule may be random selection or selection according to a certain rule, for example, selection according to a sorting order in the application program list; grouping the applications to be tested based on one or more items (namely, total test time, action interval time, an application program list, the number of corresponding test actions of each application, the corresponding maximum opening number of each application and the maximum opening number of all applications) in the configuration information, wherein the grouping rule can be random grouping, then selecting corresponding test actions for each application in the grouping based on one or more items in the configuration information, acquiring an application ID of each application and a corresponding test action ID thereof, and acquiring application IDs of all applications in each grouping and corresponding test action IDs thereof; and then, correspondingly arranging the application IDs of all the applications in each group and the corresponding test action IDs in a test action dictionary form one by one, and generating a test operation code of each group, wherein the test operation code can be stored in test software to facilitate subsequent direct calling.
In this embodiment of the present application, the grouping the applications to be tested based on the configuration information includes:
acquiring an application program list and the maximum opening number M of all applications in the configuration information;
presetting A empty groups;
randomly distributing all the application programs in the application program list into A empty groups to obtain A groups; wherein the number N of applications in each group satisfies: n is more than or equal to 1 and less than or equal to M, and A, M and N are positive integers;
acquiring the corresponding maximum opening number K of each application in the configuration information;
configuring an application program of each group in the A groups; wherein, the number B of each application program in each group and the total number C of all application programs satisfy: b is more than or equal to 1 and less than or equal to K, C is more than or equal to 1 and less than or equal to M, and B, C and K are positive integers.
In the embodiment of the present application, the grouping may be configured according to the corresponding maximum open number of each application and the maximum open numbers of all applications. Specifically, an application program list and a maximum opening number M of all applications in the configuration information are obtained, all application programs to be tested are stored in the application program list, A empty groups are preset at the moment, no application program exists in the empty groups, and then all the application programs in the application program list are randomly divided into the A empty groups to obtain A groups; wherein the number N of applications in each group satisfies: n is more than or equal to 1 and less than or equal to M, A, M and N are positive integers, and the number of application programs in each group can be the same or different; then, acquiring the corresponding maximum opening number K of each application in the configuration information, and configuring the application program of each group in the A groups according to the corresponding maximum opening number K of each application; wherein, the number B of each application program in each group and the total number C of all application programs satisfy: b is more than or equal to 1 and less than or equal to K, C is more than or equal to 1 and less than or equal to M, and B, C and K are positive integers.
In an embodiment of the present application, the selecting a corresponding test action for each application in the packet based on the configuration information includes:
obtaining a grouping result;
acquiring the test action number P corresponding to each application in the group;
acquiring a test action library;
randomly selecting Q test actions from the test action library; wherein Q is more than or equal to 1 and less than or equal to P, and Q is a positive integer;
and mapping each application and the Q corresponding test actions to form a test action dictionary.
In the embodiment of the present application, selecting the corresponding test action may be obtained by grouping the result and the test action number P corresponding to each application in the group, specifically, first obtaining the grouping result and the test action number P corresponding to each application in the group, where the grouping result stores application programs in the same group, and then obtaining the test action number P corresponding to each application in the same group; and then acquiring a test action library, randomly selecting Q test actions smaller than the corresponding P from the test action library, and distributing the Q test actions to corresponding applications to wait for a stability test to be carried out subsequently. The test action library can be preset, for example, "click" or "press", or can be customized as required, for example, "continuously click for 30 s", and the like.
In an embodiment of the present application, the executing of the test configuration by the application stability test software includes:
acquiring a group and a corresponding test operation code;
acquiring a test action dictionary corresponding to each application in the group;
acquiring total test time, action interval time and the corresponding maximum opening number of each application in the configuration information;
starting all application programs in each group according to the groups and the test operation codes;
and executing a test action on each application in each group according to the total test time, the action interval time and the corresponding maximum opening number.
In the embodiment of the application, when test configuration is executed, firstly, groups and test operation codes corresponding to each group are obtained, then, a test action dictionary corresponding to each application in each group is obtained, all application programs in each group are started according to the groups and the test operation codes, and when a plurality of same application programs exist in each group, the same application programs are all started; and then executing a test action for each application in each group according to the total test time, the action interval time and the corresponding maximum opening number. Specifically, when a test action is performed on an application in each packet, the total test duration needs to be equal to or less than the total test time, the interval time between two adjacent test action times needs to be equal to or greater than the action interval time, and the maximum number of opens of each application at each test needs to be equal to or less than the corresponding maximum number of opens of each application.
In an embodiment of the present application, the executing of the test configuration by the application stability test software includes:
performing the test motion encoding on all applications within the packet;
judging whether the total test time is reached;
if yes, collecting test information;
if not, judging whether the current test operation code has unexecuted test action;
if yes, switching to an application program corresponding to the test action, and executing the test action;
if not, judging whether all the test action codes are executed;
if yes, returning to the step of obtaining the grouping and the corresponding test operation coding;
and if not, executing the next test code adjacent to the current test code.
In the embodiment of the present application, when performing test motion coding on all applications in a group, it is necessary to periodically determine whether the total test time is reached; when the total testing time is up, the testing needs to be finished at the moment, and all testing information is collected, so that a testing report can be conveniently formed subsequently; when the total test time is not reached, judging whether the current test operation code has unexecuted test action; if the test action is not executed, switching to an application program corresponding to the test action, and executing the test action on the application program; if the unexecuted test action does not exist, judging whether all test action codes are executed; if all the action codes are executed completely, returning to the step of acquiring the grouping and the corresponding test operation codes so as to test the new grouping and the test operation codes in the grouping; and when the action codes are not executed completely, executing the next test code adjacent to the current test code until all the action codes are executed completely.
In an embodiment of the present application, the outputting a test report by the application stability test software includes:
acquiring all test information;
and printing and outputting the test information.
In the embodiment of the application, all test information is included in the test report, and when the test is completed, all test information is printed and the test report is formed for a tester to analyze the stability of the application.
The application stability testing method provided by the application has the following beneficial effects:
(1) the method is applied to a domestic Galaxy kylin operating system, and fills up the vacancy of application-level stability test in a Linux operating system;
(2) paying attention to the application-level stability test, namely the real experience aspect in the user operation process, and expanding the operating system test technology paying attention to the user experience aspect;
(3) the method for testing the stability of the cross-architecture platform is satisfied by adopting python language coding;
(4) the stability test method for the application of various scenes can be constructed and accords with the actual experience stability test method of the user;
(5) and the running test is performed in a running coding mode, so that various scene tests can be conveniently reproduced.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.