CN104035867B - Application function traversal method of testing based on Android - Google Patents

Application function traversal method of testing based on Android Download PDF

Info

Publication number
CN104035867B
CN104035867B CN201410243645.8A CN201410243645A CN104035867B CN 104035867 B CN104035867 B CN 104035867B CN 201410243645 A CN201410243645 A CN 201410243645A CN 104035867 B CN104035867 B CN 104035867B
Authority
CN
China
Prior art keywords
interface
information
traversal
control
android
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.)
Active
Application number
CN201410243645.8A
Other languages
Chinese (zh)
Other versions
CN104035867A (en
Inventor
刘金起
潘科
刘昕
鲁金屏
刘剑
刘杨
王鹏
王淞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CHONGQING ELECTRONIC INFORMATION SME PUBLIC SERVICE Co.,Ltd.
Original Assignee
Chongqing Tai Kai Science And Technology Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chongqing Tai Kai Science And Technology Ltd filed Critical Chongqing Tai Kai Science And Technology Ltd
Priority to CN201410243645.8A priority Critical patent/CN104035867B/en
Publication of CN104035867A publication Critical patent/CN104035867A/en
Application granted granted Critical
Publication of CN104035867B publication Critical patent/CN104035867B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

Method of testing is traveled through the invention discloses a kind of application function based on Android, belong to software testing technology field, start the interface pathfinding algorithm engine at PC ends first, then PC obtains interface information by the method for dump interface informations, interface information, the layout of assay surface and element that the parsing of PC ends is obtained, PC ends carry out extreme saturation according to the interface information for parsing.The present invention need not carry out pretreatment operation to tested application, not require that mobile phone must obtain root authority, can also be to the application of embedded in mobile phone, such as telephone directory, and the function such as short multimedia message carries out function traversal.

Description

Application function traversal method of testing based on Android
Technical field
The invention belongs to software testing technology field, more particularly to a kind of application function traversal based on Android is surveyed Method for testing.
Background technology
The testing tool instrument that the technology that existing function is traveled through at present is all based on Android phone offer enters Row realization to tested application, it is necessary to pre-process, main contents are exactly to generate a test for tested application to answer first With, reuse same signature and test application and tested application are signed, then tested application and test application are all installed Onto mobile phone, the Starting mode for being then used by android instrument starts test.
The defect of the mode of the function traversal mentioned above mainly has following,
First, it is that must first get the tested installation file applied, and it is pre-processed.But for mobile phone terminal The functions such as the application for having installed such as address list, short message, phone cannot just carry out function traversing operation;
2nd, many function ergodic algorithms are random unordered clicks, and the inspecting force to functional test is very weak;
3rd, common function ergodic algorithm or software can not carry out Test Strategy setting, cause user's pro-active intervention degree low, Ease for use is poor, is also manifested by that a travel time is long, and the ease for use of algorithm or software is very low;
4th, system bottom abnormal information can only be captured in function ergodic process, software interface is lacked Falling into find, such as software has quoted miscue frame, and software interface has mess code, and software interface resolution ratio there occurs change Change and cause interface display incomplete more than or less than terminal screen resolution or large area blank screen appearance.
The content of the invention
In view of the drawbacks described above of prior art, the technical problems to be solved by the invention are to provide one kind can be right Installed in Android terminal or uninstalled application has carried out the function traversal method of AM/BAM identification.
To achieve the above object, method of testing is traveled through the invention provides a kind of application function based on Android, including Following steps:
Step one, the interface pathfinding algorithm engine for starting PC ends;
Step 2, PC obtain interface information by the method for dump interface informations;
Interface information, the layout of assay surface and element that step 3, the parsing of PC ends are obtained;
Step 4, PC ends carry out extreme saturation or breadth traversal according to the interface information for parsing.
This program function ergodic process is driven by interface pathfinding algorithm engine, by each of Android system offer Plant interface dump methods and obtain the control and layout information at interface, and the interface control for obtaining is entered according to interface pathfinding algorithm Row traversal, it is not necessary to which pretreatment operation is carried out to tested application, it is often more important that the present invention does not require that mobile phone must obtain root power Limit, can also be to the application of embedded in mobile phone, such as telephone directory, and the function such as short multimedia message carries out function traversal.
Preferably, the extreme saturation is carried out according to the following steps:
A1, dump go out the Layout at interface and parse;
A2, recognize whether interface migrates by interface similarity comparison algorithm;When interface migrates, will migrate Interface afterwards replaces with current interface, and records current operation;When interface migrates, next step is performed;
A3, judge whether current interface also has the control that does not operate;Returned during the control that current interface is not operated also and held Row step A2, otherwise into next step;
A4, judge whether to reach critical condition;When critical condition is reached, traversal terminates;When not up to critical condition, Judge whether that all of interface all travels through completion;When all of interface all travels through completion, traversal terminates;When also interface does not have When traversal is completed, return and perform step A1.
Preferably, the interface information obtained in the step 2 is UI elements, the hierarchical relationship of each UI elements on interface With the attribute information of each UI elements itself.
Preferably, the layout and element of the interface information assay surface of the parsing acquisitions of PC ends described in step 3 press following step It is rapid to perform:
According to dump to information reverting go out interface UI control tree structures;Traversal control tree, identification can click on control and Particular interface;The particular interface includes Dialog, PopList and PopMenu.
Further, test path information, test sectional drawing information, performance data, mistake can be recorded simultaneously in running Information, for post analysis.
The beneficial effects of the invention are as follows:
1st, the present invention need not carry out pretreatment operation to tested application,
2nd, the present invention do not require that mobile phone must obtain root authority, can also to the application of embedded in mobile phone, such as telephone directory, The functions such as short multimedia message carry out function traversal.
3rd, the present invention can self-defined depth-first traversal, breadth first traversal strategy, using traversal depth, using traversal Range and application travel time length.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the embodiment of the invention.
Specific embodiment
The invention will be further described with reference to the accompanying drawings and examples:
As shown in figure 1, a kind of application function traversal method of testing based on Android, comprises the following steps:
Step one, the interface pathfinding algorithm engine for starting PC ends;
Step 2, PC obtain interface information by the method for dump interface informations;
Interface information, the layout of assay surface and element that step 3, the parsing of PC ends are obtained;
Step 4, PC ends carry out extreme saturation or breadth traversal according to the interface information for parsing.
This program function ergodic process is driven by interface pathfinding algorithm engine, by each of Android system offer Control and layout information that interface dump methods obtain Android system interface are planted, and according to interface pathfinding algorithm to obtaining Interface control traveled through, it is not necessary to pretreatment operation is carried out to tested application, it is often more important that the present invention does not require that mobile phone must Root authority must be obtained, can also be to the application of embedded in mobile phone, such as telephone directory, the function such as short multimedia message carries out function traversal.This Invention can recognize the various mistakes of mobile phone AM/BAM, exception, and possess self-learning capability, continuous learning accumulation error object storehouse, make It was found that the ability sustainability of mistake is improved.
The extreme saturation is carried out according to the following steps:
A1, dump go out the Layout at interface and parse;
A2, recognize whether interface migrates by interface similarity comparison algorithm;When interface migrates, will migrate Interface afterwards replaces with current interface, and records current operation;When interface migrates, next step is performed;It is above-mentioned Interface similarity comparison algorithm is contrasted based on interface control tree similarity.
A3, judge whether current interface also has the control that does not operate;Returned during the control that current interface is not operated also and held Row step A2, otherwise into next step;
A4, judge whether to reach critical condition;When critical condition is reached, traversal terminates;When not up to critical condition, Judge whether that all of interface all travels through completion;When all of interface all travels through completion, traversal terminates;When also interface does not have When traversal is completed, return and perform step A1.
The interface information obtained in the step 2 is the UI elements on interface, the hierarchical relationship of each UI elements and each UI unit The plain attribute information of itself.
The layout and element of the interface information assay surface that the parsings of PC ends described in step 4 are obtained are performed according to the following steps:
According to dump to information reverting go out interface UI control tree structures;Traversal control tree, identification can click on control and Particular interface;Particular interface described in the present embodiment is Dialog, PopList and PopMenu.
The interface of the depth-first and breadth first traversal algorithm travels through depth, travel time, traversal step number parameter can Configuration, function traversal running is driven by ergodic algorithm completely, and click control, input text can be recorded after each assay surface Word, test path information, test sectional drawing information, performance data, error message.The method of Android platform dump interface informations Including being carried out by viewserver and uiautomator, in the present embodiment, using viewserver come flat to android Platform dump interface informations.
Preferred embodiment of the invention described in detail above.It should be appreciated that one of ordinary skill in the art without Need creative work just can make many modifications and variations with design of the invention.Therefore, all technologies in the art Personnel are available by logical analysis, reasoning, or a limited experiment on the basis of existing technology under this invention's idea Technical scheme, all should be in the protection domain being defined in the patent claims.

Claims (3)

1. a kind of application function based on Android travels through method of testing, it is characterised in that comprise the following steps:
Step one, the interface pathfinding algorithm engine for starting PC ends;
Step 2, PC obtain interface information by the method for dump interface informations;
Interface information, the layout of assay surface and element that step 3, the parsing of PC ends are obtained;
Step 4, PC ends carry out extreme saturation according to the interface information for parsing;
The extreme saturation is carried out according to the following steps:
A1, dump go out the Layout at interface and parse;
A2, recognize whether interface migrates by interface similarity comparison algorithm;When interface migrates, after migration Interface replaces with current interface, and records current operation;When interface migrates, next step is performed;Above-mentioned interface Similarity comparison algorithm is contrasted based on interface control tree similarity;
A3, judge whether current interface also has the control that does not operate;Returned during the control that current interface is not operated also and perform step Rapid A2, otherwise into next step;
A4, judge whether to reach critical condition;When critical condition is reached, traversal terminates;When not up to critical condition, judge Whether all of interface all travels through completion;When all of interface all travels through completion, traversal terminates;When also interface does not travel through During completion, return and perform step A1;
The interface traversal depth of extreme saturation, travel time, traversal step number parameter can configure, function traversal running completely by Ergodic algorithm drive, can be recorded after each assay surface click control, input word, test path information, test sectional drawing information, Performance data, error message.
2. the application function based on Android as claimed in claim 1 travels through method of testing, it is characterized in that:The step 2 The interface information of middle acquisition is the attribute information of the UI elements, the hierarchical relationship of each UI elements and each UI elements itself on interface.
3. the application function based on Android as claimed in claim 1 travels through method of testing, it is characterized in that:Institute in step 3 The layout and element for stating the interface information assay surface that the parsing of PC ends is obtained are performed according to the following steps:
According to dump to information reverting go out interface UI control tree structures;Traversal control tree, identification can click on control and special Interface;The particular interface includes Dialog, PopList and PopMenu.
CN201410243645.8A 2014-06-04 2014-06-04 Application function traversal method of testing based on Android Active CN104035867B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410243645.8A CN104035867B (en) 2014-06-04 2014-06-04 Application function traversal method of testing based on Android

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410243645.8A CN104035867B (en) 2014-06-04 2014-06-04 Application function traversal method of testing based on Android

Publications (2)

Publication Number Publication Date
CN104035867A CN104035867A (en) 2014-09-10
CN104035867B true CN104035867B (en) 2017-06-09

Family

ID=51466640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410243645.8A Active CN104035867B (en) 2014-06-04 2014-06-04 Application function traversal method of testing based on Android

Country Status (1)

Country Link
CN (1) CN104035867B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589802A (en) * 2014-10-23 2016-05-18 阿里巴巴集团控股有限公司 Software test method and apparatus
CN105630665B (en) * 2014-11-07 2019-01-01 卓望数码技术(深圳)有限公司 A kind of application program adjustment method based on android system and terminal device
CN105653441B (en) * 2014-11-21 2018-05-22 中国科学院声学研究所 A kind of UI traversal test methods and system
CN104461526B (en) * 2014-11-27 2017-08-29 广东欧珀移动通信有限公司 A kind of control visiting method and device of end application
CN104462979B (en) * 2014-12-26 2017-11-07 深圳数字电视国家工程实验室股份有限公司 The automation dynamic testing method and device of a kind of application program
CN104899140B (en) * 2015-06-03 2017-08-25 上海斐讯数据通信技术有限公司 A kind of method of testing of mobile terminal component
CN107305579A (en) * 2016-04-25 2017-10-31 北京京东尚科信息技术有限公司 The method of testing and device of intelligent Answer System
CN107402877B (en) * 2016-05-19 2020-08-18 福建天晴数码有限公司 Android-terminal-based APP test method and system
CN106168923A (en) * 2016-06-30 2016-11-30 北京奇虎科技有限公司 A kind of function traversal and interface traversal method and system
CN107665187A (en) * 2016-07-28 2018-02-06 百度在线网络技术(北京)有限公司 A kind of method and apparatus for judging mobile device application interface and whether changing
CN106294152B (en) * 2016-08-09 2019-03-12 努比亚技术有限公司 Using the traversal test device and method of user interface
CN107122295B (en) * 2017-03-30 2020-12-29 腾讯科技(深圳)有限公司 Test case script generation method and device
CN107197070B (en) * 2017-06-08 2020-03-24 杭州友声科技股份有限公司 Automatic test method for mobile phone application UI breadth traversal based on event sequence
CN107451062B (en) * 2017-08-09 2020-12-29 百度在线网络技术(北京)有限公司 User interface traversal test method, device, server and storage medium
CN108536582B (en) * 2018-03-08 2021-05-25 挖财网络技术有限公司 Method and device for Android application overdrawing quantitative analysis
CN108932199B (en) * 2018-07-09 2020-11-17 南京网觉软件有限公司 Automatic taint analysis system based on user interface analysis
CN111817916A (en) * 2020-07-02 2020-10-23 浙江同花顺智能科技有限公司 Test method, device, equipment and storage medium based on mobile terminal cluster
CN112214397A (en) * 2020-09-09 2021-01-12 腾讯科技(深圳)有限公司 User interface testing method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7185232B1 (en) * 2001-02-28 2007-02-27 Cenzic, Inc. Fault injection methods and apparatus
CN101645968A (en) * 2009-05-15 2010-02-10 上海闻泰电子科技有限公司 Method for searching functions of mobile phone
CN103530221A (en) * 2012-07-02 2014-01-22 北京大学 Method for mapping procedure behavior and interface operation in Android system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7185232B1 (en) * 2001-02-28 2007-02-27 Cenzic, Inc. Fault injection methods and apparatus
CN101645968A (en) * 2009-05-15 2010-02-10 上海闻泰电子科技有限公司 Method for searching functions of mobile phone
CN103530221A (en) * 2012-07-02 2014-01-22 北京大学 Method for mapping procedure behavior and interface operation in Android system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android功能自动化测试工具的设计与实现;刘舒;《中国优秀硕士学位论文全文数据库》;20140515;正文第25-33页 *

Also Published As

Publication number Publication date
CN104035867A (en) 2014-09-10

Similar Documents

Publication Publication Date Title
CN104035867B (en) Application function traversal method of testing based on Android
CN103197930B (en) The method that automobile diagnostic software automatically generates
CN103019937B (en) A kind of human-machine interaction interface traverse test method
CN106326104B (en) Terminal control testing method and device
US20090271448A1 (en) System, Method, and Computer Readable Media for Identifying a User-Initiated Log File Record in a Log File
CN104407973A (en) Automatic unit test realizing method and device
CN104461846A (en) Method and device for detecting power consumption of application program
CN103425584A (en) Large-scale application regression testing information processing method based on Java bytecode
CN103942138A (en) Testing method and device
CN104636240A (en) Method for acquiring information report and terminal
CN105554265A (en) Bridge detection method, handheld terminal and cloud server
CN103324478A (en) Mobile terminal and application program management method thereof
CN105354138A (en) Method for determining specific control attribute of mobile phone page
CN105488089A (en) Automatic generation method and system of quality evaluation report
CN104123138A (en) Rapid building method for ERP system
CN103425558A (en) Method for achieving board card IO port test based on test configuration table
CN103699682A (en) Method for verifying structural logics of databases
CN101673200A (en) Method and device for detecting user input model
CN105653445A (en) Implementation method capable of meeting DO-178C test result
CN103942261A (en) Allocation input method for vehicle-mounted system fault dictionary
CN103049374B (en) Automatic testing method and device
CN103699482A (en) Method and device for testing reasonableness of controls
CN104504042A (en) Method and device for automatically hiding and displaying web form error prompt layer
CN104866413A (en) Multi-process testing method and device
CN108090355A (en) A kind of APK automatic triggers instrument

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200408

Address after: 400000 Ronghui building, science and technology entrepreneurship center, No.8 Yuma Road, Nan'an District, Chongqing (in the Economic Development Zone Development Zone)

Patentee after: CHONGQING ELECTRONIC INFORMATION SME PUBLIC SERVICE Co.,Ltd.

Address before: 400000 Chongqing international e-commerce Industrial Park, No. 199 Nancheng Road, Nan'an District, Chongqing

Patentee before: CHONGQING TAIKAI TECHNOLOGY Co.,Ltd.