Summary of the invention
For this reason, the invention provides a kind of automated testing method of mobile terminal, device and mobile terminal, to try hard to solve or at least alleviate at least one problem existed above.
According to an aspect of the present invention, provide a kind of automated testing method of mobile terminal, the method comprising the steps of: the operation of opening monitoring in response to user, perform the first order, obtain the real-time information of mobile terminal, wherein real-time information is the CPU usage of the mobile terminal regularly obtained with preset frequency; Open the operation of test in response to user, perform the second order, testing results script; At the end of test, output test result, test result comprises test duration and the CPU usage with test duration association store; And draw CPU using state curve map according to test result, so that judge whether normal the CPU of this application uses.
Alternatively, in mobile terminal automation testing method according to the present invention, also comprise step: write test script according to test assignment, wherein test assignment comprises actuating logic, the execution sequence that actuating logic indicates test assignment corresponding by configuration parameter.
Alternatively, in mobile terminal automation testing method according to the present invention, configuration parameter comprises testing time, test duration and testing procedure.
Alternatively, in mobile terminal automation testing method according to the present invention, the step of execution second order, testing results script comprises: the actuating logic opening test rear parsing test assignment; And automatically perform test script corresponding to this test assignment by actuating logic.
Alternatively, in mobile terminal automation testing method according to the present invention, also comprise step: during testing results script, perform corresponding testing procedure by call configuration option.
According to a further aspect in the invention, provide a kind of mobile terminal automation testing device, device comprises: monitoring unit, be suitable for the operation of opening monitoring in response to user, perform the first order, regularly obtain the real-time information of mobile terminal with preset frequency, real-time information comprises CPU usage; Driver element, is suitable for the operation of opening test in response to user, performs the second order, testing results script; Output interface, is suitable for association at the end of test and exports test duration and CPU usage, as test result; And Drawing of Curve unit, be suitable for drawing CPU using state curve map according to test result, so that judge whether normal the CPU of this application uses.
Alternatively, in mobile terminal automation testing device according to the present invention, driver element also comprises: perform subelement, be suitable for writing test script according to test assignment, wherein test assignment comprises actuating logic, the execution sequence that actuating logic indicates test assignment corresponding by configuration parameter.
Alternatively, in mobile terminal automation testing device according to the present invention, configuration parameter comprises testing time, test duration and testing procedure.
Alternatively, in mobile terminal automation testing device according to the present invention, driver element is also suitable for the actuating logic of resolving test assignment after opening test; And automatically perform test script corresponding to this test assignment by actuating logic.
Alternatively, in mobile terminal automation testing device according to the present invention, driver element is also suitable for, when testing results script, performing corresponding testing procedure by call configuration option.
According to a further aspect in the invention, provide a kind of mobile terminal, there is automatic test device as above.
According to mobile terminal automation testing scheme of the present invention, according to the Functional Design test case of test target, test is made to have more specific aim.Meanwhile, by the mode of automated execution without the need to manual operation, can raise the efficiency, greatly shorten the time; And the CPU usage of Real-Time Monitoring mobile terminal in the process of test, and then obtain CPU using state change curve, make test result very clear.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Fig. 1 is mobile terminal 100 organigram according to an embodiment of the invention.With reference to Fig. 1, mobile terminal 100 comprises: memory interface 102, one or more data processor, image processor and/or CPU (central processing unit) 104, and peripheral interface 106.Memory interface 102, one or more processor 104 and/or peripheral interface 106 both can be discrete components, also can be integrated in one or more integrated circuit.In the mobile terminal 100, various element can be coupled by one or more communication bus or signal wire.Sensor, equipment and subsystem can be coupled to peripheral interface 106, to help to realize several functions.Such as, motion sensor 110, optical sensor 112 and range sensor 114 can be coupled to peripheral interface 106, to facilitate the functions such as orientation, illumination and range finding.Other sensors 116 can be connected with peripheral interface 106 equally, such as positioning system (such as GPS), temperature sensor, biometric sensor or other sensor devices, can help thus to implement relevant function.
Camera sub-system 120 and optical sensor 122 may be used for the realization of the camera function of convenient such as recording photograph and video clipping, and wherein said camera sub-system and optical sensor can be such as charge-coupled image sensor (CCD) or complementary metal oxide semiconductor (CMOS) (CMOS) optical sensor.Can help realize communication function by one or more radio communication subsystem 124, wherein radio communication subsystem can comprise radio-frequency transmitter and transmitter and/or light (such as infrared) Receiver And Transmitter.The particular design of radio communication subsystem 124 and embodiment can depend on one or more communication networks that mobile terminal 100 is supported.Such as, mobile terminal 100 can comprise the communication subsystem 124 being designed to support GSM network, GPRS network, EDGE network, Wi-Fi or WiMax network and BlueboothTM network.Audio subsystem 126 can be coupled with loudspeaker 128 and microphone 130, such as, to help the function of implementing to enable voice, speech recognition, speech reproduction, digital recording and telephony feature.
I/O subsystem 140 can comprise touch screen controller 142 and/or other input control devices 144 one or more.Touch screen controller 142 can be coupled to touch-screen 146.For example, what this touch-screen 146 and touch screen controller 142 can use any one in multiple touch-sensing technology to detect to carry out with it contact and movement or time-out, and wherein detection technology is including, but not limited to capacitive character, resistive, infrared and surface acoustic wave technique.Other input control devices 144 one or more can be coupled to other input/control devicess 148, the indication equipment of such as one or more button, rocker switch, thumb wheel, infrared port, USB port and/or stylus and so on.Described one or more button (not shown) can comprise the up/down button for control loudspeaker 128 and/or microphone 130 volume.
Memory interface 102 can be coupled with storer 150.This storer 150 can comprise high-speed random access memory and/or nonvolatile memory, such as one or more disk storage device, one or more optical storage apparatus, and/or flash memories (such as NAND, NOR).Storer 150 can store operating system 152, the operating system of such as Android, IOS or WindowsPhone and so on.This operating system 152 can comprise the instruction of the task of depending on hardware for the treatment of basic system services and execution.Storer 150 can also store application 154.When these are applied in operation, can be loaded into processor 104 from storer 150, and run on the operating system run by processor 104, and the function that the various user of the Interface realization utilizing operating system and bottom hardware to provide expects, as instant messaging, web page browsing, pictures management etc.Application can provide independent of operating system, also can be that operating system carries.
According to one embodiment of present invention, provide a kind of mobile terminal 100 that can complete CPU automatic test, can by arranging that the client application of automatic test device 300 realizes this function, this client application is stored in application 154.
Fig. 2 shows the process flow diagram of mobile terminal automation testing method 200 according to an embodiment of the invention.The method performs in the mobile terminal 100, the method starts from step S210, opens the operation of monitoring in response to user, performs the first order, obtain the real-time information of mobile terminal 100, wherein real-time information refers to the CPU usage of the mobile terminal 100 regularly obtained with preset frequency.User opens monitoring by clicking " cpu monitor " on interface, and as shown in Figure 5A, mobile terminal 100 calls " adbshelldumpsyscpuinfo " order with preset frequency, obtains CPU real-time information, namely CPU usage.
Subsequently in step S220, open the operation of test in response to user, perform the second order, testing results script.As shown in Figure 5 B, user selects the application that will test on interface, opens test, and such as user selects " note " application, and mobile terminal 100 calls shell-command and to bring into operation automatic test script, and test short message is applied, and specific instructions form is as follows:
" adbshelluiautomatorruntest robotization bag name--nohup – c bag name. class name # method name ".
According to embodiments of the invention, will write test script according to test assignment, wherein test assignment comprises actuating logic, the execution sequence that described actuating logic indicates described test assignment corresponding by configuration parameter.So, the multiple event-action performed on mobile terminal 100 operation interface are included in test script, such as, multiple event-action can be included in the incoming event action of mobile terminal 100, click event action, obtain event control action, slip event action.Mobile terminal 100, after unlatching test, is first resolved the actuating logic of test assignment, and is automatically performed test script corresponding to this test assignment by actuating logic.
For example, when the basic function of note application in testing mobile terminal 100, actuating logic corresponding to this test assignment can be as follows:
1. open Information application program
2. newly-built information, saves as rough draft
3. slide and check information
4. newly-built multimedia message (picture, video, audio frequency, text), saves as rough draft
5. use Chinese, English, special character to search for information respectively
6. check the note searched
7. return and delete any information
8. chat background is set
9. exit information
10. send note
Wherein, configuration parameter comprises testing time (runCounts), test duration (runTimes) and testing procedure.Mobile terminal 100, when testing results script, can perform corresponding testing procedure by call configuration option.Such as, for the task of the application of test short message above, us can be specified will to test some step wherein by revising configuration parameter, or, can be specified in the 7th step by configuration parameter and delete many articles of information.
Subsequently in step S230, at the end of test, output test result.According to one embodiment of present invention, after test certain hour (such as, 12 hours), by selecting " stopping " on the interface of mobile terminal 100, as shown in Figure 5A, test can be terminated.Certainly, tester also can arrange mobile terminal 100 after automatically performing the test some time, terminates test.The present invention does not limit this.
Mobile terminal 100 automatically can export a Excel comprising the test result of all application and show in SD card.This test result comprises the test duration (or perhaps test moment) of all application and the CPU usage with test duration association store, or is CPU usage.Such as, for the task that above-mentioned test short message is applied, export following test result (only partial results) with the form of Excel form:
Subsequently in step S240, draw CPU using state curve map according to test result, so that judge whether normal the CPU of this application uses.Such as according to form above, the CPU using state curve map of note application as shown in Figure 4 can be drawn out, and can find out from the curve map of Fig. 4, the utilization rate of CPU remains between 10% ~ 30% substantially, than observation test result in table form, curve map clearly understands.
In addition, curve plotting is desired to make money or profit in the Performance comparision of mobile terminal application.According to a kind of implementation, above-mentioned steps can be adopted to test the cpu usage of note application in another mobile terminal, same output CPU using state curve map.Tester just can, by the mode of curve map overlapping contrast, intuitively arrive in the utilization rate of which moment CPU too high, more easily detects that mobile terminal occurs that card pauses, the reason of fever phenomenon.
In addition, as describe in step S220, tester can by CPU using state curve map observe the CPU of which or a certain moment mobile terminal 100 time period use unreasonable (as, CPU usage is too high), and then the configuration parameter in amendment test script, to test further and to confirm to cause CPU to use irrational concrete steps, and then the source code of this application is revised.
Fig. 3 shows the schematic diagram of mobile terminal automation testing device 300 according to an embodiment of the invention.This device 300 comprises: monitoring unit 310, driver element 320, output interface 330 and Drawing of Curve unit 340, wherein monitoring unit 310 and output interface 330 couple mutually with driver element 320 respectively, and Drawing of Curve unit 340 couples mutually with output interface 330.
Monitoring unit 310 is suitable for the operation of opening monitoring in response to user, and perform the first order, namely call adb order with preset frequency, regularly to obtain the real-time information of mobile terminal 100, wherein real-time information comprises the CPU usage of mobile terminal 100.
Meanwhile, driver element 320 is suitable for the operation of opening test in response to user, performs the second order, namely calls shell-command, testing results script.
According to a kind of implementation, driver element 320 also comprises execution subelement 322, and be suitable for writing test script according to test assignment, wherein test assignment comprises actuating logic, the execution sequence that actuating logic indicates this test assignment corresponding by configuration parameter.Such as, configuration parameter can comprise testing time, test duration and testing procedure.Test assignment should contain the basic function of application to be measured as much as possible.According to test assignment design test case, test can be made to have more specific aim.
According to another embodiment of the present invention, driver element 320 is also suitable for, when testing results script, performing corresponding testing procedure by call configuration option.Such as, for the task of test short message application, our only test some step wherein can be specified by amendment configuration parameter, or, can specify by configuration parameter the number of times, time etc. tested in a certain step.
Output interface 330 is suitable for association at the end of test and exports test duration and CPU usage, as test result.Then described test result is sent to the Drawing of Curve unit 340 coupled with it.
Drawing of Curve unit 340 is suitable for drawing CPU using state curve map according to test result, so that judge whether normal the CPU of this application uses.
In addition, the curve plotting Yu Jingpin that desires to make money or profit compares.According to a kind of implementation, such scheme can be adopted to test the cpu usage of note application in another mobile terminal, same output CPU using state curve map.Tester just can, by the mode of curve map overlapping contrast, intuitively arrive in the utilization rate of which moment CPU too high, more easily detects that mobile terminal occurs that card pauses, the reason of fever phenomenon.
According to a kind of implementation, when tester by CPU using state curve map observe use unreasonable at the CPU of which time period or a certain moment mobile terminal time (as, CPU usage is too high), the configuration parameter in test script can be revised, to test further and to confirm to cause CPU to use irrational concrete steps, and then the source code of this application is revised.
Be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires than the feature more multiple features clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are to be understood that the module of the equipment in example disclosed herein or unit or assembly can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned in one or more equipment different from the equipment in this example.Module in aforementioned exemplary can be combined as a module or can be divided into multiple submodule in addition.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
In addition, some in described embodiment are described as at this can by the processor of computer system or the method implemented by other device performing described function or the combination of method element.Therefore, there is the device of processor formation for implementing the method or method element of the necessary instruction for implementing described method or method element.In addition, the element described herein of device embodiment is the example as lower device: this device is for implementing the function performed by the element of the object in order to implement this invention.
As used in this, unless specifically stated so, use ordinal number " first ", " second ", " the 3rd " etc. to describe plain objects and only represent the different instances relating to similar object, and be not intended to imply the object be described like this must have the time upper, spatially, sequence aspect or in any other manner to definite sequence.
Although the embodiment according to limited quantity describes the present invention, benefit from description above, those skilled in the art understand, in the scope of the present invention described thus, it is contemplated that other embodiment.In addition, it should be noted that the language used in this instructions is mainly in order to object that is readable and instruction is selected, instead of select to explain or limiting theme of the present invention.Therefore, when not departing from the scope and spirit of appended claims, many modifications and changes are all apparent for those skilled in the art.For scope of the present invention, be illustrative to disclosing of doing of the present invention, and nonrestrictive, and scope of the present invention is defined by the appended claims.