Page testing methods, devices, servers, and storage media

By using reinforcement learning algorithms to determine the target actions of the vehicle infotainment system pages, the problem of insufficient page traversal in page testing is solved, thus improving testing efficiency and accuracy.

CN115774675BActive Publication Date: 2025-10-31ZEBRED NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211578600.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2025-10-31
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

In existing technologies, page testing of vehicle infotainment systems suffers from insufficient page traversal, resulting in high test case writing costs and difficulty in problem localization.

Method used

The target action is determined by reinforcement learning algorithm. The user operation is simulated by an intelligent agent to obtain the page change state. The expected reward of the target action is updated according to the page change state to achieve full traversal of the page and problem localization.

Benefits of technology

It enables full traversal of the vehicle infotainment system pages, improving testing efficiency and accuracy, and accurately locating page issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115774675B_ABST
    Figure CN115774675B_ABST
Patent Text Reader

Abstract

This application provides a page testing method, apparatus, server, and storage medium. The page testing method includes: determining the target action of the current page to be tested and obtaining the page change state corresponding to the execution of the target action; determining the target expected reward based on the page change state using a reinforcement learning algorithm; and updating the expected reward corresponding to the target action of the current page to be tested based on the target expected reward. This application can achieve sufficient page traversal and accurately locate page problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer and Internet technology, and in particular to page testing methods, apparatus, servers and storage media. Background Technology

[0002] The pace of iteration for internet products is accelerating, leading to a growing demand for testing of internet products such as websites, apps, and in-vehicle infotainment systems. However, due to the multi-platform, multi-version, and multi-device releases of internet products, manual testing by test engineers has become increasingly difficult to manage. Therefore, intelligent testing products that enable automation and continuous testing are being used and researched by more and more companies. In-vehicle infotainment systems, which control the hardware and software of automobiles, present both similarities and differences in testing applications running on these systems compared to traditional mobile apps. For example, the computational power required for automated testing differs significantly from that required for mobile devices.

[0003] Currently, in existing technologies, intelligent testing is mainly based on two testing tools: Monkey testing and UI (User Interface) Automator. Monkey testing achieves stability testing of the application client by emitting pseudo-random user event streams to the system. UI-Automator testing performs actions such as clicking, long-pressing, swiping, and searching based on text, control IDs, and coordinates, achieving consistency with manual action logic. Based on test cases, Python code is used to execute specified commands and actions, check the expected results, perform tests, and finally generate test reports through unit test execution scripts.

[0004] However, the inventors have found that the existing technology has at least the following technical problems: as the business continues to develop, such as the continuous enrichment of vehicle models, the increasing number of software functions, and the growing scale and complexity of the software to be tested, existing software testing technologies such as Monkey and UI-Automator suffer from insufficient page traversal. Summary of the Invention

[0005] This application provides a page testing method, apparatus, server, and storage medium to avoid the problem of insufficient page traversal during page testing.

[0006] In a first aspect, this application provides a page testing method, comprising: determining the target action of the current page to be tested, and obtaining the page change state corresponding to the execution of the target action; determining the target expected reward based on the page change state and a reinforcement learning algorithm; and updating the expected reward corresponding to the target action of the current page to be tested in the expected reward table according to the target expected reward.

[0007] In one possible implementation, the target action of the current page under test is determined, and the page change state corresponding to the execution of the target action is obtained. This includes: determining multiple actions to be executed on the current page under test based on an expected benefit table, where the expected benefit table records the expected benefit of executing the corresponding action on each page under test of the application under test; selecting the action with the highest expected benefit as the target action; executing the target action on the current page under test, identifying the page after execution, and obtaining the page change state corresponding to the execution of the target action.

[0008] One possible implementation also includes: when there are multiple actions to be executed with the highest expected return, randomly select one action to be executed as the target action.

[0009] In one possible implementation, the page change state includes: an abnormal change state, which includes: exiting the application under test or the page not changing; based on the page change state, the target expected reward is determined based on the reinforcement learning algorithm, including: determining the reward value of the target action based on the current page under test as a preset reward value, which is negative; substituting the preset reward value into the reinforcement learning algorithm to obtain the target expected reward, where the preset reward value and the target expected reward are positively correlated.

[0010] In one possible implementation, the page change state includes: the page jumps to the subpage corresponding to the target action; based on the page change state, the target expected reward is determined using a reinforcement learning algorithm, including: determining the target reward value based on the first number of unexecuted actions in the current test page and the reward value of the subpage; substituting the target reward value into the reinforcement learning algorithm to obtain the target expected reward, wherein the target reward value is positively correlated with the target expected reward.

[0011] In one possible implementation, before determining the target reward value based on the first number of unexecuted actions in the current test page and the reward value of the subpage, the method further includes: if the subpage is known and consistent with the current test page, determining the reward value of the subpage to be 0; if the subpage is unknown, determining the reward value of the subpage to be 100; if the subpage is known and inconsistent with the current test page, determining the reward value of the subpage in the past test page to be the reward value of the subpage.

[0012] Secondly, this application provides a page testing apparatus, comprising:

[0013] The first determination module is used to determine the target action of the current page to be tested and to obtain the page change state corresponding to the execution of the target action.

[0014] The second determination module is used to determine the expected return of the target based on the page change state and a reinforcement learning algorithm.

[0015] The update module is used to update the target action of the current test page based on the expected target return.

[0016] Thirdly, this application provides a server, including: at least one processor and memory;

[0017] The memory stores the instructions that the computer executes;

[0018] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the page testing method as described in the first aspect above.

[0019] Fourthly, this application provides a computer-readable storage medium storing an instruction to be executed by a computer, which, when executed by a processor, implements the page testing method described in the first aspect above.

[0020] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the page testing method as described in the first aspect.

[0021] The page testing method, apparatus, server, and storage medium provided in this application determine the target action of the current page under test, obtain the page change state corresponding to the execution of the target action, determine the target expected reward based on the page change state using a reinforcement learning algorithm, and update the expected reward corresponding to the target action of the current page under test based on the target expected reward. This enables testing of all pages, achieving sufficient page traversal, and accurately locating page problems. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram illustrating an application scenario of the page testing method provided in the embodiments of this application;

[0024] Figure 2 A flowchart illustrating the page testing method provided in this application embodiment;

[0025] Figure 3 A schematic diagram illustrating the interaction between an intelligent agent and an application under test, provided as an optional embodiment of this application;

[0026] Figure 4 This is a schematic diagram of the structure of the page testing device provided in the embodiments of this application;

[0027] Figure 5 This is a schematic diagram of the hardware structure of the server provided in an embodiment of this application. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] Currently, with the continuous development of the internet and the accelerating pace of software iteration and updates, the demand for software testing is also increasing. Compared to manual testing, intelligent testing, which combines data and algorithms to empower quality activities, is more popular with enterprises, significantly improving both testing quality and efficiency. Existing technologies commonly employ two types of intelligent testing: Monkey and UI-Automator. The former tests the program on the device by sending pseudo-random user events (such as key input, touchscreen input, swiping, and gesture input) to the system, detecting the program's long-term stability. The latter is a UI-based automated testing framework that uses manually written test cases to simulate manual clicks, swipes, drags, and text input. When using Monkey and UI-Automator for intelligent testing of software or website pages, the inventors discovered pain points such as high costs for test case writing and adaptation, insufficient page traversal, and difficulty in problem localization. Furthermore, related technologies optimize the algorithm level, such as traversal algorithms and genetic algorithms; however, traversal algorithms suffer from low coverage, and genetic algorithms have low sensitivity and cannot implement operation replay.

[0030] To address the aforementioned technical problems, this application provides the following technical concept for solving these problems: applied to automotive operating systems such as QNX and AliOS, specifically by determining the target action of the current page under test, obtaining the page change state corresponding to the execution of the target action; determining the expected reward based on a reinforcement learning algorithm based on the page change state; and updating the expected reward corresponding to the target action of the current page under test based on the expected reward, thereby enabling testing of all pages, achieving sufficient page traversal, and accurately locating page problems.

[0031] Figure 1 This is a schematic diagram illustrating an application scenario of the page testing method provided in the embodiments of this application, such as... Figure 1 As shown, it includes: terminal 101 and server 102.

[0032] Terminal 101 is used by testers to test and display the page under test. Server 102 is used to simulate the application under test, perform page testing on the application under test, and generate test files to send to terminal 101 for testers to locate page problems.

[0033] Figure 2 This is a flowchart illustrating the page testing method provided in this application embodiment. The execution entity of this embodiment can be... Figure 1 The server 102 in the illustrated embodiment can also be other computer-related devices, and this embodiment is not particularly limited.

[0034] like Figure 2 The image shows a page testing method provided in this application, which specifically includes the following steps:

[0035] S201. Determine the target action of the current page to be tested, and obtain the page change state corresponding to the execution of the target action.

[0036] In this embodiment, the page to be tested can be an action page, a display page, or a control page. For example, the page to be tested can be the search page of a music software. The current page to be tested is the page currently being tested. The target action is a target operation that the intelligent agent simulates to perform on a target element on the current page to be tested. The target element can be a control, button, or input box, etc. The target operation can be a click, swipe, or input operation, etc.

[0037] In this embodiment, the server simulates an agent interacting with the application under test within the server to perform reinforcement learning in order to obtain the maximum reward value. Reinforcement learning (RL) is a process where an agent learns through trial and error, receiving reward-guided behavior through interaction with the environment (not under test in this application), with the goal of maximizing the agent's reward value. Further, referring to... Figure 3 The intelligent agent, acting as a learning system, obtains the current test page S of the application under test. i Take target action A for the application under test j And obtain feedback from the application under test regarding the current page under test, S. i Execute target action A j Evaluation (i.e., reward value R(S)) i A j and the new page state (i.e., the page S after execution) i+1 If the agent's target action A... j If a positive reward value can be obtained from the application under test, then the agent will generate this target action A in the future. j The trend will be strengthened; conversely, the agent will generate this target action A. jThe trend will weaken.

[0038] Furthermore, determine the target action of the current page to be tested, and obtain the page change state corresponding to the execution of the target action, including the following steps:

[0039] a1: Based on the expected revenue table, determine multiple actions to be performed on the current page under test. The expected revenue table is used to record the expected revenue of performing the corresponding actions on each page under test of the application under test.

[0040] a2: Select the action to be executed with the highest expected return as the target action.

[0041] a3: Perform the target action on the current page to be tested, identify the page after the action, and obtain the page change state corresponding to the target action.

[0042] In this embodiment of the application, the application under test is modeled as a finite state machine, that is, the pages under test of the application under test are finite.

[0043] The expected revenue table records the expected revenue from performing corresponding actions on each page of the application under test. In this embodiment, the expected revenue table is shown in Table 1:

[0044] Table 1

[0045] Expected Returns Table <![CDATA[A1]]> <![CDATA[A2]]> <![CDATA[A3]]> <![CDATA[S1]]> <![CDATA[Q(S1,A1)]]> <![CDATA[Q(S1,A2)]]> <![CDATA[Q(S1,A3)]]> <![CDATA[S2]]> <![CDATA[Q(S2,A1)]]> <![CDATA[Q(S2,A2)]]> <![CDATA[Q(S2,A3)]]> <![CDATA[S3]]> <![CDATA[Q(S3,A1)]]> <![CDATA[Q(S3,A2)]]> <![CDATA[Q(S3,A3)]]> <![CDATA[S4]]> <![CDATA[Q(S4,A1)]]> <![CDATA[Q(S4,A2)]]> <![CDATA[Q(S4,A3)]]>

[0046] Table 1 shows four pages to be tested: S1, S2, S3, and S4. The three actions are A1, A2, and A3. Q(S i A j ) indicates the page to be tested, S i The above uses action A j The corresponding expected return. Where i ranges from 1 to 4, and j ranges from 1 to 3.

[0047] Furthermore, when there are multiple actions to be executed with the highest expected return, one of them is randomly selected as the target action.

[0048] For example, referring to Table 1, if the current page to be tested, S... i Let S1 be an action to be executed, and A1, A2, and A3 be the corresponding actions to be executed. If Q(S1, A1) > Q(S1, A2) > Q(S1, A3), then action A1 is determined as the target action. If Q(S1, A1) = Q(S1, A2) > Q(S1, A3), then one of the actions to be executed, A1 or A2, can be randomly selected as the target action.

[0049] In the embodiments of this application, under normal conditions, after the target action is performed on the current page under test, the application under test will jump to the next page, that is, the subpage corresponding to the target action. Under abnormal conditions, after the target action is performed on the current page under test, the application under test will either exit the application under test or remain on the current page under test.

[0050] The page change states include two categories: abnormal change states and normal change states. Abnormal change states include exiting the application under test or the page not changing. Normal change states include the page redirecting to the subpage corresponding to the target action.

[0051] Furthermore, identifying the page after execution refers to identifying the page of the application under test after performing the target operation, thereby determining the page change status. The identification method includes: substituting the network address of the page after execution into the MD5 hash algorithm to obtain a first calculation result; substituting the network address of the current page under test into the MD5 hash algorithm to obtain a second calculation result; then determining whether the first and second calculation results are the same. If they are the same, it is determined that the current page under test has not been adjusted; if they are different, a first hash value of the page after execution and a second hash value of the current page under test are calculated; based on the first and second hash values, the similarity between the page after execution and the current page under test is determined; if the similarity is less than a preset value, it is determined that the current page under test has not been redirected; if the similarity is greater than or equal to the preset value, it is determined that the current page under test has been redirected.

[0052] In this embodiment of the application, the page change state can be determined in any way, and there is no limitation thereto.

[0053] S202. Based on the page change status, determine the target expected return using a reinforcement learning algorithm.

[0054] Among these, the feedback of the application under test to the agent's action on the target can be determined based on the changes in the page state.

[0055] In one optional embodiment, the page change state includes: an abnormal change state, which includes: exiting the application under test or the page not changing; based on the page change state, determining the target expected benefit based on a reinforcement learning algorithm includes the following steps:

[0056] b1: Determine the reward value for the target action based on the current page to be tested as a preset reward value. The preset reward value is negative.

[0057] Specifically, if the page changes by exiting the application under test, the preset reward value is -20. If the page does not redirect and remains on the current page under test, the preset reward value is -10.

[0058] b2: Substitute the preset reward value into the reinforcement learning algorithm to obtain the target expected return. The preset reward value and the target expected return are positively correlated.

[0059] In this embodiment of the application, the reinforcement learning algorithm is as follows: (1)

[0060] newQ(S i A j )=Q(S i A j )+α(R(S i A j )+γ*maxQ′(S′,A′)-Q(S i A j ))

[0061] In the above formula, newQ(S) i A j Let Q(S) be the target expected return. i A j R(S) represents the current expected return in the expected return table. α represents the learning efficiency of the agent. i A j ) represents the reward value. γ is the discount factor. maxQ′(S′, A′) represents the maximum future reward value given the new test page and action, and is a given value.

[0062] Furthermore, the preset reward value and the target expected return are positively correlated. Where the preset reward value is negative, then the target expected return newQ(S) is... i A j ) relative to the current expected return Q(S) i A j () is decreasing.

[0063] In this embodiment of the application, since the current page under test jumps out of the application under test or the page does not change under the target action, it is not an abnormality. Therefore, the reward value given by the application under test to the agent is the preset reward value, which is negative. The target expected return can be calculated by using the above formula (1). The target expected return is reduced based on the current expected return.

[0064] In one optional embodiment, the page change state includes: the page navigating to the subpage corresponding to the target action; and determining the target expected reward based on a reinforcement learning algorithm according to the page change state, including the following steps:

[0065] c1: Determine the target reward value based on the first number of unexecuted actions on the current page under test and the reward value of the subpage.

[0066] Specifically, the sum of the first quantity and the reward value of the subpage is used as the target reward value.

[0067] c2: Substitute the target reward value into the reinforcement learning algorithm to obtain the target expected return. The target reward value and the target expected return are positively correlated.

[0068] The reinforcement learning algorithm is as described in formula (1) above, and the target reward value R(S) obtained above is... i A j Substituting this into a reinforcement learning algorithm, we can obtain the expected return. The target reward value is positively correlated with the expected return. If the preset reward value is positive, the expected return newQ(S) will be higher. i A j ) relative to the current expected return Q(S) i A j () is rising.

[0069] Before determining the target reward value based on the first number of unexecuted actions on the current test page and the reward value of the subpage, the following steps are also included:

[0070] d1: If the subpage is known and is consistent with the current page to be tested, determine that the reward value of the subpage is 0.

[0071] Specifically, the fact that a subpage is known indicates that the subpage has been tested. In this application embodiment, the method for determining whether a subpage has been tested, and the method for determining whether a subpage is consistent with the current page to be tested, are not limited.

[0072] Furthermore, if the subpage is known and is consistent with the current page under test, the reward value of the subpage is determined to be 0, indicating that the subpage has been tested and is consistent with the current page under test. In this case, the subpage has no impact on the reward value of the current page under test. The first number of unexecuted actions in the current page under test is used as the target reward value, which has already prompted the testing of unexecuted actions in the current page under test.

[0073] d2: If the subpage is unknown, then the reward value of the subpage is determined to be 100.

[0074] In this context, "unknown subpage" means the subpage has not been tested and is a new page. Therefore, the reward value for the subpage is set to 100 to instruct the agent to test the subpage, avoiding the problem where all currently tested pages are tested, but the subpage is not.

[0075] d3: If the subpage is known and is inconsistent with the current page to be tested, then the reward value when the subpage was tested in the past is determined to be the reward value of the subpage.

[0076] If a subpage is known and is inconsistent with the current page under test, it means that the subpage has already been tested. However, if the current page under test can be used to navigate to the subpage, then the reward value for the previous test of the subpage is determined to be the reward value for the subpage. The impact of the subpage on the current page under test can be taken into account.

[0077] In this embodiment, the reward value is feedback on the target action, indicating whether the user's input affects the traversal of the page under test, expressed as positive, negative, or no impact. The reward value in this application is no longer a fixed value but is dynamically calculated, considering both action coverage and page coverage to determine whether the target action triggers more business scenarios. Simultaneously, testing optimizations have been implemented, such as path deduplication and deduplication of multiple page triggers. This approach addresses the issue where all actions on the current page under test have been performed, but subpages have not been tested.

[0078] S203. Based on the expected return of the target, update the expected return corresponding to the target action of the current test page.

[0079] For example, referring to Table 2, the initial expected returns are shown in Table 2:

[0080] Table 2

[0081] Expected Returns Table <![CDATA[A1]]> <![CDATA[A2]]> <![CDATA[A3]]> <![CDATA[S1]]> <![CDATA[Q(S1,A1)=3]]> <![CDATA[Q(S1,A2)=6]]> <![CDATA[Q(S1,A3)=1]]> <![CDATA[S2]]> <![CDATA[Q(S2,A1)=-5]]> <![CDATA[Q(S2,A2)=3]]> <![CDATA[Q(S2,A3)=2]]> <![CDATA[S3]]> <![CDATA[Q(S3,A1)=1]]> <![CDATA[Q(S3,A2)=6]]> <![CDATA[Q(S3,A3)=9]]> <![CDATA[S4]]> <![CDATA[Q(S4,A1)=6]]> <![CDATA[Q(S4,A2)=8]]> <![CDATA[Q(S4,A3)=3]]>

[0082] When the current test page is S1, according to Table 2, the highest expected return is Q(S1, A2) = 6. Therefore, the action to be executed, A2, is determined to be the target action. After executing action A2 on the current test page S1, the page after execution is still S1. Therefore, the reward value is determined to be -10. Then, this reward value is substituted into formula (1) to obtain the target expected return as shown in Table 2. Then, the expected return table is updated to obtain Table 3.

[0083] Table 3

[0084] Expected Returns Table <![CDATA[A1]]> <![CDATA[A2]]> <![CDATA[A3]]> <![CDATA[S1]]> <![CDATA[Q(S1,A1)=3]]> <![CDATA[Q(S1,A2)=2]]> <![CDATA[Q(S1,A3)=1]]> <![CDATA[S2]]> <![CDATA[Q(S2,A1)=-5]]> <![CDATA[Q(S2,A2)=3]]> <![CDATA[Q(S2,A3)=2]]> <![CDATA[S3]]> <![CDATA[Q(S3,A1)=1]]> <![CDATA[Q(S3,A2)=6]]> <![CDATA[Q(S3,A3)=9]]> <![CDATA[S4]]> <![CDATA[Q(S4,A1)=6]]> <![CDATA[Q(S4,A2)=8]]> <![CDATA[Q(S4,A3)=3]]>

[0085] In this embodiment of the application, an iterative update method is adopted, and each update is the expected benefit of the target action corresponding to the current page to be tested.

[0086] Furthermore, if the page after execution is not the preset target page, the page after execution will be used as the current page to be tested, and S201 will be executed.

[0087] In this embodiment, the preset target page refers to the preset final page to which the user needs to jump. For example, this application needs to test the process of jumping from page S1 to page S4 after multiple jumps. When the executed page is page S4, the test is considered complete; otherwise, the test continues.

[0088] For example, based on Table 3, the current page to be tested is still page S1. The highest expected return for the current page in the expected return table is Q(S1, A1) = 3. Therefore, A1 is the target action, and the target action A1 is executed. If the page after execution is S2, and page S2 has not been tested, then the reward value for page S2 is determined to be 100. Furthermore, since the number of untested actions for the current page S1 is 1 (only action A3 has not been tested), the target reward value is calculated to be 101. Substituting this into formula (1) above, the target expected return is obtained, such as 8. The expected return table is then updated to obtain Table 4.

[0089] Table 4

[0090] Expected Returns Table <![CDATA[A1]]> <![CDATA[A2]]> <![CDATA[A3]]> <![CDATA[S1]]> <![CDATA[Q(S1,A1)=8]]> <![CDATA[Q(S1,A2)=2]]> <![CDATA[Q(S1,A3)=1]]> <![CDATA[S2]]> <![CDATA[Q(S2,A1)=-5]]> <![CDATA[Q(S2,A2)=3]]> <![CDATA[Q(S2,A3)=2]]> <![CDATA[S3]]> <![CDATA[Q(S3,A1)=1]]> <![CDATA[Q(S3,A2)=6]]> <![CDATA[Q(S3,A3)=9]]> <![CDATA[S4]]> <![CDATA[Q(S4,A1)=6]]> <![CDATA[Q(S4,A2)=8]]> <![CDATA[Q(S4,A3)=3]]>

[0091] In this embodiment, the test steps are executed cyclically, and the expected revenue table is continuously updated. Furthermore, untested pages and unexecuted actions can be recorded in the expected revenue table. The untested pages and actions can be tested, and the expected revenue in the expected revenue table is continuously updated until all pages and corresponding actions have been tested, ultimately yielding the target expected revenue table.

[0092] Furthermore, a target benefit expectation table can be provided to testers, who can then select actions for each page under test whose expected benefit is lower than a preset threshold, in order to locate the problem corresponding to that action.

[0093] Figure 4 This is a schematic diagram of the structure of the page testing device provided in the embodiments of this application, as shown below. Figure 4 As shown, the device includes: a first determining module 41, a second determining module 42, and an updating module 43.

[0094] The first determining module 41 is used to determine the target action of the current page to be tested and to obtain the page change state corresponding to the execution of the target action.

[0095] The second determination module 42 is used to determine the expected return of the target based on the page change state and a reinforcement learning algorithm.

[0096] Update module 43 is used to update the expected revenue corresponding to the target action of the current test page based on the target expected revenue.

[0097] In an optional embodiment of this application, the first determining module 41 is specifically used to determine multiple actions to be executed on the current page to be tested based on the expected benefit table, wherein the expected benefit table is used to record the expected benefit of executing the corresponding action on each page to be tested in the application to be tested; select the action to be executed with the highest expected benefit as the target action; execute the target action on the current page to be tested, identify the page after execution, and obtain the page change state corresponding to the execution of the target action.

[0098] In an optional embodiment of this application, the first determining module 41 is further specifically used to randomly select one action to be executed as the target action when there are multiple actions to be executed with the highest expected benefit.

[0099] In an optional embodiment of this application, the page change state includes: an abnormal change state, which includes: exiting the application under test or the page not changing. The second determining module 43 is specifically used to determine the reward value of the target action based on the current page under test as a preset reward value, which is negative; and to substitute the preset reward value into the reinforcement learning algorithm to obtain the target expected return, wherein the preset reward value and the target expected return are positively correlated.

[0100] In an optional embodiment of this application, the page change state includes: the page jumps to the subpage corresponding to the target action; the second determining module 43 is specifically used to determine the target reward value based on the first number of unexecuted actions in the current test page and the reward value of the subpage; and to substitute the target reward value into the reinforcement learning algorithm to obtain the target expected return, wherein the target reward value is positively correlated with the target expected return.

[0101] In an optional embodiment of this application, before determining the target reward value based on the first number of unexecuted actions in the current test page and the reward value of the subpage, the second determining module 43 is further specifically used for: if the subpage is known and consistent with the current test page, determining the reward value of the subpage to be 0; if the subpage is unknown, determining the reward value of the subpage to be 100; if the subpage is known and inconsistent with the current test page, determining the reward value of the subpage when it was tested in the past to be the reward value of the subpage.

[0102] The page testing device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0103] Figure 5 A schematic diagram of the hardware structure of the server provided in the embodiments of this application is shown below. Figure 5 As shown, the system includes at least one processor 501 and a memory 502.

[0104] The processor 501 is used to store computer execution instructions.

[0105] The memory 502 is used to execute computer execution instructions stored in the memory to implement the various steps involved in the above method embodiments. For details, please refer to the relevant descriptions in the foregoing method embodiments.

[0106] Alternatively, the memory 502 can be either standalone or integrated with the processor 501.

[0107] When the memory 502 is set up independently, the controller also includes a bus 503 for connecting the memory 502 and the processor 501.

[0108] This invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the page testing method described above.

[0109] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the page testing method described above.

[0110] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or modules, and may be electrical, mechanical, or other forms.

[0111] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0112] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0113] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute partial steps of the methods of the various embodiments of this application.

[0114] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0115] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0116] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0117] The aforementioned storage medium can be implemented from 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 storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.

[0118] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.

[0119] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0120] This description is intended to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A page testing method, characterized in that, include: Determine the target action of the current page to be tested, and obtain the page change state corresponding to the execution of the target action; Based on the page change state, the target expected return is determined using a reinforcement learning algorithm; Based on the target expected return, update the expected return corresponding to the target action of the current test page; Record untested pages and unexecuted actions in the expected revenue table. Test the untested pages and unexecuted actions and update the expected revenue in the expected revenue table until all pages and corresponding actions have been tested.

2. The page testing method according to claim 1, characterized in that, The step of determining the target action of the current page to be tested and obtaining the page change state corresponding to the execution of the target action includes: Based on the expected revenue table, multiple actions to be performed on the current page under test are determined. The expected revenue table is used to record the expected revenue of performing the corresponding actions on each page under test of the application under test. Select the action with the highest expected return as the target action; The target action is executed on the current page to be tested, the page after execution is identified, and the page change state corresponding to the execution of the target action is obtained.

3. The page testing method according to claim 2, characterized in that, Also includes: When there are multiple actions to be executed with the highest expected return, one of them is randomly selected as the target action.

4. The page testing method according to any one of claims 1 to 3, characterized in that, The page change states include: abnormal change states, which include: exiting the application under test or the page not changing. The step of determining the target expected return based on the page change states using a reinforcement learning algorithm includes: The reward value for the target action based on the current page to be tested is determined to be a preset reward value, wherein the preset reward value is negative; The preset reward value is substituted into the reinforcement learning algorithm to obtain the target expected return, and the preset reward value and the target expected return are positively correlated.

5. The page testing method according to any one of claims 1 to 3, characterized in that, The page change state includes: the page jumps to the subpage corresponding to the target action, and the step of determining the target expected benefit based on the page change state using a reinforcement learning algorithm includes: The target reward value is determined based on the first number of unexecuted actions in the current test page and the reward value corresponding to the subpage. The target reward value is substituted into the reinforcement learning algorithm to obtain the target expected return, and the target reward value is positively correlated with the target expected return.

6. The page testing method according to claim 5, characterized in that, Before determining the target reward value based on the first number of unexecuted actions in the current test page and the reward value corresponding to the subpage, the method further includes: If the subpage is known and is consistent with the current page to be tested, the reward value of the subpage is determined to be 0; If the subpage is unknown, then the reward value of the subpage is determined to be 100; If the subpage is known and is inconsistent with the current page to be tested, then the reward value of the subpage in the past tests is determined to be the reward value of the subpage.

7. A page testing device, characterized in that, include: The first determining module is used to determine the target action of the current page to be tested and to obtain the page change state corresponding to the execution of the target action. The second determining module is used to determine the target expected return based on the page change state and a reinforcement learning algorithm. The update module is used to update the expected revenue corresponding to the target action of the current page under test according to the target expected revenue; record untested pages under test and unexecuted actions under test in the revenue expectation table; test the untested pages under test and unexecuted actions under test; update the expected revenue in the revenue expectation table; until all pages under test and their corresponding actions under test have been tested.

8. A server, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the page testing method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the page testing method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the page testing method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Application program testing method and equipment and computer readable medium

    CN110221959A