CN105653452A - Method and device for testing application program - Google Patents

Method and device for testing application program Download PDF

Info

Publication number
CN105653452A
CN105653452A CN201511020885.2A CN201511020885A CN105653452A CN 105653452 A CN105653452 A CN 105653452A CN 201511020885 A CN201511020885 A CN 201511020885A CN 105653452 A CN105653452 A CN 105653452A
Authority
CN
China
Prior art keywords
test
tested
application program
terminal
action events
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.)
Pending
Application number
CN201511020885.2A
Other languages
Chinese (zh)
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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201511020885.2A priority Critical patent/CN105653452A/en
Publication of CN105653452A publication Critical patent/CN105653452A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Abstract

The embodiment of the invention discloses a method for testing an application program, which comprises the following steps: when an instruction for starting testing of the application program to be tested is received, testing the application program to be tested as a test object according to a preset test script; monitoring whether the test object is switched or not in the process of testing the test object as the application program to be tested; and when the switching of the test object is monitored, switching the test object to the application program to be tested again and testing. The embodiment of the invention also discloses a device for testing the application program. By adopting the method and the device, the application program to be tested can be tested at the terminal, and the terminal can be ensured to always test the application program to be tested.

Description

A kind of method of Test Application program and device
The present invention relates to electronics and calculate field, particularly relate to method and the device of a kind of Test Application program.
Background technology
In process of application development or after application development completes, in order to whether Test Application program can reach the effect of expection, application programs is generally all needed to carry out the test of stability.
And at present, in the test process treating Test Application program and carrying out stability, owing to execution mistake may occur in terminal, thus cause terminal can exit the test treating Test Application program, and switch to the test of the application program to other, and, when terminal is to other Application testings, what terminal now still recorded is the test result of application program to be tested, make terminal can be recorded in the test result of application program to be tested by the test result of other application programs, this causes test result inaccurate, make user cannot treat Test Application program to analyze accurately, so that user treats Test Application program makes false judgment.
Summary of the invention
Embodiment of the present invention technical problem to be solved is, it is provided that a kind of method of Test Application program and device. Can treat during Test Application program tests in terminal, can ensure that terminal is treat Test Application program to test all the time.
In order to solve the problems of the technologies described above, embodiments provide a kind of method of Test Application program, comprising:
When receive treat instruction that Test Application program starts test time, be that application program to be tested is tested according to preset test script to tested object;
When being in the process that described application program to be tested is tested to described tested object, monitor whether described tested object switches;
When monitoring described tested object and switch, described tested object is switched to described application program to be tested again and tests.
Wherein, described is that application program to be tested carries out test and comprises to tested object according to preset test script:
Run described test script, and running in described test script, from least one preset test operation event, select the target detection Action Events for testing;
By described target detection Action Events, described application program to be tested is tested, obtain test result;
Store described test result.
Wherein, described the target detection Action Events for testing is selected to comprise from least one preset test operation event:
Determine and the target detection Action Events that described application program to be tested is mated mutually from least one preset test operation event; Or,
Generate according to described at least one preset test operation event and select the page and export the described selection page;
When the selection instruction receiving user and inputting for the described selection page, determine, according to described selection instruction, the target detection Action Events that user selects.
Wherein, described test operation event comprises hit testing Action Events;
Described from least one preset test operation event, select the target detection Action Events for testing before comprise:
Obtain the size of display interface;
Size according to described display interface generates described hit testing Action Events.
Wherein, whether the described tested object of described monitoring switches and comprises:
Monitor whether the first test interface shown by currently testing redirect occurs;
When monitoring described first test interface generation redirect, obtain the 2nd test interface of institute's redirect;
Judge that whether described 2nd test interface is the test interface of described application program to be tested;
When judging the test interface that described 2nd test interface is not described application program to be tested, it is determined that described tested object switches.
Wherein, described method also comprises:
In the process described application program to be tested tested, calculate the resource occupation information of described application program to be tested;
Store described resource occupation information.
Correspondingly, the embodiment of the present invention additionally provides the device of a kind of Test Application program, comprising:
Test cell, for when receive treat instruction that Test Application program starts test time, be that application program to be tested is tested according to preset test script to tested object;
Monitoring means, for being in the process that described application program to be tested is tested to described tested object when described test cell, monitors whether described tested object switches;
Switch unit, for when described monitoring means monitor described tested object switch time, described tested object is switched to described application program to be tested again and tests.
Wherein, described test cell comprises:
Chooser unit, for running described test script, and running in described test script, selects the target detection Action Events for testing from least one preset test operation event;
First acquisition subelement, for described application program to be tested being tested by described target detection Action Events, obtains test result;
Storing sub-units, for storing described test result.
Wherein, described selection unit comprises:
First determines subelement, for determining and the target detection Action Events that described application program to be tested is mated mutually from least one preset test operation event;
Export subelement, select the page for generating according to described at least one preset test operation event and export the described selection page;
2nd determines subelement, for working as the selection instruction receiving user and inputting for the described selection page, determines, according to described selection instruction, the target detection Action Events that user selects.
Wherein, described test operation event comprises hit testing Action Events;
Described test cell comprises:
2nd acquisition subelement, for obtaining the size of display interface;
Generate subelement, for generating described hit testing Action Events according to the size of described display interface.
Wherein, described monitoring means comprises:
Whether monitoring subelement, there is redirect for monitoring the first test interface shown by currently testing;
3rd acquisition subelement, for when described monitoring subelement monitors described first test interface generation redirect, obtaining the 2nd test interface of institute's redirect;
Judgment sub-unit, for judging that whether described 2nd test interface is the test interface of described application program to be tested;
3rd determines subelement, for when described judgment sub-unit judges the test interface that described 2nd test interface is not described application program to be tested, it is determined that described tested object switches.
Wherein, described device also comprises:
Calculate unit, for described test cell in the process described application program to be tested tested, calculate the resource occupation information of described application program to be tested;
Storage unit, for storing described resource occupation information.
Implement the embodiment of the present invention, there is following useful effect:
In embodiments of the present invention, when receiving the instruction treating the startup test of Test Application program when terminal, it is that application program to be tested is tested according to preset test script to tested object, when being in the process that application program to be tested is tested to tested object, whether monitoring and test object switches, when monitoring tested object and switch, tested object is switched to application program to be tested again and tests, this makes terminal when treating Test Application program and test, can ensure that terminal is treat Test Application program to test all the time, improve test accuracy.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, it is briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the first embodiment schematic flow sheet of a kind of method of embodiment of the present invention offer and Test Application program;
Fig. 2 is the 2nd embodiment schematic flow sheet of a kind of method of embodiment of the present invention offer and Test Application program;
Fig. 3 is the first example structure figure of the device of a kind of Test Application program that the embodiment of the present invention provides;
Fig. 4 is the 2nd example structure figure of the device of a kind of Test Application program that the embodiment of the present invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only the present invention's part embodiment, instead of whole embodiments. Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
Terminal described in the embodiment of the present invention can comprise: mobile phone, panel computer, palm PC or mobile internet device (MobileInternetDevice, MID), the intelligent terminal such as server, above-mentioned terminal is only citing, and non exhaustive, including but not limited to above-mentioned terminal.
See Fig. 1, it it is the method first embodiment schematic flow sheet of a kind of Test Application program that the embodiment of the present invention provides.The method of a kind of Test Application program of the embodiment of the present invention comprises the steps:
S100, when receive treat instruction that Test Application program starts test time, be that application program to be tested is tested according to preset test script to tested object.
In embodiments of the present invention, terminal can install the application program to be tested being carried out testing as tested object and the Test Application program tested by tested object, it is preferable that, terminal can be treated Test Application and carry out stability test. Wherein, application program to be tested and Test Application program can be the application programs of APK form, may operate in androd system. When need to application program to be measured be tested, user can input and treat the instruction that Test Application program starts test. Concrete, user's input is treated the instruction of Test Application program startup test and can is: user starts Test Application program, inputs the title of application program to be tested, then Test Application program can get and treat the instruction that Test Application program starts test; The instruction of Test Application program startup test is treated in user's input: user starts Test Application program, by the icon of Test Application program selection application program to be tested, thus Test Application program can get the instruction treating the startup test of Test Application program.
In embodiments of the present invention, when terminal get treat Test Application program carry out the instruction starting test time, terminal can obtain preset test script and treat Test Application program and test. wherein, test script is a series of test orders that can be used for terminal and perform, and can be specifically Robotium script. when terminal get test script after, terminal can testing results script, wherein, terminal is in testing results script, and terminal can generate test operation event, thus carries out preset test operation event, and wherein, test operation event can comprise hit testing Action Events. concrete, terminal generates hit testing event: terminal obtains the resolving power of display interface, origin coordinates according to display interface and resolving power obtain the position of each pixel, thus using the position of each pixel as clicking operation event, when resolving power such as the display interface of terminal is 480*360, then the X-axis of terminal has 320 coordinate point, Y-axis has 480 coordinate point, then the position of each pixel can be the coordinate figure of the intersection point of each X and Y-axis, namely clicking operation event can be the coordinate figure of the pixel of each on display interface, namely it is, the coordinate figure of each pixel can be tested by terminal as click location. after terminal obtains clicking operation event, each clicking operation event can respectively be distributed a numerical value by terminal, and adopt java random digit generation method to obtain randomized number, thus terminal can obtain clicking operation event corresponding to each randomized number, and using clicking operation event corresponding for randomized number as hit testing Action Events. in embodiments of the present invention, terminal display screen can comprise display interface and operation interface, and wherein, display interface is used for the picture of display terminal, and operation interface is for operating terminal, and operation interface can such as the interface of return key and home key place. further, in embodiments of the present invention, terminal also can generate other test operation events, presses test operation event, slip test operation event etc. as long. terminal can simulate the operation of user according to the test operation event generated, it is achieved the object of test, and such as, when test operation event is hit testing Action Events, terminal simulates the click input operation of user by hit testing Action Events.
In embodiments of the present invention, owing to application program to be tested is various, carrying out full test for treating Test Application program, terminal can generate very multiple test operation event by testing results script.But, if all adopting all test operation events to test the application program to be tested of often kind, this tests making terminal that application program to be tested may be adopted not need the test operation event carrying out testing to treat Test Application program, wastes resource, and reduces test efficiency. therefore, in order to avoid this problem occur, terminal can select the target detection Action Events for testing from least one the test operation event generated. wherein, terminal is selected: terminal obtains the test operation event mated mutually with application program to be tested from preset test operation event, if terminal is according to the function of application program to be tested, the target detection Action Events of the function match with application program to be tested is obtained from least one preset test operation event, or, terminal is according to the corresponding relation of preset Test Application program and test operation event, the target detection Action Events corresponding with application program to be tested is obtained from least one preset test operation event. further, terminal is selected: terminal generates according at least one preset test operation event and selects the page and export the selection page, wherein, select the page to can be used for user and carry out select target test operation event, and when user is for selection page input selection instruction, terminal can get selection instruction, and can determine the target detection Action Events selected by terminal according to selection instruction.
In embodiments of the present invention, after terminal has got test operation event, terminal is tested by target detection Action Events application programs, obtain the test result after test, wherein, test result comprises terminal when treating Test Application program and test, the response information of application program. Test result can be stored in the file of terminal preset by terminal, as be stored to terminal list or application in, facilitate user to carry out checking acquisition test result. Further, terminal also can analytical test result, export analysis report, so that user can know the test report of application program to be tested.
S101, when being in the process that described application program to be tested is tested to described tested object, monitors whether described tested object switches.
In embodiments of the present invention, in embodiments of the present invention, whether monitoring and test object switches and is namely whether monitoring and test object switches to other application programs by application program to be tested. wherein, whether monitoring and test object switches can be: terminal can monitoring terminal currently test shown by the first test interface can no generation redirect, wherein, first test interface is the terminal test interface shown when treating Test Application program and test, when terminal monitors the first test interface generation redirect, terminal can obtain the 2nd test interface of institute's redirect, and judge that whether the 2nd test interface is the test interface of application program to be tested, when judging the test interface that test interface is not application program to be tested, terminal can determine that tested object switches. in a particular application, can such as: terminal can startup interface redirect monitoring service, redirect monitoring service device in interface is at running background, when interface redirect monitoring service listens to the first test interface generation redirect to be measured, whether the 2nd test interface then carrying out judging institute's redirect is the test interface of application program to be tested, when interface redirect monitoring service judges the test interface that the 2nd test interface of institute's redirect is not application program to be tested, terminal can determine that tested object switches.
S102, when monitoring described tested object and switch, again switches to tested object described application program to be tested and tests.
In embodiments of the present invention, when terminal monitor tested object switch time, terminal tested object can be switched to application program to be tested again and carry out continue test. Thus ensureing that terminal is when testing results script, terminal is treat Test Application program to test all the time, it is to increase test accuracy.
In embodiments of the present invention, terminal is when treating Test Application program and test, terminal can record test process, so that when tested object is switched to application program to be tested to test by terminal again, terminal can according to the test process of record, test procedure before continuity tested object switching continues to treat Test Application program to be tested, thus avoids treating Test Application program and re-start test, effectively saves time.
In embodiments of the present invention, when receiving the instruction treating the startup test of Test Application program when terminal, it is that application program to be tested is tested according to preset test script to tested object, when being in the process that application program to be tested is tested to tested object, whether monitoring and test object switches, when monitoring tested object and switch, tested object is switched to application program to be tested again and tests, this makes terminal when treating Test Application program and test, can ensure that terminal is treat Test Application program to test all the time, improve test accuracy.
See Fig. 2, it it is method the 2nd embodiment schematic flow sheet of a kind of Test Application program that the embodiment of the present invention provides. The method of a kind of Test Application program of the embodiment of the present invention comprises the steps:
S200, when receive treat instruction that Test Application program starts test time, be that application program to be tested is tested according to preset test script to tested object.
S201, when being in the process that described application program to be tested is tested to described tested object, monitors whether described tested object switches.
S202, when monitoring described tested object and switch, again switches to described application program to be tested by described tested object and tests.
S203, in the process described application program to be tested tested, calculates the resource occupation information of described application program to be tested.
In embodiments of the present invention, resource occupation information can comprise terminal to the resource size shared by one or more resources in CPU during test application program to be tested, internal memory, hard disk and bandwidth, or the ratio of the size of resource shared by multiple resource and the total resources of terminal. Wherein, terminal can arrange the acquisition cycle, carries out periodically calculating the resource occupation size of application program to be tested according to the acquisition cycle, and wherein, the acquisition cycle can be 30s. In a particular application, terminal can startability index monitoring service, performance index monitoring service device is at running background, but and the resource occupation size of each 30s computing application program in test process.
S204, stores described resource occupation information.
In embodiments of the present invention, when terminal calculates resource occupation size, terminal can store record resource occupation size in preset file, so that user is by viewing files, obtains the resource occupation size of application program to be tested.
Wherein, the concrete implementation content of step S200, step S201 and step S202 also see the concrete implementation content of the step S100 in above-described embodiment one, step S101 and step S102, can not repeat at this.
In embodiments of the present invention, treating Test Application program in terminal carries out in the process tested, terminal can calculate the resource occupation size of application program to be tested in test process, and storage resources takies size, thus the resource occupation size of terminal in the test process treating Test Application program can be recorded, customer analysis terminal is facilitated to carry out in the process tested treating Test Application program, the resource occupation information of application program to be tested.
See Fig. 3, it is the first example structure figure of the device of a kind of Test Application program that the embodiment of the present invention provides. Device described in the embodiment of the present invention comprises:
Test cell 100, for when receive treat instruction that Test Application program starts test time, be that application program to be tested is tested according to preset test script to tested object;
Monitoring means 200, for being in the process that described application program to be tested is tested to described tested object when described test cell, monitors whether described tested object switches.
Switch unit 300, for when described monitoring means monitor described tested object switch time, described tested object is switched to described application program to be tested again and tests.
In embodiments of the present invention, the device of described Test Application program specifically can be terminal, it is possible to is certain the function module in terminal, simply will be described explanation for terminal below.
In embodiments of the present invention, terminal can install the application program to be tested being carried out testing as tested object and the Test Application program tested by tested object, it is preferable that, terminal can be treated Test Application and carry out stability test. Wherein, application program to be tested and Test Application program can be the application programs of APK form, may operate in androd system. When need to application program to be measured be tested, user can input and treat the instruction that Test Application program starts test. Concrete, user's input is treated the instruction of Test Application program startup test and can is: user starts Test Application program, inputs the title of application program to be tested, then Test Application program can get and treat the instruction that Test Application program starts test; The instruction of Test Application program startup test is treated in user's input: user starts Test Application program, by the icon of Test Application program selection application program to be tested, thus Test Application program can get the instruction treating the startup test of Test Application program.
In embodiments of the present invention, when terminal get treat Test Application program carry out the instruction starting test time, test cell 100 can obtain preset test script and treat Test Application program and test. wherein, test script is a series of test orders that can be used for terminal and perform, and can be specifically Robotium script. after test cell 100 gets test script, test cell 100 can testing results script, wherein, test cell 100 is in testing results script, test cell 100 can generate test operation event, thus carry out preset test operation event, wherein, test operation event can comprise hit testing Action Events. concrete, test cell 100 generates hit testing event: test cell 100 obtains the resolving power of display interface, origin coordinates according to display interface and resolving power obtain the position of each pixel, thus using the position of each pixel as clicking operation event, when resolving power such as the display interface of terminal is 480*360, then the X-axis of terminal has 320 coordinate point, Y-axis has 480 coordinate point, then the position of each pixel can be the coordinate figure of the intersection point of each X and Y-axis, namely clicking operation event can be the coordinate figure of the pixel of each on display interface, namely it is, the coordinate figure of each pixel can be tested by test cell 100 as click location.After test cell 100 obtains clicking operation event, each clicking operation event can respectively be distributed a numerical value by test cell 100, and adopt java random digit generation method to obtain randomized number, thus test cell 100 can obtain clicking operation event corresponding to each randomized number, and using clicking operation event corresponding for randomized number as hit testing Action Events. In embodiments of the present invention, terminal display screen can comprise display interface and operation interface, and wherein, display interface is used for the picture of display terminal, and operation interface is for operating terminal, and operation interface can such as the interface of return key and home key place. Further, in embodiments of the present invention, test cell 100 also can generate other test operation events, presses test operation event, slip test operation event etc. as long. Test cell 100 can simulate the operation of user according to the test operation event generated, realize the object of test, such as, when test operation event is hit testing Action Events, test cell 100 simulates the click input operation of user by hit testing Action Events.
In embodiments of the present invention, owing to application program to be tested is various, carrying out full test for treating Test Application program, test cell 100 can generate very multiple test operation event by testing results script. but, if all adopting all test operation events to test the application program to be tested of often kind, this tests making terminal that application program to be tested may be adopted not need the test operation event carrying out testing to treat Test Application program, wastes resource, and reduces test efficiency. therefore, in order to avoid this problem occur, test cell 100 can select the target detection Action Events for testing from least one the test operation event generated. wherein, test cell 100 selects the target detection Action Events for testing to be: test cell 100 obtains the test operation event mated mutually with application program to be tested from preset test operation event, if test cell 100 is according to the function of application program to be tested, the target detection Action Events of the function match with application program to be tested is obtained from least one preset test operation event, or, test cell 100 is according to the corresponding relation of preset Test Application program and test operation event, the target detection Action Events corresponding with application program to be tested is obtained from least one preset test operation event. further, test cell 100 selects the target detection Action Events for testing to be: test cell 100 generates according at least one preset test operation event and selects the page and export the selection page, wherein, select the page to can be used for user and carry out select target test operation event, and when user is for selection page input selection instruction, test cell 100 can get selection instruction, and can determine the target detection Action Events selected by terminal according to selection instruction.
In embodiments of the present invention, after test cell 100 has got test operation event, test cell 100 is tested by target detection Action Events application programs, obtain the test result after test, wherein, test result comprises terminal when treating Test Application program and test, the response information of application program. Test result can be stored in the file of terminal preset by test cell 100, as be stored to terminal list or application in, facilitate user to carry out checking acquisition test result.Further, test cell 100 also can analytical test result, export analysis report, so that user can know the test report of application program to be tested.
In embodiments of the present invention, in embodiments of the present invention, whether monitoring means 200 monitoring and test object switches and is namely whether monitoring means 200 monitoring and test object switches to other application programs by application program to be tested. wherein, whether monitoring means 200 monitoring and test object switches and can be: monitoring means 200 can monitoring terminal currently test shown by the first test interface can no generation redirect, wherein, first test interface is test cell 100 test interface shown when treating Test Application program and test, when monitoring means 200 monitors the first test interface generation redirect, monitoring means 200 can obtain the 2nd test interface of institute's redirect, and judge that whether the 2nd test interface is the test interface of application program to be tested, when monitoring means 200 judges the test interface that test interface is not application program to be tested, monitoring means 200 can determine that tested object switches. in a particular application, can such as: monitoring means 200 can startup interface redirect monitoring service, redirect monitoring service device in interface is at running background, when interface redirect monitoring service listens to the first test interface generation redirect to be measured, then monitoring means 200 carries out judging that whether the 2nd test interface of institute's redirect is the test interface of application program to be tested, when interface redirect monitoring service judges the test interface that the 2nd test interface of institute's redirect is not application program to be tested, monitoring means 200 can determine that tested object switches.
In embodiments of the present invention, when monitoring means 200 monitor tested object switch time, switch unit 300 tested object can be switched to application program to be tested again and carry out continue test. Thus ensureing that terminal is when testing results script, terminal is treat Test Application program to test all the time, it is to increase test accuracy.
In embodiments of the present invention, when treating Test Application program and test, terminal can record test process, so that when tested object is switched to application program to be tested to test by switch unit 300 again, test cell 100 can according to the test process of record, test procedure before continuity tested object switching continues to treat Test Application program to be tested, thus avoids treating Test Application program and re-start test, effectively saves time.
Wherein, described test cell 100 comprises:
Chooser unit, for running described test script, and running in described test script, selects the target detection Action Events for testing from least one preset test operation event.
First acquisition subelement, for described application program to be tested being tested by described target detection Action Events, obtains test result.
Storing sub-units, for storing described test result.
Wherein, described chooser unit comprises:
First determines subelement, for determining and the target detection Action Events that described application program to be tested is mated mutually from least one preset test operation event.
Export subelement, select the page for generating according to described at least one preset test operation event and export the described selection page.
2nd determines subelement, for working as the selection instruction receiving user and inputting for the described selection page, determines, according to described selection instruction, the target detection Action Events that user selects.
Wherein, described test operation event comprises hit testing Action Events;
Described test cell 100 comprises:
2nd acquisition subelement, for obtaining the size of display interface.
Generate subelement, for generating described hit testing Action Events according to the size of described display interface.
Wherein, described monitoring means 200 comprises:
Whether monitoring subelement, there is redirect for monitoring the first test interface shown by currently testing.
3rd acquisition subelement, for when described monitoring subelement monitors described first test interface generation redirect, obtaining the 2nd test interface of institute's redirect.
Judgment sub-unit, for judging that whether described 2nd test interface is the test interface of described application program to be tested.
3rd determines subelement, for when described judgment sub-unit judges the test interface that described 2nd test interface is not described application program to be tested, it is determined that described tested object switches.
It should be appreciated that the function of each function module of unit in the terminal of the present embodiment can according to the method specific implementation in aforesaid method embodiment, its specific implementation process with reference to the associated description of aforesaid method embodiment, no longer can repeat herein.
In embodiments of the present invention, when receiving the instruction treating the startup test of Test Application program when terminal, it is that application program to be tested is tested according to preset test script to tested object, when being in the process that application program to be tested is tested to tested object, whether monitoring and test object switches, when monitoring tested object and switch, tested object is switched to application program to be tested again and tests, this makes terminal when treating Test Application program and test, can ensure that terminal is treat Test Application program to test all the time, improve test accuracy.
See Fig. 4, it is the 2nd example structure figure of the device of a kind of Test Application program that the embodiment of the present invention provides. Device described in the embodiment of the present invention comprises:
Test cell 100, monitoring means 200 and switch unit 300.
Wherein, described device also comprises:
Calculate unit 400, for, in the process described application program to be tested tested at described test cell 100, calculating the resource occupation information of described application program to be tested.
Storage unit 500, for storing described resource occupation information.
In embodiments of the present invention, resource occupation information can comprise terminal to the resource size shared by one or more resources in CPU during test application program to be tested, internal memory, hard disk and bandwidth, or the ratio of the size of resource shared by multiple resource and the total resources of terminal. Wherein, terminal can arrange the acquisition cycle, calculates the resource occupation size that unit 400 carries out periodically calculating application program to be tested according to the acquisition cycle, and wherein, the acquisition cycle can be 30s. In a particular application, terminal can startability index monitoring service, performance index monitoring service device is at running background, but and the resource occupation size of each 30s computing application program in test process.
In embodiments of the present invention, when calculating unit 400 and get resource occupation size, storage unit 500 can store record resource occupation size in preset file, so that user is by viewing files, obtains the resource occupation size of application program to be tested.
It should be appreciated that the function of each function module of unit in the terminal of the present embodiment can according to the method specific implementation in aforesaid method embodiment, its specific implementation process with reference to the associated description of aforesaid method embodiment, no longer can repeat herein.
In embodiments of the present invention, treating Test Application program in terminal carries out in the process tested, terminal can calculate the resource occupation size of application program to be tested in test process, and storage resources takies size, thus the resource occupation size of terminal in the test process treating Test Application program can be recorded, customer analysis terminal is facilitated to carry out in the process tested treating Test Application program, the resource occupation information of application program to be tested.
In the description of this specification sheets, at least one embodiment that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to be contained in the present invention in conjunction with concrete feature, structure, material or feature that this embodiment or example describe or example. In this manual, to the schematic representation of above-mentioned term not must for be identical embodiment or example. And, the concrete feature of description, structure, material or feature can combine in one or more embodiment in office or example in an appropriate manner. In addition, when not conflicting, the feature of the different embodiment described in this specification sheets or example and different embodiment or example can be carried out combining and combining by the technician of this area.
In addition, term " first ", " the 2nd " are only for describing object, and can not be interpreted as instruction or hint relative importance or imply the quantity indicating indicated technology feature. Thus, be limited with " first ", the feature of " the 2nd " can express or implicit comprise at least one this feature. In describing the invention, the implication of " multiple " is at least two, such as two, three etc., unless otherwise expressly limited specifically.
Describe and can be understood in schema or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the performed instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carrying out n-back test, this should be understood by embodiments of the invention person of ordinary skill in the field.
In flow charts represent or in this logic otherwise described and/or step, such as, the sequencing list of the performed instruction for realizing logic function can be considered as, may be embodied in any computer-readable medium, for instruction execution system, device or equipment (as based on system for computer, the system comprising treater or other can from instruction execution system, device or equipment instruction fetch and perform the system of instruction) use, or use in conjunction with these instruction execution systems, device or equipment. With regard to this specification sheets, " computer-readable medium " can be any can comprise, store, communicate, propagate or transmission program for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment. The example more specifically (non-exhaustive list) of computer-readable medium comprises following: the electrical connection section (electronic installation) with one or more wiring, portable computer diskette box (magnetic device), random access memory (RAM), read-only storage (ROM), erasable edit read-only storage (EPROM or dodge speed storer), fiber device, and portable optic disk read-only storage (CDROM).In addition, computer-readable medium is it is even possible that be paper or other the suitable media that can print described program thereon, because can such as by paper or other media be carried out optical scanning, then carry out editing, decipher or carry out process with other suitable methods if desired and electronically obtain described program, then store it in computer memory.
It is to be understood that each several part of the present invention can realize with hardware, software, firmware or their combination. In the above-described embodiment, multiple step or method can realize with the software stored in memory and perform by suitable instruction execution system or firmware. Such as, if realized with hardware, the same with in another enforcement mode, can realize with the arbitrary item in following technology well known in the art or their combination: the discrete logic with the logic gates for data signal realizes logic function has the application specific integrated circuit of suitable combinational logic gating circuit, programmable gate array (PGA), field-programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is can be completed by the hardware that program carrys out instruction relevant, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, it is also possible to is that the independent physics of each unit exists, it is also possible to two or more unit are integrated in a module. Above-mentioned integrated module both can adopt the form of hardware to realize, it is also possible to adopts the form of software function module to realize. If described integrated module realize using the form of software function module and as independent production marketing or when using, it is also possible to be stored in a computer read/write memory medium.
The above-mentioned storage media mentioned can be read-only storage, disk or CD etc. Although above it has been shown and described that embodiments of the invention, it is understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and above-described embodiment can be changed, revises, replace and modification by the those of ordinary skill of this area within the scope of the invention.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, it is can be completed by the hardware that computer program carrys out instruction relevant, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment such as above-mentioned each side method. Wherein, described storage media can be magnetic disc, CD, read-only storage memory body (Read-OnlyMemory, ROM) or random storage and remembers body (RandomAccessMemory, RAM) etc.
Above disclosed being only the better embodiment of the present invention, certainly can not limit the interest field of the present invention with this, the equivalent variations therefore done according to the claims in the present invention, still belongs to the scope that the present invention is contained.

Claims (10)

1. the method for a Test Application program, it is characterised in that, described method comprises:
When receive treat instruction that Test Application program starts test time, be that application program to be tested is tested according to preset test script to tested object;
When being in the process that described application program to be tested is tested to described tested object, monitor whether described tested object switches;
When monitoring described tested object and switch, described tested object is switched to described application program to be tested again and tests.
2. the method for claim 1, it is characterised in that, described is that application program to be tested carries out test and comprises to tested object according to preset test script:
Run described test script, and running in described test script, from least one preset test operation event, select the target detection Action Events for testing;
By described target detection Action Events, described application program to be tested is tested, obtain test result;
Store described test result.
3. method as claimed in claim 2, it is characterised in that, described select the target detection Action Events for testing to comprise from least one preset test operation event:
Determine and the target detection Action Events that described application program to be tested is mated mutually from least one preset test operation event; Or,
Generate according to described at least one preset test operation event and select the page and export the described selection page;
When the selection instruction receiving user and inputting for the described selection page, determine, according to described selection instruction, the target detection Action Events that user selects.
4. method as claimed in claim 2, it is characterised in that, described test operation event comprises hit testing Action Events;
Described from least one preset test operation event, select the target detection Action Events for testing before comprise:
Obtain the size of display interface;
Size according to described display interface generates described hit testing Action Events.
5. the method for claim 1, it is characterised in that, whether the described tested object of described monitoring switches and comprises:
Monitor whether the first test interface shown by currently testing redirect occurs;
When monitoring described first test interface generation redirect, obtain the 2nd test interface of institute's redirect;
Judge that whether described 2nd test interface is the test interface of described application program to be tested;
When judging the test interface that described 2nd test interface is not described application program to be tested, it is determined that described tested object switches.
6. the method for claim 1, it is characterised in that, described method also comprises:
In the process described application program to be tested tested, calculate the resource occupation information of described application program to be tested;
Store described resource occupation information.
7. the device of a Test Application program, it is characterised in that, described device comprises:
Test cell, for when receive treat instruction that Test Application program starts test time, be that application program to be tested is tested according to preset test script to tested object;
Monitoring means, for being in the process that described application program to be tested is tested to described tested object when described test cell, monitors whether described tested object switches;
Switch unit, for when described monitoring means monitor described tested object switch time, described tested object is switched to described application program to be tested again and tests.
8. device as claimed in claim 7, it is characterised in that, described test cell comprises:
Chooser unit, for running described test script, and running in described test script, selects the target detection Action Events for testing from least one preset test operation event;
First acquisition subelement, for described application program to be tested being tested by described target detection Action Events, obtains test result;
Storing sub-units, for storing described test result.
9. device as claimed in claim 8, it is characterised in that, described chooser unit comprises:
First determines subelement, for determining and the target detection Action Events that described application program to be tested is mated mutually from least one preset test operation event;
Export subelement, select the page for generating according to described at least one preset test operation event and export the described selection page;
2nd determines subelement, for working as the selection instruction receiving user and inputting for the described selection page, determines, according to described selection instruction, the target detection Action Events that user selects.
10. device as claimed in claim 8, it is characterised in that, described test operation event comprises hit testing Action Events;
Described test cell comprises:
2nd acquisition subelement, for obtaining the size of display interface;
Generate subelement, for generating described hit testing Action Events according to the size of described display interface.
CN201511020885.2A 2015-12-30 2015-12-30 Method and device for testing application program Pending CN105653452A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511020885.2A CN105653452A (en) 2015-12-30 2015-12-30 Method and device for testing application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511020885.2A CN105653452A (en) 2015-12-30 2015-12-30 Method and device for testing application program

Publications (1)

Publication Number Publication Date
CN105653452A true CN105653452A (en) 2016-06-08

Family

ID=56489958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511020885.2A Pending CN105653452A (en) 2015-12-30 2015-12-30 Method and device for testing application program

Country Status (1)

Country Link
CN (1) CN105653452A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113934645A (en) * 2021-12-16 2022-01-14 深圳市明源云链互联网科技有限公司 Application testing method, system, device and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309802A (en) * 2012-03-16 2013-09-18 百度在线网络技术(北京)有限公司 Method and device for testing system stability in mobile terminal
CN103744784A (en) * 2014-01-06 2014-04-23 中国移动(深圳)有限公司 Method and system for automatically testing mobile phone applications
CN103914387A (en) * 2014-04-23 2014-07-09 广东欧珀移动通信有限公司 Method and device for eliminating abnormal interference in Android mobile phone automated testing process
CN104331373A (en) * 2014-11-28 2015-02-04 上海斐讯数据通信技术有限公司 Monkey test system and method
CN104484273A (en) * 2014-12-19 2015-04-01 广州博冠信息科技有限公司 Test method for application program, device and system
CN105094783A (en) * 2014-05-19 2015-11-25 腾讯科技(深圳)有限公司 Method and device for testing Android application stability
CN105183643A (en) * 2015-08-18 2015-12-23 惠州Tcl移动通信有限公司 Automatic testing interference preventing method and apparatus for Android mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309802A (en) * 2012-03-16 2013-09-18 百度在线网络技术(北京)有限公司 Method and device for testing system stability in mobile terminal
CN103744784A (en) * 2014-01-06 2014-04-23 中国移动(深圳)有限公司 Method and system for automatically testing mobile phone applications
CN103914387A (en) * 2014-04-23 2014-07-09 广东欧珀移动通信有限公司 Method and device for eliminating abnormal interference in Android mobile phone automated testing process
CN105094783A (en) * 2014-05-19 2015-11-25 腾讯科技(深圳)有限公司 Method and device for testing Android application stability
CN104331373A (en) * 2014-11-28 2015-02-04 上海斐讯数据通信技术有限公司 Monkey test system and method
CN104484273A (en) * 2014-12-19 2015-04-01 广州博冠信息科技有限公司 Test method for application program, device and system
CN105183643A (en) * 2015-08-18 2015-12-23 惠州Tcl移动通信有限公司 Automatic testing interference preventing method and apparatus for Android mobile terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113934645A (en) * 2021-12-16 2022-01-14 深圳市明源云链互联网科技有限公司 Application testing method, system, device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN101964036B (en) Leak detection method and device
CN107423048B (en) Data collection method, device, medium and computing equipment
CN108717393A (en) A kind of applied program testing method and mobile terminal
CN109960642B (en) Automatic test method and device
CN103455403B (en) Method of testing and device
CN105045714A (en) Method and device for testing starting duration of application software and terminal
CN110674025A (en) Interactive behavior monitoring method and device and computer equipment
CN108595343A (en) The test method and device of application program
CN110147327B (en) Multi-granularity-based web automatic test management method
CN105204986A (en) Automated product testing method, server and mobile equipment
CN104777416A (en) Testing method and tester for circuit board
CN103678380A (en) Test state presentation and anomaly indexing system and method
CN111736951A (en) Simulation method for automatic driving, computer device, and storage medium
CN106453778B (en) A kind of contact photo setting method and mobile terminal
CN111552521A (en) Application data reporting method, device, server and storage medium
CN107544902B (en) Program testing method, device and equipment
CN112363885B (en) Method, device, electronic equipment and computer readable medium for detecting application abnormality
CN108287781B (en) Memory occupation monitoring method, device and system
CN107085532B (en) task monitoring method and device
CN103678059B (en) A kind of random key test method and device
CN105653452A (en) Method and device for testing application program
CN110889116B (en) Advertisement interception method and device and electronic equipment
CN107102937A (en) A kind of ui testing method and apparatus
CN105138458A (en) Method and system for recording automatic testing scripts by combining intelligent terminal and computer terminal
CN112463574A (en) Software testing method, device, system, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160608