CN103970649B - The test method and device of Android terminal application program - Google Patents

The test method and device of Android terminal application program Download PDF

Info

Publication number
CN103970649B
CN103970649B CN201310038455.8A CN201310038455A CN103970649B CN 103970649 B CN103970649 B CN 103970649B CN 201310038455 A CN201310038455 A CN 201310038455A CN 103970649 B CN103970649 B CN 103970649B
Authority
CN
China
Prior art keywords
file
program
video file
user operation
operation case
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
CN201310038455.8A
Other languages
Chinese (zh)
Other versions
CN103970649A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310038455.8A priority Critical patent/CN103970649B/en
Publication of CN103970649A publication Critical patent/CN103970649A/en
Application granted granted Critical
Publication of CN103970649B publication Critical patent/CN103970649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the present invention provides the test method and device of Android terminal application program, to be tested under from the constraint of Android application programs in itself various Android application programs.The described method includes:Program is recorded by running, generates the video file of user operation case file;The video file is preserved after the video file generation of the user operation case file;According to playback command input by user, the video file is played back in playback program.Third party's executable file of tested program is independently of due to recording program and playback program, therefore, method interactive mode provided by the invention is extremely simple, support the recording and playback across the interface operation of the i.e. different application program of application, from the constraint of tested program itself, easily passive coding third party application and system application realization can be automatically brought into operation.In addition, method provided by the invention supports nearly all user's operation type.

Description

The test method and device of Android terminal application program
Technical field
The present invention relates to the test method and device in terminal applies field, more particularly to Android terminal application program.
Background technology
Android is a kind of open source code operating system based on Linux, just because of it is increased income freely, is added Android operation system is simple and practical, is had a preference for be subject to lots of manufacturers, especially obtains tremendous development, mesh in smart mobile phone field Before already exceed Apple Macintosh operating system and become the first intelligent operating system, moreover, tablet computer, smart television etc. other The more and more manufacturers in field all start progressively to be inclined to selection Android operation system.
Why intelligent terminal can be liked be subject to consumers in general, be because its application program with magnanimity, pass through Different application programs realizes different functions, enriches the life of user, improves the usage experience of user.For Android Mobile phone is no exception, exactly because system is increased income, vast program development fan may be added to this Android program The environment of exploitation.But then, enter as formal software product before market, it is necessary to the fine survey of tester Trial work is made to ensure software quality, and on the other hand, Android operation system renewal is also getting faster, in operating system update While be also required to the software previously developed whether can with validation test is carried out in the Android platform of new version, for example, Some on Android2.1-update1 versions can with the software of normal operation in Android2.1-update3 and It this may result in collapsing on Android2.2, this, which means that, needs to carry out the test job largely repeated.
A kind of method for test software product that the prior art provides is known as Instrumentation methods, and this method is A kind of mechanism that Google officials provide for android system test, specifically provides similar inside Instrumentation The operation to keyboard or screen is triggered in the method for " sendKeyDownUpSync ", the PC client of its realization can be passed through The operation of program or Web program monitoring users is held, then plays the operation.
The test method defect that the above-mentioned prior art provides is that the boundary of tested Android application programs in itself can only be directed to Face carries out recording and playback, does not support the test operation across application program.
The content of the invention
The embodiment of the present invention provides the test method and device of Android terminal application program, to be answered from Android Various Android application programs are tested with the constraint of program in itself.
The embodiment of the present invention provides a kind of test method of Android terminal application program, the described method includes:
Program is recorded by running, generates the video file of user operation case file;
The video file is preserved after the video file generation of the user operation case file;
According to playback command input by user, the video file is played back in playback program.
The embodiment of the present invention provides a kind of test device of Android terminal application program, and described device includes:
Video file generation module, for recording program by running, generates the video file of user operation case file;
Video file preserving module, for preserving institute after the generation of the video file of the user operation case file State video file;
Playback module, for according to playback command input by user, the video file to be played back in playback program.
It was found from the embodiments of the present invention, it is based on its corresponding video recording of user operation case file generated to record program File, then, plays back these video files in playback program.Tested program is independently of due to recording program and playback program Third party's executable file, therefore, on the one hand, method interactive mode provided in an embodiment of the present invention is extremely simple, user only Recording process and replayed section can be started by needing to run simplest program;On the other hand, support to answer across using i.e. different , can be easily to passive coding third party from the constraint of tested program itself with the recording and playback of the interface operation of program Application program and system application realization are automatically brought into operation.Finally, due to specific catalogue can record user under android system The corresponding user operation case file of nearly all action event, therefore, method provided in an embodiment of the present invention supports almost institute There is user's action type, will not can miss the operation that some upper layer applications are not supported as in the prior art.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be in the prior art or embodiment description Required attached drawing is briefly described, it should be apparent that, drawings in the following description are only some realities of the present invention Example is applied, for those skilled in the art, other attached drawings can also be obtained such as these attached drawings.
Fig. 1 is the test method flow diagram of Android terminal application program provided in an embodiment of the present invention;
Fig. 2 is the test device structure diagram of Android terminal application program provided in an embodiment of the present invention;
Fig. 3 is the test device structure diagram for the Android terminal application program that another embodiment of the present invention provides;
Fig. 4-a are the test device structure diagrams for the Android terminal application program that another embodiment of the present invention provides;
Fig. 4-b are the test device structure diagrams for the Android terminal application program that another embodiment of the present invention provides;
Fig. 5 is the test device structure diagram for the Android terminal application program that another embodiment of the present invention provides;
Fig. 6-a are the test device structure diagrams for the Android terminal application program that another embodiment of the present invention provides;
Fig. 6-b are the test device structure diagrams for the Android terminal application program that another embodiment of the present invention provides.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those skilled in the art's all other embodiments obtained, belongs to the scope of protection of the invention.
Attached drawing 1 is referred to, is the test method flow signal of Android terminal application program provided in an embodiment of the present invention Figure, is mainly used for Android intelligent terminal, for example, smart mobile phone, tablet computer etc..1 exemplary Android terminal of attached drawing The test method of application program mainly includes step S101, step S102 and step S103, describes in detail as follows:
S101, records program by running, generates the video file of user operation case file.
It can be that one kind uses common programs language, such as c language developments to come out and answered independently of tested to record program With the executable file of program, before the test method of Android terminal application program is carried out, it is necessary to by this recording program Copy to Android terminal.In embodiments of the present invention, user operation case can be by Android terminal operational motion The event of generation, including click on entity, virtual key, entity, virtual function buttons and application program in Android terminal Icon etc..Since android system uses the Linux input systems of standard, user operation case, such as keyboard thing Part, the click event etc. of screen can all be recorded to/dev/input/ catalogues under a series of files in ,/dev/input/ This paper series recorded under catalogue are exactly user operation case file.Program is recorded by running, generates user's operation thing The video file of part file.
Program is recorded by running as the present invention, generates an implementation of the video file of user operation case file Example, first, starts the above-mentioned recording program for copying to Android terminal.As previously described, because it is that a use is normal to record program Use program language(For example, c language)The executable file developed, therefore, starts recording program and is not difficult for a user, directly Connect double-click.After recording program start completion, the incident file in scanning system, and the user's operation that writing scan is arrived Incident file, for example, by the user operation case file record scanned into array to replicate these user's operations Incident file.Finally, the user operation case file synchronization scanned is copied to and records the file specified of program and formed The video file of the user operation case file, specifically, can synchronize the user operation case file scanned Monitor, the process of the event code writing system file caused by user's operation is synchronously copied into the text recorded specified by program In part.After the completion of synchronous reproduction process, it is exactly the user operation case text to record the content in the file specified by program The video file of part, substantially, it is the copy of the user operation case file.It should be noted that due to some Test has specific precondition, therefore, when program is recorded in operation, can initialize the recording program.
S102, preserves the video recording of user operation case file after the video file generation of user operation case file File.
When preserving the video file of user operation case file, it is necessary to name a playback program can the video file The filename of identification, can identify when being played back so as to subsequent playback program.
S103, according to playback command input by user, plays back the video file in playback program.
Similar with foregoing recording program, in embodiments of the present invention, playback program can be that one kind uses common programs language Speech, such as c language developments are carrying out Android terminal application out and independently of the executable file of tested application program , it is necessary to which this playback program is copied to Android terminal before the test method of program.Inputted as the present invention according to user Playback command, one embodiment of the video file is played back in playback program, first, is detected after playback program is started Playback command input by user, playback command include title and the playback of the video file of generation early period user operation case file The number of the video file of the user's action event file.Then, the incident file queue in scanning system simultaneously arrive by writing scan The user operation case file, for example, by the user operation case file record scanned into array, with after an action of the bowels The continuous incident file queue being inserted into these user operation case files in system.3rd step is to read user operation case text Copied in the video file of part, that is, foregoing customer incident file from system and carry out generated video file.Finally, by described in Incident file queue in the video file insertion system of the user operation case file of reading, the result is that for system start by The behavior recorded early period according to user is operated.Playback program according to the playback number input by user detected, repeat according to The behavior that user records early period is operated.Such as foregoing recording program is similar, since some tests have specific precondition, Therefore, when running playback program, the playback program can be initialized.
It was found from the test method for the Android terminal application program that the embodiments of the present invention provide, recording program is Based on its corresponding video file of user operation case file generated, then, these video files are played back in playback program.By Third party's executable file of tested program is independently of in recording program and playback program, therefore, on the one hand, the present invention is implemented The method interactive mode that example provides is extremely simple, and user, which only needs to run simplest program, can start recording process and playback Process;On the other hand, the recording and playback across the interface operation of the i.e. different application program of application is supported, from tested program certainly The constraint of body, easily can be automatically brought into operation passive coding third party application and system application realization.Finally, due to Specific catalogue can record the corresponding user operation case file of the nearly all action event of user under android system, because This, method provided in an embodiment of the present invention supports nearly all user's operation type, will not can miss one as in the prior art The operation that a little upper layer applications are not supported.
Attached drawing 2 is referred to, is the test device structural representation of Android terminal application program provided in an embodiment of the present invention Figure.For convenience of description, illustrate only and the relevant part of the embodiment of the present invention.The exemplary Android terminal application of attached drawing 2 The test device of program can be intelligent terminal(Such as Android terminal)In some function module/unit, it include video recording File generating module 201, video file preserving module 202 and playback module 203, wherein:
Video file generation module 201, for recording program by running, generates the video recording text of user operation case file Part;
Video file preserving module 202, for being protected after the generation of the video file of the user operation case file Deposit the video file;
Playback module 203, for according to playback command input by user, the video file to be played back in playback program.
It should be noted that in the embodiment of the test device of above Android terminal application program, each function module Division be merely illustrative of, can be as needed in practical application, such as the reality of the configuration requirement of corresponding hardware or software Existing convenient consideration, and above-mentioned function distribution is completed by different function modules, will the Android terminal application program The internal structure of test device be divided into different function modules, to complete all or part of function described above.And And in practical application, the corresponding function module in the present embodiment can be by corresponding hardware realization, can also be by corresponding Hardware performs corresponding software and completes, for example, foregoing video file generation module, can have to perform mentioned by operation Program is recorded, generates the hardware of the video file of user operation case file, such as video file maker or can Corresponding computer program is performed so as to complete the general processor or other hardware devices of foregoing function;Playback as the aforementioned again Module, can have execution foregoing according to playback command input by user, the video file work(is played back in playback program Can hardware, such as playback device or be able to carry out corresponding computer program so as to complete the general processing of foregoing function Device or other hardware devices(Each embodiment that this specification provides can all apply foregoing description principle).
The exemplary video file generation module 201 of attached drawing 2 can include start and stop unit 301, the first scanning element 302 and same Copied cells 303 is walked, as shown in Figure 3 the test device for the Android terminal application program that another embodiment of the present invention provides, Wherein:
Start and stop unit 301, for starting or stoping the recording program;
First scanning element 302, for the user's operation thing that simultaneously writing scan is arrived of the incident file in scanning system Part file;
Synchronous copied cells 303, for the user operation case file synchronization scanned to be copied to the recording The file that program is specified forms the video file of the user operation case file.
The test device of attached drawing 1 or the exemplary Android terminal application program of attached drawing 2 can also include the first initialization mould Block 401, the test dress for the Android terminal application program that another embodiment of the present invention as shown in attached drawing 4-a or attached drawing 4-b provides Put.First initialization module 401, which is used to initialize, records program.
The exemplary playback module 203 of attached drawing 2 can include detection unit 501, the second scanning element 502, reading unit 503 With insertion unit 504, as shown in Figure 5 another embodiment of the present invention provide Android terminal application program test device, Wherein:
Detection unit 501, for detecting playback command input by user;
Second scanning element 502, for the user's operation thing that simultaneously writing scan is arrived of the incident file in scanning system Part file;
Reading unit 503, for reading the video file of the user operation case file;
Unit 504 is inserted into, for by the thing in the video file insertion system of the user operation case file of the reading Part document queue.
The test device of attached drawing 1 or the exemplary Android terminal application program of attached drawing 5 can also include the second initialization mould Block 601, the test dress for the Android terminal application program that another embodiment of the present invention as shown in attached drawing 6-a or attached drawing 6-b provides Put.Second initialization module 601 is used to initialize playback program.
It should be noted that the content such as information exchange, implementation procedure between each module/unit of above device, due to The method of the present invention embodiment is based on same design, its technique effect brought is identical with the method for the present invention embodiment, particular content Reference can be made to the narration in the method for the present invention embodiment, details are not described herein again.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can To instruct relevant hardware to complete by program, for example following various methods is one or more or whole:
Program is recorded by running, generates the video file of user operation case file;
The video file is preserved after the video file generation of the user operation case file;
According to playback command input by user, the video file is played back in playback program.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can To instruct relevant hardware to complete by program, which can be stored in a computer-readable recording medium, storage Medium can include:Read-only storage(ROM, Read Only Memory), random access memory(RAM, Random Access Memory), disk or CD etc..
The test method to Android terminal application program provided in an embodiment of the present invention and device have carried out in detail above Introduce, specific case used herein is set forth the principle of the present invention and embodiment, the explanation of above example It is only intended to help the method and its core concept for understanding the present invention;Meanwhile for those of ordinary skill in the art, according to this The thought of invention, there will be changes in specific embodiments and applications, in conclusion this specification content should It is interpreted as limitation of the present invention.

Claims (8)

  1. A kind of 1. test method of Android terminal application program, it is characterised in that the described method includes:
    Program is recorded by running, generates the video file of user operation case file;
    The video file is preserved after the video file generation of the user operation case file;
    According to playback command input by user, the video file is played back in playback program;
    The video file of generation user operation case file includes:
    Start the recording program;
    The user operation case file that incident file and writing scan in scanning system arrive;
    The user operation case file synchronization scanned is copied into the file specified of recording program and forms the use The video file of family action event file.
  2. 2. the method as described in claim 1, it is characterised in that the method further includes:
    Initialize the recording program.
  3. 3. the method as described in claim 1, it is characterised in that it is described according to playback command input by user, in playback program The middle playback video file includes:
    Detect playback command input by user;
    The user operation case file that incident file and writing scan in scanning system arrive;
    Read the video file of the user operation case file;
    By the incident file queue in the video file insertion system of the user operation case file of the reading.
  4. 4. the method as described in claim 1 or 3, it is characterised in that the method further includes:
    Initialize the playback program.
  5. 5. a kind of test device of Android terminal application program, it is characterised in that described device includes:
    Video file generation module, for recording program by running, generates the video file of user operation case file;
    Video file preserving module, for preserving the record after the generation of the video file of the user operation case file As file;
    Playback module, for according to playback command input by user, the video file to be played back in playback program;
    The video file generation module includes:
    Start and stop unit, for starting or stoping the recording program;
    First scanning element, for the user operation case file that simultaneously writing scan is arrived of the incident file in scanning system;
    Synchronous copied cells, is specified for the user operation case file synchronization scanned to be copied to the recording program File form the video file of the user operation case file.
  6. 6. device as claimed in claim 5, it is characterised in that described device further includes:
    First initialization module, for initializing the recording program.
  7. 7. device as claimed in claim 5, it is characterised in that the playback module includes:
    Detection unit, for detecting playback command input by user;
    Second scanning element, for the user operation case file that simultaneously writing scan is arrived of the incident file in scanning system;
    Reading unit, for reading the video file of the user operation case file;
    Unit is inserted into, for by the incident file team in the video file insertion system of the user operation case file of the reading Row.
  8. 8. the device as described in claim 5 or 7, it is characterised in that described device further includes:
    Second initialization module, for initializing the playback program.
CN201310038455.8A 2013-01-31 2013-01-31 The test method and device of Android terminal application program Active CN103970649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310038455.8A CN103970649B (en) 2013-01-31 2013-01-31 The test method and device of Android terminal application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310038455.8A CN103970649B (en) 2013-01-31 2013-01-31 The test method and device of Android terminal application program

Publications (2)

Publication Number Publication Date
CN103970649A CN103970649A (en) 2014-08-06
CN103970649B true CN103970649B (en) 2018-04-27

Family

ID=51240178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310038455.8A Active CN103970649B (en) 2013-01-31 2013-01-31 The test method and device of Android terminal application program

Country Status (1)

Country Link
CN (1) CN103970649B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995718B (en) * 2014-05-08 2017-05-10 百度在线网络技术(北京)有限公司 Method and device for collecting program information
CN104572447B (en) * 2014-12-19 2017-09-29 中国电子科技集团公司第十五研究所 Operation flow recording and replaying method and system based on Android operation system
CN104866420B (en) * 2015-04-27 2018-11-02 深圳市祈锦通信技术有限公司 A kind of cell phone software test method accurately recorded
CN106469113B (en) * 2015-08-18 2023-08-08 腾讯科技(深圳)有限公司 Application program testing method and system
CN105512031A (en) * 2015-11-30 2016-04-20 惠州Tcl移动通信有限公司 Mobile terminal and automatic test method
CN106792193B (en) * 2016-12-23 2020-06-23 Tcl科技集团股份有限公司 Android television-based repair system and repair method
CN107832205A (en) * 2017-10-16 2018-03-23 深圳天珑无线科技有限公司 Terminal and its record screen method of running, external equipment, storage device
CN109902030B (en) * 2019-04-25 2022-05-24 安然 Method for recording and replaying automatic test steps of mobile phone application program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6067639A (en) * 1995-11-09 2000-05-23 Microsoft Corporation Method for integrating automated software testing with software development
CN101957793A (en) * 2010-09-03 2011-01-26 中国科学院软件研究所 Android and android derivative system-oriented method for playing back software operation record
CN102521118A (en) * 2011-11-11 2012-06-27 福建星网视易信息系统有限公司 Automatic testing method of Android program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6067639A (en) * 1995-11-09 2000-05-23 Microsoft Corporation Method for integrating automated software testing with software development
CN101957793A (en) * 2010-09-03 2011-01-26 中国科学院软件研究所 Android and android derivative system-oriented method for playing back software operation record
CN102521118A (en) * 2011-11-11 2012-06-27 福建星网视易信息系统有限公司 Automatic testing method of Android program

Also Published As

Publication number Publication date
CN103970649A (en) 2014-08-06

Similar Documents

Publication Publication Date Title
CN103970649B (en) The test method and device of Android terminal application program
Kaasila et al. Testdroid: automated remote UI testing on Android
US10853232B2 (en) Adaptive system for mobile device testing
Gonsalves Evaluating the mobile development frameworks Apache Cordova and Flutter and their impact on the development process and application characteristics
WO2016095554A1 (en) Test method, device and system for application
Silva et al. A survey on the tool support for the automatic evaluation of mobile accessibility
CN105843734A (en) Automatic test method and device and computing device
US6148417A (en) Method for determining a source of failure during a file system access
CN104572447B (en) Operation flow recording and replaying method and system based on Android operation system
CN101311897B (en) Method and device for snatching at application program graphical user interface resource
JP2014532948A (en) Server upgrade with safety check and preview
CN103853658B (en) The automated testing method and Android device of recording and playback are carried out in Android device
KR101693683B1 (en) Virtual database rewind
CN106126424B (en) A kind of visual automated testing method of script, device and mobile terminal
CN103123605B (en) A kind of Android platform automatic integration test method and device
CN110209735A (en) Database backup method, calculates equipment and storage medium at DB Backup device
WO2018118166A1 (en) System and method for testing program using user interaction
CN102999327B (en) With compression animation mode viewing PowerPoint
US20120050336A1 (en) Touch-based remote control
US20130138381A1 (en) Handheld electronic device testing method
CN109189954A (en) Content recommendation method and device
JP2009176186A (en) Program test device and program
CN106484779B (en) File operation method and device
CN105453033A (en) Program testing service
CN105512276A (en) Method and device for constructing junk file and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant