CN105446877A - Method and apparatus for testing power consumption of mobile application - Google Patents

Method and apparatus for testing power consumption of mobile application Download PDF

Info

Publication number
CN105446877A
CN105446877A CN201510740049.5A CN201510740049A CN105446877A CN 105446877 A CN105446877 A CN 105446877A CN 201510740049 A CN201510740049 A CN 201510740049A CN 105446877 A CN105446877 A CN 105446877A
Authority
CN
China
Prior art keywords
test
mobile applications
current value
power consumption
test script
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
CN201510740049.5A
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.)
Shanghai Synacast Media Technology Co Ltd
Original Assignee
Shanghai Synacast Media Technology 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 Shanghai Synacast Media Technology Co Ltd filed Critical Shanghai Synacast Media Technology Co Ltd
Priority to CN201510740049.5A priority Critical patent/CN105446877A/en
Publication of CN105446877A publication Critical patent/CN105446877A/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

Abstract

The present invention discloses a method and apparatus for testing power consumption of a mobile application. The method comprises: reading and running a test script of the mobile application; according to the test script, triggering the mobile application to be automatically operated, and calling a bottom-layer interface in an operation system of the mobile terminal acquiring an instantaneous current value of the mobile application in predetermined test time via the bottom-layer interface; calculating an average current value of the mobile application based on the instantaneous current value; and recording the average current value as a power consumption value of the mobile application, and ending the running of the test script. According to the method for testing power consumption of the mobile application, which is provided by the present invention, the power consumption of the mobile application can be tested without disassembling the mobile terminal or utilizing an external test tool, the operation procedure of the test is simplified, cost of the test is reduced, automation of the power consumption test of the mobile application is implemented, and an effect of simply, conveniently and rapidly testing the power consumption of the application is achieved.

Description

A kind of method and apparatus testing mobile applications power consumption
Technical field
The embodiment of the present invention relates to software testing technology field, particularly relates to a kind of method and apparatus testing mobile applications power consumption.
Background technology
Power consumption is the key technical index of intelligent mobile terminal institute critical concern always, and the quality of power consumption directly determines the core competitiveness of a intelligent mobile product.
The optimization of power consumption can be carried out from aspects such as hardware, driving, system software and application programs.Before mobile terminal product export, the device fabrication chamber of commerce is optimized in the face of power consumption at hardware, driving and system software layer, accomplishes the optimal balance of performance and power consumption.For the power consumption of application program, technician can only test the size of its power consumption by the method for software test, then is optimized based on test value application programs.
The method of existing test mobile applications power consumption, generally will dismantle mobile terminal, then by testing tool, as special reometer etc. carries out the power consumption test of mobile applications.Based on above-mentioned method of testing, when testing Mobile solution power consumption, the cost expenses of its testing tool is very high, whole test process is based on manual operation, automatically can not enter the test of next application program, and then cause the cost cost of whole test very high, and complicated operation.
Summary of the invention
The invention provides a kind of method and apparatus testing mobile applications power consumption.Must not the problem of simple and convenient, low cost autonation test Mobile solution power consumption with solution.
The embodiment of the present invention is by the following technical solutions:
First aspect, embodiments provide a kind of method of testing mobile applications power consumption, the method comprises:
Read and run the test script of mobile applications;
According to described test script, trigger described mobile applications automatic operation, and call the physical layer interface of mobile terminal operating system;
By described physical layer interface, obtain the instantaneous current value of described mobile applications in the presumptive test time;
Based on described instantaneous current value, calculate the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, terminate the operation of described test script.
Second aspect, the embodiment of the present invention additionally provides a kind of device testing mobile applications power consumption, and this device comprises:
Test script read module, for reading and running the test script of mobile applications;
Physical layer interface calling module, for according to described test script, triggers described mobile applications automatic operation, and calls the physical layer interface of mobile terminal operating system;
Instantaneous current value acquisition module, for by described physical layer interface, obtains the instantaneous current value of described mobile applications in the presumptive test time;
Power consumption number computing module, for based on described instantaneous current value, calculates the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, terminate the operation of described test script.
A kind of method and apparatus testing mobile applications power consumption provided by the invention, by running the test script of the mobile applications of setting, triggering the automatic operation of corresponding mobile applications, calling the physical layer interface of mobile terminal operating system simultaneously; Then obtain the instantaneous current value of mobile applications within the default test duration based on physical layer interface, can calculate the average current value of mobile applications based on instantaneous current value, the average current value calculated is exactly the power consumption number of this mobile applications.Utilize the method, without the need to dismantling mobile terminal, also the power consumption of mobile applications just need can not be measured by external testing tool, simplify the operating process of test, reduce the cost expenses of test, achieve the robotization of mobile applications power consumption test, reach the effect of simple and convenient test application power consumption.
Accompanying drawing explanation
A kind of process flow diagram testing the method for mobile applications power consumption that Fig. 1 provides for the embodiment of the present invention one;
A kind of process flow diagram testing the method for mobile applications power consumption that Fig. 2 provides for the embodiment of the present invention two;
A kind of process flow diagram testing the method for mobile applications power consumption that Fig. 3 provides for the embodiment of the present invention three;
A kind of structural representation testing the device of mobile applications power consumption that Fig. 4 provides for the embodiment of the present invention four.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.Be understandable that, specific embodiment described herein is only for explaining the present invention, but not limitation of the invention.It also should be noted that, for convenience of description, illustrate only part related to the present invention in accompanying drawing but not entire infrastructure.
Embodiment one
The schematic flow sheet of the method for the test mobile applications power consumption that Fig. 1 provides for the embodiment of the present invention one, the present embodiment is applicable to the situation of test mobile applications power consumption, the method can be performed by the device of the test mobile applications power consumption configured in the terminal, a kind of method of testing mobile applications power consumption of thering is provided of the present embodiment as shown in Figure 1, comprises following operation:
Step 101, read and run the test script of mobile applications.
In the present embodiment, described mobile applications specifically can refer to the client of the mobile terminal that the user-operable installed based on mobile terminal operating system uses.Described mobile terminal specifically can refer to the mobile electronic device such as mobile phone, panel computer.The operating system of described mobile terminal specifically can comprise the intelligent operating system such as Android, IOS and Windowsphone.Described test script is specially the script file for testing mobile applications power consumption write based on Uiautomator wscript.exe.
In the present embodiment, described test script is stored in the internal memory of mobile terminal, concrete, when carrying out power consumption test, first reading the test script in mobile terminal internal memory, starting the operation of described test script afterwards.Described Uiautomator wscript.exe is specially the scripting tools for automatic test user interface (UserInterface, UI), and this wscript.exe can be write for different test script files.
Step 102, according to described test script, trigger described mobile applications automatic operation, and call the physical layer interface of mobile terminal operating system.
In the present embodiment, after running described test script, trigger the automatic operation of corresponding mobile applications based on test script, meanwhile, the physical layer interface of mobile terminal operating system can also be called based on test script.The automatic operation of described triggering mobile applications specifically can be: trigger the startup of mobile applications and the simulation operations to described application program, exemplary, the operations such as what the UI as application programs carried out emulating clicks, slide, input text.
The described physical layer interface calling mobile terminal operating system specifically can be the interface of the inner nuclear layer calling composition operating system framework.Usually, the inner nuclear layer that different mobile terminal operating systems has is different, and exemplary, the inner nuclear layer of IOS is Unix kernel, and the inner nuclear layer of Android operation system is linux kernel.But inner nuclear layer in an operating system role is substantially identical, the core system service of the bottom is mainly provided, comprises: security, storage administration, management of process, power management and driver model etc. is provided.In the present embodiment, calling physical layer interface (inner nuclear layer interface) can be realized based on test script.
Step 103, by described physical layer interface, obtain the instantaneous current value of described mobile applications in the presumptive test time.
In the present embodiment, the inner nuclear layer of operating system can return the instantaneous current value of mobile terminal when mobile terminal exists the progress of work.Therefore, after called physical layer interface (inner nuclear layer interface) by test script, just can read instantaneous current value during mobile terminal work.Because mobile terminal is in test mode, the instantaneous current value produced when the instantaneous current value of the mobile terminal now obtained can be equivalent to tested mobile applications automatic operation.
In the present embodiment, in order to test the power consumption of mobile applications, need the instantaneous current value obtaining mobile applications in the presumptive test time.Wherein, the instantaneous current value of acquisition leaves in the buffer memory of mobile terminal, so that operation afterwards uses.
Further, the scope that arranges of the presumptive test time of described mobile applications is 20 minutes ~ 40 minutes, and described instantaneous current value detects in seconds.
In the present embodiment, the time of carrying out mobile applications power consumption test generally can not be too short, and the time, too short meeting caused the inaccurate of power consumption test result.But can not be oversize, because mobile applications constantly can carry out automation mechanized operation based on test script in testing, running time oversize meeting causes mobile terminal to generate heat or electricity deficiency, also can affect the test result of the power consumption of mobile applications.Therefore the scope that arranges of presumptive test time is 20 minutes ~ 40 minutes, can ensure the correctness of power consumption test result within this time period.
In the present embodiment, if remove the instantaneous current value of monitoring mobile terminal with special reometer, can find that based on its instantaneous current value of time shaft be a continuous print curve.That considers test script calls the limit, by millisecond or can not remove the instantaneous current value obtaining mobile applications in units of less nanosecond, therefore preferably carry out the acquisition of instantaneous current value in seconds.
Step 104, based on described instantaneous current value, calculate the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, terminate the operation of described test script.
In the present embodiment, based on the instantaneous current value of the mobile applications obtained, the average current value of mobile applications in Preset Time can be calculated.The average current value calculated just can be used as the power consumption number of mobile applications.When after the power consumption number calculating mobile applications, the operation of test script can be terminated.And for the test script run, provide a rreturn value after end of run as the mark run, usually, can arrange rreturn value is 1.
Further, described average current value is the ratio of all instantaneous current value sums and described presumptive test time in the described presumptive test time.
In the present embodiment, the power consumption number of test mobile applications is actual is exactly the average current value calculating mobile applications, the computation process of described average current value specifically can be described as: first, based on the instantaneous current value that mobile applications obtains within the presumptive test time, calculate all instantaneous current value in the presumptive test time and; Then, calculate all instantaneous current value and with the ratio of described presumptive test time.The described ratio calculated is the average current value of mobile applications.
A kind of method of testing mobile applications power consumption that the embodiment of the present invention one provides, first triggers the automatic operation of mobile applications, and calls the physical layer interface of mobile terminal operating system based on test script; Then, the instantaneous current value of tested mobile applications is obtained based on physical layer interface; Finally, then based on instantaneous current value, calculate the average current value in the presumptive test time, the average current value calculated is exactly the power consumption number of tested application program.Utilize the method, without the need to dismantling mobile terminal, also the power consumption of mobile applications just need can not be measured by external testing tool, simplify the operating process of test, reduce the cost expenses of test, achieve the robotization of mobile applications power consumption test, reach the effect of simple and convenient test application power consumption.
Embodiment two
A kind of schematic flow sheet testing the method for mobile applications that Fig. 2 provides for the embodiment of the present invention two.The present embodiment is optimized on the basis of above-described embodiment one, in the present embodiment, before step " reads and runs the test script of mobile applications ", add step: the test environment of mobile applications, presumptive test time and test script are set, and stores described test script in the test file folder of mobile terminal.
" based on described instantaneous current value, the average current value of described mobile applications is calculated in step; Remember that described average current value is the power consumption number of described mobile applications, and terminate the operation of described test script " after; add step: if test script all end of runs all in described test file folder, then export the test result of the corresponding mobile applications of all test scripts; Otherwise, repeat testing procedure.
As shown in Figure 2, a kind of method of testing mobile applications that the embodiment of the present invention provides, comprises the steps:
Step 201, the test environment that mobile applications is set, presumptive test time and test script, and store described test script in the test file folder of mobile terminal.
In the present embodiment, in order to ensure the accuracy of mobile applications power consumption test, before carrying out power consumption test, the preliminary work of test is first carried out.First arrange the test environment of mobile applications, the described test environment that arranges specifically can comprise: the screen intensity regulating mobile applications place mobile terminal, makes screen intensity be a fixed value; Stop all operations with testing incoherent process on mobile terminal; The battery electric quantity controlling mobile terminal is in 100% state etc.
In the present embodiment, before startup test script runs, after triggers power consumption test, by display one prompt window on the screen of mobile terminal, artificially input the default test duration by described prompt window, afterwards testing results script in Preset Time.Usually, the scope of the presumptive test time of input is 20 minutes ~ 40 minutes, ensures the precision of power consumption test thus.
In the present embodiment, the described test script arranging mobile applications specifically can comprise: on the Uiautomator wscript.exe supporting the intelligent operating system such as Android, IOS and Windowsphone, writing can automation mechanized operation mobile applications and can the test script file of call operation system bottom interface, and is stored in the test file folder of mobile terminal.
Further, in described test file folder, at least comprise a test script, and a mobile applications in a corresponding triggering mobile terminals of test script.
In the present embodiment, power consumption test generally can carry out power consumption test to multiple mobile applications successively, and all needs to write a test script for the mobile applications that will carry out testing, and these test scripts are all stored in mobile terminal internal memory.For the ease of operation, the test script write all is deposited in test file folder, and each test script is all named with corresponding mobile applications.Therefore, a mobile applications on test script is corresponding mobile terminal.
Step 202, read and run the test script of mobile applications.
Concrete, prepare to terminate in test, after starting power consumption test, the test script that in order read test file, off-duty is crossed.
Step 203, according to described test script, trigger described mobile applications automatic operation, and call the physical layer interface of mobile terminal operating system.
Concrete, after testing results script, based on run test script, trigger the corresponding mobile applications of this test script and automatically run, make described mobile applications robotization carry out simulation operations; Meanwhile, based on run test script, also can call the physical layer interface of mobile terminal operating system, to obtain more detecting informations based on physical layer interface.
Step 204, by described physical layer interface, obtain the instantaneous current value of described mobile applications in the presumptive test time.
Concrete, after calling physical layer interface based on test script, the instantaneous current value of the mobile terminal in the sustainable acquisition presumptive test time, due in testing, the carrying out of mobile applications is only had to operate, so now the instantaneous current value of mobile terminal can regard the instantaneous current value of the current mobile applications run as.
Step 205, based on described instantaneous current value, calculate the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, terminate the operation of described test script.
Concrete, after reaching the presumptive test time, can according to the instantaneous current value obtained, calculate all instantaneous current value sums in the presumptive test time, then the ratio of described instantaneous current value sum and described presumptive test time is calculated, and using the ratio that the calculates average current value as mobile applications, the average current value finally calculated is exactly the power consumption number of current mobile applications.After calculating power consumption number, the test script of current operation can be terminated, it should be noted that the end of test script also means the automatic operation finishing current mobile applications, further, relevant with current mobile mobile applications process also will stop.
If test script all end of runs all in step 206 described test file folder, then export the test result of the corresponding mobile applications of all test scripts; Otherwise, step 202 is returned to off-duty test script and re-executes.
In the present embodiment, when in test file folder, test script number is greater than 1, mean that needs perform test operation continuously, therefore need to judge whether the test script in test file folder ran all, if all end of runs, then export the test result of the corresponding mobile applications of all test scripts.Usually, the form of the test result of mobile applications is Excel table, in Excel table, and a corresponding average current value calculated after each mobile applications, the also power consumption number of i.e. this mobile applications.Described Excel table is saved to mobile phone EMS memory, is convenient to consulting of staff.
In the present embodiment, if there is the script file that test script rreturn value is not 1 in test file folder, then order reads the test script that a rreturn value is not 1, and this test script of startup optimization, the testing procedure after then repeating.
A kind of method of testing mobile applications power consumption that the embodiment of the present invention two provides, first carry out test to prepare, test environment and test script etc. are set, then trigger the automatic operation of mobile applications based on test script, and call the physical layer interface of mobile terminal operating system; Afterwards, obtain instantaneous current value further based on physical layer interface, and calculate average current value; Finally, then judge test file folder in test script whether all run complete, if run complete, output test result.Utilize the method, without the need to dismantling mobile terminal, also the power consumption of mobile applications just need can not be measured by external testing tool, simplify the operating process of test, reduce the cost expenses of test, meanwhile, the interference of other processes to test result is reduced to the setting of test environment, and then simple and convenient achieve mobile applications power consumption test, and reach the object of automatic test mobile applications power consumption.
Embodiment three
A kind of process flow diagram testing the method for mobile applications power consumption that Fig. 3 provides for the embodiment of the present invention three, the present embodiment is based on above-described embodiment, give a kind of preferred embodiment testing mobile applications power consumption, as shown in Figure 3, specifically comprise the steps:
Step 301, the test environment arranging mobile applications and test script, sequential storage test script presss from both sides to test file.
Exemplary, the backlight illumination of adjustable mobile terminal is 10%; Terminate all processes irrelevant with test; Controlling battery capacity of mobile terminal is 100%; The test script of mobile applications is write based on Uiautomator wscript.exe; Corresponding test script is named and sequential storage value test file folder with mobile applications.
Whether all step 302, the test script end of run judged in test file folder, if not, then perform step 303; If so, then step 308 is performed.
Exemplary, if detect that the rreturn value of test script is 1, then determine test script end of run.There is when detecting the test script that rreturn value is not 1, performing step 303.
Step 303, order read an off-duty test script and run described test script.
Exemplary, if a test script also off-duty in test file folder, then read and run this test script.
Step 304, trigger corresponding mobile applications based on described test script and automatically run, call the physical layer interface of mobile terminal operating system simultaneously.
Exemplary, trigger that corresponding mobile applications carries out emulating click, slide, the operation such as input text.Meanwhile, the interface that in the inner nuclear layer of mobile terminal operating system, electric quantity monitoring is relevant is called based on test script.
Step 305, obtain the instantaneous current value of mobile applications in the presumptive test time based on physical layer interface.
Exemplary, based on the interface that electric quantity monitoring in the inner nuclear layer of mobile terminal operating system is relevant, read the instantaneous current value of mobile terminal in Preset Time.Wherein, in test process, the instantaneous current value of mobile terminal is the instantaneous current value of tested mobile applications.
Step 306, calculate the average current value of mobile applications within the presumptive test time based on instantaneous current value.
Step 307, remember that described average current value is the power consumption number of described mobile applications, and terminate the operation of current test script, return step 302 afterwards.
Exemplary, after terminating the operation of current test script, the associative operation also corresponding stopping of tested mobile terminal, ensures the consistance of different mobile applications test environment thus.Further, the operation conditions returning test script in step 302 pair test file folder judges.
The power consumption test result of step 308, output mobile application program.
Exemplary, when after all test scripts all end of run, export the result of power consumption test.Described test result is stored in mobile terminal internal memory with the form of Excel.
The present embodiment three is a kind of preferred embodiment testing the method for mobile applications power consumption, by the preferred embodiment, further illustrates the specific operation process of method of testing of the present invention.Utilize the inventive method, without the need to dismantling mobile terminal, also the power consumption of mobile applications just need can not be measured by external testing tool, simplify the operating process of test, reduce the cost expenses of test, meanwhile, the interference of other processes to test result is reduced to the setting of test environment, and then simple and convenient achieve mobile applications power consumption test, and reach the object of automatic test mobile applications power consumption.
Embodiment four
A kind of structural representation testing the device of mobile applications power consumption that Fig. 4 provides for the embodiment of the present invention four.The present embodiment is applicable to the situation of test mobile applications power consumption, this device can by software and/or hardware implementing, and be generally integrated in mobile terminal, the concrete structure of this device is as follows, comprising: test script read module 41, physical layer interface calling module 42, instantaneous current value acquisition module 43, power consumption number computing module 44.Wherein,
Test script read module 41, for reading and running the test script of mobile applications;
Physical layer interface calling module 42, for according to described test script, triggers described mobile applications automatic operation, and calls the physical layer interface of mobile terminal operating system;
Instantaneous current value acquisition module 43, for by described physical layer interface, obtains the instantaneous current value of described mobile applications in the presumptive test time;
Power consumption number computing module 44, for based on described instantaneous current value, calculates the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, terminate the operation of described test script.
In the present embodiment, first this device is read by test script read module 41 and runs the test script chosen; Secondly triggered the automatic operation of corresponding mobile applications by physical layer interface calling module 42 according to the test script run, call the physical layer interface of mobile terminal operating system simultaneously based on test script; Then obtained the instantaneous current value of mobile applications in the presumptive test time based on physical layer interface by instantaneous current value acquisition module 43; Calculate its average current value finally by power consumption number computing module 44 based on the instantaneous current value of mobile applications in the default test duration, the average current value calculated is the power consumption number of mobile applications, then terminates the operation of test script.
A kind of device testing mobile applications power consumption that the present embodiment provides, utilize this device, without the need to dismantling mobile terminal, also the power consumption of mobile applications just need can not be measured by external testing tool, simplify the operating process of test, reduce the cost expenses of test, achieve the robotization of mobile applications power consumption test, reach the effect of simple and convenient test application power consumption.
On above-described embodiment basis, described device also comprises: test preparation module, for arranging the test environment of mobile applications, presumptive test time and test script, and stores described test script in the test file folder of mobile terminal.
Meanwhile, in the device of test mobile applications power consumption, in described test file folder, at least comprise a test script, and a mobile applications in a corresponding triggering mobile terminals of test script.
On above-described embodiment basis, described device also comprises: test result output module, for when test scripts all in described test file folder all end of run time, export the test result of the corresponding mobile applications of all test scripts; Otherwise, return to test script read module.
Meanwhile, in the device of test mobile applications power consumption, the scope that arranges of the presumptive test time of described mobile applications is 20 minutes ~ 40 minutes, and described instantaneous current value detects in seconds; Described average current value is the ratio of all instantaneous current value sums and described presumptive test time in the described presumptive test time.
Note, above are only preferred embodiment of the present invention and institute's application technology principle.Skilled person in the art will appreciate that and the invention is not restricted to specific embodiment described here, various obvious change can be carried out for a person skilled in the art, readjust and substitute and can not protection scope of the present invention be departed from.Therefore, although be described in further detail invention has been by above embodiment, the present invention is not limited only to above embodiment, when not departing from the present invention's design, can also comprise other Equivalent embodiments more, and scope of the present invention is determined by appended right.

Claims (10)

1. test a method for mobile applications power consumption, it is characterized in that, comprising:
Read and run the test script of mobile applications;
According to described test script, trigger described mobile applications automatic operation, and call the physical layer interface of mobile terminal operating system;
By described physical layer interface, obtain the instantaneous current value of described mobile applications in the presumptive test time;
Based on described instantaneous current value, calculate the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, terminate the operation of described test script.
2. method according to claim 1, is characterized in that, is reading and before running the test script of mobile applications, is also comprising:
The test environment of mobile applications, presumptive test time and test script are set, and store described test script in the test file folder of mobile terminal.
3. method according to claim 2, is characterized in that, at least comprises a test script in described test file folder, and a mobile applications in a corresponding triggering mobile terminals of test script.
4. method according to claim 3, is characterized in that, based on described instantaneous current value, calculates the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, and after terminating the operation of described test script, also comprise:
If test script all end of runs all in described test file folder, then export the test result of the corresponding mobile applications of all test scripts; Otherwise, repeat testing procedure.
5., according to the arbitrary described method of claim 1-4, it is characterized in that, the scope that arranges of the presumptive test time of described mobile applications is 20 minutes ~ 40 minutes, and described instantaneous current value detects in seconds; Described average current value is the ratio of all instantaneous current value sums and described presumptive test time in the described presumptive test time.
6. test a device for mobile applications power consumption, configuration in the terminal, is characterized in that, comprising:
Test script read module, for reading and running the test script of mobile applications;
Physical layer interface calling module, for according to described test script, triggers described mobile applications automatic operation, and calls the physical layer interface of mobile terminal operating system;
Instantaneous current value acquisition module, for by described physical layer interface, obtains the instantaneous current value of described mobile applications in the presumptive test time;
Power consumption number computing module, for based on described instantaneous current value, calculates the average current value of described mobile applications; Remember that described average current value is the power consumption number of described mobile applications, terminate the operation of described test script.
7. device according to claim 6, is characterized in that, also comprises:
Test preparation module, for arranging the test environment of mobile applications, presumptive test time and test script, and stores described test script in the test file folder of mobile terminal.
8. device according to claim 7, is characterized in that, at least comprises a test script in described test file folder, and a mobile applications in a corresponding triggering mobile terminals of test script.
9. device according to claim 8, is characterized in that, also comprises:
Test result output module, for when test scripts all in described test file folder all end of run time, export the test result of the corresponding mobile applications of all test scripts; Otherwise, return to test script read module.
10., according to the arbitrary described device of claim 6-9, it is characterized in that, the scope that arranges of the presumptive test time of described mobile applications is 20 minutes ~ 40 minutes, and described instantaneous current value detects in seconds; Described average current value is the ratio of all instantaneous current value sums and described presumptive test time in the described presumptive test time.
CN201510740049.5A 2015-11-04 2015-11-04 Method and apparatus for testing power consumption of mobile application Pending CN105446877A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510740049.5A CN105446877A (en) 2015-11-04 2015-11-04 Method and apparatus for testing power consumption of mobile application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510740049.5A CN105446877A (en) 2015-11-04 2015-11-04 Method and apparatus for testing power consumption of mobile application

Publications (1)

Publication Number Publication Date
CN105446877A true CN105446877A (en) 2016-03-30

Family

ID=55557106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510740049.5A Pending CN105446877A (en) 2015-11-04 2015-11-04 Method and apparatus for testing power consumption of mobile application

Country Status (1)

Country Link
CN (1) CN105446877A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106681916A (en) * 2016-12-20 2017-05-17 广东小天才科技有限公司 Method, device and system for testing application power consumption
CN106771562A (en) * 2017-02-23 2017-05-31 上海与德信息技术有限公司 The power consumption test method and device of a kind of terminal
CN108918959A (en) * 2018-07-19 2018-11-30 北京首汽智行科技有限公司 The automatization test system of car-mounted terminal module dissipation

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1654966A (en) * 2005-01-07 2005-08-17 清华大学 Transient current measuring method and system for IC chip
CN101727172A (en) * 2008-10-27 2010-06-09 联想(北京)有限公司 Method and device for measuring process consumption of computer, and computer system
CN102638603A (en) * 2011-02-11 2012-08-15 上海闻泰电子科技有限公司 Method for automatically testing power consumption of mobile phone through simulation key
CN103179241A (en) * 2013-03-08 2013-06-26 百度在线网络技术(北京)有限公司 Method and system for automatically testing power consumption of mobile terminal
CN104166619A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 Performance measuring method and terminal of application program
CN104219383A (en) * 2014-08-20 2014-12-17 小米科技有限责任公司 Terminal power information prompting method and device
CN104461849A (en) * 2014-12-08 2015-03-25 东南大学 Method for measuring power consumption of CPU (Central Processing Unit) and GPU (Graphics Processing Unit) software on mobile processor
US20150309093A1 (en) * 2014-04-24 2015-10-29 Chungjin Lee Method for automatically measuring power consumption of mobile device corresponding to executing given event

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1654966A (en) * 2005-01-07 2005-08-17 清华大学 Transient current measuring method and system for IC chip
CN101727172A (en) * 2008-10-27 2010-06-09 联想(北京)有限公司 Method and device for measuring process consumption of computer, and computer system
CN102638603A (en) * 2011-02-11 2012-08-15 上海闻泰电子科技有限公司 Method for automatically testing power consumption of mobile phone through simulation key
CN103179241A (en) * 2013-03-08 2013-06-26 百度在线网络技术(北京)有限公司 Method and system for automatically testing power consumption of mobile terminal
CN104166619A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 Performance measuring method and terminal of application program
US20150309093A1 (en) * 2014-04-24 2015-10-29 Chungjin Lee Method for automatically measuring power consumption of mobile device corresponding to executing given event
CN104219383A (en) * 2014-08-20 2014-12-17 小米科技有限责任公司 Terminal power information prompting method and device
CN104461849A (en) * 2014-12-08 2015-03-25 东南大学 Method for measuring power consumption of CPU (Central Processing Unit) and GPU (Graphics Processing Unit) software on mobile processor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106681916A (en) * 2016-12-20 2017-05-17 广东小天才科技有限公司 Method, device and system for testing application power consumption
CN106771562A (en) * 2017-02-23 2017-05-31 上海与德信息技术有限公司 The power consumption test method and device of a kind of terminal
CN106771562B (en) * 2017-02-23 2019-10-18 上海与德信息技术有限公司 A kind of power consumption test method and device of terminal
CN108918959A (en) * 2018-07-19 2018-11-30 北京首汽智行科技有限公司 The automatization test system of car-mounted terminal module dissipation

Similar Documents

Publication Publication Date Title
CN104253892B (en) The method of testing of the performance of application program and system in Intelligent mobile equipment
CN103186439A (en) Server test system and server stability test method
CN110493812B (en) Distribution network test processing method, device and system, processor and master control equipment
CN104572422A (en) Memory monitoring achievement method based on startup and shutdown of Linux system
CN103268289B (en) Record the method and system of application testing script on mobile terminals
CN106405286B (en) The automatic test approach and system of quality monitoring device of electrical energy
CN105446877A (en) Method and apparatus for testing power consumption of mobile application
CN104281513A (en) Application power consumption detection method and system
CN103391362B (en) A kind of application class method based on power consumption and mobile terminal
CN105677306A (en) Automation script compiling method and device
CN102156227A (en) Detecting system and detecting method for non-vehicular charging machine
CN104915297A (en) APP electricity consumption automatic test method for android device
CN105279092A (en) Software testing method and apparatus
CN101846708B (en) Method for detecting power-failure counting function of distribution transformer terminals in batch
CN105044614A (en) Single-phase electric energy meter battery life acceleration test system and method
CN106708696B (en) Method and device for detecting power consumption of function in application program of mobile terminal
CN102880549A (en) Method and device for production test
CN103760514B (en) The method and device that a kind of electric energy meter quickly detects
CN102662806A (en) Adaptive testing method directed at different performance indicators of Java card
CN104714203A (en) Calibration method for power quality monitoring device
CN116774056A (en) Method, system and computer readable storage medium for evaluating charge time of battery
CN103577290A (en) Test script playback rhythm control method and system
CN108804719A (en) Digital circuit aging emulation mode and device
CN116702668A (en) Regression testing method and device, electronic equipment and storage medium
CN106370955B (en) USB PD protocol-based adapter detection method and device

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: 20160330