Font Size: a A A

Research On APP Test Case Generation Method Based On Guided Direction

Posted on:2021-02-21Degree:MasterType:Thesis
Country:ChinaCandidate:H H YangFull Text:PDF
GTID:2428330626958913Subject:Computer technology
Abstract/Summary:PDF Full Text Request
In mobile software testing,the comprehensiveness and reusability of the tests are the main indicators of the strengths and weaknesses of the test cases.Under the premise of ensuring the comprehensiveness and reusability of Android mobile terminal testing,in order to solve the problem of weak guidance of test cases,we propose to adopt the app function test based on the recording and playback mechanism on the Android platform and combine the guiding information to generate the final test.In the use case,the recording part first records the operation of the mobile terminal and forms a test script;the playback part then returns the generated test case to the app functional test for quality inspection.The current software testing tools for the Android platform have the disadvantages of low test case coverage and low reusability.In this paper,we study the test case generation method of the depth-first traversal control and find that the DFS algorithm will generate an infinite loop and low efficiency when it traverses the control.Problems,and the emergence of an infinite loop is difficult to find and consumes PC-side memory resources.It takes a lot of manpower to modify the bug.Based on this,a method for generating app test cases(PBW algorithm)based on path branch weight algorithm is proposed.Under the guidance of the target path,this method assigns weights to each test path to measure the quality of the path,and by setting the size of the stack,it avoids the problem of an infinite loop in the program when the control traverses the ring structure in the directed graph.It not only retains the high path coverage of the depth-first traversal algorithm and satisfies the comprehensiveness of test cases,but also provides test direction through weight information.First,the relevant functional modules of the app under test are simulated and recorded on the Android phone,and then the coordinate-based script generated by therecording result is converted into a script based on the control information through JNI technology and the interface calls provided in the Android auxiliary service class.The control The information script extracts a path that can implement the function to be tested as a target path to guide future paths to be expanded.The function of the target path is to avoid deviation from the functional test and improve the control traversal efficiency.The input test data is combined with the generated test path to generate App corresponding functional test cases.The main work of this paper covers the implementation of data communication technology between the mobile terminal and the PC,the acquisition of the underlying operating events on the mobile terminal,the technologies and methods for converting the acquired operating events into controls,and the introduction of guiding information.The following is a brief description:1.The development and testing phase of the Android-side application is performed on the PC side.In order to ensure the communication between the mobile terminal and the PC side,ADB tools and Socket tools are used to complete the end-to-end data transmission.Use shell commands on the PC side to simulate the operations of the tester on the mobile side.Through the connection to achieve the test process and problem feedback.2.JNI technology extracts path information.The tester's initial operation on the mobile terminal needs to use JNI technology to convert to coordinate-based information.Then the control information extraction method in the Android auxiliary service class will convert the coordinate-based information into the corresponding control-based information.The path extracted from the path based on the control information is called the target path.The advantage of control information over coordinate information is that control information is mainly composed of the control's individual identification and operation on the control.Testers can easily edit the script,while coordinate information needs to be combined with the specific position on the screen.There is no flexibility.And the reusability is very low.3.In the control traversal based on the PBW algorithm,each time a path that meets the functional test is traversed,the weight of the current path branch ismeasured by the degree of its deviation from the target path.The weight information of the path is reflected in the test case file.The weight information will provide the tester with a test direction.When time is tight,the test path can be tested in a priority manner based on the path information fed back by the weight.4.The test path and test data together form a test case file.In the case of cross-Android models,the test case can still meet the corresponding functional test of the app,and for different apps with similar functions,only the test data in the test case can be modified Complete the corresponding functional test.Based on the above two points,the test cases generated by the algorithm meet the requirements of reusability.Finally,the application function test case generation method based on the PBW algorithm is applied to the Android system test case generation tool.This test tool can basically complete the app function test of the Android platform on the market,and the timeliness and comprehensiveness of the application generated by the tool Sexual test.The results were as expected.
Keywords/Search Tags:app functional test, function test, Guide direction, Test case, Android mobile
PDF Full Text Request
Related items