CN106201876B - A kind of application testing method, device and mobile terminal - Google Patents
A kind of application testing method, device and mobile terminal Download PDFInfo
- Publication number
- CN106201876B CN106201876B CN201610531823.6A CN201610531823A CN106201876B CN 106201876 B CN106201876 B CN 106201876B CN 201610531823 A CN201610531823 A CN 201610531823A CN 106201876 B CN106201876 B CN 106201876B
- Authority
- CN
- China
- Prior art keywords
- test
- application
- tester
- mobile terminal
- random
- 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
Links
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
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Abstract
The invention discloses a kind of application testing methods, execute in the terminal, and this method includes:It obtains and shows application packet all in mobile terminal;Receive selection of the tester to random test mode or fixed test pattern;If tester selects random test mode, setting of the tester to random test parameter is received, random test order is generated according to random test parameter, receives selection of the tester to tested application packet, is wrapped in tested application and executes random test order;If tester selects fixed test pattern, selection of the tester to fixed test command is received, receives selection of the tester to blacklist application packet, is wrapped in other mobile terminal applications other than blacklist application packet, executes fixed test command;Record test case.In addition, the invention also discloses using test device and include the above-mentioned mobile terminal using test device using above-mentioned application testing method.
Description
Technical field
The present invention relates to mobile terminal test field more particularly to a kind of application testing methods, device and mobile terminal.
Background technique
With the continuous development and maturation of mobile communication technology, various mobile terminal applications emerge one after another.In order to guarantee to apply
It can work normally, need to test it before publication.Monkey test is a kind of common test method.It is existing
Monkey test needs for connect with mobile terminal at the end PC, then executes test by CMD order at the end PC.Since it is desired that accounting for
With PC, this mode not only causes the consumption of the end PC resource, and malfunction, the survey not being suitable under mobile context state
Examination.In addition, if needing to shield related application, it is also necessary to write the text comprising packet name and be conducted into mobile terminal, grasp
It is inconvenient to make, and inefficiency.
For disadvantages described above, existing processing method can construct Monkey in PC system and execute system, this is in certain journey
The execution of Monkey test is facilitated on degree.But this method is there is still a need for mobile terminal and the end PC to be attached, especially when to
When the mobile terminal of test is more, it is more inconvenient to operate.In addition, face mobile context or need the case where shielding certain applications,
Suitable solution is not provided yet.
Summary of the invention
For this purpose, the present invention provides a kind of application testing method, device and mobile terminal, to try hard to solve or at least alleviate
The problem of existing above.
According to an aspect of the present invention, a kind of application testing method is provided, is executed in the terminal, this method packet
It includes:It obtains and shows application packet all in mobile terminal;Tester is received to random test mode or fixed test pattern
Selection;If tester selects random test mode, setting of the tester to random test parameter is received, according to described
Random test parameter generates random test order, selection of the tester to tested application packet is received, in the tested application packet
It is upper to execute the random test order;If tester selects fixed test pattern, tester is received to fixed test life
The selection of order receives selection of the tester to blacklist application packet, in other shiftings other than blacklist application packet
Dynamic terminal applies are wrapped, and the fixed test command is executed;Record test case.
Optionally, it in application according to the present invention test method, in the acquisition and shows all in mobile terminal
Before the step of packet, further include:Obtain the root authority of mobile terminal.
Optionally, it in application according to the present invention test device, in the acquisition and shows all in mobile terminal
Before the step of packet, further include:Detect the operating system version number of mobile terminal;If operating system version number less than 5.1,
Then by android in the AndroidManifest.xml file of mobile terminal:SharedUserId is set as
"android.uid.system";If operating system version number is more than or equal to 5.1, in mobile terminal
By android in AndroidManifest.xml file:SharedUserId is set as " android.uid.shell ".
Optionally, in application according to the present invention test method, under random test mode, if not receiving tester
Selection of the member to tested application packet, then all application wraps and executes the random test order in the terminal.
Optionally, described other than blacklist application packet in application according to the present invention test method
Other mobile terminal applications are wrapped, execute the fixed test command the step of include:For consolidating for not specified test application packet
Determine test command, wraps execution in other all mobile terminal applications other than blacklist application packet;For specified
The fixation test command of test application packet is wrapped in other all test applications other than blacklist application packet and is held
Row.
Optionally, in application according to the present invention test method, random test parameter includes:Chance event executes secondary
Number, chance event interval, the ratio of different types of chance event, feedback information rank, random test constraint condition.
Optionally, in application according to the present invention test method, chance event includes:Touch event, action event, rail
Mark event, basic navigation event, prime navaid event, system event.
Optionally, in application according to the present invention test method, record test case the step of further comprise:It will open
Testing time beginning and test command are written in the first specified file;The output position of test log is directed to described second to specify
File, and open thread and monitor the test log;If listening to abnormal conditions, by the corresponding test log of the abnormal conditions
It saves to second specified file.
Optionally, in application according to the present invention test method, abnormal conditions include collapsing and without response.
Optionally, in application according to the present invention test method, selection of the tester to tested application packet is being received
The step of after, the tested application wrap execute the random test order the step of before, further include:To tested application
Application in packet carries out data filling.
According to an aspect of the present invention, it provides a kind of using test device, resides in mobile terminal, the device packet
It includes:Using packet display module, suitable for obtaining and showing application packet all in mobile terminal;Mode selection module is suitable for receiving
Selection of the tester to random test mode or fixed test pattern;Random test module, be suitable for when tester selection with
When machine test pattern, setting of the tester to random test parameter is received, random survey is generated according to the random test parameter
Examination order receives selection of the tester to tested application packet, and wraps in the tested application and execute the random test
Order;Fixed test module is suitable for when tester selects fixed test pattern, receives tester to fixed test command
Selection, receive tester to blacklist application packet selection, and in addition to the blacklist application packet other than other
Mobile terminal application is wrapped, and the fixed test command is executed;Logger module is suitable for record test case.
Optionally, in application according to the present invention test device, further include:Power module is proposed, is suitable for obtaining mobile terminal
Root authority.
Optionally, in application according to the present invention test device, further include:Power module is proposed, mobile terminal is adapted to detect for
Operating system version number;If operating system version number is less than 5.1, in the AndroidManifest.xml text of mobile terminal
By android in part:SharedUserId is set as " android.uid.system ";If operating system version number is more than or equal to
5.1, then by android in the AndroidManifest.xml file of mobile terminal:SharedUserId is set as
“android.uid.shell”。
Optionally, in application according to the present invention test device, random test module is further adapted for:If not receiving
Selection of the tester to tested application packet, then all applications wrap and execute the random test order in the terminal.
Optionally, in application according to the present invention test device, fixed test module is further adapted for:For not specified
The fixation test command of test application packet is wrapped in other all mobile terminal applications other than blacklist application packet
It executes;For specifying the fixation test command of test application packet, other than blacklist application packet other are all
Test application wraps execution.
Optionally, in application according to the present invention test device, random test parameter includes:Chance event executes secondary
Number, chance event interval, the ratio of different types of chance event, feedback information rank, random test constraint condition.
Optionally, in application according to the present invention test device, chance event includes:Touch event, action event, rail
Mark event, basic navigation event, prime navaid event, system event.
Optionally, in application according to the present invention test device, logger module is further adapted for:It will start to test
Time and test command are written in the first specified file;The output position of test log is directed to second specified file,
And it opens thread and monitors the test log;If listening to abnormal conditions, the corresponding test log of the abnormal conditions is saved
To second specified file.
Optionally, in application according to the present invention test device, abnormal conditions include collapsing and without response.
Optionally, in application according to the present invention test device, random test module is further adapted for:To in tested application packet
Application carry out data filling.
According to an aspect of the present invention, a kind of mobile terminal is provided, including as above applies test device.
The technical solution provided according to the present invention is executed by residing at the application test device of mobile terminal to other
The Monkey of application is tested, and without being attached with the end PC, reduces the consumption of resource, easy to use, is suitable for mobile context
Test under state.In addition, the present invention can execute fixed test command under fixed test pattern, to realize same application
Different editions contrast test.Under fixed test pattern, Monkey test blacklist can also be set, phase is conveniently realized
Close the shielding of application.
Detailed description of the invention
To the accomplishment of the foregoing and related purposes, certain illustrative sides are described herein in conjunction with following description and drawings
Face, these aspects indicate the various modes that can practice principles disclosed herein, and all aspects and its equivalent aspect
It is intended to fall in the range of theme claimed.Read following detailed description in conjunction with the accompanying drawings, the disclosure it is above-mentioned
And other purposes, feature and advantage will be apparent.Throughout the disclosure, identical appended drawing reference generally refers to identical
Component or element.
Fig. 1 shows the structure chart including the mobile terminal 100 according to an embodiment of the invention using test device;
Fig. 2 shows the structure charts according to an embodiment of the invention using test device 200;
Fig. 3 shows the schematic diagram that application packet according to an embodiment of the invention shows interface;
Fig. 4 shows the schematic diagram of random test parameter setting interface according to an embodiment of the invention;
Fig. 5 shows the schematic diagram of fixed test command selection interface according to an embodiment of the invention;
Fig. 6 shows the flow chart of application testing method 600 according to an embodiment of the invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
Fig. 1 shows the structure chart for realizing the Example mobile terminals 100 of screen locking time display apparatus according to the present invention.Tool
The mobile terminal 100 for having multiple point touching ability may include memory interface 102, one or more data processor, at image
Manage device and/or central processing unit 104 and peripheral interface 106.
Memory interface 102, one or more processors 104 and/or peripheral interface 106 either discrete component,
It can integrate in one or more integrated circuits.In the mobile terminal 100, various elements can pass through one or more communication
Bus or signal wire couple.Sensor, equipment and subsystem may be coupled to peripheral interface 106, a variety of to help to realize
Function.For example, motion sensor 110, optical sensor 112 and range sensor 114 may be coupled to peripheral interface 106, with side
Just the functions such as orientation, illumination and ranging.Other sensors 116 can equally be connected with peripheral interface 106, such as positioning system
(such as GPS receiver), temperature sensor, biometric sensor or other sensor devices, it is possible thereby to help to implement correlation
Function.
Camera sub-system 120 and optical sensor 122 can be used for the camera of convenient such as record photos and video clips
The realization of function, wherein the camera sub-system and optical sensor for example can be charge-coupled device (CCD) or complementary gold
Belong to oxide semiconductor (CMOS) optical sensor.
It can help to realize communication function by one or more radio communication subsystems 124, wherein wireless communication
System may include radio-frequency transmitter and transmitter and/or light (such as infrared) Receiver And Transmitter.Radio communication subsystem
124 particular design and embodiment can depend on one or more communication networks that mobile terminal 100 is supported.For example,
Mobile terminal 100 may include be designed to support GSM network, GPRS network, EDGE network, Wi-Fi or WiMax network and
The radio communication subsystem 124 of BlueboothTM network.
Audio subsystem 126 can be coupled with loudspeaker 128 and microphone 130, to help to implement to enable voice
Function, such as speech recognition, speech reproduction, digital record and telephony feature.
I/O subsystem 140 may include screen controller 142 and/or other one or more input controllers 144.
Screen controller 142 may be coupled to screen 146.For example, the screen 146 and screen controller 142 can be with
The contact carried out therewith and movement or pause are detected using any one of a variety of touch-sensing technologies, wherein sensing skill
Art includes but is not limited to capacitive character, resistive, infrared and surface acoustic wave technique.
Other one or more input controllers 144 may be coupled to other input/control devicess 148, for example, one or
The pointer device of multiple buttons, rocker switch, thumb wheel, infrared port, USB port, and/or stylus etc.One or
Multiple buttons (not shown) may include the up/down button for controlling 130 volume of loudspeaker 128 and/or microphone.
Memory interface 102 can be coupled with memory 150.The memory 150 may include that high random access is deposited
Reservoir and/or nonvolatile memory, such as one or more disk storage equipments, one or more optical storage apparatus, and/
Or flash memories (such as NAND, NOR).
Memory 150 can store an operating system 152, such as the behaviour of Android, IOS or Windows Phone etc
Make system.The operating system 152 may include for handling basic system services and executing the finger of the task dependent on hardware
It enables.Memory 150, which can also store, various applies 154.In mobile device operation, can load operation be from memory 150
System 152, and executed by processor 104.At runtime using 154, it can also be loaded from memory 150, and by processor 104
It executes.It is operated on operating system using 154, realizes various users using the interface that operating system and bottom hardware provide
Desired function, such as instant messaging, web page browsing, pictures management.It, can also using can be independently of operating system offer
To be that operating system is included.
In various applications 154, one such application is using test device 200.It can be right using test device 200
Other application in mobile terminal 100 executes Monkey test, without being attached with the end PC, reduces the consumption of resource,
It is easy to use, suitable for the test under mobile context state.In addition, can be under fixed test pattern using test device 200
Fixed test command is executed, to realize the contrast test of the different editions of same application.It, can be under fixed test pattern
Monkey is set and tests blacklist, conveniently realizes the shielding of related application.
Fig. 2 shows the structure charts according to an embodiment of the invention using test device 200.As shown in Fig. 2, using
Test device 200 includes applying packet display module 210, mode selection module 220, random test module 230, fixed test module
240 and logger module 250.
It is suitable for obtaining and showing application packet all in mobile terminal using packet display module 210.Using packet i.e. application pair
The apk packet answered is the object of Monkey test.According to a kind of embodiment, Android can be passed through using packet display module 210
PackageManager class in system gets the information of all applications in mobile terminal, for example, respectively apply icon, title
And packet name etc., and it is presented to tester, intuitively show testable object.Fig. 3 shows according to the present invention one
The application packet of a embodiment shows the schematic diagram at interface.As shown in figure 3, showing the icon of each application, title and packet in interface
Name.
Mode selection module 220 is suitable for receiving selection of the tester to random test mode or fixed test pattern.?
Under random test mode, tester needs that random test parameter, random test module are arranged in random test module 230
230 generate random test order according to random test parameter.Under fixed test pattern, tester needs to test mould fixed
An existing fixed test command is selected in block 240, without test parameter is additionally arranged.According to a kind of embodiment, test
Personnel can enter random test by showing " the advanced setting " in the click upper right corner in interface in application packet as shown in Figure 3
Mode, and random test parameter is set;Enter fixed test mould by click " fix command test " (being not shown in Fig. 3)
Formula, and select fixed test command.
Random test module 230, which is suitable for wrapping application, executes random test.Random test is joined firstly, receiving tester
Several settings.Random test parameter include chance event execute number, chance event interval, different types of chance event ratio
Example, feedback information rank, random test constraint condition.Wherein, chance event include touch event, action event, track event,
Basic navigation event, prime navaid event, system event and other events.Chance event execution number refers to random at this
The number for the chance event for including in test, default value are 50000.Chance event interval refers between chance event
Fixed delay, default value are 1000ms.The ratio of different types of chance event refers to various types of chance events
Account for the ratio that chance event executes number.Feedback information rank is used for the level of detail of nominative testing log (Log), is divided into 1-
3 three ranks, rating value is higher, and test log is more detailed.Random test constraint condition is tested application for being arranged to work as
When mistake, if stop entire random test process and whether report mistake.
Fig. 4 shows the schematic diagram of random test parameter setting interface according to an embodiment of the invention.It is shown in Fig. 4
The ratio of random test constraint condition, feedback information rank and different types of chance event can be set in interface.It is random to survey
Examination constraint condition is configured by choosing the corresponding check box of each constraint condition, and Fig. 4, which is shown, " occurs any collapse or different
Often continue to run " " time-out error occurs to continue to run " " licensing error occurs to continue to run " " application error stops wrong process "
" monitoring report system local code crash event " five constraint conditions.Feedback information rank is divided into tri- ranks of 1-3, setting
Tester is needed to be manually entered any of 1,2,3 three number.Number is bigger, and test log is more detailed.Different type
The setting of ratio of chance event need tester to be manually entered the arbitrary integer in [0,100] range.
After tester completes the setting to each random test parameter, random test module 230 is joined according to random test
Number generates random test order, i.e., random to generate test random event sequence used.This step is equivalent to random generation
Seed value in Monkey test.If the seed value of random test twice is identical, the time caused by this random test twice
Sequence is also identical.
After random test module 230 generates random test order, selection of the tester to tested application packet is received.Test
Personnel can select tested application packet by wrapping to choose in displaying interface using corresponding check box in application, as shown in Figure 3.
Tester can choose an application packet, can also choose multiple application packets simultaneously or one is not selected.Work as tester
When choosing multiple application packets, it may be implemented simultaneously to test multiple applications.When tester does not choose using packet, to shifting
All applications in dynamic terminal are tested.After tester has chosen tested application packet, random test module 230 can lead to
Adapter method is crossed to get which application packet tester has selected.
After random test order and tested application packet determine, random test module 230 wraps execution in tested application
Above-mentioned random test order, that is, start random test process.According to a kind of embodiment, random test module 230 passes through
Runtime.getRuntime () .exec executes random test order.
Fixed test module 240, which is suitable for wrapping application, executes fixed test.Under fixed test pattern, application packet is executed
Fixed test command.According to a kind of embodiment, fixed test command is stored in entitled under SD card root
In the configuration file of monkeycommand.txt.After tester selects fixed test pattern, fixed test module 240 is obtained
The configuration file comprising fixed test command in SD card is taken, and by the fixed test command of items in configuration file with graphical interfaces
Form show tester, for tester selection.Fig. 5 shows fixed test according to an embodiment of the invention
The schematic diagram at command selection interface.Multiple fixed test commands (ordering 1~order 10) is shown in Fig. 5, tester can
To select a selection.Fixed test module 240 is suitable for receiving selection of the tester to fixed test command.
After fixed test module 240 receives tester to the selection of fixed test command, tester is received to black name
The selection of single application packet.Tester can select quilt by wrapping to choose in displaying interface using corresponding check box in application
Blacklist application packet, as shown in Figure 3.Tester can choose an application packet, can also choose multiple application packets simultaneously, or
Person one is not selected.
After fixed test command and blacklist application determine, fixed test module 240 is wrapped in addition to blacklist application
Except other mobile terminal applications wrap and execute above-mentioned selected fixation test command, that is, start fixed test process.Gu if
Determine not specified test application packet in test command, then in other all mobile terminal application packets other than blacklist application packet
Upper execution fixation test command;If test application packet is specified in fixed test command, in addition to the blacklist application
Other all test applications except packet, which are wrapped, executes the fixation test command.Fixed test process is not wrapped in blacklist application
It executes, that is to say, that fixed test shields the application in blacklist application packet, certainly, if the not set blacklist of tester
Using packet, is then fixed in test at this and do not need to shield any application.
For example, sharing tetra- application packets of A, B, C, D in some mobile terminal, 1. fixed test command specifies test application
Packet is A, B.If the not set blacklist application packet of tester, 1. fixed survey will be executed to application packet A and B by fixing test command
Examination;If blacklist is arranged in tester, application packet is B, fixes test command and 1. only executes fixed test to application packet A.It is fixed
Test command 2. not specified test application packet.If the not set blacklist application packet of tester, fixing test command 2. will be right
All application packets in mobile terminal, i.e. application packet A, B, C, D execute fixed test;If blacklist application packet is arranged in tester
For B, then fixes test command and fixed test only 2. is executed to application packet A, C, D.
Logger module 250 is suitable for record test case.It is (whether random to survey in the moment for starting to execute test command
Examination order or fixed test command), it will be in the first specified file that testing time and test command write-in SD card be started.In order to
Facilitate analysis test result, test log is redirected into output to the second specified file.According to a kind of embodiment, the first specified text
Part and the second specified file can be same file.The test log for opening thread snoopy test process, if listening to exception
Situation, such as collapse (Crash), without response (ANR, Application Not Responding) etc., then by the abnormal conditions
Corresponding test log is saved to the second specified file.The corresponding test log of abnormal conditions is only stored in second specified file.
According to another embodiment, the test log of entire test process is stored in the second specified file, no matter test case is normal
Or it is abnormal.Open thread snoopy test process test log, if listening to abnormal conditions, by the abnormal conditions save to
Third specified file only stores the corresponding test log of abnormal conditions in third specified file.
Further include proposing power module 260 (being not shown in Fig. 2) using test device 200 according to a kind of embodiment, is suitable for improving
Using permission of the test device 200 in mobile terminal operating system, to initiate the Monkey to other application in mobile terminal
Test.Proposing power method, there are mainly two types of:
1) root authority of mobile terminal is obtained.
2) configuration file is modified:
If the version number of android system less than 5.1, is arranged in AndroidManifest.xml file
android:SharedUserId=" android.uid.system ";
If the version number of android system is more than or equal to 5.1, it is arranged in AndroidManifest.xml file
android:SharedUserId=" android.uid.shell ".
Power mode is mentioned for modification configuration file, is having modified the android in configuration file:SharedUserId ginseng
After number, to be compiled to apk file, then firstly the need of use java-jar signapk.jar method to the apk file
It is signed again.
According to a kind of embodiment, further includes database population module 270 (being not shown in Fig. 2) using test device 200, be suitable for
Data filling is carried out to tested application.For example, when testing address list application, it is necessary first to fill a certain number of
It is people, then executes Monkey test again.Data filling is particularly convenient efficient for the test of ROM related application.
Fig. 6 shows the flow chart of application testing method 600 according to an embodiment of the invention.Application testing method
600 execute in the terminal.As shown in fig. 6, this method starts from step S610.
In step S610, obtains and show application packet all in mobile terminal.
According to a kind of embodiment, institute in mobile terminal is got by the PackageManager class in android system
There is the information of application, such as icon, title and packet name for respectively applying etc., and be presented to tester, intuitively shows
Testable object.Application packet according to an embodiment of the invention shows that the schematic diagram at interface is as shown in Figure 3.
Then, in step S620, selection of the tester to random test mode or fixed test pattern is received.
According to a kind of embodiment, tester can click upper right by showing in interface in application packet as shown in Figure 3
" the advanced setting " at angle enters random test mode, and random test parameter is arranged;Pass through click " fix command test " (figure
It is not shown in 3) enter fixed test pattern, and select fixed test command.
If tester selects random test mode, S632~S638 is thened follow the steps:
In step S632, setting of the tester to random test parameter is received.Random test parameter includes Random event
Part executes number, chance event interval, the ratio of different types of chance event, feedback information rank, random test constraint item
Part.Wherein, chance event includes touch event, action event, track event, basic navigation event, prime navaid event, system
Event and other events.It is 50000 that chance event, which executes number default value, and it is 1000ms that value is defaulted at chance event interval.
The schematic diagram of random test parameter setting interface according to an embodiment of the invention is as shown in figure 4, can in interface shown in Fig. 4
The ratio of random test constraint condition, feedback information rank and different types of chance event is arranged.
Then, in step S634, random test order is generated according to random test parameter.The step generates test institute
Random event sequence is equivalent to the random seed value generated in Monkey test.
Then, in step S636, selection of the tester to tested application packet is received.
According to a kind of embodiment, tester can be chosen by wrapping in displaying interface in application using corresponding check box
It is tested using packet to select, as shown in Figure 3.Tester can choose an application packet, can also choose multiple applications simultaneously
It wraps or one is not selected.
Then, it in step S638, is wrapped in tested application and executes random test order.That is, starting random test process.
If tester selects fixed test pattern, S642~S646 is thened follow the steps:
In step S642, selection of the tester to fixed test command is received.
According to a kind of embodiment, tester can select a choosing in fixation test command selection interface as shown in Figure 5
Take an order.
Then, in step S644, selection of the tester to blacklist application packet is received.
According to a kind of embodiment, tester can be chosen by wrapping in displaying interface in application using corresponding check box
To select by blacklist application packet, as shown in Figure 3.Tester can choose an application packet, can also choose simultaneously multiple
It is not selected using packet or one.
Then, it in step S646, wraps, executes solid in other mobile terminal applications other than blacklist application packet
Determine test command.If not specified test application packet in fixed test command, in other institutes other than blacklist application packet
There is mobile terminal application to wrap and executes the fixation test command;If specifying test application packet in fixed test command, removing
Other all test applications except the blacklist application packet, which are wrapped, executes the fixation test command.Fixed test process is not
Execution is wrapped in blacklist application, that is to say, that fixed test shields the application in blacklist application packet, certainly, if test
The not set blacklist application packet of personnel, then fix in test at this and do not need to shield any application.
Then, in step S650, test case is recorded.
According to a kind of embodiment, in moment (whether random test order or the fixed survey for starting execution test command
Examination order), it will be in the first specified file that testing time and test command write-in SD card be started.In order to facilitate analysis test knot
Test log is redirected output to the second specified file by fruit.According to a kind of embodiment, the first specified file and the second specified text
Part can be same file.The test log for opening thread snoopy test process, if listening to abnormal conditions, such as collapses
(Crash), without response (ANR, Application Not Responding) etc., then by the corresponding test log of the abnormal conditions
It saves to the second specified file.
According to a kind of embodiment, in application testing method 600 shown in Fig. 6, can also include before step S610
Step S601 (is not shown) in Fig. 6.In step s 601, it carries out proposing power to using test device.Power method is proposed referring to aforementioned right
The description of power module 260 is proposed, details are not described herein again.
According to a kind of embodiment, in application testing method shown in Fig. 6, between step S636 and step S638, also
It may include step S637 (being not shown in Fig. 6).In step S637, as needed, the application in tested application packet is carried out
Data filling.For example, when testing address list application, it is necessary first to fill a certain number of contact persons, then hold again
Row Monkey test.
The technical solution provided according to the present invention is executed by residing at the application test device of mobile terminal to other
The Monkey of application is tested, and without being attached with the end PC, reduces the consumption of resource, easy to use, is suitable for mobile context
Test under state.In addition, the present invention can execute fixed test command under fixed test pattern, to realize same application
Different editions contrast test.Under fixed test pattern, Monkey test blacklist can also be set, phase is conveniently realized
Close the shielding of application.
A6:Application testing method described in A1, wherein the random test parameter includes:Chance event execute number, with
Machine interval of events, the ratio of different types of chance event, feedback information rank, random test constraint condition.A7:Described in A6
Application testing method, wherein the chance event includes:Touch event, action event, track event, basic navigation event, master
Want navigation event, system event.A8:Application testing method described in A1, wherein the step of record test case is further
Including:It will start the testing time and test command is written in the first specified file;The output position of test log is directed to institute
The second specified file is stated, and opens thread and monitors the test log;It is if listening to abnormal conditions, the abnormal conditions are corresponding
Test log save to second specified file.A9:Application testing method described in A8, wherein the abnormal conditions packet
Include collapse and without response.A10:Application testing method described in A1, wherein receiving selection of the tester to tested application packet
The step of after, the tested application wrap execute the random test order the step of before, further include:To tested application
Application in packet carries out data filling.
B15:Application test device described in B11, wherein the fixed test module is further adapted for:For not specified
The fixation test command of test application packet is wrapped in other all mobile terminal applications other than blacklist application packet
It executes;For specifying the fixation test command of test application packet, other than blacklist application packet other are all
Test application wraps execution.B16:Application test device described in B11, wherein the random test parameter includes:Chance event
Execute number, chance event interval, the ratio of different types of chance event, feedback information rank, random test constraint condition.
B17:Application test device described in B16, wherein the chance event includes:Touch event, action event, track event, base
This navigation event, prime navaid event, system event.B18:Application test device described in B11, wherein the log recording
Module is further adapted for:It will start the testing time and test command is written in the first specified file;By the output bit of test log
It sets and is directed to second specified file, and open thread and monitor the test log;It is if listening to abnormal conditions, this is different
The corresponding test log of reason condition is saved to second specified file.B19:Application test device described in B18, wherein institute
Stating abnormal conditions includes collapsing and without response.B20:Application testing method described in B11, wherein the random test module is also
It is suitable for:Data filling is carried out to the application in tested application packet.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be practiced without these specific details.In some instances, well known method, knot is not been shown in detail
Structure and technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention:It is i.e. required to protect
Shield the present invention claims than feature more features expressly recited in each claim.More precisely, as following
As claims reflect, inventive aspect is all features less than single embodiment disclosed above.Therefore, it abides by
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
As a separate embodiment of the present invention.
Those skilled in the art should understand that the module of the equipment in example disclosed herein or unit or groups
Part can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned at and the equipment in the example
In different one or more equipment.Module in aforementioned exemplary can be combined into a module or furthermore be segmented into multiple
Submodule.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
Meaning one of can in any combination mode come using.
In addition, be described as herein can be by the processor of computer system or by executing by some in the embodiment
The combination of method or method element that other devices of the function are implemented.Therefore, have for implementing the method or method
The processor of the necessary instruction of element forms the device for implementing this method or method element.In addition, Installation practice
Element described in this is the example of following device:The device be used for implement as in order to implement the purpose of the invention element performed by
Function.
As used in this, unless specifically stated, come using ordinal number " first ", " second ", " third " etc.
Description plain objects, which are merely representative of, is related to the different instances of similar object, and is not intended to imply that the object being described in this way must
Must have the time it is upper, spatially, sequence aspect or given sequence in any other manner.
Although the embodiment according to limited quantity describes the present invention, above description, the art are benefited from
It is interior it is clear for the skilled person that in the scope of the present invention thus described, it can be envisaged that other embodiments.Additionally, it should be noted that
Language used in this specification primarily to readable and introduction purpose and select, rather than in order to explain or limit
Determine subject of the present invention and selects.Therefore, without departing from the scope and spirit of the appended claims, for this
Many modifications and changes are obvious for the those of ordinary skill of technical field.For the scope of the present invention, to this
Invent done disclosure be it is illustrative and not restrictive, it is intended that the scope of the present invention be defined by the claims appended hereto.
Claims (21)
1. a kind of application testing method, executes in the terminal, this method includes:
It obtains and shows application packet all in mobile terminal;
Receive selection of the tester to random test mode or fixed test pattern;
If tester selects random test mode,
Setting of the tester to random test parameter is received,
Random test order is generated according to the random test parameter,
Selection of the tester to tested application packet is received,
It is wrapped in the tested application and executes the random test order;
If tester selects fixed test pattern,
Selection of the tester to fixed test command is received,
Selection of the tester to blacklist application packet is received,
It is wrapped in other mobile terminal applications other than blacklist application packet, executes the fixed test command;
Record test case.
2. application testing method as described in claim 1, wherein in the acquisition and show application all in mobile terminal
Before the step of packet, further include:Obtain the root authority of mobile terminal.
3. application testing method as described in claim 1, wherein in the acquisition and show application all in mobile terminal
Before the step of packet, further include:
Detect the operating system version number of mobile terminal;
If operating system version number is less than 5.1, by android in the AndroidManifest.xml file of mobile terminal:
SharedUserId is set as " android.uid.system ";
It, will in the AndroidManifest.xml file of mobile terminal if operating system version number is more than or equal to 5.1
android:SharedUserId is set as " android.uid.shell ".
4. application testing method as described in claim 1, wherein under random test mode, if not receiving tester
Selection to tested application packet, then all applications wrap and execute the random test order in the terminal.
5. application testing method as described in claim 1, wherein it is described in addition to the blacklist application packet other than other
Mobile terminal application is wrapped, execute the fixed test command the step of include:
For the fixation test command of not specified test application packet, in other all shiftings other than blacklist application packet
Dynamic terminal applies wrap execution;
For specifying the fixation test command of test application packet, in other all surveys other than blacklist application packet
Execution is wrapped in examination application.
6. application testing method as described in claim 1, wherein the random test parameter includes:Chance event executes secondary
Number, chance event interval, the ratio of different types of chance event, feedback information rank, random test constraint condition.
7. application testing method as claimed in claim 6, wherein the chance event includes:
Touch event, action event, track event, basic navigation event, prime navaid event, system event.
8. application testing method as described in claim 1, wherein the step of record test case further comprises:
It will start the testing time and test command is written in the first specified file;
The output position of test log is directed to the second specified file, and opens thread and monitors the test log;
If listening to abnormal conditions, the corresponding test log of the abnormal conditions is saved to second specified file.
9. application testing method as claimed in claim 8, wherein the abnormal conditions include collapsing and without response.
10. application testing method as described in claim 1, wherein receiving selection of the tester to tested application packet
After step, before the step of executing the random test order is wrapped in the tested application, further include:To tested application packet
In application carry out data filling.
11. a kind of apply test device, reside in mobile terminal, which includes:
Using packet display module, suitable for obtaining and showing application packet all in mobile terminal;
Mode selection module, suitable for receiving selection of the tester to random test mode or fixed test pattern;
Random test module is suitable for receiving tester to random test parameter when tester selects random test mode
Setting, random test order is generated according to the random test parameter, receives selection of the tester to tested application packet, with
And it is wrapped in the tested application and executes the random test order;
Fixed test module is suitable for when tester selects fixed test pattern, receives tester to fixed test command
Selection, receive tester to blacklist application packet selection, and in addition to the blacklist application packet other than other
Mobile terminal application is wrapped, and the fixed test command is executed;
Logger module is suitable for record test case.
12. applying test device as claimed in claim 11, wherein further include:Power module is proposed, suitable for obtaining mobile terminal
Root authority.
13. applying test device as claimed in claim 11, wherein further include:Power module is proposed, mobile terminal is adapted to detect for
Operating system version number;
If operating system version number is less than 5.1, by android in the AndroidManifest.xml file of mobile terminal:
SharedUserId is set as " android.uid.system ";
It, will in the AndroidManifest.xml file of mobile terminal if operating system version number is more than or equal to 5.1
android:SharedUserId is set as " android.uid.shell ".
14. applying test device as claimed in claim 11, wherein the random test module is further adapted for:If not connecing
Selection of the tester to tested application packet is received, then all applications wrap and execute the random test life in the terminal
It enables.
15. applying test device as claimed in claim 11, wherein the fixed test module is further adapted for:For not
The fixation test command of nominative testing application packet, in other all mobile terminal applications other than blacklist application packet
Wrap execution;
For specifying the fixation test command of test application packet, in other all surveys other than blacklist application packet
Execution is wrapped in examination application.
16. applying test device as claimed in claim 11, wherein the random test parameter includes:Chance event executes
Number, chance event interval, the ratio of different types of chance event, feedback information rank, random test constraint condition.
17. applying test device as claimed in claim 16, wherein the chance event includes:
Touch event, action event, track event, basic navigation event, prime navaid event, system event.
18. applying test device as claimed in claim 11, wherein the logger module is further adapted for:
It will start the testing time and test command is written in the first specified file;
The output position of test log is directed to the second specified file, and opens thread and monitors the test log;
If listening to abnormal conditions, the corresponding test log of the abnormal conditions is saved to second specified file.
19. applying test device as claimed in claim 18, wherein the abnormal conditions include collapsing and without response.
20. applying test device as claimed in claim 11, wherein the random test module is further adapted for:To tested application
Application in packet carries out data filling.
21. a kind of mobile terminal, including the application test device as described in any one of claim 11-20.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610531823.6A CN106201876B (en) | 2016-07-07 | 2016-07-07 | A kind of application testing method, device and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610531823.6A CN106201876B (en) | 2016-07-07 | 2016-07-07 | A kind of application testing method, device and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106201876A CN106201876A (en) | 2016-12-07 |
CN106201876B true CN106201876B (en) | 2018-11-23 |
Family
ID=57473548
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610531823.6A Active CN106201876B (en) | 2016-07-07 | 2016-07-07 | A kind of application testing method, device and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106201876B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107357704B (en) * | 2017-06-27 | 2021-01-01 | 努比亚技术有限公司 | Application program detection method, terminal and computer readable storage medium |
CN107861854A (en) * | 2017-09-27 | 2018-03-30 | 努比亚技术有限公司 | A kind of terminal local collapse processing method, terminal and computer-readable recording medium |
CN108280352A (en) * | 2018-01-17 | 2018-07-13 | 西安邮电大学 | A kind of privacy assessment and right management method based on 8.0 authority mechanisms of Android |
CN110727551B (en) * | 2019-09-20 | 2022-07-19 | 苏州浪潮智能科技有限公司 | Random divergent configuration testing method, system and storage medium |
CN112363954B (en) * | 2020-12-08 | 2021-07-30 | 南京大学 | Software dynamic update test method based on object state consistency |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631702A (en) * | 2012-08-20 | 2014-03-12 | 腾讯科技(深圳)有限公司 | Automatic random key test method and device |
CN105095078A (en) * | 2015-07-22 | 2015-11-25 | 厦门美图移动科技有限公司 | Systematic automation testing device and method and calculating device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9208065B1 (en) * | 2014-05-14 | 2015-12-08 | International Business Machines Corporation | Correlating out-of-band process data during mobile test automation |
-
2016
- 2016-07-07 CN CN201610531823.6A patent/CN106201876B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631702A (en) * | 2012-08-20 | 2014-03-12 | 腾讯科技(深圳)有限公司 | Automatic random key test method and device |
CN105095078A (en) * | 2015-07-22 | 2015-11-25 | 厦门美图移动科技有限公司 | Systematic automation testing device and method and calculating device |
Also Published As
Publication number | Publication date |
---|---|
CN106201876A (en) | 2016-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106201876B (en) | A kind of application testing method, device and mobile terminal | |
CN105630686B (en) | A kind of application traversal test method, equipment and mobile terminal | |
CN105868105B (en) | A kind of application traversal test method, equipment and mobile terminal | |
CN105975391B (en) | One kind restarting test method, equipment and mobile terminal | |
CN105512033B (en) | A kind of automated testing method of mobile terminal, device and mobile terminal | |
US9152521B2 (en) | Systems and methods for testing content of mobile communication devices | |
CN105373479B (en) | A kind of automated testing method of RAM leakage, device and mobile terminal | |
CN105824755B (en) | A kind of automated testing method, device and mobile terminal | |
CN106126424B (en) | A kind of visual automated testing method of script, device and mobile terminal | |
CN109783350A (en) | Interface test method, device and computer readable storage medium | |
CN104063305A (en) | Pressure testing method, device and system for intelligent terminal software | |
CN104991847B (en) | A kind of RAM leakage automated detection method, device and mobile terminal | |
CN105808399A (en) | Method and device for remote debugging | |
CN108415734A (en) | A kind of application recovery device, method and mobile terminal | |
CN107656866A (en) | A kind of method, mobile terminal and computing device tested using fluency | |
CN113138925A (en) | Function test method and device of application program, computer equipment and storage medium | |
CN108509348A (en) | A kind of test method and mobile terminal of system aging | |
CN107733866A (en) | RPC requests, RPC request processing methods, device and equipment | |
CN110366100A (en) | Localization method, positioning device, readable storage medium storing program for executing and the terminal device of terminal | |
CN116225807A (en) | Method, system, device, equipment and storage medium for testing embedded equipment | |
CN106021004A (en) | User behavior simulation unit, test system and test method | |
CN110297754A (en) | A kind of test information feedback method and system | |
CN106649096B (en) | The method and device of change facility information based on automatic test | |
CN106502899A (en) | The method of monitoring application, device, mobile terminal and system | |
CN110516187A (en) | A kind of page processing method, mobile terminal, readable storage medium storing program for executing |
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 |