A kind of Monkey method of testings and device
Technical field
The present embodiments relate to testing field, more particularly to a kind of Monkey method of testings and device.
Background technology
Monkey tests are also known as random test or stability test, are to set Monkey test programs in simulator or truly
During standby middle operation, program can produce the use such as certain amount or click, button and the gesture of stochastic simulation user in certain time
There is number of times or the time of exception in event of family Action Events and some system levels etc., test equipment, and then knows to be measured
The stability of equipment.
In the prior art, generally subsequently surveyed using the test bag name for obtaining or manually selecting manually in Devices to test
Examination, complex steps.Meanwhile, highly professional, matching and the lookup when being tested of test bag name that is to be obtained or treating selection
It is more difficult, especially it is not easy to test Monkey uncomprehending tester's progress test operation, causes such tester
Test experience is not good.
The content of the invention
The present invention provides a kind of Monkey method of testings and device, and uncomprehending tester is tested to Monkey to realize
Test operation can be carried out, test Experience Degree is improved.
In a first aspect, the embodiments of the invention provide a kind of Monkey method of testings, this method includes:
Automatic to obtain the corresponding bag name of all application programs in intelligent terminal, acquisition can test bag name list;
Obtain the corresponding module title list to be tested of application program to be tested in the intelligent terminal;
Test parameter when testing the application program to be tested is set, test parameter list is obtained;
It is described can module title list to be tested described in Auto-matching in test bag name list, obtain bag name to be tested
Claim list;
The test parameter in the test parameter list is to being needed in the bag name list to be tested
Test bag is tested;
Generate test log.
Second aspect, the embodiment of the present invention additionally provides a kind of Monkey test devices, and the device includes:
Can test bag name acquiring module, for obtaining the corresponding bag name of all application programs in intelligent terminal automatically, obtain
Obtaining can test bag name list;
Module title acquisition module to be tested, for obtaining, the application program to be tested in the intelligent terminal is corresponding to be treated
Test module name list;
Test parameter setup module, for setting test parameter when testing the application program to be tested, is obtained
Obtain test parameter list;
Bag name acquiring module to be tested, for it is described can die trial to be measured described in Auto-matching in test bag name list
Block name list, obtains bag name list to be tested;
Test module, for the test parameter in the test parameter list to the bag name column to be tested
All bags to be tested in table are tested;
Test log generation module, for generating test log.
The present invention is by can Auto-matching is obtained in test bag name list module title to be tested what is obtained automatically
List, obtains bag name list to be tested, and the test parameter list set is combined to be measured according to the bag name list to be tested
Bag to be tested in examination bag name list is tested, and generates the technical scheme of corresponding test log, is solved and is used hand
The problem of dynamic test bag for obtaining or manually selecting in Devices to test complex steps.Simultaneously because survey that is to be obtained or treating selection
The highly professional of bag name is tried, more difficulty is matched and searched when being tested, realizes and uncomprehending is tested to Monkey
Tester can also carry out test operation, improve the beneficial effect of the test experience of such tester.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention one is provided.
Fig. 2 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention two is provided.
Fig. 3 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention three is provided.
Fig. 4 A are a kind of schematic diagrames of test result analysis cake chart in the embodiment of the present invention three.
Fig. 4 B are a kind of schematic diagrames of test result analysis block diagram in the embodiment of the present invention three.
Fig. 5 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention four is provided.
Fig. 6 is a kind of structural representation for Monkey test devices that the embodiment of the present invention five is provided.
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that, in order to just
Part related to the present invention rather than entire infrastructure are illustrate only in description, accompanying drawing.
Embodiment one
Fig. 1 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention one is provided, and the present embodiment can use
In the situation that stability test is carried out to intelligent terminals such as mobile phone, tablet personal computers, this method can by software and/or
Hardware is performed, and specifically includes following steps:
Step 110, it is automatic obtain the corresponding bag name of all application programs in intelligent terminal, acquisition can test bag name column
Table;
Wherein, intelligent terminal can be mobile terminal device or fixed terminal equipment.Can test bag name list
At least include all application programs in intelligent terminal and be presented to the usual title of user and the application program stored in intelligent terminal
The title table of comparisons of the individual calling formation of bag.By taking smart mobile phone as an example, the short message in the smart mobile phone that user intuitively obtains
" short message " shown under icon is usual title;The corresponding program bag of short message application program stored in smart mobile phone
" com.android.mms " is individual calling.
Step 120, the corresponding module title list to be tested of application program to be tested obtained in the intelligent terminal;
Wherein, the corresponding title of application program to be tested in module title list to be tested is usual title.In addition,
The specific presentation mode for obtaining each usual title in module title list to be tested is not limited.If that is, intelligence is eventually
End is directed to the user using Chinese as mother tongue, then usual entitled Chinese form;If intelligent terminal is directed to using other language as mother
The user of language, then usual entitled corresponding linguistic form.
The test parameter of step 130, setting when testing the application program to be tested, obtains test parameter and arranges
Table;
Wherein, test parameter at least includes event times/length of testing speech, time interval and Test Strategy.It is worth explanation
, event times refer to perform the testing time that Monkey test needs are circulated, and user can be voluntarily defeated according to demand
Enter;Length of testing speech refers to perform test bag to be tested within the default period Monkey tests, pre- more than this when the time
If duration, then the EOT end of test;Time interval refers to the interval time between Monkey test events twice, and user can basis
Demand sets itself, is defaulted as 500ms.
Event times/length of testing speech, time interval or the Test Strategy of setting are different, then the test parameter list formed
Also different, the test instruction ultimately formed is also just different.
Step 140, it is described can module title list to be tested described in Auto-matching in test bag name list, treated
Test bag name list;
Wherein, the title of each bag to be tested included in bag name list to be tested is individual calling, to be formed
Final test instruction.
Step 150, the test parameter in the test parameter list are in the bag name list to be tested
All bags to be tested tested;
Step 160, generation test log.
The operation principle of the Monkey method of testings is:By obtaining the corresponding bag of all application programs in intelligent terminal
What the usual title and individual calling of name were formed can test bag name list, the acquisition corresponding trivial name of application program to be tested
Claim the module title list to be tested formed.Obtained after content in above-mentioned two list is carried out into Auto-matching by module to be tested
The corresponding individual calling of the usual title of application program to be tested in list forms bag name list to be tested.Also, with reference to survey
The test parameter list for the test parameter formation that examination personnel are manually entered and/or manually selected, is treated in test bag name list
It is all it is to be tested bag carry out Monkey tests, ultimately generate test log.
The present invention is by can Auto-matching is obtained in test bag name list module title to be tested what is obtained automatically
List, obtains bag name list to be tested, and the test parameter list set is combined to be measured according to the bag name list to be tested
Bag to be tested in examination bag name list is tested, and generates the technical scheme of corresponding test log, is solved and is used hand
The problem of dynamic test bag for obtaining or manually selecting in Devices to test complex steps.Simultaneously because survey that is to be obtained or treating selection
The highly professional of bag name is tried, more difficulty is matched and searched when being tested, realizes and uncomprehending is tested to Monkey
Tester can also carry out test operation, improve the beneficial effect of the test experience of such tester.
Embodiment two
Fig. 2 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention two is provided, and the present embodiment is upper
On the basis of the technical scheme for stating each embodiment, other features are further increased.
Further, after generation test log, in addition to:
Step 170, automatically analyze the test log, generation test result analysis figure and/or test result analysis table.
Specifically, the method that analysis can use search key is carried out to test log, ANR is retrieved in test log
(Application No Response, application program without response), CRASH (collapse) and Exception (exception) and by its
The specific crucial paragraph navigated in test log, then extracts key message in paragraph, generates test result analysis figure
And/or test result analysis table.
Further, the test log, generation test result analysis figure and/or test result analysis table are being automatically analyzed
Afterwards, in addition to:
Step 180, the test log and/or test result analysis figure and/or test result analysis table be sent to finger
Determine mailbox.
Specifically, by test log and follow-up test result analysis figure and/or test result through automatically analyzing generation
Analytical table be automatically sent to research and develop and the E-mail address of related personnel tested in.Wherein, the email address of related personnel can be with
It is configured in intelligent terminal.
The technical scheme of the present embodiment, by automatically analyzing test log, generation test result analysis figure and/or test knot
This test application program the problem of point can be intuitively presented in fruit analytical table.By by test log and subsequently through automatically analyzing
The electronics of related personnel that the test result analysis figure and/or test result analysis table generated afterwards is automatically sent to research and develop and tested
Mailbox, facilitates research staff and the related personnel of test to obtain test information in time, follow-up excellent targetedly to carry out
Change.
Embodiment three
Fig. 3 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention three is provided.The present embodiment can be with
There is provided a kind of preferred embodiment based on the technical scheme of the various embodiments described above.Specifically include following steps:
Step 110, it is automatic obtain the corresponding bag name of all application programs in intelligent terminal, acquisition can test bag name column
Table;
Specifically, the batch-processed files that will be constituted comprising test program script file are needed before testing and installed in intelligence
Installation package file in energy terminal is put into the identical file of computer end folder.By intelligent terminal connection on computers, computer end is opened
The batch-processed files are moved, installation package file is installed to intelligence by running the test bridge joint instruction of the Android in batch-processed files
In energy terminal, and run the corresponding application program of the installation package file.The application program will be presented for being handed over user
Mutual Monkey testing tool main interfaces, while running background obtains the corresponding bag name of all application programs in intelligent terminal, are obtained
Obtaining can test bag name list.The list is stored in intelligent terminal, facilitates subsequent testing operation.
Wherein, can test bag name list at least include all application programs in intelligent terminal and be presented to the trivial name of user
Claim the title table of comparisons of the individual calling formation of the application package with being stored in intelligent terminal.Wherein, such as " QQ browsers ",
The title of the forms such as " telephone service ", " short message " is usual title;Corresponding " com.tencent.mtt ",
The title of the forms such as " com.android.phone ", " com.android.mms " is individual calling.In addition, noticeable
Be, can test bag name list can be TXT text formattings or other storage formats.
If it should be noted that obtaining successfully automatically, subsequent step will be continued executing with;Otherwise will be with pop-up etc.
Form reminds user to re-operate.
Step 120, the corresponding module title list to be tested of application program to be tested obtained in the intelligent terminal;
Wherein, the corresponding title of application program to be tested in module title list to be tested is usual title.In addition,
The concrete mode for obtaining each usual title in module title list to be tested is not limited.
Specifically, what user can be inputted by Monkey testing tools main interface in intelligent terminal is all to be tested
The usual title of application program forms module title list to be tested.Here, to the module title list to be tested at intelligent end
Storage format and store path in end do not do any restriction.
Preferably, step 120 can include:
The corresponding title of application program to be tested described in step 121A, tester's text input;
Step 122A, according to the title, obtain the module title list to be tested.
Specifically, user can be manually entered application program to be tested in the text box of Monkey testing tool main interfaces
Usual title, module title list to be tested is then formed using above-mentioned usual title.
It should be noted that user once or repeatedly can input in the text box of Monkey testing tool main interfaces
The usual title of application program to be tested.Between text input twice, the main interface selection window can occurs and be selected for user
Select and whether continue input.Here, not doing any restriction to the specific appearance form of selection window.
The test parameter of step 130, setting when testing the application program to be tested, obtains test parameter and arranges
Table;
Specifically, user can be manually entered or manually select corresponding test in Monkey testing tool main interfaces
Parameter.
Exemplarily, when the event times that user is set are 1200000000, "-v-v-v are selected;”、“--pct-
trackball<percent>;" and " -- ignore-crashes;", the test parameter list ultimately formed is:Ignore collapse
Event (-- ignore-crashes);Trace ball event accounting 0% (-- pct-trackball<percent>);Day is exported in detail
Will information (- v-v-v);Test interval 500ms (-- throttle 500);Event times (1200000000).
Step 140, it is described can module title list to be tested described in Auto-matching in test bag name list, treated
Test bag name list;
Wherein, the title of each bag to be tested included in bag name list to be tested is individual calling, to be formed
Final test instruction.
Specifically, intelligent terminal can test bag name list, module title list to be tested and test parameter list one
And import computer end.Computer end can be in test bag name list in bag name list to be tested each usual title
The corresponding individual calling of Auto-matching, forms bag name list to be tested.
If it should be noted that user is carried out in the case where not inputting the usual title of any application program to be tested
Test, then could be arranged to pair can be in test bag name list all application packages test, or be set to enter
Any test of row.
In addition, if there is such as user's input in module title list to be tested title be wrong or intelligent terminal in simultaneously
Do not install the reasons such as the corresponding application program of the usual title cause to there may be matching during Auto-matching it is unsuccessful
Situation.Now, computer end may remind the user that the usual title that the match is successful, then proceed to perform follow-up test step;Also
The operation of subsequent step can be terminated, reminds user to re-execute step 120.
Step 150, the test parameter in the test parameter list are in the bag name list to be tested
All bags to be tested tested;
Step 160, generation test log.
Step 170, automatically analyze the test log, generation test result analysis figure and/or test result analysis table.
Specifically, the method that analysis can use search key is carried out to test log, ANR is retrieved in test log
(Application No Response, application program is without response), CRASH (collapse) and Exception (exception) will be tested
Related content in daily record navigates to specific crucial paragraph, and key message, generation test result point are then extracted in paragraph
Analysis figure and/or test result analysis table.
Specifically, test result analysis figure is at least secondary including occurring the exception of tri- kinds of exceptions of ANR, CRASH, Exception
Number.Any restriction, the exemplary offer test result of the present embodiment are not done to the specific appearance form of the test result analysis figure
Analyze cake chart (referring to Fig. 4 A) and test result analysis block diagram (referring to Fig. 4 B).
Specifically, test result analysis table at least includes Monkey test conclusive tables and/or Monkey daily record abnormal informations
Statistical form.
Wherein, Monkey tests the content of conclusive table at least including ANR number, CRASH number and Exception times
Number.It is exemplary that to provide a kind of content of specific test result analysis table as shown in the table:
The bag of test bag that wherein, the content in Monkey daily records abnormal information statistical form at least includes being tested,
Exception Type, anomalous content and abnormal cause etc..Exemplary provides a kind of specific Monkey daily records abnormal information statistics
The content of table is as shown in the table:
Step 180, the test log and/or test result analysis figure and/or test result analysis table be sent to finger
Determine mailbox.
The above-mentioned technical proposal of the present embodiment, user is manually entered by the text box in Monkey testing tool main interfaces
The usual title of application package to be tested in intelligent terminal, reduces the professional requirement to tester, makes pair
Monkey, which tests uncomprehending tester, can also carry out test operation, improve the test experience of such tester.
Example IV
Fig. 5 is a kind of schematic flow sheet for Monkey method of testings that the embodiment of the present invention four is provided, the embodiment of the present invention
Difference with embodiment three is, " will obtain the application journey to be tested in the intelligent terminal in above-described embodiment step 120
The corresponding module title list to be tested of sequence " is preferably herein below:
The corresponding title of application program to be tested described in step 121B, tester's phonetic entry;
Step 122B, according to the title after speech recognition, obtain the module title list to be tested.
Specifically, user can click on phonetic entry icon at Monkey testing tools interface, will now call intelligence
Voice input module in terminal, intelligent terminal according to the voice input module speech recognition user of itself input it is to be detected should
With the usual title of program, and module title list to be measured is aggregated into according to above-mentioned usual title, for follow-up test process.
The technical scheme of the present embodiment, user by Monkey testing tool main interfaces click on phonetic entry icon come
The voice input module in intelligent terminal is called, intelligent terminal obtains and recognized the application program to be tested of user speech input
Usual title, facilitates the test operation of user, reduces the professional requirement to tester, makes not testing Monkey
The tester of solution can also carry out test operation, improve the test experience of such tester.
Embodiment five
Fig. 6 is a kind of structural representation for Monkey test devices that the embodiment of the present invention five is provided, and the device includes:
Can test bag name acquiring module 210, module title acquisition module 220 to be tested, test parameter setup module
230th, bag name acquiring module 240 to be tested, test module 250 and test log generation module 260.
Wherein, can test bag name acquiring module 210, for automatically obtain intelligent terminal in all application programs it is corresponding
Bag name, acquisition can test bag name list;
Module title acquisition module 220 to be tested, for obtaining the correspondence of the application program to be tested in the intelligent terminal
Module title list to be tested;
Test parameter setup module 230, for setting test parameter when testing the application program to be tested,
Obtain test parameter list;
Bag name acquiring module 240 to be tested, for it is described can in test bag name list described in Auto-matching it is to be measured
Die trial block name list, obtains bag name list to be tested;
Test module 250, for the test parameter in the test parameter list to the bag name to be tested
All bags to be tested in list are claimed to be tested;
Test log generation module 260, for generating test log.
Monkey test devices provided in an embodiment of the present invention, by can test bag name acquiring module 210 automatically obtain
In intelligent terminal can test bag name list;And obtained module title to be tested by bag name acquiring module 240 to be tested
The usual title of application program to be tested in the intelligent terminal that modulus block 220 is obtained, can in test bag name list it is automatic
The corresponding individual calling of the usual title is matched, bag name list to be tested is obtained;The binding test parameter setting of test module 250
The test parameter that test parameter list in module 230 is included, the dependence test bag treated in test bag name list performs survey
Examination operation, and test log generation module 260 generates corresponding test log.Above-mentioned technical proposal is solved to use and obtained manually
The problem of taking or manually select the test bag name complex steps in Devices to test.Solve simultaneously due to be obtained or treat selection
Highly professional, matching and the lookup more difficulty when being tested of test bag name, realizes and Monkey tests is not known about
Tester can also carry out test operation, improve the beneficial effect of the test experience of such tester.
Said apparatus, it is preferable that also include:
Test result generation module 270, for automatically analyzing the test log, generation test result analysis figure and/or
Test result analysis table.
Said apparatus, it is preferable that also include:
Mail sending module 280, for the test log and/or test result analysis figure and/or test result to be divided
Analysis table is sent to specified mailbox.
Exemplarily, the module title acquisition module 230 to be tested, including:
Text input unit, the corresponding title of the application program to be tested is manually entered for tester;
First title acquiring unit, for according to the title, obtaining the module title list to be tested.
Exemplarily, the module title acquisition module 230 to be tested, including:
Voice-input unit, for the corresponding title of application program to be tested described in tester's phonetic entry;
Second title acquiring unit, according to the title after speech recognition, obtains the module title list to be tested.
Above-mentioned Monkey test devices can perform the Monkey method of testings that any embodiment of the present invention is provided, and possesses and holds
The corresponding functional module of row method and beneficial effect.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art it is various it is obvious change,
Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.