Application test method and device, computer equipment and computer readable storage medium

The server device determines and sends interface event information, and combines the event collection information of the client device for application testing, solving the problems of many invalid test operations and low coverage in the prior art, and achieving more efficient application test coverage.

CN119201690APending Publication Date: 2024-12-27SHENZHEN TCL CREATIVE CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411209356.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing application testing method based on monkey tests is due to the random operation of client devices, resulting in many invalid test operations, and the test coverage is low.

Method used

The application's event list is obtained through the server device, the interface event information is determined and sent to the client device, the returned event collection information is received, and the traversal test is performed based on the active components and event list, so as to avoid random operations of the client device and improve page coverage.

Benefits of technology

It effectively avoids the test invalid operation caused by random operation of client devices and improves the page coverage of application tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201690A_ABST
    Figure CN119201690A_ABST
Patent Text Reader

Abstract

The invention discloses an application testing method and device, computer equipment and a computer readable storage medium, and the method comprises the steps: obtaining a first event list corresponding to a first page of a tested application, and determining first interface event information from the first event list; sending the first interface event information to the client device, and receiving first event set information corresponding to a second page of the tested application returned by the client device based on the first interface event information; the first event set information comprises first activity component information corresponding to the second page and a second event list corresponding to the second page; and performing a traversal test on an interface event corresponding to the tested application based on the first activity component information and the second event list to obtain a test result of the tested application. By adopting the method provided by the invention, many invalid test operations caused by random operation of the client equipment can be avoided, and the page coverage rate of application test is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application testing technology, and in particular to an application testing method, apparatus, computer equipment, and computer-readable storage medium. Background Art

[0002] Currently, monkey testing is usually used to stress test applications. Monkey testing simulates user operation behaviors and triggers events in the application in a random manner, such as clicks, slides, inputs, etc., to discover problems and abnormal situations that may occur in the application under extreme circumstances. However, in the existing application testing method based on monkey testing, the client device uses commands to send random event streams, resulting in many invalid test operations and low test coverage. Summary of the invention

[0003] The embodiments of the present application provide an application testing method, apparatus, computer device, and computer-readable storage medium, which can avoid many invalid test operations caused by random operations of client devices and improve the page coverage of application testing.

[0004] The technical solution adopted by the present invention to solve the problem is as follows:

[0005] On the one hand, the present application provides an application testing method, comprising:

[0006] Obtaining a first event list corresponding to a first page of the application under test, and determining first interface event information from the first event list;

[0007] Sending the first interface event information to the client device, and receiving the first event collection information corresponding to the second page of the tested application returned by the client device based on the first interface event information; the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page;

[0008] Based on the first activity component information and the second event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

[0009] In some embodiments of the present application, the first event list includes a plurality of first candidate interface event information, and determining the first interface event information from the first event list includes:

[0010] Determine whether all of the first candidate interface event information has been traversed;

[0011] If the plurality of first candidate interface event information have not been traversed in full, second candidate interface event information is determined from the plurality of first candidate interface event information; the second candidate interface event information is the interface event information that has not been traversed in the plurality of first candidate interface event information;

[0012] Inputting the second candidate interface event information into the first prediction model, and outputting the first interface event information through the first prediction model;

[0013] If all of the multiple first candidate interface event information are traversed, the multiple first candidate interface event information are input into the second prediction model, and the first interface event information is output through the second prediction model.

[0014] In some implementation schemes of the present application, based on the first activity component information and the second event list, a traversal test is performed on the interface events corresponding to the tested application to obtain a test result of the tested application, including:

[0015] Based on the first activity component information, determining whether the activity component corresponding to the second page is a blacklist component;

[0016] If the active component corresponding to the second page is a blacklist component or the second event list is empty, continue to execute the step of determining the first interface event information from the first event list until the test time of the application under test reaches the preset time or all interface events corresponding to the application under test are traversed.

[0017] In some embodiments of the present application, after determining whether the activity component corresponding to the second page is a blacklist component based on the first activity component information, the method further includes:

[0018] If the active component corresponding to the second page is not a blacklist component and the second event list is not empty, determining the second interface event information from the second event list;

[0019] Send the second interface event information to the client device, and receive the second event collection information corresponding to the third page of the tested application returned by the client device based on the second interface event information; the second event collection information includes the second activity component information corresponding to the third page and the third event list corresponding to the third page;

[0020] Based on the second activity component information and the third event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

[0021] In some embodiments of the present application, the second event list includes a plurality of third candidate interface event information, and determining the second interface event information from the second event list includes:

[0022] Determine fourth candidate interface event information from multiple third candidate interface event information;

[0023] Determine whether the interface event corresponding to the fourth candidate interface event information is a blacklist event;

[0024] If the interface event corresponding to the fourth candidate interface event information is a blacklist event, continue to perform the step of determining the fourth candidate interface event information from the plurality of third candidate interface event information until the interface event corresponding to the fourth candidate interface event information is not a blacklist event;

[0025] The fourth candidate interface event information is determined as the second interface event information.

[0026] In some implementation schemes of the present application, obtaining a first event list corresponding to a first page of the application under test includes:

[0027] Obtaining a list of active components of the application under test, and determining information about a third active component from the list of active components;

[0028] The third activity component information is sent to the client device, and a first event list corresponding to the first page returned by the client device based on the third activity component information is received.

[0029] In some implementation schemes of the present application, the test result includes the first page number of the tested pages of the tested application, and after the interface events corresponding to the tested application are traversed and tested based on the first activity component information and the second event list, the test result of the tested application is obtained, including:

[0030] Obtain the number of second pages of the application under test; the number of second pages is the total number of pages of the application under test;

[0031] Based on the first number of pages and the second number of pages, a test coverage of the application under test is determined.

[0032] In a second aspect, an embodiment of the present invention further provides an application testing device, including:

[0033] An information acquisition module, used to acquire a first event list corresponding to a first page of the application under test, and determine first interface event information from the first event list;

[0034] An event determination module is used to send the first interface event information to the client device, and receive the first event collection information corresponding to the second page of the tested application returned by the client device based on the first interface event information; the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page;

[0035] The traversal test module is used to perform a traversal test on the interface events corresponding to the tested application based on the first activity component information and the second event list to obtain the test result of the tested application.

[0036] In a third aspect, the present application further provides a computer device, the computer device comprising:

[0037] one or more processors;

[0038] Memory; and

[0039] One or more application programs, wherein the one or more application programs are stored in a memory and configured to be executed by a processor to implement any application testing method in the first aspect.

[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in the application testing method of any one of the first aspects.

[0041] The beneficial effects of the present invention are as follows: by determining the first interface event information from the first event list through the server-side device, sending the first interface event information to the client device, and receiving the first event collection information corresponding to the second page of the tested application returned by the client device based on the first interface event information, and performing traversal testing on the interface events corresponding to the tested application based on the first active component information in the first event collection information and the second event list, it is possible to avoid many invalid test operations caused by random operations of the client device and improve the page coverage of the application test. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 is a flow chart of an application testing system provided by an embodiment of the present invention;

[0044] Figure 2 It is a flowchart of an embodiment of the application testing method provided by an embodiment of the present invention;

[0045] Figure 3 It is a schematic diagram of a specific embodiment flow of determining first interface event information from a first event list provided by an embodiment of the present invention;

[0046] Figure 4 It is a schematic diagram of a specific embodiment flow of performing traversal testing on interface events corresponding to the tested application provided by an embodiment of the present invention;

[0047] Figure 5 is a principle block diagram of an application testing device provided by an embodiment of the present invention;

[0048] Figure 6It is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0050] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, features defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.

[0051] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0052] It should be noted that since the method of the embodiment of the present application is executed in a computer device, the processing objects of each computer device exist in the form of data or information. For example, time is actually time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data for processing by the computer device. The details will not be repeated here.

[0053] The embodiments of the present application provide an application testing method, apparatus, computer device, and computer-readable storage medium, which are described in detail below.

[0054] See also Figure 1 , Figure 1A schematic diagram of a scenario of an application testing system provided in an embodiment of the present application, wherein the application testing system may include a server device and a client device, wherein the server device is integrated with an application testing apparatus, and the client device runs an application under test, such as Figure 1 Computer equipment in.

[0055] In the embodiment of the present application, the server device is mainly used to obtain a first event list corresponding to the first page of the application under test, determine the first interface event information from the first event list; send the first interface event information to the client device, and receive the first event collection information corresponding to the second page of the application under test returned by the client device based on the first interface event information; the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page; based on the first activity component information and the second event list, the interface events corresponding to the application under test are traversed and tested to obtain the test results of the application under test, and the server device selects the interface event from the event list and sends it to the client device for execution, which can avoid many invalid test operations caused by random operations of the client device and improve the page coverage of the application test.

[0056] In the embodiments of the present application, the server device may be an independent server, or a server network or server cluster composed of servers. For example, the computer device described in the embodiments of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0057] It is understandable that the server device used in the embodiments of the present application may be a device that includes both receiving and transmitting hardware, that is, a device that has receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific server device may be a desktop terminal or a mobile terminal, and the server device may also be one of a mobile phone, a tablet computer, a laptop computer, etc.

[0058] In the embodiment of the present application, the client device is a terminal device that runs the application under test. The client device can specifically be a desktop terminal or a mobile terminal. The client device can also specifically be one of a television, a mobile phone, a tablet computer, a laptop computer, etc., which is not limited in this embodiment.

[0059] Those skilled in the art will understand that Figure 1The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer devices as shown in Figure 1 Only one server device and one client device are shown. It can be understood that the application testing system can also include one or more other services, which are not specifically limited here.

[0060] In addition, the application testing system may also include a memory for storing data, such as interface event information, such as first interface event information, second interface event information, etc., such as event collection information, such as first event collection information, second event collection information, etc.

[0061] It should be noted that Figure 1 The scenario diagram of the application testing system shown is merely an example. The application testing system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the application testing system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.

[0062] First, an application testing method, device, computer equipment and computer-readable storage medium are provided in an embodiment of the present application. The executor of the application testing method is the application testing device, which is applied to a server-side device. The application testing method includes: obtaining a first event list corresponding to a first page of the application under test, and determining first interface event information from the first event list; sending the first interface event information to a client device, and receiving first event collection information corresponding to a second page of the application under test returned by the client device based on the first interface event information; the first event collection information includes first activity component information corresponding to the second page and a second event list corresponding to the second page; based on the first activity component information and the second event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

[0063] like Figure 2 FIG. 2 is a flow chart of an embodiment of an application test method in an embodiment of the present application. The application test method may include the following steps S201 to S203, which are as follows:

[0064] Step S201: Obtain a first event list corresponding to a first page of the application under test, and determine first interface event information from the first event list.

[0065] In a specific embodiment, the application under test is an application program to be tested, and the application under test includes multiple pages. The first page can be the root page of the application under test, or can be other pages of the application under test, which is not limited in this embodiment. Each of the multiple pages of the application under test has a corresponding event list, and the first event list is an event list corresponding to the first page. For example, if the first page is the root page of the application under test, then the first event list is an event list corresponding to the root page of the application under test, and if the first page is other pages of the application under test, then the first event list is an event list corresponding to other pages of the application under test.

[0066] Furthermore, the first event list includes multiple first candidate interface event information, and the first interface event information is interface event information selected from multiple first candidate interface event information. For example, the first event list includes first candidate interface event information A, first candidate interface event information B, and first candidate interface event information C, and the first interface event information is first candidate interface event information A.

[0067] In a specific embodiment, the step of obtaining the first event list corresponding to the first page of the application under test in the above step S201 specifically includes: obtaining the active component list of the application under test, and determining the third active component information from the active component list; sending the third active component information to the client device, and receiving the first event list corresponding to the first page returned by the client device based on the third active component information.

[0068] The application under test includes multiple activity components (Activity components), which are one of the four most common components of an application. Each Activity component is usually a separate screen, which can display some controls and can also listen to and process user events to respond. The activity component list is the total activity component list of the application under test. After the server device obtains the activity component list of the application under test, it sends the third activity component information in the activity component list to the client device. The client device can enter the first page corresponding to the third activity component information and send the first event list corresponding to the first page to the server device.

[0069] Step S202: Send the first interface event information to the client device, and receive the first event collection information corresponding to the second page of the tested application returned by the client device based on the first interface event information; the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page.

[0070] In a specific embodiment, after the server device sends the first interface event information to the client device, the client device can execute the interface event corresponding to the first interface event information and enter the second page corresponding to the first interface event information. At the same time, the client device can also send the first event collection information corresponding to the second page to the server device, so that the server device can perform a traversal test on the interface events corresponding to the application under test based on the first event collection information corresponding to the second page.

[0071] Among them, the first event collection information is the super event collection corresponding to the second page of the application under test, the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page, the first activity component information is the information related to the Activity component to which the second page belongs, and the second event list is the list related to the interface events (UI events) corresponding to the second page.

[0072] Step S203: Perform a traversal test on the interface events corresponding to the application under test based on the first activity component information and the second event list to obtain a test result of the application under test.

[0073] In this embodiment, the server device determines the first interface event information from the first event list, and receives the first activity component information corresponding to the second page and the second event list corresponding to the second page returned by the client device based on the first interface event information. The interface events corresponding to the tested application are traversed and tested based on the first activity component information and the second event list. The server device selects the interface event from the event list and sends it to the client device for execution. This can avoid many invalid test operations caused by random operations of the client device and improve the page coverage of the application test.

[0074] In a specific implementation, referring to Figure 3 As shown, determining the first interface event information from the first event list in the above step S201 may include steps S301 to S304, which are specifically as follows:

[0075] Step S301: Determine whether all of the first candidate interface event information has been traversed.

[0076] Optionally, the first event list includes multiple first candidate interface event information. When determining the first interface event information from the first event list, it is first determined whether all the multiple first candidate interface event information are traversed. If all the multiple first candidate interface event information are not traversed, the first interface event information is filtered out from the first event list based on the first prediction model. If all the multiple first candidate interface event information are traversed, the first interface event information is filtered out from the first event list based on the second prediction model.

[0077] Step S302: If all of the first candidate interface event information are not traversed, determine the second candidate interface event information from the first candidate interface event information.

[0078] In a specific embodiment, the second candidate interface event information is interface event information that has not been traversed among the multiple first candidate interface event information. If the multiple first candidate interface event information has not been traversed in full, the candidate interface event information that has not been traversed is screened out from the multiple first candidate interface event information as the second candidate interface event information. For example, the multiple first candidate interface event information includes the first candidate interface event information A, the first candidate interface event information B, the first candidate interface event information C, the first candidate interface event information D and the first candidate interface event information E. If the first candidate interface event information A and the first candidate interface event information B have been traversed, and the first candidate interface event information C, the first candidate interface event information D and the first candidate interface event information E have not been traversed, then it is determined that the second candidate interface event information includes the first candidate interface event information C, the first candidate interface event information D and the first candidate interface event information E.

[0079] Step S303: input the second candidate interface event information into the first prediction model, and output the first interface event information through the first prediction model.

[0080] In a specific embodiment, the first prediction model is a pre-trained network model for filtering out the first interface event information from the second candidate interface event information. The first prediction model is obtained by training a preset first network model based on a first training sample set. The first prediction model can adopt convolutional neural networks (CNN), deconvolutional neural networks (DN), deep neural networks (DNN), etc., which are not limited in this embodiment.

[0081] In this embodiment, if multiple first candidate interface event information have not been traversed in full, the interface event information that has not been traversed among the multiple first candidate interface event information is input into the first prediction model. The first prediction model can filter out the first interface event information from the interface event information that has not been traversed based on the contribution degree of the interface event corresponding to the interface event information to the page coverage, thereby improving the page coverage of the application test.

[0082] Optionally, the first training sample set includes multiple first training samples and first label interface event information corresponding to each first training sample, and the first prediction model is obtained by the following steps: inputting multiple first training samples into a preset first network model, and outputting the first prediction interface event information corresponding to each first training sample through the preset first network model; determining the first loss value based on the first label interface event information, the first prediction interface event information and the loss function of the preset first network model; if the first loss value does not meet the preset first condition, correcting the model parameters of the preset first network model based on the preset first parameter learning rate, and continuing to perform the step of inputting multiple first training samples into the preset first network model, and outputting the first prediction interface event information corresponding to each first training sample through the preset first network model, until the first loss value meets the preset first condition. Among them, the first loss value meeting the preset first condition can be that the first loss value is less than the preset first threshold value or the difference between the first loss values ​​obtained twice before and after is less than the preset second threshold value.

[0083] Step S304: If all of the multiple first candidate interface event information are traversed, the multiple first candidate interface event information are input into the second prediction model, and the first interface event information is output through the second prediction model.

[0084] In a specific embodiment, the second prediction model is a pre-trained network model for screening out first interface event information from multiple first candidate interface event information. The second prediction model is obtained by training a preset second network model based on a second training sample set. The second prediction model can adopt convolutional neural networks (CNN), deconvolutional neural networks (DN), deep neural networks (DNN), etc., which are not limited in this embodiment.

[0085] Optionally, the second training sample set includes multiple second training samples and second label interface event information corresponding to each second training sample, and the second prediction model is obtained by the following steps: inputting multiple second training samples into a preset second network model, and outputting the second prediction interface event information corresponding to each second training sample through the preset second network model; determining the second loss value based on the second label interface event information, the second prediction interface event information and the loss function of the preset second network model; if the second loss value does not meet the preset second condition, correcting the model parameters of the preset second network model based on the preset second parameter learning rate, and continuing to perform the steps of inputting multiple second training samples into the preset second network model, and outputting the second prediction interface event information corresponding to each second training sample through the preset second network model, until the second loss value meets the preset second condition. Among them, the second loss value meeting the preset second condition can be that the second loss value is less than the preset third threshold or the difference between the second loss values ​​obtained twice before and after is less than the preset fourth threshold.

[0086] In a specific implementation, referring to Figure 4 As shown, in the above step S203, based on the first activity component information and the second event list, the interface events corresponding to the tested application are traversed and tested to obtain the test result of the tested application, which may include steps S401 to S405, which are specifically as follows:

[0087] Step S401: Based on the first active component information, determine whether the active component corresponding to the second page is a blacklist component.

[0088] Optionally, the activity component corresponding to the second page is the Activity component to which the second page belongs. Since the first activity component information is information related to the Activity component to which the second page belongs, the Activity component to which the second page belongs can be determined based on the first activity component information, and then it can be determined whether the Activity component to which the second page belongs is a blacklist component.

[0089] Step S402: If the active component corresponding to the second page is a blacklist component or the second event list is empty, continue to execute the step of determining the first interface event information from the first event list until the test time of the application under test reaches the preset time or all interface events corresponding to the application under test are traversed.

[0090] In a specific embodiment, if the Activity component corresponding to the second page is a blacklist component or the second event list is empty, continue to execute the step of determining the first interface event information from the first event list in step S201 until the test time of the application under test reaches the preset time or all interface events corresponding to the application under test are traversed.

[0091] Step S403: If the active component corresponding to the second page is not a blacklist component and the second event list is not empty, determine the second interface event information from the second event list.

[0092] In this embodiment, the second interface event information is the interface event information filtered out from the second event list. If the active component corresponding to the second page is not a blacklist component and the second event list is not empty, the second interface event information is filtered out from the second event list, and the interface events corresponding to the application under test are traversed and tested based on the second interface event information.

[0093] In a specific embodiment, the second event list includes multiple third candidate interface event information, and the step of determining the second interface event information from the second event list specifically includes: determining the fourth candidate interface event information from multiple third candidate interface event information; judging whether the interface event corresponding to the fourth candidate interface event information is a blacklist event; if the interface event corresponding to the fourth candidate interface event information is a blacklist event, continuing to execute the step of determining the fourth candidate interface event information from multiple third candidate interface event information until the interface event corresponding to the fourth candidate interface event information is not a blacklist event; and determining the fourth candidate interface event information as the second interface event information.

[0094] Optionally, the step of determining the fourth candidate interface event information from multiple third candidate interface event information specifically includes: determining whether all the multiple third candidate interface event information are traversed; if all the multiple third candidate interface events are not traversed, determining the fifth candidate interface event information from the multiple third candidate interface event information; the fifth candidate interface event information is the interface event information that has not been traversed among the multiple third candidate interface event information; inputting the fifth candidate interface event information into the first prediction model, and outputting the fourth candidate interface event information through the first prediction model; if all the multiple third candidate interface events are traversed, inputting the multiple third candidate interface event information into the second prediction model, and outputting the fourth candidate interface event information through the second prediction model.

[0095] Step S404: Send the second interface event information to the client device, and receive the second event set information corresponding to the third page of the tested application returned by the client device based on the second interface event information.

[0096] In a specific embodiment, the second event collection information is a super event collection corresponding to the third page of the application under test, and the second event collection information includes second activity component information corresponding to the third page and a third event list corresponding to the third page. After the server device sends the second interface event information to the client device, the client device can execute the interface event corresponding to the second interface event information and enter the third page corresponding to the second interface event information, and return the second event collection information corresponding to the third page of the application under test to the server device.

[0097] Step S405: Perform a traversal test on the interface events corresponding to the application under test based on the second activity component information and the third event list to obtain a test result of the application under test.

[0098] In a specific embodiment, the interface events corresponding to the tested application are traversed and tested based on the second active component information and the third event list, and the steps of obtaining the test results of the tested application specifically include: based on the second active component information, determining whether the active component corresponding to the third page is a blacklist component; if the active component corresponding to the third page is a blacklist component or the third event list is empty, continuing to execute the step of determining the first interface event information from the first event list until the test time of the tested application reaches the preset time or all the interface events corresponding to the tested application are traversed; if the active component corresponding to the third page is not a blacklist component and the third event list is not empty, determining the third interface event information from the third event list; sending the third interface event information to the client, and receiving the third event collection information corresponding to the fourth page of the tested application returned by the client based on the third interface event information; the third event collection information includes the fourth active component information corresponding to the fourth page and the fourth event list corresponding to the fourth page; based on the fourth active component information and the fourth event list, the interface events corresponding to the tested application are traversed and tested to obtain the test results of the tested application, and such a cycle can realize the traversal test of the pages of the tested application.

[0099] In a specific implementation, the test results include the first page number of tested pages of the application under test. In the above step S203, the interface events corresponding to the application under test are traversed and tested based on the first active component information and the second event list. After obtaining the test results of the application under test, it includes: obtaining the second page number of the application under test; the second page number is the total number of pages of the application under test; based on the first page number and the second page number, determining the test coverage of the application under test.

[0100] Among them, the process of determining the test coverage can be expressed as: S represents the test coverage, N1 represents the number of first pages, and N2 represents the number of second pages.

[0101] In a specific implementation, the test result also includes test data. After the interface events corresponding to the tested application are traversed and tested based on the first activity component information and the second event list in the above step S203 to obtain the test result of the tested application, the following further includes: performing data analysis on the test data to obtain a number of candidate keyword information of the first test data; matching the several candidate keyword information with the several benchmark keyword information, and determining the fault information of the tested application based on the matching results of the several candidate keyword information with the several benchmark keyword information. Among them, the several benchmark keyword information is a pre-set keyword used to measure whether the tested application has a fault, and the several benchmark keyword information is not limited to ANRin, FATAL EXCEPTION, F DEBUG, REBOOT, etc.

[0102] In order to better implement the application test method in the embodiment of the present application, based on the application test method, an application test device is also provided in the embodiment of the present application, such as Figure 5 As shown, the application testing device 700 includes:

[0103] An information acquisition module 710 is used to acquire a first event list corresponding to a first page of the application under test, and determine first interface event information from the first event list;

[0104] The event determination module 720 is used to send the first interface event information to the client device, and receive the first event collection information corresponding to the second page of the tested application returned by the client device based on the first interface event information; the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page;

[0105] The traversal test module 730 is used to perform a traversal test on the interface events corresponding to the application under test based on the first activity component information and the second event list to obtain the test result of the application under test.

[0106] In an embodiment of the present application, the server device determines the first interface event information from the first event list, sends the first interface event information to the client device, and receives the first event collection information corresponding to the second page of the application under test returned by the client device based on the first interface event information. Based on the first active component information in the first event collection information and the second event list, a traversal test is performed on the interface events corresponding to the application under test. This can avoid many invalid test operations caused by random operations of the client device and improve the page coverage of the application test.

[0107] In some embodiments of the present application, the information acquisition module 710 acquires a first event list corresponding to a first page of the tested application, including:

[0108] Obtaining a list of active components of the application under test, and determining information about a third active component from the list of active components;

[0109] The third activity component information is sent to the client device, and a first event list corresponding to the first page returned by the client device based on the third activity component information is received.

[0110] In some embodiments of the present application, the first event list includes a plurality of first candidate interface event information, and the information acquisition module 710 determines the first interface event information from the first event list, including:

[0111] Determine whether all of the first candidate interface event information has been traversed;

[0112] If the plurality of first candidate interface event information have not been traversed in full, second candidate interface event information is determined from the plurality of first candidate interface event information; the second candidate interface event information is the interface event information that has not been traversed in the plurality of first candidate interface event information;

[0113] Inputting the second candidate interface event information into the first prediction model, and outputting the first interface event information through the first prediction model;

[0114] If all of the multiple first candidate interface event information are traversed, the multiple first candidate interface event information are input into the second prediction model, and the first interface event information is output through the second prediction model.

[0115] In some embodiments of the present application, the traversal test module 730 performs a traversal test on the interface events corresponding to the tested application based on the first activity component information and the second event list to obtain a test result of the tested application, including:

[0116] Based on the first activity component information, determining whether the activity component corresponding to the second page is a blacklist component;

[0117] If the active component corresponding to the second page is a blacklist component or the second event list is empty, continue to execute the step of determining the first interface event information from the first event list until the test time of the application under test reaches the preset time or all interface events corresponding to the application under test are traversed.

[0118] In some embodiments of the present application, after the traversal test module 730 determines whether the active component corresponding to the second page is a blacklist component based on the first active component information, the traversal test module 730 is further configured to:

[0119] If the active component corresponding to the second page is not a blacklist component and the second event list is not empty, determining the second interface event information from the second event list;

[0120] Send the second interface event information to the client device, and receive the second event collection information corresponding to the third page of the tested application returned by the client device based on the second interface event information; the second event collection information includes the second activity component information corresponding to the third page and the third event list corresponding to the third page;

[0121] Based on the second activity component information and the third event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

[0122] In some embodiments of the present application, the second event list includes a plurality of third candidate interface event information, and the traversal test module 730 determines the second interface event information from the second event list, including:

[0123] Determine fourth candidate interface event information from multiple third candidate interface event information;

[0124] Determine whether the interface event corresponding to the fourth candidate interface event information is a blacklist event;

[0125] If the interface event corresponding to the fourth candidate interface event information is a blacklist event, continue to perform the step of determining the fourth candidate interface event information from the plurality of third candidate interface event information until the interface event corresponding to the fourth candidate interface event information is not a blacklist event;

[0126] The fourth candidate interface event information is determined as the second interface event information.

[0127] In some embodiments of the present application, the test result includes the first page number of the tested application's tested pages. The traversal test module 730 performs a traversal test on the interface events corresponding to the tested application based on the first activity component information and the second event list. After obtaining the test result of the tested application, the traversal test module 730 is further used to:

[0128] Obtain the number of second pages of the application under test; the number of second pages is the total number of pages of the application under test;

[0129] Based on the first number of pages and the second number of pages, a test coverage of the application under test is determined.

[0130] The embodiment of the present application further provides a computer device, which integrates any application testing device provided in the embodiment of the present application, and the computer device includes:

[0131] one or more processors;

[0132] Memory; and

[0133] One or more applications, wherein the one or more applications are stored in a memory and are configured to be executed by a processor to execute the steps of the application testing method in any of the above application testing method embodiments.

[0134] The present application also provides a computer device that integrates any application testing device provided in the present application. Figure 6 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:

[0135] The computer device may include one or more processing core processors 801, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Figure 6 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0136] The processor 801 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.

[0137] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.

[0138] The computer device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0139] The computer device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0140] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:

[0141] Obtaining a first event list corresponding to a first page of the application under test, and determining first interface event information from the first event list;

[0142] Sending the first interface event information to the client device, and receiving the first event collection information corresponding to the second page of the tested application returned by the client device based on the first interface event information; the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page;

[0143] Based on the first activity component information and the second event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

[0144] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0145] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any application test method provided in the embodiment of the present application. For example, the computer program is loaded by a processor to execute the following steps:

[0146] Obtaining a first event list corresponding to a first page of the application under test, and determining first interface event information from the first event list;

[0147] Sending the first interface event information to the client device, and receiving the first event collection information corresponding to the second page of the tested application returned by the client device based on the first interface event information; the first event collection information includes the first activity component information corresponding to the second page and the second event list corresponding to the second page;

[0148] Based on the first activity component information and the second event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

[0149] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0150] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0151] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0152] The above is a detailed introduction to an application testing method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An application testing method, characterized in that: include: Obtaining a first event list corresponding to a first page of the application under test, and determining first interface event information from the first event list; Sending the first interface event information to a client device, and receiving first event set information corresponding to the second page of the tested application returned by the client device based on the first interface event information; The first event collection information includes first activity component information corresponding to the second page and a second event list corresponding to the second page; Based on the first activity component information and the second event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

2. The method according to claim 1, characterized in that The first event list includes a plurality of first candidate interface event information, and determining the first interface event information from the first event list includes: Determining whether all of the first candidate interface event information are traversed; If the plurality of first candidate interface event information have not been traversed in full, determining the second candidate interface event information from the plurality of first candidate interface event information; the second candidate interface event information is the interface event information that has not been traversed in the plurality of first candidate interface event information; Inputting the second candidate interface event information into a first prediction model, and outputting the first interface event information through the first prediction model; If all of the first candidate interface event information are traversed, the first candidate interface event information are input into a second prediction model, and the first interface event information is output through the second prediction model.

3. The method according to claim 1, characterized in that The traversal test of the interface events corresponding to the application under test based on the first activity component information and the second event list to obtain the test result of the application under test includes: Based on the first activity component information, determining whether the activity component corresponding to the second page is a blacklist component; If the active component corresponding to the second page is a blacklist component or the second event list is empty, continue to execute the step of determining the first interface event information from the first event list until the test time of the application under test reaches the preset time or all interface events corresponding to the application under test are traversed.

4. The method according to claim 3, characterized in that After determining whether the activity component corresponding to the second page is a blacklist component based on the first activity component information, the method further includes: If the active component corresponding to the second page is not a blacklist component and the second event list is not empty, determining the second interface event information from the second event list; Sending the second interface event information to the client device, and receiving the second event collection information corresponding to the third page of the tested application returned by the client device based on the second interface event information; the second event collection information includes the second activity component information corresponding to the third page and the third event list corresponding to the third page; Based on the second activity component information and the third event list, a traversal test is performed on the interface events corresponding to the application under test to obtain a test result of the application under test.

5. The method according to claim 4, characterized in that The second event list includes a plurality of third candidate interface event information, and determining the second interface event information from the second event list includes: Determine fourth candidate interface event information from the plurality of third candidate interface event information; Determine whether the interface event corresponding to the fourth candidate interface event information is a blacklist event; If the interface event corresponding to the fourth candidate interface event information is a blacklist event, continue to execute the step of determining the fourth candidate interface event information from the plurality of third candidate interface event information until the interface event corresponding to the fourth candidate interface event information is not a blacklist event; The fourth candidate interface event information is determined as the second interface event information.

6. The method according to claim 1, characterized in that The obtaining a first event list corresponding to the first page of the tested application includes: Obtaining a list of active components of the application under test, and determining third active component information from the list of active components; The third activity component information is sent to the client device, and a first event list corresponding to the first page returned by the client device based on the third activity component information is received.

7. The method according to any one of claims 1 to 6, characterized in that: The test result includes a first page number of tested pages of the application under test, and after the interface events corresponding to the application under test are traversed and tested based on the first activity component information and the second event list and the test result of the application under test is obtained, the method includes: Acquire the second page quantity of the application under test; the second page quantity is the total page quantity of the application under test; Based on the first number of pages and the second number of pages, a test coverage of the application under test is determined.

8. An application testing device, characterized in that: include: An information acquisition module, used to acquire a first event list corresponding to a first page of the tested application, and determine first interface event information from the first event list; An event determination module, configured to send the first interface event information to a client device, and receive first event set information corresponding to the second page of the tested application returned by the client device based on the first interface event information; The first event collection information includes first activity component information corresponding to the second page and a second event list corresponding to the second page; The traversal test module is used to perform a traversal test on the interface events corresponding to the application under test based on the first activity component information and the second event list to obtain the test result of the application under test.

9. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; and One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the application testing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the application testing method according to any one of claims 1 to 7.