Application program testing method and device

By obtaining the application's page data to be tested and generating and controlling the display time test page, the problem of incomplete testing in the existing technology is solved and more reliable test results are achieved.

CN120386713APending Publication Date: 2025-07-29BEIJING AUTONAVI YUNMAP TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410102788.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The stability test of applications in the prior art has problems such as inability to cover pages with deep buried paths and the residence time is too short, resulting in incomplete test results and insufficient reliability.

Method used

By obtaining test-related data of the application's page to be tested, generating a test page, and controlling the display of the page according to the preset display time, obtaining the detection results, and directly conducting a certain duration of tests on each page to avoid the problem of deep burying paths or short access time.

Benefits of technology

Improve the reliability of application test results, ensuring that each page is fully tested, with a wider coverage and more accurate test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386713A_ABST
    Figure CN120386713A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an application program test method and device, and the method comprises the steps: obtaining test related data of to-be-tested pages of an application program, and enabling one to-be-tested page to correspond to one test related data; for a to-be-tested page, the following steps are executed: generating a test page according to the test related data of the to-be-tested page. And controlling the display duration of the test page according to a preset display duration. And in the display process of the test page, obtaining a detection result of the test page as a detection result of the to-be-tested page. And determining a test result of the application program according to the detection results of all the to-be-tested pages of the application program. According to the method and the device, the test of a certain duration can be carried out from the perspective of each independent test page, so that the problems that access cannot be realized due to a relatively deep buried path of the page and the access time of a single page is too short can be effectively avoided, and the reliability of a test result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to computer technology, and more particularly to a method and apparatus for testing an application program. Background Art

[0002] With the popularity of smart terminals and the increasing complexity of application functions and interaction methods, stability testing of applications before release is becoming increasingly important.

[0003] Currently, the common approach in related technologies is to inject random events into applications using testing tools to perform stability tests on application pages, functions, and interactions. However, this approach relies on random clicks and jumps generated by random events, which can result in some pages being untested due to their deep buried paths. Furthermore, this testing approach typically only allows for a short time spent on a page, making it impossible to fully test the page's functions and interactions.

[0004] Therefore, it is necessary to provide a technical solution that can comprehensively test the application program to improve the reliability of the test results. Summary of the Invention

[0005] The embodiments of the present application provide an application testing method and apparatus to improve the reliability of test results.

[0006] In a first aspect, an embodiment of the present application provides an application testing method, comprising:

[0007] Acquire test-related data of a page to be tested of the application, where each page to be tested corresponds to one piece of test-related data;

[0008] For a page to be tested, perform the following steps:

[0009] Generate a test page based on the test-related data of the page to be tested;

[0010] Control the display time of the test page according to the preset display time;

[0011] During the display of the test page, obtaining the detection result of the test page as the detection result of the page to be tested;

[0012] The test result of the application is determined according to the detection results of all pages to be tested of the application.

[0013] In a second aspect, an embodiment of the present application provides an application testing method, comprising:

[0014] Receive page retrieval request;

[0015] Determine a page to be tested from the alternative pages stored locally according to the page acquisition request, and obtain the test-related data of the page to be tested;

[0016] Return response data for the request, where the response data includes: the test-related data of the page to be tested, so that the application will display the test page generated according to the test-related data for a preset display duration, and obtain the detection result of the test page during the display process.

[0017] In a third aspect, an embodiment of the present application provides an application testing device, including:

[0018] An acquisition unit, configured to acquire the test-related data of the page to be tested of the application, and one page to be tested corresponds to one copy of test-related data;

[0019] A processing module, configured to perform the following steps for one page to be tested:

[0020] Generate a test page according to the test-related data of the page to be tested;

[0021] Control the display duration of the test page according to a preset display duration;

[0022] During the display process of the test page, obtain the detection result of the test page as the detection result of the page to be tested;

[0023] Determine the test result of the application according to the detection results of all pages to be tested of the application.

[0024] In a fourth aspect, an embodiment of the present application provides an application testing device, including:

[0025] A transceiver unit, configured to receive a page acquisition request;

[0026] A determination unit, configured to determine a page to be tested from the alternative pages stored locally according to the page acquisition request, and obtain the test-related data of the page to be tested;

[0027] The transceiver unit is further configured to return response data for the request, where the response data includes: the test-related data of the page to be tested, so that the application will display the test page generated according to the test-related data for a preset display duration, and obtain the detection result of the test page during the display process.

[0028] In a fifth aspect, an embodiment of the present application provides an electronic device, including:

[0029] A memory, configured to store programs;

[0030] A processor is configured to execute the program stored in the memory. When the program is executed, the processor is configured to execute the methods described in the first aspect and the second aspect above.

[0031] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions that, when running on a computer, cause the computer to execute the methods described in the first aspect and the second aspect above.

[0032] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in the first aspect and the second aspect above.

[0033] An embodiment of the present application provides a method and apparatus for testing an application program. The method includes: obtaining test-related data of a page to be tested of the application program, where one page to be tested corresponds to one set of test-related data. For a page to be tested, perform the following steps: generate a test page according to the test-related data of the page to be tested. Control the display duration of the test page according to a preset display duration. During the display process of the test page, obtain the detection result of the test page as the detection result of the page to be tested. Determine the test result of the application program according to the detection results of all pages to be tested of the application program. By directly obtaining the test-related data of multiple pages to be tested, then restoring the pages to be tested according to the test-related data of the pages to be tested, and respectively displaying each test page for a preset display duration, and detecting whether there is an abnormality in the test page during the display process, it is possible to perform a test for a certain duration from the perspective of each independent test page itself. Therefore, it is possible to effectively avoid the problems that the buried path of the page is too deep to be accessed and the access time for a single page is too short, thereby improving the reliability of the test result. Description of the Drawings

[0034] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0035] Figure 1 It is a schematic diagram of the interface for testing an application program provided by an embodiment of the present application;

[0036] Figure 2 It is a schematic diagram of the structure of an application program test system provided by an embodiment of the present application;

[0037] Figure 3 It is a flowchart of the method for testing an application program provided by an embodiment of the present application;

[0038] Figure 4 Schematic diagram of the display test page provided by the embodiment of the present application;

[0039] Figure 5 Flow chart of the application test method provided by the embodiment of the present application Figure 2 ;

[0040] Figure 6 Schematic diagram of multiple alternative pages corresponding to the same page identifier provided by the embodiment of the present application;

[0041] Figure 7 Schematic diagram of preferentially selecting the new version page provided by the embodiment of the present application;

[0042] Figure 8 Schematic diagram of realizing the determination of the first quantity provided by the embodiment of the present application;

[0043] Figure 9 Schematic diagram of realizing the determination of the second quantity provided by the embodiment of the present application;

[0044] Figure 10 Schematic diagram of the page coverage rate provided by the embodiment of the present application;

[0045] Figure 11 Structural schematic diagram of the application test device provided by the embodiment of the present application Figure 1 ;

[0046] Figure 12 Structural schematic diagram of the application test device provided by the embodiment of the present application Figure 2 ;

[0047] Figure 13 Hardware structure schematic diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners

[0048] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0049] To better understand the technical solutions of the present application, the related technologies involved in the present application will be further introduced in detail below.

[0050] With the popularization of smart terminals and the increasing complexity of the functions and interaction methods of applications, the stability testing before the release of applications has become increasingly important. Through testing, pages or functions with abnormal stability in the application can be identified and repaired specifically, thereby effectively improving the stability of the application.

[0051] Currently, in related technologies, stability testing of the pages, functions, interactions, etc. of an application is usually carried out by injecting random events into the application through a testing tool. The random events can include randomly clicking, swiping, inputting data, etc. in the application, so as to traverse the test points in an exhaustive manner, thereby realizing the testing of the application.

[0052] For example, it can be combined with Figure 1 for understanding. Figure 1 The following is a schematic diagram of the interface for testing the application provided by the embodiments of the present application. Assume Figure 1 The interface (a) shown is the initial interface at the start of the test, which includes multiple controls. The testing tool can inject random events into the application. For example, randomly click in the interface (a). If the "Food" control is clicked, then the corresponding detailed food interface can be jumped and displayed later. The detailed food interface can, for example, refer to Figure 1 the interface (b) in, which also includes multiple controls.

[0053] After that, the testing tool can continue to inject random events into the application. For example, randomly swipe the interface (b). Assume an upward swipe operation is performed, then the further detailed food interface shown in (c) in Figure 1 can be displayed later.

[0054] In the actual implementation process, the random events injected into the application are randomly generated. Therefore, how the interfaces in the application will specifically jump and which interfaces will be specifically tested depend on the random operations.

[0055] Therefore, this implementation method has the following defects: Defect 1: Since the page is triggered and displayed depending on random operations, for some pages with a deep buried path or a complex jump path, there will be a problem that they cannot be triggered and displayed all the time, which will lead to the lack of page coverage in stability testing. Defect 2: Triggering the display and jump of the page through random operations often stays on a page for a very short time, so that the functions and interactions of the page cannot be comprehensively verified. For example, some pages need a period of time to display a pop-up window, or the user needs to read the content of the pop-up window. Then, a short stay time cannot effectively verify this part of the functions and interactions, which will lead to the lack of function coverage in stability testing.

[0056] In another possible implementation, it is also possible to perform a depth-first traversal of the operation path and scenario to achieve exhaustive test points.

[0057] In this implementation, for example, when performing a depth-first traversal of the operation path, for each page accessed, it is possible to continuously access the deeper page until reaching the bottom page, that is, there is no next lower page, and then return to the previous layer and repeat the above operation. Or, when performing a depth-first traversal of a certain scenario, among the clickable controls on the page, the controls corresponding to the specified scenario can be preferentially clicked. For example, for the scenario of "food", the corresponding "food" controls on the page can be preferentially clicked and continuously accessed to the lower layer until reaching the bottom page.

[0058] Using this depth-first traversal implementation, it is possible to access pages with deeper buried paths or more complex jump paths, but it also has the following defects:

[0059] Defect 1: Using the depth-first traversal method can effectively access interfaces with deeper buried paths, but in the case of limited resources, it cannot cover the breadth of test pages, resulting in incomplete coverage of multi-category pages.

[0060] Here, a brief introduction to multi-category pages is given. A multi-category page can be understood as an application providing an initial page framework, and then different specific pages of different categories are rendered according to the obtained different page contents. For example, in the evaluation page, if the relevant evaluation information of the "food" category is passed in, a food-related evaluation page is obtained; if the relevant evaluation information of the "accommodation" category is passed in, an accommodation-related evaluation page is obtained. Another example is the details page, the complaint page, etc., which are all similar.

[0061] The specific settings of multi-category pages can be implemented according to actual needs. Generally speaking, multi-category pages can render different specific pages corresponding to different categories according to the passed-in page contents of different categories, and the overall framework and structure of each page are the same.

[0062] Based on the above introduction, it can be understood that the application can be pre-set with a fixed number of pages, including some multi-category pages. Any multi-category page is a separate preset page, and then for each multi-category page, according to the different page contents passed in, multiple different test pages can be obtained, but the page identifiers corresponding to these test pages are the same.

[0063] So for example, for the above Figure 1In the case illustrated in (a) below, assuming that the preset categories in the application include accommodation, dining, shopping, etc., a relatively comprehensive test can be conducted on the pages under certain categories by using the depth-first traversal method to achieve the test of some categories corresponding to the multi-category pages. However, on the premise of limited processing resources, it is impossible to cover and test all the specific pages of all categories under the multi-category pages.

[0064] Defect 2: During the depth-first traversal process, it is difficult to reach the underlying pages without a set of access paths. However, the access paths to reach the underlying pages span multiple processing modules. Therefore, it is difficult to achieve precise testing for changes in a certain module and lacks the ability to put into production.

[0065] To address the above-described technical problems, the present application proposes the following technical concept: For a developed application, the number of pages it contains is actually fixed. Then, we can access the pages not from the perspective of page jumps, but directly obtain multiple pages to be tested, and then conduct continuous testing for a certain period of time for each page to be tested, thereby effectively solving the problem of poor stability test results caused by deep-buried pages and short access times. Moreover, when selecting the pages to be tested, the corresponding selection strategy can be configured to specifically address the problem of weak multi-category coverage and the inability to achieve precise testing for a certain module described above.

[0066] Based on this technical concept, the application testing method provided by the present application will be introduced below. First, in combination with Figure 2 the system architecture of the application testing method provided by the present application will be described. Figure 2 FIG. is a schematic structural diagram of the application testing system provided by the embodiments of the present application.

[0067] As Figure 2 shown, the system includes an application and a server. The application can request pages to be tested from the server. The server, in response to the request of the application, determines multiple pages to be tested and sends the test-related data of the multiple pages to be tested to the application. Then, the application can conduct tests for a certain period of time for each page to be tested based on the test-related data of each page to be tested to obtain the test results of the application.

[0068] The application program in this embodiment corresponds to the server and is a program that provides local services to customers. The application program can also become a client. For example, it can be a web client or a mobile client, etc. This embodiment does not limit this. In addition, the application program can run on a terminal device, which can be a smart phone, a personal computer, a tablet computer, a vehicle-mounted terminal, etc. This embodiment does not limit the implementation of the specific device on which the application program runs.

[0069] Therefore, the application program testing method provided in this application involves the operations of the application program and the server. The implementations of the application program and the server will be introduced separately below.

[0070] First, the implementation on the application program side will be described. Figure 3 It is a flowchart of the application program testing method provided in an embodiment of this application.

[0071] As Figure 3 shown, the method includes:

[0072] S301. Obtain the test-related data of the page to be tested of the application program. One page to be tested corresponds to one set of test-related data.

[0073] In this embodiment, the application program can directly obtain the test-related data of multiple pages to be tested. The test-related data can include the access address of the page to be tested and the filled content in the page to be tested. Therefore, according to the test-related data of the page to be tested, a specific test page can be directly restored. In the actual implementation process, the specific implementation of the test-related data can be extended according to actual needs. This embodiment does not make special limitations on the content it contains.

[0074] The access address can be, for example, a url (Uniform Resource Locator) address, or it can also be an address preset for the page. This embodiment does not limit the specific implementation of the access address as long as it can access the corresponding page.

[0075] In a possible implementation manner, the application program can, for example, send a page acquisition request to the server, and thus receive the test-related data of multiple pages to be tested sent by the server in response to the page acquisition request. Or, the server can also actively send the test-related data of multiple pages to be tested to the application program according to the test configuration.

[0076] In this embodiment, the application receives the test-related data of each page to be tested. The test process of each page to be tested is independent. That is to say, in this embodiment, the corresponding test is directly performed on the page to be tested according to the obtained test-related data, without relying on page jumps to access the corresponding page.

[0077] Therefore, in this embodiment, test operations can be performed separately for each page to be tested. Taking any page to be tested as an example for illustration below, the test implementation of each page to be tested is similar.

[0078] Specifically, in this embodiment, for any page to be tested, the following steps S302 to S304 can be executed.

[0079] S302. Generate a test page according to the test-related data of the page to be tested.

[0080] After obtaining the test-related data of the page to be tested, for example, the page to be tested can be restored first according to the test-related data of the page to be tested, so as to generate a test page.

[0081] S303. Control the display duration of the test page according to a preset display duration.

[0082] In order to overcome the problem that the page cannot be comprehensively tested due to the short stay time on the page, a preset display duration can be set in this embodiment. Then, the display duration of the test page can be controlled according to the preset display duration. For example, the display duration of the test page can be controlled to reach the preset display duration, or the display duration of the test page can also be controlled to be not less than the preset display duration.

[0083] By controlling the display duration of the test page according to the preset display duration, it is possible to determine the possible interactions on the page, etc., and there is enough time to process and respond, so as to effectively achieve a comprehensive test of each test page.

[0084] The specific setting of the preset display duration can be selected according to actual needs. For example, the preset display duration can be set to 4 minutes, and it is necessary to ensure that each test page is displayed for at least 4 minutes.

[0085] S304. During the display process of the test page, obtain the detection result of the test page as the detection result of the page to be tested.

[0086] During the process of displaying the test page for a preset display duration, actual detection operations need to be performed on the test page to achieve the stability test of the page. Therefore, in this embodiment, during the display process of the test page, it can be detected whether the test page has any abnormalities, so as to obtain the detection result of the test page. The detection result can indicate that the test page has abnormalities, or the detection result can indicate that the test page has no abnormalities. This embodiment does not limit this.

[0087] Among them, during the process of detecting whether the test page has any abnormalities, for example, it can be detected whether the display effect of the test page is normal, and a series of operations can also be performed on the test page to detect whether these operations will cause abnormalities in the test page. In the actual implementation process, during the display process of the test page, the specific detection processing and measurement detection indicators performed on the test page can be selected and set according to actual needs.

[0088] After determining the detection result of the test page, the detection result of the test page can be further used as the detection result of the page to be tested.

[0089] S305. Determine the test result of the application program according to the detection results of all pages to be tested of the application program.

[0090] After determining the detection results for each page to be tested respectively, it can be determined that the current detection process for the pages to be tested ends. Then, according to the detection results corresponding to each page to be tested of the application program, the test result of the application program can be determined.

[0091] Among them, the test result can simply include the detection results corresponding to each page to be tested respectively, or further analysis can be performed on the detection results corresponding to each page to be tested respectively to obtain the test result of the application program. For example, the page abnormality rate can be determined according to the detection results corresponding to each page to be tested respectively, and the page abnormality rate can be included in the test result. Another example is that the number of pages to be tested corresponding to each type of abnormality can be determined according to the detection results corresponding to each page to be tested respectively, and the number of pages to be tested corresponding to each type of abnormality can be included in the test result.

[0092] In the actual implementation process, the specific content included in the test result of the application program can be selected and set according to actual needs, which depends on what specific parameters are needed to characterize the test result of the application program, as long as the test result is obtained by analyzing the detection results corresponding to each page to be tested respectively.

[0093] The application program testing method provided by the embodiments of the present application includes: obtaining test-related data of the to-be-tested pages of the application program, where one to-be-tested page corresponds to one set of test-related data. For one to-be-tested page, the following steps are executed: generating a test page according to the test-related data of the to-be-tested page; controlling the display duration of the test page according to a preset display duration; during the display process of the test page, obtaining the detection result of the test page as the detection result of the to-be-tested page; and determining the test result of the application program according to the detection results of all the to-be-tested pages of the application program. By directly obtaining the test-related data of multiple to-be-tested pages, then restoring the to-be-tested pages according to the test-related data of the to-be-tested pages, and respectively displaying each test page for a preset display duration, and detecting whether there is an abnormality in the test page during the display process, it is possible to perform tests for a certain duration from the perspective of each independent test page itself. Therefore, it is possible to effectively avoid the problems that the buried path of the page is too deep to be accessed and the access time for a single page is too short, thereby improving the reliability of the test result.

[0094] Based on the above introduction, the following further details the specific implementation of displaying the test page in combination with Figure 4 to further introduce the specific implementation of displaying the test page in detail. Figure 4 It is a schematic diagram of displaying the test page provided by the embodiments of the present application.

[0095] In this embodiment, the test-related data of the to-be-tested page may include the page address and the page filling content. When displaying the test page according to the test-related data, the initial page can be opened first according to the page address of the to-be-tested page.

[0096] However, it can be understood that the page content of the initial page opened according to the page address of the to-be-tested page is in an initialized state, that is, the parts that need to be operated or filled by the user in the page content are in an unprocessed initial state. However, the to-be-tested pages received by the application program in this embodiment are all pages collected during the actual test process. Therefore, each to-be-tested page also corresponds to its own corresponding page filling content. Then, in order to completely restore the scene of the to-be-tested page, in this embodiment, the corresponding positions in the initial page can be filled with data according to the page filling content of the to-be-tested page, so as to realize the complete display of the received to-be-tested page. In this embodiment, the page with the restored page filling content is called the test page.

[0097] After the test page is displayed, the display duration of the test page can be controlled according to the preset display duration set in advance.

[0098] It can be combined with Figure 4 to further understand the initial page and the page filling content introduced above, as Figure 4As shown, according to the page address of the page to be tested, assume that the initial page opened is Figure 4 the page (a) in Figure 4 It can be determined that the content in the initial page is in the initial state of initialization and has not been operated.

[0099] After that, according to the page filling content of the page to be tested, data filling can be performed on the corresponding positions in the initial page (a), so as to obtain Figure 4 the test page (b) shown in Figure 4 . "Zhang San" is filled in the input box corresponding to the name, "male" is filled in the input box corresponding to the gender, and "Province A" is filled in the input box corresponding to the address. Thus, the complete content of the test page can be accurately displayed.

[0100] For another example, for the multi-category page introduced above, the initial page opened according to the page address may be a page framework without filling any substantial content. After that, content input needs to be performed on the corresponding page positions according to the page filling content in order to display the complete page. For example, for the evaluation page, which is a multi-category page, different evaluation pages corresponding to different categories are displayed according to different page filling contents. For example, if the page filling content is the relevant content corresponding to accommodation, the evaluation page corresponding to the accommodation category is displayed.

[0101] Based on this, it can be understood that although the number of pages of an application program is fixed, for example, a certain application program contains a total of 200 pages, namely page 1 to page 200. However, for each of these pages, by filling different contents, different test pages can be obtained. And the test pages in this embodiment are actually collected during the test process of a specified type. Therefore, the test pages collected at different times, even if the contents filled in them are exactly the same, are two independent test pages. For example, for page 1, it is tested 10 times during the manual test process, and 10 test pages can be generated.

[0102] Therefore, in this embodiment, by displaying the test page according to the page address and page filling content of the page to be tested, the content of the complete test page can be ensured to be displayed, so as to effectively ensure the comprehensiveness and effectiveness of the test. And in this way, multiple corresponding test pages can exist for the same initial page, so as to effectively ensure that the quantity of test data is sufficient.

[0103] Based on the above-introduced content, the specific implementation of the abnormal detection of the test page during the display process of the test page will be further introduced in detail below.

[0104] In a possible implementation, during the display process of the test page, at least one page operation can be performed on the test page at a preset frequency to detect whether there are any running anomalies on the test page. The running anomalies can include at least one of the following: the application crashes, the page freezes, or the page reports an error.

[0105] Among them, the page operations can include clicking, long-pressing, swiping, switching between portrait and landscape orientations, and switching between the foreground and background, etc. The specific implementation of the page operations is not limited in this embodiment. When performing page operations on the test page at a preset frequency, for example, it can be cycled at a preset frequency and randomly select one of multiple page operations to execute. Or it can also be cycled at a preset frequency and sequentially execute multiple page operations in a preset order. Or for each page operation, a preset frequency can be set separately, and then each page operation is executed at the preset frequency respectively.

[0106] Performing page operations on the test page can simulate the user's operation behavior during the use of the application. During this process, it is detected whether there are any running anomalies on the test page, so as to achieve a comprehensive test of the test page.

[0107] It should be noted that when performing page operations on the test page, it may happen to jump from the current test page to other pages. If other interfaces are displayed, in this embodiment, it will be controlled to jump back to the test page, and during the period when other pages are displayed, the timing of the preset display duration is not carried out. And if during the test, if the above-mentioned situations such as the application crashing, the page freezing, and the page reporting an error occur, resulting in the stop of the display of the test page, in this embodiment, the test page will be redisplayed according to the test-related data of the test page, and according to the already displayed duration and the preset display duration of the test page, the test page will continue to be displayed to ensure that the display duration of the test page meets the preset display duration. Therefore, in this embodiment, it is ensured that each test page is separately displayed for the preset display duration. During this process, each test page is fully tested, so as to effectively ensure the sufficiency and completeness of the test for the test page.

[0108] In addition, during the display process of the test page, the application can also synchronously detect whether there are any display anomalies on the test page. The display anomalies in this embodiment can include at least one of the following: white screen, black screen, landscape orientation anomaly, and inconsistency with the historical version.

[0109] Horizontal screen anomalies refer to abnormalities that occur when the page switches to horizontal display. Inconsistency with historical versions refers to inconsistencies between the screenshot of the current test page and the screenshot of the historical version corresponding to the current test page (for each page identifier, screenshots of the historical version of the test page are stored). In this case, there may be some errors in the display of the test page, which can confirm the existence of an anomaly.

[0110] It can be understood that the operation anomalies in this embodiment reflect some functional anomalies that may occur during the operation of the test page, and the display anomalies reflect some interface anomalies that may occur during the display of the test page.

[0111] After performing the above-described detection, if the test page has the above-described operational anomaly or display anomaly, the test result of the test page can be determined to be abnormal. Alternatively, if the test page has neither the above-described operational anomaly nor the above-described display anomaly, it can be determined that no abnormality has occurred on the test page within the preset display time of the test page, and the test result of the test page can be determined to be abnormal.

[0112] In this embodiment, by ensuring that a sufficient preset display time is displayed for each individual interface, and during the display process, on the one hand, page operations can be performed on the test page to detect whether the function of the test page will have operational abnormalities, and on the other hand, it is also possible to synchronously detect whether there are corresponding display abnormalities in the display of the test page, thereby effectively achieving sufficient detection of the test page to ensure the completeness and adequacy of the test.

[0113] Based on the above introduction, it can be determined that the application can send a page acquisition request to the server, and then receive test-related data of the page to be tested sent by the server in response to the page acquisition request. The content included in the page acquisition request is further introduced in detail below.

[0114] Among them, the page acquisition request is used to request the server to send test-related data of the page to be tested, so some reference data for determining the page to be tested can be provided to the server in the page acquisition request. In one possible implementation, the page acquisition request may include a preset display duration and a total test duration, wherein the preset display duration is a display duration preset for a single page to be tested, that is, how long each page to be tested needs to be tested (or how long it needs to be displayed), and the total test duration refers to the overall duration of the current test. The server can then determine the number of pages to be tested based on the preset display duration and the total test duration.

[0115] For example, if the preset display duration for a single page to be tested is currently set to 4 minutes, and the total test duration is set to 10,000 minutes, then based on these two pieces of information, it can be determined that the number of pages to be tested is 2,500. Subsequently, the application conducts a 4-minute test on each of these 2,500 pages to be tested, thus meeting the requirement that the total test duration reaches 10,000 minutes.

[0116] In the actual implementation process, the above-mentioned preset display duration and total test duration can also be preset in the server. For the content preset in the server, the application does not need to carry it in the page acquisition request.

[0117] Moreover, when the application needs to conduct targeted tests on certain modules, at least one module identifier can be included in the page acquisition request. The module identifier is used to indicate the page to be tested associated with the functional module corresponding to the module identifier. Specifically, there can be an association relationship between the functional module and the page. For example, there is a functional module A whose function is to collect user information, and there are 10 pages in the application that need to collect user information. Then there is an association relationship between these 10 pages and the functional module A.

[0118] Therefore, in this embodiment, by including the module identifier in the page acquisition request, it is thus indicated to the server that the page to be tested associated with the functional module corresponding to the module identifier is currently requested to be acquired.

[0119] In this embodiment, by including the corresponding data in the page acquisition request, some reference information for determining the page to be tested can be provided to the server, so that the server can provide the page to be tested required by the application in a targeted manner, thereby meeting the test requirements of the application.

[0120] Based on the above introduction, the acquisition process of the page to be tested will be further introduced in detail below.

[0121] Multiple alternative pages can be stored in the server to select the page to be tested from the alternative pages according to the test requirements of the application and provide it to the application. However, the alternative pages stored in the server are actually collected during the test process of the application. That is to say, different applications can respectively conduct page acquisition, provide the collected pages to the server for storage, and then the server will provide the page to be tested to the application according to the test requirements of the application.

[0122] In a possible implementation, page collection can be performed during the test process of a preset type of the application. The test process of the preset type can be, for example, manual testing or can also be automated testing. Among them, the test process of the preset type being manual testing is a preferred implementation because there is human intervention in manual testing, and more reasonable and comprehensive pages can be collected.

[0123] During the test process of a preset type for the application, the log data of the test process can be recorded. The log data can include the test-related data of at least one tested page during the test process, and the tested page is the page opened during the test process.

[0124] During the test process, the application will continuously record the log data, and the log data can record the test-related data of each tested page accessed during the test process. After that, the application can send the test-related data of at least one tested page to the server so that the server can use the tested page as an alternative page and save the test-related data of the alternative page. Then, according to the test requirements of the application, the page to be tested can be selected from the alternative pages and provided to the application.

[0125] Among them, when the application performs page collection, for example, the page frame in the application can be used to collect the page opening scene during the test process, so as to obtain the page address and the page filling content. The page frame refers to the underlying support framework of the application, which can record the page address and the page filling content of the tested page, and then the page frame can be called to fully restore the page state.

[0126] And in a possible implementation, in order to ensure the data quality of the alternative pages stored in the server, before sending the test-related data to the server, the application can first perform data filtering on the test-related data of at least one page. Or, it can also be that after the server receives the test-related data sent by the application, the server itself performs data filtering on the test-related data of at least one page.

[0127] Among them, the data filtering process can be, for example, only retaining a part of the same tested page, only retaining a part of the similar tested pages, eliminating the abnormal tested pages, etc. The specific data filtering strategy can be selected and set according to the actual requirements.

[0128] In this embodiment, when the application sends test-related data to the server, it can send the test-related data recorded in the log within the current period in units of a preset period. For example, it can send the test-related data of the previous hour relative to the current moment to the server in units of one hour to achieve hourly reporting of test-related data. In this way, the test-related data collected in the previous preset period can be used for testing in the next preset period to ensure the timeliness and sufficiency of the alternative pages stored in the server.

[0129] In this embodiment, during the test of a preset type of the application, the test-related data of the page under test is collected, and then the test-related data of the page under test collected by the application is provided to the server. The server aggregates the test-related data of the pages under test collected by each application to accumulate a large amount of test-related data, ensuring the rationality and sufficiency of the alternative pages stored in the server. Then, the server determines the page to be tested from the alternative pages and provides it to the application, thereby ensuring the reasonable and effective execution of the test process.

[0130] In an alternative implementation, the application in this application can be developed based on a target engine, where the target engine has high performance close to native applications, supports scalability in terms of capabilities, and has the characteristics of hot update, supporting one set of code, one-end development, one-time testing, and dynamic release. The target engine can support recording only for one end of the Android or iOS side, but both ends can perform playback testing based on the recorded test-related data to effectively improve the test efficiency.

[0131] The above embodiments introduce the related operations of the application in the application test method provided by this application. Next, the related operations of the server will be further introduced in detail in combination with specific embodiments.

[0132] Figure 5 For the flow of the application test method provided by the embodiments of this application Figure 2 , as Figure 5 shown, the method includes:

[0133] S501. Receive a page acquisition request.

[0134] In this embodiment, the server can receive the page acquisition request sent by the application. Similar to the above embodiments, the page acquisition request may include a preset display duration and / or a total test duration, and may also include the module identifier of at least one functional module.

[0135] In the actual implementation process, all relevant data indicating the test requirements of the application can only be carried in the page acquisition request. Therefore, this embodiment does not limit the detailed implementation manner of the specific content included in the page acquisition request.

[0136] S502. According to the page acquisition request, determine the page to be tested among the alternative pages stored locally, and obtain the test-related data of the page to be tested.

[0137] The test-related data of multiple alternative pages is stored in the server. After the server receives the page acquisition request, it can, in response to the page acquisition request, determine multiple pages to be tested among the multiple alternative pages, and obtain the test-related data of the pages to be tested.

[0138] In a possible implementation manner, for example, the preset display duration and / or the total test duration introduced above may be included in the page acquisition request. Then, the server can determine the target number of pages to be tested according to the preset display duration and the preset total duration, and then determine the target number of pages to be tested among the multiple alternative pages stored in the server. The implementation manner is similar to that introduced in the above embodiment and will not be elaborated here.

[0139] S503. Return the response data for the page acquisition request. The response data includes: the test-related data of the page to be tested, so that the application will display the test page generated according to the test-related data for the preset display duration, and obtain the detection result of the test page during the display process.

[0140] Specifically, after the server determines the page to be tested, it can use the test-related data of the page to be tested as the response data, and thus return the response data for the page acquisition request to the application, so that the application performs the test operation introduced in the above embodiment to implement the test of the application.

[0141] The application test method provided by the embodiment of the present application includes: receiving a page acquisition request. According to the page acquisition request, determine the page to be tested among the alternative pages stored locally, and obtain the test-related data of the page to be tested. Return the response data for the request. The response data includes: the test-related data of the page to be tested, so that the application will display the test page generated according to the test-related data for the preset display duration, and obtain the detection result of the test page during the display process. By accumulating a large amount of test-related data of alternative pages in the server, and then according to the page acquisition request sent by the application, providing a certain number of pages to be tested to the application, so that the application performs the stability test process, thereby effectively avoiding the problem that the interface with a relatively deep buried path or difficult to jump and trigger cannot be tested.

[0142] Based on the above introduction, when the server selects a target number of pages to be tested from multiple alternative pages, it can make a selection among the multiple alternative pages based on corresponding strategies.

[0143] In a possible implementation manner, for example, a strategy obtained by combining at least one candidate strategy can be determined as the target strategy. Then, among the alternative pages stored locally, a target number of alternative pages are determined as the pages to be tested according to the target strategy and a preset rule. The preset rule is used to indicate that when there are multiple (for example, more than the target number) alternative pages that meet the target strategy, a target number of them are selected as the candidate pages according to the preset rule.

[0144] Exemplarily, the preset rule can be, for example, random selection, or the preset rule can also be selection in the order from largest to smallest page identifier, or the preset rule can also be selection in the order from smallest to largest page identifier, and so on.

[0145] The following describes the possible candidate strategies for determining the pages to be tested in this embodiment.

[0146] First, in combination with Figure 6 introduce the page identifiers corresponding to each alternative page. Figure 6 FIG. is a schematic diagram of multiple alternative pages corresponding to the same page identifier provided in an embodiment of the present application.

[0147] In this embodiment, each alternative page corresponds to its own page identifier. At the same time, each page identifier can correspond to one or more alternative pages, that is, the page identifier and the alternative page in this embodiment have a one-to-many relationship.

[0148] The page identifier here can be an identifier for distinguishing multiple different fixed pages of an application program, and it can be, for example, the serial number of the page. In one example, for example, an application program contains a total of 200 pages, which are pages 1 to 100 respectively. Then, for example, the corresponding page identifiers can be determined for each of these 200 pages for distinction.

[0149] However, for any page identifier, there can be multiple generated alternative pages. Based on the above introduction, it can be determined that the alternative pages in this embodiment are collected and generated during the testing process of the application program. Therefore, for the same page identifier, different alternative pages will be generated in different testing processes, and the multiple alternative pages corresponding to the same page identifier are independent of each other.

[0150] In combination with Figure 6 for understanding, assume that currently for page 1 with a page identifier of 1, it is Figure 6 the page for user input information as shown in the example.

[0151] Assume that during a certain test, for the information in Page 1, the "Zhang San", "male", and "Province A" shown in (a) of Figure 6 are filled in, then the alternative pages shown in (a) of Figure 6 can be collected.

[0152] For another example, during another test, for the information in Page 1, the "Li Si", "male", and "Province B" shown in (b) of Figure 6 are filled in, then the alternative pages shown in (b) of Figure 6 can be collected.

[0153] For another example, during another test, for the information in Page 1, the "Wang Wu", "male", and "Province C" shown in (c) of Figure 6 are filled in, then the alternative pages shown in (c) of Figure 6 can be collected.

[0154] Combined with the three alternative pages shown in Figure 6 it can be understood that these three alternative pages are all the pages corresponding to Page Identification 1. Therefore, for one page identification, there can be multiple alternative pages.

[0155] And Figure 6 shows that the multiple alternative pages corresponding to the same page identification are different from each other. However, in the actual implementation process, there may also be a situation where different alternative pages corresponding to the same page identification are exactly the same. As long as the different alternative pages are collected separately during different tests, then these alternative pages are completely independent and have nothing to do with their specific content.

[0156] Based on the above-introduced content, the possible candidate strategies for selecting the target number of pages to be tested from multiple alternative pages are described below.

[0157] Strategy 1 (which can also be called the third strategy): For multiple alternative pages corresponding to the same page identification, the priority of the new version of the alternative page is higher than that of the old version of the alternative page.

[0158] This strategy is for selecting the corresponding page to be tested for a certain page identification, and then selecting from the multiple alternative pages corresponding to this page identification. During the specific selection process, the selection can be made according to the relative newness or oldness of the versions.

[0159] For example, it can be understood by referring to Figure 7 which is Figure 7 a schematic diagram for preferentially selecting the new version page provided by the embodiment of the present application.

[0160] As Figure 7 shown, assume that among the multiple alternative pages corresponding to page identifier 1, there are Figure 7 two alternative pages as shown, namely alternative page 1-a and alternative page 1-b. The version number corresponding to alternative page 1-a is 1.0, and the version number corresponding to alternative page 1-b is 2.0.

[0161] If you want to select the page to be tested corresponding to page identifier 1, you need to select from the multiple alternative pages corresponding to page identifier 1. Among them, the version corresponding to alternative page 1-b is a new version compared to the version of alternative page 1-a, so the priority of alternative page 1-b is higher than that of alternative page 1-a.

[0162] In the actual implementation process, for example, the new version and the old version can be determined by comparing the version numbers, or the new version and the old version can be directly marked. This embodiment does not limit this. However, it can be understood that the new version and the old version are relative, and the specific implementation of determining the newness and oldness of the versions of two alternative pages can be selected according to actual needs.

[0163] By aiming at the same page identifier, the priority of the alternative page of the new version is higher than that of the alternative page of the old version, so as to ensure the timeliness and freshness of the determined page to be tested.

[0164] Strategy 2 (which can also be called the first strategy): For any page identifier, according to the proportion of the access quantity of the page corresponding to the page identifier in the total access quantity, select the first quantity of alternative pages from the multiple alternative pages corresponding to the page identifier as the page to be tested, and the ratio of the first quantity to the target quantity is equal to the access quantity proportion.

[0165] Among them, for each page identifier, the access quantity of the page corresponding to it will be counted. Here, the page access quantity refers to the quantity accessed during the test. For example, if the access quantity corresponding to page 1 is 100, it means that page 1 has been accessed 100 times during the test. It can be understood that the larger the page access quantity of a page during the test, the higher the test requirement for this page. Therefore, in this strategy, according to the proportion of the access quantities corresponding to each page identifier in the overall alternative pages, corresponding proportions of page extraction can be performed for different page identifiers to ensure that the higher the test requirement for a page, the more the quantity of the page to be tested extracted.

[0166] Combined with Figure 8 for illustration, Figure 8 is a schematic diagram of the implementation for determining the first quantity provided by the embodiment of this application.

[0167] Assume that the total number of accesses to the current alternative pages is 10,000, that is, the total number of page accesses of all alternative pages sums up to 10,000 times. Then, for each page identifier, its corresponding page access number and the total access number can be used to determine the proportion of the access number corresponding to each page identifier.

[0168] As Figure 8 shown, the page access number corresponding to Page 1 is 100, so its proportion in the total access number of 10,000 is 1%; the page access number corresponding to Page 2 is 200, so its proportion in the total access number of 10,000 is 2%; similarly, the proportion corresponding to Page 3 is 0.5%.

[0169] After determining the proportion of the access number corresponding to each page identifier, the first quantity can be determined for each page identifier respectively, where the first quantity is the number of pages to be tested that need to be selected for the page identifier. In this embodiment, a total of target number of pages to be tested need to be selected. Then, in order to achieve proportional selection, for any page identifier, the ratio of its corresponding first quantity to the target number is equal to its corresponding access proportion.

[0170] Referring to Figure 8 , the access proportion corresponding to Page 1 is 1%, and the target number of pages to be tested to be selected is 1,000. Then it can be determined that the first quantity of the pages to be tested to be selected corresponding to Page 1 is 10. Similarly, it can be determined that the first quantity corresponding to Page 2 is 10, and the first quantity corresponding to Page 3 is 5. In the actual implementation process, if the determined first quantity is not an integer, the first quantity is also processed as an integer by rounding.

[0171] After determining the first quantity corresponding to each page identifier, the first quantity of alternative pages can be selected from the multiple alternative pages corresponding to the page identifier as the pages to be tested.

[0172] And it can be understood that the page access number in this embodiment refers to the number of accesses to the page corresponding to the page identifier during the test process. And referring to the above embodiment, it can be understood that each page accessed during each test process in this embodiment will be recorded. Then correspondingly, if the page access number corresponding to a page identifier is larger, the number of corresponding alternative pages is more. Therefore, after determining the first quantity according to the access proportion, selecting the first quantity of alternative pages as the pages to be tested among the alternative pages corresponding to the page identifier can ensure that there are enough alternative pages for selection.

[0173] When selecting the first number of pages to be tested from the alternative pages corresponding to the page identifier, the first number can be randomly selected, or the first number can be sequentially selected according to the order of collection time of the alternative pages. Or the strategy 1 and strategy 2 can be combined. Among the multiple alternative pages corresponding to the page identifier, the alternative pages of the new version are preferentially selected as the pages to be tested.

[0174] For example, among the multiple alternative pages corresponding to the page identifier, determine the multiple alternative pages of the latest version. If the number of the multiple alternative pages of the latest version has met the first number, directly select the loan. If the number of the multiple alternative pages of the latest version is less than the first number, then select from the multiple alternative pages of the second latest version, and so on, until the sufficient first number of pages to be tested is determined.

[0175] Under this strategy, by selecting the corresponding proportion of pages to be tested from the multiple alternative pages corresponding to each page identifier according to the proportion of the page access quantity corresponding to each page identifier, it can be ensured that the corresponding quantity is selected according to the test requirements of the pages corresponding to each page identifier, so that for the page with greater test requirements, the greater the number of pages to be tested selected, and thus the rationality of the test data can be effectively ensured.

[0176] Strategy 3 (which can also be called the second strategy): For any service category corresponding to any page identifier, select the second number of alternative pages from the alternative pages corresponding to the page identifier and the service category as the pages to be tested according to the proportion of the category quantity of the alternative pages corresponding to the service category in the alternative pages corresponding to the page identifier. The ratio of the second number to the number of pages to be tested corresponding to the page identifier is equal to the category quantity proportion.

[0177] Based on the above introduction, it can be understood that the multi-category page can be rendered into specific pages corresponding to different categories according to the page content of different categories passed in. Among them, the multi-category page can correspond to at least one service category, and the service category can be the food, accommodation, entertainment, etc. introduced above.

[0178] For any multi-category page, when selecting the pages to be tested of this multi-category page, the corresponding proportion can be selected according to the proportion of the quantity of the alternative pages corresponding to each category corresponding to this multi-category page, so as to ensure that for each category corresponding to this multi-category page, the corresponding pages to be tested can be covered and selected, and the proportion rationality of the selected pages to be tested is ensured.

[0179] Among them, each multi-category page corresponds to its own page identifier. Then, for any page identifier, the multiple service categories it contains can be determined. Next, the same processing is performed for each service category. Here, taking any one service category as an example, the number of alternative pages corresponding to this service category is determined, as well as the proportion of the number of categories in the total number of alternative pages corresponding to this page identifier. After that, among the multiple alternative pages corresponding to this page identifier and this service category, the second number of alternative pages is selected according to the proportion as the pages to be tested.

[0180] The "multiple alternative pages corresponding to this page identifier and this service category" introduced here are all within the multiple alternative pages corresponding to this page identifier, and further, the alternative pages corresponding to this service category are determined. That is to say, in this embodiment, within the scope of the alternative pages corresponding to each page identifier respectively, the proportion of the number of alternative pages of each of the above-introduced service categories is determined, and then for each service category, the corresponding second number of pages to be tested is selected.

[0181] Among them, the ratio of the second number to the number of pages to be tested corresponding to the page identifier is equal to the proportion of the number of categories. It can be understood that the "number of pages to be tested corresponding to the page identifier" here is the number of pages to be tested determined for this page identifier, which can be determined according to actual needs. For example, if the current strategy 3 is executed based on the above-introduced strategy 2, then the number of pages to be tested corresponding to the page identifier is determined according to the above-introduced strategy 2. Or if the current strategy 3 is executed independently, then the number of pages to be tested corresponding to the page identifier can be randomly selected, for example, or it can also be pre-set. This embodiment does not limit this.

[0182] The following is combined with Figure 9 for illustration. Figure 9 This is a schematic diagram for implementing the determination of the second number provided by the embodiment of the present application.

[0183] Suppose it is currently determined to test pages for page 1. Among them, page 1 is a multi-category page, and the service categories corresponding to page 1 are assumed to include Figure 9 category A, category B, and category C shown in the figure.

[0184] Among them, the number of alternative pages corresponding to page 1 is 2000. Among these 2000 alternative pages, the number of alternative pages corresponding to category A is 200, the number of alternative pages corresponding to category B is 100, and the number of alternative pages corresponding to category C is 100. For the remaining categories, they are not listed, but it can be understood that the sum of the numbers of alternative pages corresponding to each of the categories corresponding to page 1 is the total number of alternative pages corresponding to page 1, which is 2000.

[0185] For category A among them, it can be determined that the proportion of the number of product categories corresponding to category A in the number of alternative pages corresponding to page 1 is 10%. Similarly, the proportion of the number of product categories corresponding to category B is 5%, and the proportion of the number of product categories corresponding to category C is 5%.

[0186] After that, for the proportion of the number of product categories corresponding to each category respectively, the second quantity can be determined respectively. The ratio of the second quantity to the number of pages to be tested corresponding to page identifier 1 is equal to the determined proportion of the number of product categories. Assuming that 100 pages to be tested need to be determined for page 1, then the second quantity corresponding to category A can be determined to be 10. Therefore, 10 pages need to be selected from the 200 alternative pages corresponding to category A on page 1 as the pages to be tested.

[0187] Similarly, the second quantity corresponding to category B can be determined to be 5, so 5 pages need to be selected from the 100 alternative pages corresponding to category B on page 1 as the pages to be tested. Also, the second quantity corresponding to category C can be determined to be 5, so 5 pages need to be selected from the 100 alternative pages corresponding to category C on page 1 as the pages to be tested.

[0188] Under this strategy, among the multiple service categories included in the multi-category page, according to the proportion of the number of alternative pages corresponding to each service category in the number of alternative pages corresponding to this multi-category page, corresponding proportions of pages to be tested are selected from the alternative pages corresponding to each service category respectively, so as to ensure that each category corresponding to the multi-category page can be covered. At the same time, for the category with more alternative pages collected, the corresponding number of pages to be tested selected is also more, and thus the rationality of the test data can be effectively guaranteed.

[0189] Strategy 4 (which can also be called the fourth strategy): For any alternative page, the number of times the alternative page is sent is inversely proportional to the priority of the alternative page.

[0190] In this embodiment, for each alternative page stored in the server, the number of times it is sent is counted. That is, every time an alternative page is sent to the application program, the corresponding number of times it is sent will be incremented by 1. In the current strategy, for the alternative page with fewer send times, its priority of being selected as a page to be tested is higher, so as to ensure that every alternative page has the opportunity to be selected as a page to be tested, in order to hopefully quickly achieve the corresponding index of page coverage rate.

[0191] Strategy 5 (which can also be called the fifth strategy): If the page acquisition request includes a module identifier, then the alternative pages associated with the function module corresponding to the module identifier are preferentially selected as the pages to be tested.

[0192] For the projects released through rapid iteration, where only some modules may be modified, the application may need to conduct targeted tests on these modules. Therefore, the module identifier of the functional module can be included in the page acquisition request. In response to the page acquisition request, the server can preferentially select the alternative page associated with the functional module corresponding to the module identifier included in the page acquisition request as the page to be tested, where each page is associated with its corresponding module identifier.

[0193] Specifically, it can first be determined whether the number of alternative pages corresponding to the functional module is greater than or equal to the target number. If so, directly determine the target number of pages to be tested among the alternative pages corresponding to the functional module; if the number of alternative pages corresponding to the functional module is less than the target number, after determining the alternative pages corresponding to the functional module as the pages to be tested, then select the pages to be tested from the alternative pages other than the alternative pages corresponding to the functional module to ensure that a sufficient number of pages to be tested are determined.

[0194] In the actual implementation process, the various strategies introduced above can be implemented separately to determine the target number of pages to be tested. Or, the strategies introduced above can also be combined with each other to determine the target number of pages to be tested.

[0195] The following gives an exemplary introduction to the implementation of the combination of the above strategies:

[0196] Combination of Strategy 1 and Strategy 2: For any page identifier, select the corresponding first number of alternative pages as the pages to be tested among the multiple alternative pages corresponding to the page identifier according to the access quantity ratio of the page access quantity corresponding to the page identifier. When selecting, preferentially select the new version of the alternative pages.

[0197] Combination of Strategy 2 and Strategy 3: For any page identifier, select the corresponding first number of alternative pages as the pages to be tested among the multiple alternative pages corresponding to the page identifier according to the access quantity ratio of the page access quantity corresponding to the page identifier. When selecting, further determine the category quantity ratio according to each service category included in the page identifier, and then for any service category, determine the corresponding second number of alternative quantities. In this implementation method, the sum of the second numbers of multiple service categories is actually the first number.

[0198] And, if Strategy 3 is executed alone, then the sum of the second numbers of multiple service categories is the number of pages to be tested corresponding to the page identifier. When Strategy 3 is executed alone, this number can be randomly determined, for example.

[0199] On the basis of the combination of Strategy 2 and Strategy 3, assuming the further combination with Strategy 1, it means that for each service category, when selecting the second number of alternative pages from the multiple alternative pages corresponding to the service category under this page identifier, it is preferred to select the new version of the alternative page as the page to be tested.

[0200] Moreover, Strategy 4 can also be combined with each of the above-introduced strategies, and further combined with the combinations of the above-introduced multiple strategies. When specifically selecting alternative pages, it is preferred to select the alternative page with the fewest number of sending times.

[0201] The above-introduced Strategy 5 is relatively special because it needs to preferentially select the alternative page corresponding to the function module as the page to be tested. When combining Strategy 5 with the other strategies, it is necessary to first obtain the multiple alternative pages corresponding to the function module.

[0202] In a possible implementation manner, when the number of multiple alternative pages corresponding to the function module is sufficient to select the target number of pages to be tested, then combine with the above-introduced strategies to select alternative pages. For example, when combining with Strategy 1, preferentially select the new version of the alternative page; for another example, when combining with Strategy 2, make a corresponding proportion of selection according to the proportion of the page quantity corresponding to the page identifier; for another example, when combining with Strategy 3, make a corresponding proportion of selection according to the proportion of the page quantity corresponding to the service category; for another example, when combining with Strategy 4, preferentially select the alternative page with fewer sending times.

[0203] In another possible implementation manner, if the number of multiple alternative pages corresponding to the function module itself is less than the target number, then it is necessary to first determine all the multiple alternative pages corresponding to the function module as the pages to be tested. Then, from the alternative pages outside the function module, supplement and select a certain number of pages to be tested to ensure that enough target number of pages to be tested are determined. Further, it is also possible to make supplementary selections from the alternative pages of the associated module that has an associated relationship with the function module.

[0204] When supplementing and selecting a certain number of pages to be tested, it can be randomly selected, or combined with at least one of the above-introduced methods for selection.

[0205] It should be noted that when combining Strategy 5 with Strategy 2 and Strategy 3, when determining the first number for a certain page identifier, or when determining the second number for a certain service category, as long as the corresponding proportion of alternative pages is selected according to the principle of stratified sampling. Stratified sampling refers to a method of randomly sampling from different sub-populations in a population that can be divided into different sub-populations according to the corresponding proportions. As for which alternative pages the sub-population and the population specifically contain, it depends on the actual selection requirements.

[0206] In summary, according to at least one strategy provided by the embodiments of the present application, a target number of pages to be tested are selected from multiple alternative pages, so as to specifically solve the problems that it is impossible to cover all multi-category pages and it is impossible to conduct targeted tests for specific modules. And through a series of strategies introduced above, it is expected to cover more pages in a shorter time, while ensuring the rationality and comprehensiveness of the selected pages to be tested. Then the application performs test operations according to the pages to be tested, so as to effectively ensure the test effect of the stability test. And in the actual implementation process, specifically which of the above alternative strategies are adopted to form the target strategy can be selected according to actual test requirements. Therefore, by providing multiple alternative strategies in the present application, various test requirements can be met.

[0207] Further, when measuring the test effect of the current stability test plan, usually through traditional measurement models of stability execution duration and MTBF (Mean Time Between Failure), the general situation of the stability test is evaluated. However, such indicators are all indicators reflecting the overall operation situation and cannot accurately indicate the detailed situation of the stability test.

[0208] In view of the above problems, in the present application, for different measurement dimensions, according to the number of alternative pages that have been tested in the measurement dimension and the total number of alternative pages corresponding to the measurement dimension, the page coverage rate corresponding to the measurement dimension can be determined, where the page coverage rate can accurately reflect the execution situation of the stability test. The measurement dimensions in this embodiment include at least one of the following: version, project, test method, business line, and module. The test methods in the measurement dimension can include manual testing, machine testing, automated testing, etc.

[0209] For example, for the measurement dimension of version, for example, the total number of alternative pages corresponding to a certain version is 1000, and 800 of these 1000 alternative pages have been tested, then the page coverage rate corresponding to this version can be determined to be 80%.

[0210] For another example, for the measurement dimension of project, for example, the total number of alternative pages corresponding to a certain project is 300, and only 150 of these 300 pages have been tested, then the page coverage rate corresponding to this project can be determined to be 50%. The situation is similar for the remaining measurement dimensions and will not be elaborated here.

[0211] And, the above-introduced measurement dimensions can be understood as having a progressive relationship or a correlation relationship. For example, they can be combined Figure 10 for understanding. Figure 10 is a schematic diagram of the page coverage rate provided by the embodiments of the present application.

[0212] As Figure 10 shown, for example, when determining the page coverage rate of the current measurement dimension of the business line, referring to Figure 10 , for business line 1 under project A in version 1.0, which may include multiple sub-business lines, the page coverage rate corresponding to each sub-business line can be determined based on the total number of alternative pages (total number of pages) corresponding to each sub-business line and the number of tested alternative pages (covered page number). Additionally, the number of untested pages to be measured can also be displayed.

[0213] In Figure 10 , what is shown is the total page coverage rate of each sub-business line under each test method. Further, if the page coverage rate corresponding to each test method needs to be determined, the page coverage rate corresponding to each test method can be determined based on the total number of alternative pages of each sub-business line and the number of alternative pages tested using a specific execution method.

[0214] Furthermore, the untested pages to be measured can also be marked or output so that testers can quickly determine which specific pages have not been tested, and then targeted testing can be carried out according to requirements to meet the coverage requirements of the pages to be measured.

[0215] In this embodiment, by determining the page coverage rate corresponding to each measurement dimension respectively, the execution situation of the stability test can be accurately reflected.

[0216] In summary, the application program testing method provided by this application records test-related data during the preset type of test process, thereby recording a large amount of test-related data on the server side to avoid the problem of page coverage loss caused by the fact that in traditional test methods, due to deep buried paths or difficult-to-trigger jumps, some pages are always inaccessible. Moreover, by controlling to stay on each test page for a preset display duration and injecting page operations during the display process, the problem of incomplete page function and interaction verification is effectively solved.

[0217] In addition, when the server in this application selects a test page from multiple alternative pages, it can perform stratified sampling by category to achieve sampling of a large number of alternative pages in proportion to the proportion of service categories, so as to ensure comprehensive coverage of multi-category pages. In addition, it is also possible to specifically select test pages for function modules to achieve precise testing of function modules, so that the target page can be triggered without traversing the entire path. In addition, this application also provides a series of page selection strategies, which can effectively ensure the comprehensiveness and rationality of the selected alternative pages, and thus can effectively improve the test effect of stability testing.

[0218] At the same time, in this application, the page coverage rate can also be determined separately for multiple measurement dimensions, so as to accurately measure the execution effect and execution degree of stability testing.

[0219] Therefore, the method provided in this application of directly obtaining a separate test page and separately testing the separate test page can effectively improve the test effect of stability testing compared with the method of accessing multiple pages on the path through random operations to achieve testing.

[0220] Figure 11 Schematic structure of the application program testing device provided in the embodiments of this application Figure 1 As Figure 11 shown, the device 110 includes: an acquisition unit 1101 and a processing unit 1102.

[0221] The acquisition unit 1101 is used to acquire the test-related data of the page to be tested of the application program, and one page to be tested corresponds to one copy of test-related data;

[0222] The processing module 1102 is used to perform the following steps for one of the pages to be tested:

[0223] Generate a test page according to the test-related data of the page to be tested;

[0224] Control the display duration of the test page according to a preset display duration;

[0225] During the display process of the test page, obtain the detection result of the test page as the detection result of the page to be tested;

[0226] Determine the test result of the application program according to the detection results of all pages to be tested of the application program.

[0227] In a possible design, the processing unit 1102 is specifically used for:

[0228] Open the page to be tested according to the page address of the page to be tested;

[0229] Fill in data at the corresponding positions in the page to be tested according to the page filling content of the page to be tested, so as to generate the test page.

[0230] In a possible design, the processing unit 1102 is specifically configured to:

[0231] Perform at least one page operation on the test page at a preset frequency to detect whether there is an abnormal operation of the test page. The abnormal operation includes at least one of the following: the application crashes, the page freezes, or the page reports an error;

[0232] During the display process of the test page, detect whether there is a display abnormality of the test page. The display abnormality includes at least one of the following: a white screen, a black screen, a landscape screen abnormality, or being inconsistent with the historical version;

[0233] If there is an abnormal operation or a display abnormality in the test page, determine that the detection result of the test page is abnormal; if there is no abnormal operation and no display abnormality in the test page, determine that the detection result of the test page is normal.

[0234] In a possible design, the processing unit 1102 is further configured to:

[0235] Before obtaining the test-related data of the page to be tested of the application, send a page acquisition request to the server. The page acquisition request is used to request the server to send the test-related data of the page to be tested;

[0236] Wherein, the page acquisition request at least includes the preset display duration and the total test duration, and the preset display duration and the total test duration are used to determine the number of pages to be tested.

[0237] In a possible design, the page acquisition request further includes a module identifier, and the module identifier is used to indicate the page to be tested associated with the functional module corresponding to the module identifier.

[0238] In a possible design, the processing unit 1102 is further configured to:

[0239] During the test of the preset type, record the log data of the test process. The log data includes the test-related data of at least one page under test during the test process;

[0240] Send the test-related data of the at least one page under test to the server, so that the server uses the at least one page under test as an alternative page and saves the test-related data of the alternative page.

[0241] The device provided in this embodiment can be used to implement the technical solutions of the above method embodiments. The implementation principles and technical effects are similar, and will not be elaborated here in this embodiment.

[0242] Figure 12 The following is a schematic structure of the application program testing device provided in the embodiments of the present application Figure 2 . As Figure 12 shown, the device 120 includes: a transceiver unit 1201 and a determination unit 1202.

[0243] The transceiver unit 1201 is configured to receive a page acquisition request;

[0244] The determination unit 1202 is configured to determine a page to be tested from the alternative pages stored locally according to the page acquisition request, and obtain test-related data of the page to be tested;

[0245] The transceiver unit 1201 is further configured to return response data for the request, where the response data includes: test-related data of the page to be tested, so that the application program will display a test page generated according to the test-related data for a preset display duration, and obtain a detection result of the test page during the display process.

[0246] In a possible design, the page acquisition request includes the preset display duration and / or the total test duration;

[0247] The determination unit 1202 is specifically configured to:

[0248] Determine the target number of pages to be tested according to the preset display duration and the total test duration;

[0249] Determine the target number of pages to be tested from the alternative pages stored locally.

[0250] In a possible design, each of the alternative pages has its own page identifier, and each page identifier corresponds to one or more of the alternative pages;

[0251] The determination unit 1202 is specifically configured to:

[0252] Determine the target number of alternative pages as the pages to be tested from the alternative pages stored locally according to the target strategy and the preset rule; where the preset rule is used to indicate that when there are multiple alternative pages that meet the target strategy, select the target number of pages from the multiple alternative pages that meet the target strategy according to the preset rule;

[0253] Wherein, the alternative strategy at least includes:

[0254] The first strategy: for any page identifier, select the first number of alternative pages from the multiple alternative pages corresponding to the page identifier as the page to be tested according to the proportion of the access quantity corresponding to the page identifier in the total access quantity, where the ratio of the first number to the target number is equal to the access quantity proportion;

[0255] The second strategy: for any service category corresponding to any page identifier, select the second number of alternative pages from the alternative pages corresponding to the page identifier and the service category as the page to be tested according to the proportion of the number of categories of the alternative pages corresponding to the service category in the alternative pages corresponding to the page identifier, where the ratio of the second number to the number of pages to be tested corresponding to the page identifier is equal to the category quantity proportion;

[0256] The third strategy: for the multiple alternative pages corresponding to the same page identifier, the priority of the alternative pages of the new version is higher than that of the alternative pages of the old version;

[0257] The fourth strategy: for any alternative page, the sending times corresponding to the alternative page are inversely proportional to the priority corresponding to the alternative page;

[0258] The fifth strategy: if the page acquisition request includes a module identifier, preferentially select the alternative pages associated with the function module corresponding to the module identifier as the test page.

[0259] In a possible design, the determining unit 1202 is further configured to:

[0260] Determine the page coverage rate corresponding to the metric dimension according to the number of alternative pages tested in the metric dimension and the total number of alternative pages corresponding to the metric dimension;

[0261] The metric dimension includes at least one of the following: version, project, business line, module, and test method.

[0262] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.

[0263] Figure 13 It is a schematic hardware structure diagram of an electronic device provided in an embodiment of the present application. As Figure 13 shown, the electronic device 130 in this embodiment includes: a processor 1301 and a memory 1302; where

[0264] The memory 1302 is used to store computer execution instructions;

[0265] The processor 1301 is configured to execute computer-executable instructions stored in the memory to implement the various steps performed in the application test in the above embodiments. For specific details, reference may be made to the relevant descriptions in the foregoing method embodiments.

[0266] Optionally, the memory 1302 can be either independent or integrated with the processor 1301.

[0267] When the memory 1302 is independently provided, the electronic device further includes a bus 1303 for connecting the memory 1302 and the processor 1301.

[0268] An embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the application test performed by the above electronic device.

[0269] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for users to choose to authorize or refuse.

[0270] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be in electrical, mechanical, or other forms.

[0271] The integrated modules implemented in the form of software function modules can be stored in a computer-readable storage medium. The above software function modules are stored in a storage medium and include several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods described in various embodiments of the present application.

[0272] It should be understood that the above-mentioned processor may be a Central Processing Unit (CPU), or it may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly embodied as being completed by a hardware processor, or can be completed by a combination of hardware and software modules in the processor.

[0273] The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disc, etc.

[0274] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, the bus in the attached drawings of this application is not limited to only one bus or one type of bus.

[0275] The above-mentioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disc. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0276] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disks, or optical discs and other media that can store program codes.

[0277] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present application.

Claims

1. A method for testing an application program, characterized in that, The method includes: Obtaining test-related data of a to-be-tested page of the application, where one to-be-tested page corresponds to one set of test-related data; For one of the to-be-tested pages, perform the following steps: Generate a test page according to the test-related data of the to-be-tested page; Control the display duration of the test page according to a preset display duration; During the display process of the test page, obtain the detection result of the test page as the detection result of the to-be-tested page; Determine the test result of the application according to the detection results of all to-be-tested pages of the application.

2. The method according to claim 1, characterized in that The test-related data includes a page address and page filling content; the generating a test page according to the test-related data of the to-be-tested page includes: Open the to-be-tested page according to the page address of the to-be-tested page; Perform data filling at the corresponding position in the to-be-tested page according to the page filling content of the to-be-tested page to generate the test page.

3. The method according to claim 1 or 2, characterized in that: The obtaining the detection result of the test page includes: Perform at least one page operation on the test page at a preset frequency to detect whether there is a running anomaly in the test page, where the running anomaly includes at least one of the following: the application crashes, the page lags, or the page reports an error; During the display process of the test page, detect whether there is a display anomaly in the test page, where the display anomaly includes at least one of the following: a white screen, a black screen, a landscape screen anomaly, or being inconsistent with the historical version; If there is a running anomaly or a display anomaly in the test page, determine that the detection result of the test page is abnormal; if there is no running anomaly and no display anomaly in the test page, determine that the detection result of the test page is normal.

4. The method according to any one of claims 1 to 3, characterized in that Before obtaining the test-related data of the to-be-tested page of the application, the method further includes: Sending a page acquisition request to the server, where the page acquisition request is used to request the server to send the test-related data of the to-be-tested page; Wherein, the page acquisition request at least includes the preset display duration and the total test duration, and the preset display duration and the total test duration are used to determine the number of to-be-tested pages.

5. The method according to claim 4, characterized in that, The page acquisition request further includes a module identifier, and the module identifier is used to indicate the to-be-tested pages associated with the functional module corresponding to the module identifier.

6. A method for testing an application program, characterized in that, The method includes: Receiving a page acquisition request; Determine to-be-tested pages from the alternative pages stored locally according to the page acquisition request, and obtain the test-related data of the to-be-tested pages; Return response data for the request, where the response data includes: the test-related data of the to-be-tested pages, so that the application will display the test page generated according to the test-related data for the preset display duration and obtain the detection result of the test page during the display process.

7. The method according to claim 6, wherein The page acquisition request at least includes the preset display duration and the total test duration; The determining to-be-tested pages from the alternative pages stored locally according to the page acquisition request includes: Determine the target number of to-be-tested pages according to the preset display duration and the total test duration; Determine the target number of pages to be tested among the alternative pages stored locally.

8. The method according to claim 7, characterized in that Each of the alternative pages has its own page identifier, and each page identifier corresponds to one or more of the alternative pages; Determining the target number of pages to be tested among the alternative pages stored locally includes: Determine the policy obtained by combining at least one alternative policy as the target policy; Among the alternative pages stored locally, determine the target number of alternative pages as the pages to be tested according to the target policy and a preset rule; wherein, the preset rule is used to indicate that when there are multiple alternative pages that meet the target policy, select the target number of pages from the multiple alternative pages that meet the target policy according to the preset rule; Wherein, the alternative policies at least include: The first policy: for any page identifier, select the first number of alternative pages as the pages to be tested from the multiple alternative pages corresponding to the page identifier according to the proportion of the access number of the pages corresponding to the page identifier in the total access number, and the ratio of the first number to the target number is equal to the access number proportion; The second policy: for any service category corresponding to any page identifier, select the second number of alternative pages as the pages to be tested from the alternative pages corresponding to the page identifier and the service category according to the proportion of the number of categories of the alternative pages corresponding to the service category in the alternative pages corresponding to the page identifier, and the ratio of the second number to the number of pages to be tested corresponding to the page identifier is equal to the category number proportion; The third policy: for multiple alternative pages corresponding to the same page identifier, the priority of the alternative pages of the new version is higher than that of the alternative pages of the old version; The fourth policy: for any alternative page, the sending times corresponding to the alternative page are inversely proportional to the priority corresponding to the alternative page; The fifth policy: if the page acquisition request includes a module identifier, preferentially select the alternative pages associated with the function module corresponding to the module identifier as the pages to be tested.

9. An application testing device, characterized in that: Include: An acquisition unit, configured to acquire the test-related data of the pages to be tested of the application program, and one page to be tested corresponds to one copy of test-related data; A processing module, configured to perform the following steps for one of the pages to be tested: Generate a test page according to the test-related data of the page to be tested; Control the display duration of the test page according to a preset display duration; During the display process of the test page, acquire the detection result of the test page as the detection result of the page to be tested; Determine the test result of the application program according to the detection results of all the pages to be tested of the application program.

10. A computer-readable storage medium, characterized in that: Include instructions that, when running on a computer, cause the computer to execute the method according to any one of claims 1 to 8.