CN104156308A - Mobile application testing method on basis of playback of execution trace of users - Google Patents

Mobile application testing method on basis of playback of execution trace of users Download PDF

Info

Publication number
CN104156308A
CN104156308A CN201410364808.8A CN201410364808A CN104156308A CN 104156308 A CN104156308 A CN 104156308A CN 201410364808 A CN201410364808 A CN 201410364808A CN 104156308 A CN104156308 A CN 104156308A
Authority
CN
China
Prior art keywords
user
event
trace
mobile device
halt
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.)
Granted
Application number
CN201410364808.8A
Other languages
Chinese (zh)
Other versions
CN104156308B (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.)
Nanjing University
Original Assignee
Nanjing University
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 Nanjing University filed Critical Nanjing University
Priority to CN201410364808.8A priority Critical patent/CN104156308B/en
Publication of CN104156308A publication Critical patent/CN104156308A/en
Application granted granted Critical
Publication of CN104156308B publication Critical patent/CN104156308B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a mobile application testing method on the basis of playback of execution trace of users. The mobile application testing method includes steps of recording an execution trace of a certain mobile application of a user; analyzing the execution trace and determining a plurality of stop points; playing back the execution trace of the application to a certain stop point; implanting an automatic testing method from the stop points. An automatic test process is guided by a handful of user execution trace information, the defect that automation method fails to process complicated interaction is overcome by a simple and feasible method, coverage rate of codes is greatly increased, and testing efficiency and quality are improved.

Description

A kind of mobile application testing method of carrying out trace playback based on user
Technical field
The present invention relates to mobile application testing field, what be specifically related to is a kind of method of testing of carrying out trace playback based on user.
Background technology
Mainly comprise two large classes for the method for testing of mobile application at present: manual testing and automatically test.Manual testing produces various types of test cases by means of manpower completely.Although it can obtain valuable test case by people's strength, reach better test effect.But test can allow tester feel uninteresting boring for a long time, easily makes mistakes.Automatic test roughly can be divided into Monkey instrument and the method for testing based on model.Monkey is the instrument that Android system carries, in order to random generation incoming event.This instrument cannot meet the demand that generates mass efficient test case.And based on the method for model by building GUI correlation model, each interface that traversal simply can arrive alternately in an orderly manner, has promoted test effect and efficiency.But due to the GUI event in mobile application, to be mingled with large amount of complex mutual, and the automatic mode based on model has run into self impassable obstacle.
Summary of the invention
The problem existing for prior art, the invention provides a kind of method of testing of carrying out trace playback based on user, can make up the deficiency of full-automatic method, utilize a small amount of user profile, process the indeterminable complex interaction problem of automatic mode, strengthen the coverage rate of code, thereby improve testing efficiency and quality.
Technical solution of the present invention is: a kind of method of testing of carrying out trace playback based on user, the steps include:
Step 1: user carries out trace record;
Step 2: halt identification;
Step 3: playback engine;
Step 4: automatic test engine.
In step 1, described user carries out trace record and refers to the once execution trace of recording user to mobile application.The major function of described logout part is the various sensor incoming event sequences of record move equipment;
Described user refers to the crowd of certain mobile device use experience, and this type of user can not have even ordinary procedure development Experience of mobile platform; Use in the process of mobile device user, all is all to complete between user and sensor alternately, and these type of alternative events are finally all pooled to mobile device system input processing unit;
Described record refers to and is deep into mobile device input processing unit, all sequences of events wherein saved as to user and carry out trace;
Described mobile application refers to the program that operates on mobile device, can complete various tasks, general using the multiple sensors of mobile device complete complex interaction;
Described mobile device refers to pocket size, generally carries intelligent operating system, can help user to complete the portable computing device of varied task, and described mobile device exemplary comprises smart mobile phone and panel computer;
Described execution trace refers to that user is without any information in the situation that, and routine use moves the operation incoming event sequence that application produces, and is to arrange according to Time To Event order.
In step 2, described halt identification is to analyze to carry out trace, and determines several halts.The major function of described halt identification division is to identify according to given principle the point that in incoming event sequence, several application should stop.
Described halt refers to that user carries out the stop position of trace playback time; Described stop position is that user carries out certain event in trace; Carrying out on the basis of trace according to the tactic user of event time, definite principle of halt is: carry out user and carry out in trace after a certain event, certain new gui interface produces, and this event is halt; Carry out user and carry out in trace after a certain event, certain interface of containing a large amount of GUI elements dynamically generates, and this event is halt; In the time interval that relatively user carries out adjacent two events in trace, interval exceedes certain threshold value, and the front event at this interval is halt; Described halt can be generated by above-mentioned part or all of principle identification.Described threshold value refers to the minimum value in several significantly larger time intervals.
In step 3, described playback engine refers to the execution trace of playback application, until certain halt; Specifically point to the part sequence of events that user that mobile device writes collection carries out trace, it comprises: start application program, user is carried out to event that trace comprises write mobile device system input processing unit and stop writing with certain halt that reaches user and again operate the effect of an application, determine in previous step; Described incoming event refers to all the sensors input message that mobile device receives, and comprises event time, event source and event argument information; Described event argument information comprises event type, code and value.
In step 4, described automated testing method refers to can be for some methods of the full-automatic test of mobile application; In the present invention, refering in particular to random device and Depth Priority Searching, can be existing or the method for tester oneself proposition, and they generally all comprise following three steps: first, obtain the GUI Dynamic Distribution information that is applied in the time of running, comprise various GUI elements; Then, on the GUI element information basis obtaining, according to the next input action of robotization strategy decision; Robotization strategy described here can be random selection or depth-first search; Finally input action sent to mobile device and carry out.
The present invention compared with prior art, its advantage is: the present invention combines manual testing's method with automated testing method, having brought into play manual method is good at being longer than the feature to all state traversals of ad-hoc location by advantage and the automatic mode of complex interaction heuristic routine framework, greatly strengthen the coverage rate of code, thereby improved testing efficiency and quality; From the cost of artificial participation, the present invention only needs to collect a small amount of user and carries out trace, and the user that generally need to be no more than 10 minutes participates in.
Brief description of the drawings
Fig. 1 is fundamental diagram one of the present invention;
Fig. 2 is fundamental diagram two of the present invention;
Fig. 3 is fundamental diagram three of the present invention;
Fig. 4 is workflow diagram of the present invention;
Fig. 5 is that user of the present invention carries out trace schematic diagram.
Embodiment
Below in conjunction with accompanying drawing, by specific embodiment, technical solution of the present invention is described further.
As shown in Figure 1, Figure 2, Figure 3 shows, Fig. 1 is fundamental diagram one of the present invention; Fig. 2 is fundamental diagram two of the present invention; Fig. 3 is fundamental diagram three of the present invention; In figure, tree-shaped expression needs the state space of Test Application; Circle represents program state; Bian represents various mutual, comprises button click, draws release pattern etc.Fig. 1 represents that a user who collects carries out, and in figure, 101-106 represents that a user carries out trace; Dash area 107 represents that user carries out and has covered five points; Fig. 2 is the situation of pure automatic mode, is limited to the complex interaction that dotted line 110 represents, automatic mode probably can only traverse the point of half, as shown in dash area 111; The present invention has collected user and has carried out trace 101-106, then identifying user, to carry out two events in trace be halt, as shown in the concentric circles of Fig. 3, the automatic test course starting from these two points has covered the institute figure a little, it is dash area 121 and 122, so the present invention can improve test code coverage rate greatly.
As shown in Figure 4, Figure 5, Fig. 4 is workflow diagram of the present invention; Fig. 5 is that user of the present invention carries out trace schematic diagram; The present embodiment is introduced as an example of popular Android system example.This mobile application testing method of carrying out trace playback based on user comprises logout, halt identification, playback engine, testing engine and mobile test framework five major parts.Each several part completes following four steps:
Step 1: recording user is carried out trace.As shown in Fig. 4 left part, user is in use mobile device process, in all write/dev/input/event* of the Action Events to sensor (210).This step reads and is written to/all events in dev/input/event*, and composition user carries out trace 211.When Fig. 5 is twice " press-unclamp " recording, the user of screen carries out trace, every a line represents an event, be respectively from left to right time, event source (equipment) and the event argument of event, event argument comprises type, code and value, and all events described in Fig. 5 are all to sort according to timestamp.
User carries out trace and refers to that user is in the process of operation mobile device, the incoming event sequence of mobile device all the sensors.Use in the process of mobile device user, all is all to complete between user and sensor alternately.These type of alternative events are finally all pooled to mobile device system input processing unit.Described record refers to and is deep into mobile device input processing unit, all sequences of events wherein saved as to user and carry out trace.
Step 2: identification halt.Described halt refers to the stop position of next step playback time, and it specifically refers to that the user of above-mentioned acquisition carries out certain event in trace.Carrying out on the basis of trace according to the tactic user of event time, halt is determined according to following three principles:
Carry out user and carry out in trace after a certain event, certain new gui interface produces, and this event may become halt, and for example, after in Fig. 5, second " press-unclamp " moved, new screen appears in mobile device, and the 14th event is halt.
Carrying out user carries out in trace after a certain event, certain interface of containing a large amount of GUI elements dynamically generates, and this event may become halt, for example, after " pressing-unclamp " for the first time and having moved, a large amount of dynamically GUI elements appear at screen, and the 7th event is halt.
The time interval that relatively user carries out adjacent two events in trace, interval is larger, the front event at this interval more may become halt, for example, interval of events between any two continuous events of calculating chart 5, the 7th to the 8th and the 14th to the 15th interval of events larger, so the 7th event and the 14th event may be all halts.
Described halt identification (212) can be generated by above-mentioned part or all of principle.
Step 3: playback application is carried out trace, until certain halt (213).Comprise specifically following a few step:
User is carried out to trace and all halts send to mobile device.
Start mobile device, then the event in the trace user who receives carried out is according to write/dev/input/event* of time sequencing (mobile device system input processing unit 210), again operate the effect of mobile device to reach user, the mobile device of this step need obtain ROOT authority, in addition the interval that, each event writes should be when recording interval consistent.
While arriving certain halt, stop the playback of event, and this halt is deleted from halt list.
Playback procedure described above, after step 4 completes, continues to repeat, until halt list is empty.
Step 4, from halt, carries out automated testing method (214).Described automated testing method can be existing or the method for tester oneself proposition, and they generally all comprise following three steps: first obtain the GUI Dynamic Distribution information that is applied in the time of running, comprise various GUI elements; Then on the GUI element information basis obtaining, according to the next input action of robotization strategy decision, described robotization strategy can be random selection or depth-first search; Finally input action sent to mobile device and carry out.
Typical automatic test course comprises random algorithm RND and Depth Priority Algorithm DFS; Random algorithm is random from all optional actions in the time of automated decision-making selects next action, and depth-first algorithm can be according to the institute in the mode Access Model of depth-first in figure ergodic algorithm a little and limit.
Although the present invention is with preferred embodiment openly as above, they are not for limiting the present invention, anyly have the knack of this skill person, without departing from the spirit and scope of the invention, and certainly when making various changes or retouch, but equally within protection scope of the present invention.

Claims (8)

1. carry out based on user the mobile application testing method that trace is reset, it is characterized in that, step is:
Step 1, user carry out trace record;
Step 2, halt identification;
Step 3, playback engine;
Step 4, automatic test engine.
2. the mobile application testing method of carrying out trace playback based on user according to claim 1, is characterized in that:
Described user carries out trace record and refers to the once execution trace of recording user to mobile application, refers to the various sensor incoming event sequences of record move equipment;
Described halt identification is to analyze to carry out trace, and determines several halts, refers to identify several halts in incoming event sequence according to given principle;
Described playback engine refers to the execution trace of playback application, until certain halt refers to the part incoming event sequence of record to re-write mobile device;
Described automatic test engine refers to, from halt, carries out automated testing method, completes the automatic test course of mobile device.
3. the mobile application testing method of carrying out trace playback based on user according to claim 2, is characterized in that:
In step 1, user is in use mobile device process, and all is all event to the operation of sensor, and all incoming events composition users carry out trace;
In step 2, halt refers to the stop position of next step playback time, specifically refer to that the user who obtains in step 1 carries out certain event in trace, carrying out on the basis of trace according to the tactic user of Time To Event, the principle that halt is definite: carry out user and carry out in trace after a certain event, certain new gui interface produces, and this event may become halt; Carry out user and carry out in trace after a certain event, certain interface of containing a large amount of GUI elements dynamically generates, and this event may become halt; In the time interval that relatively user carries out adjacent two events in trace, interval is larger, and the front event at this interval more may become halt; Described halt identification can be generated by above-mentioned part or all of principle;
In step 3, be specially: user is carried out to trace and all halts send to mobile device; Start mobile device, then will receive that the event that user carries out in trace writes mobile device system input processing unit according to time sequencing, again operate the effect of mobile device to reach user, now mobile device need obtain ROOT authority, and the interval that the interval that each event writes should be when recording is consistent; While arriving certain halt, stop the playback of event, and this halt is deleted from halt list, enter step 4; Described playback procedure, after step 4 completes, continues to repeat, until halt list is empty;
In step 4, obtain the GUI Dynamic Distribution information that is applied in the time of running, comprise various GUI elements; On the GUI element information basis obtaining, according to the next input action of robotization strategy decision, described robotization strategy can be random selection or depth-first search; Input action is sent to mobile device and carries out, so repeat, until complete automatic test task.
According to described in claim 2 or 3 based on user carry out trace reset mobile application testing method, it is characterized in that:
Described user refers to the crowd of certain mobile device use experience;
Described mobile application refers to the program that operates on mobile device, can complete various tasks, general using the multiple sensors of mobile device complete complex interaction;
Described record refers to and is deep into mobile device input processing unit, all sequences of events wherein saved as to user and carry out trace;
Described execution trace refers to that user is without any information in the situation that, and routine use moves the operation incoming event sequence that application produces;
Described record is carried out trace and is referred to the incoming event sequence producing when collecting user operates mobile device;
Described halt refers to that user carries out the stop position of trace playback time;
Described stop position is that user carries out certain event in trace;
Described playback is the part sequence of events that points to user that mobile device writes collection and carry out trace;
Described automated testing method refers to can be for some methods of the full-automatic test of mobile application.
5. the mobile application testing method of carrying out trace playback based on user according to claim 4, is characterized in that:
Described mobile device refers to pocket size, generally carries intelligent operating system, can help user to complete the portable computing device of varied task, comprises smart mobile phone and panel computer;
Described incoming event refers to all the sensors input message that mobile device receives, and comprises event time, event source and event argument information;
Described incoming event refers to all the sensors input message that mobile device receives;
Described event comprises event time, event source and event argument information;
Described event argument comprises event type, code and value.
6. the mobile application testing method of carrying out trace playback based on user according to claim 3, it is characterized in that: in step 2, in the time interval that relatively user carries out adjacent two events in trace, interval exceedes certain threshold value, and the front event at this interval is halt.
7. the mobile application testing method of carrying out trace playback based on user according to claim 3, is characterized in that: described threshold value refers to the minimum value in several significantly larger time intervals.
8. playback step as claimed in claim 3, is characterized in that, according to event time information, accurately controls time-write interval, and completing user is carried out the accurate playback of trace.
CN201410364808.8A 2014-07-29 2014-07-29 Mobile application testing method on basis of playback of execution trace of users Active CN104156308B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410364808.8A CN104156308B (en) 2014-07-29 2014-07-29 Mobile application testing method on basis of playback of execution trace of users

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410364808.8A CN104156308B (en) 2014-07-29 2014-07-29 Mobile application testing method on basis of playback of execution trace of users

Publications (2)

Publication Number Publication Date
CN104156308A true CN104156308A (en) 2014-11-19
CN104156308B CN104156308B (en) 2017-02-15

Family

ID=51881813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410364808.8A Active CN104156308B (en) 2014-07-29 2014-07-29 Mobile application testing method on basis of playback of execution trace of users

Country Status (1)

Country Link
CN (1) CN104156308B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468521A (en) * 2015-11-18 2016-04-06 北京航空航天大学 Pointer related semantic error location method based on subgraph search
CN106528412A (en) * 2016-10-27 2017-03-22 南京大学 Test framework for putting of related gesture of android application
CN106776229A (en) * 2016-12-30 2017-05-31 河源市美晨联合智能硬件电子研究院 Power consumption of terminal method of testing and device
WO2017097103A1 (en) * 2015-12-11 2017-06-15 Huawei Technologies Co., Ltd. Recommendation system, apparatus and method thereof to guide self-service analytic
US9703691B1 (en) 2015-06-15 2017-07-11 Google Inc. Testing application software using virtual or physical devices

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120239986A1 (en) * 2011-03-14 2012-09-20 Moshe Eran Kraus Script execution with fallback
CN103810089A (en) * 2012-11-12 2014-05-21 Sap股份公司 Application of automatic test based on posture

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120239986A1 (en) * 2011-03-14 2012-09-20 Moshe Eran Kraus Script execution with fallback
CN103810089A (en) * 2012-11-12 2014-05-21 Sap股份公司 Application of automatic test based on posture

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
L.GOMEZ 等: "RERAN: Timing and touch-sensitive record and replay for Android", 《PROCEEDINGS OF THE 35TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING》 *
W.CHOI 等: "Guided GUI testing of Android apps with minimal restart and approximate learning", 《PROCEEDINGS OF THE 2013 ACM SIGPLAN INTERNATIONAL CONFERENCE ON OBJECT ORIENTED PROGRAMMING SYSTEMS LANGUAGES AND APPLICATIONS》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9703691B1 (en) 2015-06-15 2017-07-11 Google Inc. Testing application software using virtual or physical devices
CN105468521A (en) * 2015-11-18 2016-04-06 北京航空航天大学 Pointer related semantic error location method based on subgraph search
CN105468521B (en) * 2015-11-18 2018-01-19 北京航空航天大学 A kind of semantic location of mistake method of pointer correlation based on subgraph search
WO2017097103A1 (en) * 2015-12-11 2017-06-15 Huawei Technologies Co., Ltd. Recommendation system, apparatus and method thereof to guide self-service analytic
CN106528412A (en) * 2016-10-27 2017-03-22 南京大学 Test framework for putting of related gesture of android application
CN106528412B (en) * 2016-10-27 2019-01-08 南京大学 A kind of related gesture dispensing test frame of Android application
CN106776229A (en) * 2016-12-30 2017-05-31 河源市美晨联合智能硬件电子研究院 Power consumption of terminal method of testing and device

Also Published As

Publication number Publication date
CN104156308B (en) 2017-02-15

Similar Documents

Publication Publication Date Title
CN105955889B (en) A kind of graphical interfaces automated testing method
CN104461894B (en) The operation record device and method of Android software
CN104156308A (en) Mobile application testing method on basis of playback of execution trace of users
CN104050075B (en) The method of testing and device of Andriod application programs
Lettner et al. Automated and unsupervised user interaction logging as basis for usability evaluation of mobile applications
CN110525823A (en) A kind of method, apparatus and system that monitoring rubbish is put on by classification
CN103136471B (en) A kind of malice Android application program detection method and system
CN107025165A (en) Game automated testing method and relevant apparatus
CN107121690B (en) A kind of dwell point recognition methods and device based on parameter of doing more physical exercises
CN106599230A (en) Method and system for evaluating distributed data mining model
CN105843734A (en) Automatic test method and device and computing device
CN104615658B (en) A kind of method for determining user identity
RU2331096C1 (en) Method to simulate control over hardware and simulation system
CN104615544B (en) Problem oriented gui software correlation function analysis method and device
CN102110053A (en) Random testing method based on Android
CN101645036A (en) Method for automatically distributing test tasks based on capability level of test executor
CN105677306A (en) Automation script compiling method and device
CN104462979A (en) Automatic dynamic detection method and device of application program
CN105892304B (en) Curve data automatic interpretation method
CN109472496A (en) Workflow construction method and device based on visualization guidance and automatic Verification
CN107967207A (en) The test method and device of user interface interaction function
CN109241485A (en) Relation establishing method and device are jumped between a kind of page
CN111027023A (en) House property online opening detection method and system based on frequent analysis
CN107729510B (en) Information interaction method, information interaction terminal and storage medium
CN109558307B (en) Game program testing method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant