CN111290938A - Android semi-automatic testing method based on manual assistance - Google Patents
Android semi-automatic testing method based on manual assistance Download PDFInfo
- Publication number
- CN111290938A CN111290938A CN201811499040.XA CN201811499040A CN111290938A CN 111290938 A CN111290938 A CN 111290938A CN 201811499040 A CN201811499040 A CN 201811499040A CN 111290938 A CN111290938 A CN 111290938A
- Authority
- CN
- China
- Prior art keywords
- test
- page
- application
- android
- traversal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 91
- 238000000034 method Methods 0.000 claims description 22
- 238000013515 script Methods 0.000 claims description 17
- 230000008569 process Effects 0.000 claims description 12
- 230000002159 abnormal effect Effects 0.000 claims description 2
- 238000009434 installation Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 abstract description 3
- 230000007849 functional defect Effects 0.000 abstract 1
- 238000004422 calculation algorithm Methods 0.000 description 11
- 241000282693 Cercopithecidae Species 0.000 description 4
- 238000013522 software testing Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
Abstract
The invention provides an Android semi-automatic testing method based on manual assistance, which is used for improving the depth and effectiveness of automatic testing in the field of Android application automatic testing. The invention finally obtains the page tree diagram, the test log, the screenshot and a series of compatibility information and performance indexes of the specific test application, further helps testers to find the functional defects and potential problems of the test application, and locates the errors of the application in the test.
Description
Technical Field
The invention belongs to the technical field of software testing in computer technology, in particular to the technical field of automatic testing in software testing, and is used for performing manual-assisted semi-automatic testing on Android application, namely performing automatic testing by mainly using depth traversal testing and combining the assistance of the conventional manual script and collecting various testing information.
Background
In a conventional testing process, a tester often tests a mobile application in a manual click mode. The manual testing mode is time-consuming and labor-consuming, and is difficult to cover various machine types and various system versions and to cover the page set of the application. Just because of the inefficiency of manual testing, the industry has begun to seek automated testing methods to replace manual testing.
Automated testing can be broadly divided into three categories: monkey, record-playback, automated traversal. Monkey, namely randomly clicking the application, can provide a pressure test for the mobile application, and may also find errors that cannot be found by other two ways (event processing of the other two ways is component-based, errors outside the component cannot be found, and Monkey does not have such a limitation), but the random clicking way also determines the characteristic of low efficiency, and the test process is difficult to reproduce. Recording-playback requires the tester to perform a manual test in advance, the system automatically generates a test script, and the test process can be reproduced on the machine. Because the test script is generated by interaction between a user and an application program, a large amount of hard coding is often provided, so that the test script lacks reusability and has high maintenance cost. Furthermore, a relatively stable recording-playback tool has not been presented so far.
The automatic traversal test can automatically identify the page elements of the mobile application in the traversal process, automatically operate the corresponding elements and automatically generate a test model. Compared with the random test of Monkey, the automatic traversal test has the advantages of high coverage, controllable path, reproducible test process and the like; compared with a recording-playback test mode, the automatic traversal test has the advantages of high reusability, high automation and the like.
In many cases, however, the results obtained may not be ideal when performing automated traversal testing of mobile applications. One of the most notable problems is that most applications include events requiring specific operations, such as input events, typically user login actions, which require user input parameters, but this is often achieved only by configuring parameters when performing automated traversal tests, that is, the specific input parameters of each mobile application to be tested need to be configured, otherwise the traversal depth is greatly affected, and such a solution causes the test script to lose its reusability.
Disclosure of Invention
The invention aims to solve the problems that: an Android semi-automatic testing method based on manual assistance is provided. The technical scheme of the invention is as follows:
1) installing and starting an application to be tested on a testing machine, collecting various performance indexes and compatibility information, and acquiring all controls on the current page
2) And traversing the controls on the page in sequence, simulating to generate user events, judging whether the existing artificial script is used as an assistant, and if so, acquiring available user events in the existing script to operate the current control. Otherwise, automatically generating a corresponding event according to the type of the control, wherein most events are click events.
3) And judging the page state after the user event is simulated, adopting a depth-first traversal strategy, and if a new page is entered, acquiring all controls on the new page and starting a new round of traversal. And if the new page is not entered, updating the current page control and continuing to traverse.
4) The method comprises the following steps that (1) after the automatic test is finished, test passing conditions are collected, a test spanning tree is drawn, and the test is finished under 4 conditions, (1) all applications to be tested traverse and are finished, (2) the set test time is exceeded; (3) the page which does not belong to the application to be tested is reached in the test process and the return cannot be carried out; (4) an abnormal crash occurs during the test. And after the test is finished, collecting the passing condition of the test, and drawing a test spanning tree taking the page screenshot as a node according to the page screenshot in the test process and the recorded test spanning tree.
The invention has the beneficial effects that: the automatic traversal test can be assisted by using the written test script of a tester when testing each specific function, and the depth of the automatic traversal test can be well improved and better effect can be obtained under the condition that each application to be tested does not need to be subjected to specific parameter configuration.
Drawings
FIG. 1 is an execution flow chart of an Android semi-automatic testing method based on manual assistance
FIG. 2 is an exemplary diagram of establishing a parent-child relationship of pages
FIG. 3 is an exemplary diagram of changing the parent-child relationship of a page
FIG. 4 improved depth-first traversal example code
Detailed description of the invention
The method uses an algorithm of a depth-first traversal strategy as a framework, so that the automatic test script logic of the depth-first traversal strategy is realized firstly, then optimization is carried out on the automatic test script logic, the collection of all information in the test process is added into the depth-first traversal algorithm, the assistance of the existing manual script is combined, deep-level traversal test is carried out on the application, all functions of the application are tested, the compatibility information of the application is collected, and a tree-shaped structure chart and a detailed test report of the test application are derived. The specific execution flow of the method is shown in figure 1.
The method is mainly realized based on an improved depth-first traversal algorithm, the whole page structure of the application to be tested is abstracted into a tree, when a certain page is entered, all control elements of the current page are obtained, the elements are traversed in sequence, and corresponding operation is executed.
When an operation is performed on a component of a page, the following situations may occur:
1) the page has not changed
2) The main structure of the page is not changed, and the detail is slightly changed
3) Enter a new sub-page
4) Go to a sub-page that was present
5) Go back to its parent page
And aiming at the conditions 1) and 3), completing the traversal by using a common depth-first traversal algorithm. For case 2), a determination needs to be made: when the changed elements are not enough, no treatment is carried out; when the changed elements are enough, the current page is updated and traversed.
Since the actual structure of this page tree is not known in advance, the normal depth-first traversal algorithm has not been able to solve the problem when encountering cases 4), 5). On the basis, the method adds additional content on the basis of a common depth-first traversal algorithm: establishing parent-child relationships and changing parent-child relationships.
1) Establishing parent-child relationships
As shown in FIG. 2, the A page jumps to the B interface, the B interface jumps to the C interface, and the C jumps to the B interface. When the traversal of the interface B is finished, the return to the parent page is required, the return to the interface C is required in the logic of the original algorithm (because C calls B at last), and the return to the interface A is realized in the actual return operation (the Android return key function is used for realizing the return of the page).
In order to solve the conflict, the method adds a function of establishing a parent-child relationship, namely marking that the page B is a child page of the page A, and marking that the page C is a child page of the page B. When the C interface jumps to the B interface, the method considers that the operation executes the Return operation of the depth-first traversal algorithm, namely, the operation returns to the parent node from the child node instead of a new round of depth-first traversal algorithm. Thus, when the B page is ready to return, it is logically returned its parent page A, consistent with the actual operation.
2) Changing parent-child relationships
As shown in FIG. 3, both A and B pages can jump to C page, A first B then B. When the B page jumps to the C page and the C page finishes traversing and prepares to return, the C page is logically returned to the A page because the C is recorded as a sub-page of the A in the program, but in actual operation, the C page is returned to the B page. In order to solve the conflict, the method changes the parent page of the C page to be B when B jumps to C.
In conclusion, the improved algorithm realized based on the depth-first traversal strategy is combined with the assistance of the artificial script, so that the test application can be traversed more deeply, and the potential problems or bugs of the application can be found. The pseudo code of the improved depth-first traversal algorithm in the method is shown in fig. 4.
Claims (3)
1. An Android semi-automatic testing method based on manual assistance is characterized by comprising the following steps: (1) performing automatic test on the application to be tested by a depth-first traversal strategy, and simulating user events such as clicking, sliding and inputting; (2) the method supports the configuration of the existing test script written by people and is used for assisting the automatic test; (3) and collecting information such as screenshots, logs, installation and uninstallation conditions, electric quantity, CPU occupancy rate, tester types, tester versions, test passing conditions and the like in the test process, and generating a test spanning tree from the test screenshots.
2. The Android semi-automatic testing method based on manual assistance as claimed in claim 1, characterized in that a depth-first traversal strategy is adopted to automatically explore the application, and test sequences such as clicking, sliding and inputting are generated according to controls on a page; existing test scripts may be configured as an aid before starting the automated test, i.e., available user events are extracted from the existing scripts for use in generating test sequences.
3. The Android semi-automatic testing method based on manual assistance as claimed in claims 1 and 2, is characterized by comprising the following specific steps:
1) installing and starting an application to be tested on a testing machine, collecting various performance indexes and compatibility information, and acquiring all controls on a current page;
2) and traversing the controls on the page in sequence, simulating to generate user events, judging whether the existing manual script is used as an assistant or not as described in the claims 1 and 2, and if so, acquiring available user events in the existing script to operate the current control. Otherwise, automatically generating corresponding events according to the types of the controls, wherein most events are click events;
3) and judging the page state after the user event is simulated, and acquiring all controls on a new page and starting a new round of traversal according to the depth-first traversal strategy of the claims 1 and 2 if the new page is entered. If the new page is not entered, updating the current page control and continuing to traverse;
after the automatic test is finished, collecting the passing condition of the test, and drawing a test spanning tree, wherein the test is finished under three conditions, (1) the set test time is exceeded; (2) the page which does not belong to the application to be tested is reached in the test process and the return cannot be carried out; (3) abnormal collapse occurs in the test process; and after the test is finished, collecting the passing condition of the test, and drawing a test spanning tree taking the page screenshot as a node according to the page screenshot in the test process and the recorded test spanning tree.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811499040.XA CN111290938A (en) | 2018-12-08 | 2018-12-08 | Android semi-automatic testing method based on manual assistance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811499040.XA CN111290938A (en) | 2018-12-08 | 2018-12-08 | Android semi-automatic testing method based on manual assistance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111290938A true CN111290938A (en) | 2020-06-16 |
Family
ID=71023176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811499040.XA Pending CN111290938A (en) | 2018-12-08 | 2018-12-08 | Android semi-automatic testing method based on manual assistance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111290938A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113779352A (en) * | 2021-07-27 | 2021-12-10 | 浙江大学 | Mobile terminal application page automatic traversal method oriented to barrier-free detection |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461900A (en) * | 2014-12-19 | 2015-03-25 | 北京奇虎科技有限公司 | User interface testing method, center control server, test terminal and system |
CN106649100A (en) * | 2016-11-16 | 2017-05-10 | 福建天晴数码有限公司 | Automatic test method and system |
CN107526676A (en) * | 2016-06-20 | 2017-12-29 | 苏宁云商集团股份有限公司 | A kind of cross-system method of testing and device |
-
2018
- 2018-12-08 CN CN201811499040.XA patent/CN111290938A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461900A (en) * | 2014-12-19 | 2015-03-25 | 北京奇虎科技有限公司 | User interface testing method, center control server, test terminal and system |
CN107526676A (en) * | 2016-06-20 | 2017-12-29 | 苏宁云商集团股份有限公司 | A kind of cross-system method of testing and device |
CN106649100A (en) * | 2016-11-16 | 2017-05-10 | 福建天晴数码有限公司 | Automatic test method and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113779352A (en) * | 2021-07-27 | 2021-12-10 | 浙江大学 | Mobile terminal application page automatic traversal method oriented to barrier-free detection |
CN113779352B (en) * | 2021-07-27 | 2023-11-24 | 浙江大学 | Mobile terminal application page automatic traversing method for barrier-free detection |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109739755B (en) | Fuzzy test system based on program tracking and mixed execution | |
US8627290B2 (en) | Test case pattern matching | |
CN110008113B (en) | Test method and device and electronic equipment | |
CN105373478B (en) | Automated testing method and system | |
Cunha et al. | PETTool: a pattern-based GUI testing tool | |
CN108021509B (en) | Test case dynamic sequencing method based on program behavior network aggregation | |
Eldh et al. | A framework for comparing efficiency, effectiveness and applicability of software testing techniques | |
CN111008154B (en) | Android application automatic test method and system based on reinforcement learning | |
CN108874649B (en) | Method and device for generating automatic test script and computer equipment thereof | |
EP3264274A1 (en) | Input discovery for unknown program binaries | |
CN107608873B (en) | Software testing method and system and testing platform | |
CN102707712B (en) | Electronic equipment fault diagnosis method and system | |
CN115080398A (en) | Automatic interface test system and method | |
Said et al. | Towards Interactive Mining of Understandable State Machine Models from Embedded Software. | |
CN106528429A (en) | UI testing method and device | |
CN111258876B (en) | Accurate regression testing method and device under micro-service architecture | |
CN110990282B (en) | Automatic unit testing method | |
CN111290938A (en) | Android semi-automatic testing method based on manual assistance | |
CN107273745B (en) | Dynamic analysis method for malicious code in dynamic link library form | |
CN112631704A (en) | Interface element identification method and device, storage medium and electronic equipment | |
CN117493188A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN112084108A (en) | Test script generation method and device and related components | |
Wang et al. | Design pattern detection in Eiffel systems | |
CN111984624A (en) | Method and system for data migration through correction migration model | |
CN107102938B (en) | Test script updating method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20211008 Address after: 518000 903a, building 10, Shenzhen Bay science and technology ecological park, No. 10, Gaoxin ninth Road, high tech Zone community, Yuehai street, Nanshan District, Shenzhen, Guangdong Applicant after: Shenzhen Muzhi Technology Co.,Ltd. Address before: Room 1302, 301 Hanzhongmen street, Gulou District, Nanjing City, Jiangsu Province, 210000 Applicant before: NANJING MUCE INFORMATION TECHNOLOGY Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200616 |