Android application error reproduction method guided by control hierarchy diagram

By constructing a control hierarchy diagram and static analysis, calculating control fitness, and guiding automated test scripts, the problem of low Android application error reproduction efficiency in the existing technology is solved, and efficient error location and reproduction are achieved.

CN115033490BActive Publication Date: 2024-08-30BEIJING INFORMATION SCI & TECH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210746493.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2024-08-30
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

Existing automated testing tools are inefficient when reproducing Android application errors, lack pertinence, and cannot effectively utilize the information in error reports, resulting in scattered testing resources and low reproduction efficiency.

Method used

By constructing a control hierarchical relationship diagram, combined with static analysis of suspicious controls, the control fitness is calculated, the automated test script is guided, the search scope is narrowed, and the error reproduction efficiency is improved.

Benefits of technology

It significantly improves the efficiency of error reproduction, reduces the cost of reproduction, is suitable for different versions of Android devices, reduces the exploration of unnecessary paths, and improves the utilization of test resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033490B
    Figure CN115033490B
Patent Text Reader

Abstract

The present invention discloses an Android application error reproduction method guided by a control hierarchy diagram, which is applied to the field of software testing technology. First, an APK file is generated using a project file of an application under test, and the APK file is analyzed to obtain function calls. The interface jump and the association between controls and functions are obtained by combining the function calls and the project file of the application under test, and the construction of a control hierarchy diagram is completed; secondly, suspicious controls are located, and the control hierarchy diagram and the suspicious controls are used to calculate the control fitness; finally, the control information in the current interface of the application under test is identified, and the control fitness is used to calculate the probability of each control being selected, and the control is selected according to the probability for operation, and the application running state is detected. This method focuses on the suspicious controls involved in the error report, reduces the exploration of unnecessary paths, and improves the reproduction efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and more particularly to an Android application error reproduction method guided by a control hierarchy diagram. Background Art

[0002] As of December 2021, Android system accounts for 70.01% of the mobile operating system market share. With the continued prosperity of the Android system, Android mobile applications have also achieved rapid growth. In 2021, more than 2.6 million applications were released on the Google Play application market alone. Faced with the fiercely competitive mobile application market, in order to improve the competitiveness of products, developers need to quickly release new versions of applications, which makes it difficult to fully test them, resulting in more errors. This has further increased the testing and maintenance costs of mobile applications, and the robustness and reliability of mobile applications are facing unprecedented challenges.

[0003] Studies have shown that 88% of users will give up using an app when they encounter repeated app errors. It can be seen that errors in an app directly affect user retention, and app quality is a key factor in determining its success. To improve app quality, developers need to respond quickly and fix the errors they find. A very critical step in fixing errors is to reproduce the errors. However, since applications have complex event-driven GUI-related behaviors and may require many GUI-based operations to reproduce errors, it is a very inefficient way for developers to manually reproduce errors. Existing automated testing tools can help developers reproduce errors, but they are inefficient. Take Google's automated testing tool Monkey as an example. It generates random UI event sequences and injects them into the target Android application without considering the design details of the application under test. Although this type of automated testing tool can find errors in some of the objects under test, its search range is all executable paths within the application, which lacks pertinence and has a low efficiency in reproducing errors.

[0004] In order to track and speed up the resolution of problems in applications and manage the process, many modern software projects use error tracking systems (such as Bugzilla, Google Code Issue Tracker, and GitHub Issue Tracker) for testers to report problems found during testing. In addition, users can also report the problems they find by commenting on mobile application markets (such as Google Play). Viewing error feedback in error tracking systems and user comments is an important way to find errors. After testers and users find errors, they usually provide content such as application version, system version, error screenshots, exception stack information, and control information. Among them, developers need to pay special attention to error reports involving application crashes, because such reports directly affect the availability of applications. The exception stack information and control information contained in the error report can help developers narrow the search scope when manually locating errors. Similarly, when reproducing errors automatically, if the above information in the error report can be effectively used, the search scope can also be narrowed, and test resources can be more concentrated on the location involved in the error report, thereby improving the efficiency of reproducing errors. However, existing automated testing tools usually do not pay attention to error reports. Summary of the invention

[0005] In view of this, the present invention provides an Android application error reproduction method guided by a control hierarchy diagram, which combines the control hierarchy diagram and the static analysis of suspicious controls to obtain the control fitness, and uses the control fitness to guide the automated test, thereby achieving the purpose of rapid error reproduction. Compared with other testing methods, this method focuses on the suspicious controls involved in the error report, reduces the exploration of unnecessary paths, improves the reproduction efficiency, is applicable to different applications, is based on the control hierarchy diagram, is independent of the device and the control layout, and can be adapted to different versions of Android devices.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A control hierarchy diagram-guided Android application error reproduction method, the specific steps are as follows:

[0008] Constructing a control hierarchy diagram: Obtaining function calls according to the application project file under test, combining the function calls and the application project file under test to obtain the interface jumps and the association relationship between controls and functions, and combining the function calls, interface jumps and the association relationship between controls and functions to complete the construction of the control hierarchy diagram;

[0009] Fitness calculation: locate suspicious controls by combining error reports and the application project files under test, and calculate the control fitness using the control hierarchy diagram and the suspicious controls;

[0010] Automatic generation of test scripts: Identify the control information in the current interface of the application under test, use the control fitness to calculate the probability of each control being selected, select the control for operation based on the probability, and detect the application running status. If the error is successfully reproduced, output the test script that can reproduce the error, otherwise, continue to execute the test.

[0011] Optionally, in the above-mentioned control hierarchy diagram-guided Android application error reproduction method, the specific steps of constructing the control hierarchy diagram are as follows:

[0012] Step 1-1: Initial state, input the application project file under test;

[0013] Step 1-2: APK file generation;

[0014] Step 1-3: Output APK file;

[0015] Step 1-4: Analyze function calls;

[0016] Step 1-5: Output function call;

[0017] Step 1-6: Extract information from the application project file under test in combination with function calls;

[0018] Step 1-7: Output the relationship between controls and functions and interface jumps;

[0019] Step 1-8: Use function calls, interface jumps, and the relationship between controls and functions to build a control hierarchy diagram;

[0020] Step 1-9: Output the control hierarchy diagram.

[0021] Optionally, in the above-mentioned control hierarchy diagram-guided Android application error reproduction method, the control hierarchy diagram corresponding to the Android application A is a six-tuple (V, C, J, W, W jump , P); the nodes in the graph are the function set V in A; there are two types of edges in the graph, namely the function call set C in A and the interface jump set J; W is the control set in A; W jump is a set of controls in A that can trigger interface jumps; P is a set of interfaces in A, each interface consists of several controls; for function v i ∈V, is the same as the function v i The associated control set represents the operation set W i When any control in the function v i Will be called if Indicates v i There is no associated control; for the function call ck,l ∈C,Caller(c k,l )=v k ∈V,Callee(c k,l )=v l ∈V, represents v in A k Will call v l ; For interface jump j m,n ∈J,From(j m,n )=p m ∈P,To(j m,n )=p n ∈P, indicating that the interface p in A m You can jump to the interface p n , where the jump starting point is p m , the jump destination is p n .

[0022] Optionally, in the above-mentioned control hierarchy diagram-guided Android application error reproduction method, the specific steps of fitness calculation are as follows:

[0023] Step 2-1: Initial state, input error report;

[0024] Step 2-2: Input the application project file under test;

[0025] Step 2-3: Locate suspicious controls;

[0026] Step 2-4: Output the suspicious control set W susp ;

[0027] Step 2-5: Input control hierarchy diagram;

[0028] Step 2-6: Find the interface where all suspicious controls are located;

[0029] Step 2-7: Output the interface set P where the suspicious controls are located locate ;

[0030] Step 2-8: Use formula (1) to calculate the set P locate The adaptability of controls in all interfaces;

[0031]

[0032] Step 2-9: Find and output the P locate The interface set P in which any interface is the jump destination start ;

[0033] Step 2-10: Determine P start Is it empty? If so, go to step 2-14; if not, go to step 2-11;

[0034] Step 2-11: Enter the control set W that can trigger the interface jump jump ;

[0035] Step 2-12: Use formula (2) to calculate the set P start The adaptability of controls in any interface;

[0036]

[0037] Step 2-13: P locate =P start , jump to step 2-9;

[0038] Step 2-14: Output the control fitness calculation results.

[0039] Optionally, in the above-mentioned control hierarchy diagram-guided Android application error reproduction method, the specific steps of automatically generating a test script are as follows:

[0040] Step 3-1: Initial state, input the application under test;

[0041] Step 3-2: Get the current interface information;

[0042] Step 3-3: Output interface information;

[0043] Step 3-4: Identify the controls in the current interface;

[0044] Step 3-5: Output all controls in the current interface;

[0045] Step 3-6: Input control fitness;

[0046] Step 3-7: Calculate the probability of each control being selected;

[0047] Step 3-8: Output control probability;

[0048] Step 3-9: Select and operate controls;

[0049] Step 3-10: Determine whether the error has been reproduced. If so, output the test script. Otherwise, execute step 3-2.

[0050] Optionally, in the above-mentioned control hierarchy diagram-guided Android application error reproduction method, the specific steps of calculating the probability of each control being selected are as follows: t ∈P, use formula (3) to calculate p t The probability of each control being selected in ; where, For p t Middle Controls The fitness of For interface p t The sum of the fitness of all controls in The probability of being selected is its fitness and interface p t The ratio of the sum of fitness of all controls in ;

[0051]

[0052] Through the above technical solution, it can be known that compared with the prior art, the present invention discloses a method for reproducing Android application errors guided by a control hierarchy diagram. First, the APK file generated by the tested application project file is analyzed to obtain function calls, and the interface jump and the association between the control and the function are extracted from the tested application project file according to the function call. The construction of the control hierarchy diagram is completed by combining the function call, the interface jump and the association between the control and the function. Secondly, the suspicious control is located according to the error report and the tested application project file. After obtaining the suspicious control, the control hierarchy diagram and the suspicious control are used to calculate the control fitness. Finally, the control fitness calculation result is used to guide the automated test, reproduce the application error, and save the operations performed during the reproduction as a test script to help developers reproduce the error. The control fitness is calculated by static analysis, and then the fitness is used to guide the automated test. There is no need to dynamically build and maintain the model during the reproduction process. Compared with traditional automated testing methods and manual reproduction methods, the reproduction cost is reduced and the reproduction efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0054] Figure 1 is a flow chart of the method of the present invention;

[0055] Figure 2 A flowchart of constructing a control hierarchy diagram of the present invention;

[0056] Figure 3 It is a fitness calculation flow chart of the present invention;

[0057] Figure 4 A flow chart is automatically generated for the test script based on control adaptability of the present invention. DETAILED DESCRIPTION

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

[0059] The embodiment of the present invention discloses an Android application error reproduction method guided by a control hierarchy diagram. First, an APK file is generated using a project file of an application under test, the APK file is analyzed to obtain function calls, interface jumps and the association relationship between controls and functions are obtained by combining the function calls and the project file of the application under test, and the construction of a control hierarchy diagram is completed by combining the function calls, the interface jumps and the association relationship between controls and functions; secondly, suspicious controls are located by combining error reports and the project file of the application under test, and the control hierarchy diagram and the suspicious controls are used to calculate the control fitness; finally, control information in the current interface of the application under test is identified, the probability of each control being selected is calculated using the control fitness, the control is selected according to the probability for operation, and the application running state is detected. If the error is successfully reproduced, a test script that can reproduce the error is output, otherwise, the test is continued.

[0060] In order to quickly reproduce errors in Android applications, the present invention proposes an Android application error reproduction method guided by a control hierarchy diagram, and the specific steps are as follows:

[0061] The embodiment of the present invention generates an APK file according to the application project file under test, and statically analyzes the APK file to obtain function calls, then extracts interface jumps and the association relationship between controls and functions from the application project file under test, and constructs a control hierarchy diagram by combining function calls, interface jumps and the association relationship between controls and functions.

[0062] The control hierarchy diagram corresponding to Android application A is a six-tuple (V, C, J, W, W jump , P). Among them, the nodes in the graph are the function set V in A; there are two types of edges in the graph, namely the function call set C in A and the interface jump set J; W is the control set in A; W jump is a set of controls in A that can trigger interface jumps; P is a set of interfaces in A, each of which is composed of several controls. i ∈V, is the same as the function v i The associated control set represents the operation set W i When any control in the function v i Will be called if Indicates vi There is no associated control; for the function call c k,l ∈C,Caller(c k,l )=v k ∈V,Callee(c k,l )=v l ∈V, represents v in A k Will call v l ; For interface jump j m,n ∈J,From(j m,n )=p m ∈P,To(j m,n )=p n ∈P, indicating that the interface p in A m You can jump to the interface p n , where the jump starting point is p m , the jump destination is p n .

[0063] like Figure 2 As shown, the steps to build a control hierarchy diagram are as follows:

[0064] Step 1-1: Initial state, input the application project file under test;

[0065] Step 1-2: APK file generation;

[0066] Step 1-3: Output APK file;

[0067] Step 1-4: Analyze function calls;

[0068] Step 1-5: Output function call;

[0069] Step 1-6: Extract information from the application project file under test in combination with function calls;

[0070] Step 1-7: Output the relationship between controls and functions and interface jumps;

[0071] Step 1-8: Use function calls, interface jumps, and the relationship between controls and functions to build a control hierarchy diagram;

[0072] Step 1-9: Output the control hierarchy diagram.

[0073] In steps 1-3 to 1-5, the present invention performs static analysis on the APK file of the application under test to obtain all function calls in the application. The function set V and the function call set C can be directly obtained from the function call. k,l ∈C,Caller(c k,l )=v k ∈V,Callee(c k,l )=vl ∈V, represents v in A k Will call v l The present invention uses FlowDroid 1 Analyze function calls. Android applications are composed of components with complex life cycles (ActivitV, Service, BroadcastReceiver, and ContentProvider) and developer-defined GUI callback methods. Components with complex life cycles provide multiple callback methods (i.e., life cycle callback methods). Calling life cycle callback methods allows components to transition between various stages of the life cycle. These life cycle callback methods and GUI callback methods are implicitly called by the Android framework. In order to reduce the complexity of Android applications, FlowDroid artificially synthesizes a class of methods (i.e., dummy methods) that represent implicit calls by calling life cycle callback methods and GUI callback methods in a specific order.

[0074] In steps 1-6 to 1-7, the present invention analyzes the application project file under test in combination with function calls to obtain the association relationship between interface jumps and controls and functions. First, the control set W can be directly obtained from the application project file under test. Then, the association relationship between controls and functions is obtained, and the method associated with the control set W is obtained by analyzing the application project file under test (when operating a certain control, if the control automatically calls a certain method, then the control is said to be associated with this method). For function v i ∈V, That is, function v i With the set W i The controls in are related to each other. Third, get the interface set P, traverse the function set V, if the function v u is a dummy function, then get v u The control collection associated with the called function And W u The interface p u Add the interface set P. Finally, get the interface jump set J. If the interface p m You can jump to the interface p n , will be able to trigger the interface jump control w m,n Add to collection W jump , and jump the interface to j m,n Add J, where From(j m,n )=p m ,To(j m,n )=p n .

[0075] In steps 1-8 to 1-9, the present invention uses a function set V, a function call set C, a control set W, and a control set W capable of triggering an interface jump. jump , the interface set P and the interface jump set J together constitute a control hierarchical relationship diagram. Among them, the first two items are obtained in steps 1-3 to 1-5, and the last four items are obtained in steps 1-6 to 1-7.

[0076] The embodiment of the present invention locates suspicious controls from the application project file under test according to the error report, and then calculates the fitness of each control in the application according to the located suspicious controls and the control hierarchy relationship diagram.

[0077] like Figure 3 As shown, the steps of fitness calculation are as follows:

[0078] Step 2-1: Initial state, input error report;

[0079] Step 2-2: Input the application project file under test;

[0080] Step 2-3: Locate suspicious controls;

[0081] Step 2-4: Output the suspicious control set W susp ;

[0082] Step 2-5: Input control hierarchy diagram;

[0083] Step 2-6: Find the interface where all suspicious controls are located;

[0084] Step 2-7: Output the interface set P where the suspicious controls are located locate ;

[0085] Step 2-8: Use formula (1) to calculate the set P locate The adaptability of controls in all interfaces;

[0086] Step 2-9: Find and output the P locate The interface set P in which any interface is the jump destination start ;

[0087] Step 2-10: Determine P start Is it empty? If so, go to step 2-14; if not, go to step 2-11;

[0088] Step 2-11: Enter the control set W that can trigger the interface jump jump ;

[0089] Step 2-12: Use formula (2) to calculate the set P start The adaptability of controls in any interface;

[0090] Step 2-13: Plocate =P start , jump to step 2-9;

[0091] Step 2-14: Output the control fitness calculation results.

[0092] In step 2-3, suspicious controls can be obtained using information retrieval-based bug localization (IRBL). IRBL takes error reports (error information found during use submitted by users or testers, which may include application version, system version, error screenshots, exception stack information, control information, etc.) and the application project file under test as input, and outputs an ordered list of suspicious controls (controls are sorted from high to low according to the possibility of triggering application errors). This method selects the first x controls in the ordered list (x>0) as the suspicious control set W susp .

[0093] In steps 2-5, input the control hierarchy diagram built in step 1.

[0094] Get suspicious control collection W susp After the control hierarchy diagram is obtained, the control fitness can be calculated (steps 2-6 to 2-14):

[0095] In step 2-6, find the set W susp The interface where each control is located is stored in the collection P locate For the interface p n ∈P, if there exists and This indicates that the interface p n Suspicious controls exist in The interface p n Add to collection P locate .

[0096] In step 2-8, for the interface p n ∈P locate , use formula (1) to calculate p n The fitness of each control in . Among them, for the control If the control Then its fitness is K×N; if the control Then its fitness is N. Where N is a non-zero constant and K is a constant greater than 1.

[0097] In step 2-9, find the control hierarchy diagram with set P locate The middle interface is the interface set P of the jump destination start , get P start . For interface jump jm,n ∈J, if there exists p n ∈P locate and p m ∈P, satisfying To(j m,n )=p n ,From(j m,n )=p m , then the interface p m Add to collection P start .

[0098] In step 2-10, determine the set P start Is it empty? If P start If it is not empty, execute steps 2-11 to 2-13; otherwise, execute step 2-14.

[0099] In step 2-11, input the control set W that can trigger the interface jump obtained in step 1 jump ;

[0100] In step 2-12, for the interface p m ∈P start , there exists p n ∈P locate and j m,n ∈J, satisfying: From(j m,n )=p m AndTo(j m,n )=p n , use formula (2) to calculate p m The adaptability of the control in . Among them, for If the control It is the interface m Can trigger the interface to jump to p n The fitness is p n The sum of the fitness of all controls in If the control Belong to interface p m and If it is not a control that can trigger interface jump, its fitness is N.

[0101]

[0102]

[0103] The embodiment of the present invention uses the control fitness to guide the automated test, so as to quickly reproduce the application errors and output the test script. The detailed steps of the test script automated generation are as follows: Figure 4 shown.

[0104] Step 3-1: Initial state, input the application under test;

[0105] Step 3-2: Get the current interface information;

[0106] Step 3-3: Output interface information.

[0107] Step 3-4: Identify the controls in the current interface;

[0108] Step 3-5: Output all controls in the current interface;

[0109] Step 3-6: Input control fitness;

[0110] Step 3-7: Calculate the probability of each control being selected;

[0111] Step 3-8: Output control probability;

[0112] Step 3-9: Select and operate controls;

[0113] Step 3-10: Determine whether the error has been reproduced. If so, output the test script. Otherwise, execute step 3-2.

[0114] When the application under test is in a certain interface during execution, the present invention will select one of all controls in the current interface and operate it. The adaptability of the control will directly affect the probability of the control being selected, thereby affecting the exploration process of the application by the automated test.

[0115] In step 3-7, for the interface p t ∈P, use formula (3) to calculate p t The probability of each control being selected. For p t Middle Controls The fitness of For interface p t The sum of the fitness of all controls in the control. The probability of being selected is its fitness and interface p t The ratio of the sum of the fitness of all controls in the .

[0116]

[0117] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0118] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A control hierarchy diagram-guided Android application error reproduction method, It is characterized in that The specific steps are as follows: Constructing the control hierarchy diagram: Get the function call according to the project file of the application under test, combine the function call and the project file of the application under test to get the interface jump and the relationship between the control and the function, and complete the construction of the control hierarchy diagram by combining the function call, interface jump and the relationship between the control and the function; the control hierarchy diagram corresponding to Android application A is a six-tuple (V, C, J, W, W jump ,P); the nodes in the graph are the function set V in A; there are two types of edges in the graph, namely the function call set C in A and the interface jump set J; W is the control set in A; W jump is a set of controls in A that can trigger interface jumps; P is a set of interfaces in A, each interface consists of several controls; for function v i ∈V, is the same as the function v i The associated control set represents the operation set W i When any control in the function v i Will be called if Indicates v i There is no associated control; for the function call c k,l ∈C,Caller(c k,l )=v k ∈V,Callee(c k,l )=v l ∈V, represents v in A k Will call v l ; For interface jump j m,n ∈J,From(j m,n )=p m ∈P,To(j m,n )=p n ∈P, indicating that the interface p in A m You can jump to the interface p n , where the jump starting point is p m , the jump destination is p n ; Fitness calculation: locate suspicious controls based on error reports and the application project files under test, and calculate the control fitness using the control hierarchy diagram and the suspicious controls; the specific steps for fitness calculation are as follows: Step 2-1: Initial state, input error report; Step 2-2: Input the application project file under test; Step 2-3: Locate suspicious controls; Step 2-4: Output the suspicious control set W susp ; Step 2-5: Input control hierarchy diagram; Step 2-6: Find the interface where all suspicious controls are located; Step 2-7: Output the interface set P where the suspicious controls are located locate ; Step 2-8: Use formula (1) to calculate the set P locate The adaptability of controls in all interfaces; Step 2-9: Find and output the P locate The interface set P in which any interface is the jump destination start ; Step 2-10: Determine P start Is it empty? If so, go to step 2-14; if not, go to step 2-11; Step 2-11: Enter the control set W that can trigger the interface jump jump ; Step 2-12: Use formula (2) to calculate the set P start The adaptability of controls in any interface; Step 2-13: P locate =P start , jump to step 2-9; Step 2-14: Output the control fitness calculation results; Automatic generation of test scripts: Identify the control information in the current interface of the application under test, use the control fitness to calculate the probability of each control being selected, select the control to operate according to the probability, and detect the application running status. If the error is successfully reproduced, output the test script that can reproduce the error, otherwise, continue to execute the test; calculate the probability of each control being selected. The specific steps are as follows: For the interface p t ∈P, use formula (3) to calculate p t The probability of each control being selected in ; where, For p t Middle Controls The fitness of For interface p t The sum of the fitness of all controls in The probability of being selected is its fitness and interface p t The ratio of the sum of fitness of all controls in ; 2. According to the control hierarchy diagram-guided Android application error reproduction method of claim 1, It is characterized in that The specific steps of constructing the control hierarchy diagram are as follows: Step 1-1: Initial state, input the application project file under test; Step 1-2: APK file generation; Step 1-3: Output APK file; Step 1-4: Analyze function calls; Step 1-5: Output function call; Step 1-6: Extract information from the application project file under test in combination with function calls; Step 1-7: Output the relationship between controls and functions and interface jumps; Step 1-8: Use function calls, interface jumps, and the relationship between controls and functions to build a control hierarchy diagram; Step 1-9: Output the control hierarchy diagram.

3. According to the control hierarchy diagram-guided Android application error reproduction method of claim 1, It is characterized in that The specific steps for automatic test script generation are as follows: Step 3-1: Initial state, input the application under test; Step 3-2: Get the current interface information; Step 3-3: Output interface information; Step 3-4: Identify the controls in the current interface; Step 3-5: Output all controls in the current interface; Step 3-6: Input control fitness; Step 3-7: Calculate the probability of each control being selected; Step 3-8: Output control probability; Step 3-9: Select and operate controls; Step 3-10: Determine whether the error has been reproduced. If so, output the test script. Otherwise, execute step 3-2.

Citation Information

Patent Citations

  • Method for testing Android application controls

    CN104834600A

  • Method and device for detecting properties of Android application program

    CN114637664A