CN103455403A - Testing method and device - Google Patents

Testing method and device Download PDF

Info

Publication number
CN103455403A
CN103455403A CN201310375474XA CN201310375474A CN103455403A CN 103455403 A CN103455403 A CN 103455403A CN 201310375474X A CN201310375474X A CN 201310375474XA CN 201310375474 A CN201310375474 A CN 201310375474A CN 103455403 A CN103455403 A CN 103455403A
Authority
CN
China
Prior art keywords
test
mobile terminal
measured
event
monitoring point
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.)
Granted
Application number
CN201310375474XA
Other languages
Chinese (zh)
Other versions
CN103455403B (en
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201310375474.XA priority Critical patent/CN103455403B/en
Publication of CN103455403A publication Critical patent/CN103455403A/en
Application granted granted Critical
Publication of CN103455403B publication Critical patent/CN103455403B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and a device for testing in a mobile terminal as well as a method and a device for testing in a control terminal, wherein a method for testing in the mobile terminal comprises the steps that information of a monitoring point and a testing instruction are received from the control terminal, the testing instruction is used for indicting to execute an event to be tested through the preset testing parameters, the simulation testing of the event to be tested is executed according to the testing instruction, the displayed RGB (red green blue) value of the monitoring point on a mobile terminal screen is detected according to the preset time interval, and the corresponding obtaining time is recorded; when the condition that the displayed RGB value of the monitoring point on the mobile terminal screen is not changed is detected, the executing time of the event to be tested is determined; and the executing result of the executing time of the event to be tested is sent to the control terminal. When the method and the device are adopted, the precise testing executing time can be obtained, and in addition, the testing efficiency can be greatly improved.

Description

Method of testing and device
Technical field
The application relates to a kind of method and apparatus of being tested in mobile terminal and a kind of method and apparatus of being tested in control terminal, relates in particular to the technology that a kind of rgb value that each in test process shows constantly according to monitoring point is determined the execution time of event to be measured.
Background technology
Day by day universal along with smart machine (as: touch-screen mobile phone, panel computer etc.), various application programs based on smart machine are more and more, consider that these equipment are subject to all many-sided restrictions such as size, volume, hardware, can can be more and more higher to the performance requirement of the application program of carrying on equipment, thereby how in these equipment, to obtain accurate performance test data and be of great significance for the exploitation tool of application program on these equipment.But, because performance test is very high to the data accuracy requirement, so difficulty of test is very large, the part-time performance test need to be accurate to Millisecond, and the manual testing can't realize at all, and the test item that manually can complete individually also needs to drop into a large amount of manpowers and carries out long data acquisition.So not only consumed a large amount of manpowers, extended the construction cycle, science that simultaneously also can't the guaranteed performance test data.
At present, performance test for application software on smart machine on market mainly comprises following three types of technology scheme: first kind scheme is by the difference of the encoding scheme of comparison Code obtaining place Project Product and competing product, and code efficiency is carried out to Performance Evaluation, the output performance analysis result.But this scheme can be subject to a large amount of human factor impacts in implementation process, the data that therefore obtain are rigorous not, and the performance test very high for some accuracy requirements has little significance.The Equations of The Second Kind scheme is to carry out mode performance computing time of surrounding time by the mode printing of injecting codes.Understand in detail the implementation of the code of each competing product because this mode needs the tester, then by coding, obtain performance test data, the cost that therefore this scheme obtains data is too high; In addition, tend to code is prevented the processing of decompiling for the protection to self rights and interests due to each software vendor, further increased code injection and the cost of encoding scheme relatively.The 3rd class scheme is to utilize the software control high-speed camera to be recorded and analyze the operating process of software, the time performance of carrying out to obtain application software operation.But this scheme need to be bought expensive test equipment and drop into suitable manpower, thereby testing cost is higher, efficiency is lower.
Summary of the invention
The object of the present invention is to provide the method and apparatus of being tested in a kind of method and apparatus of being tested and control terminal in mobile terminal.Adopt the method for the invention and device not only can obtain the accurate test execution time, and can increase substantially the efficiency of test.
According to an aspect of of the present present invention, a kind of method of being tested in mobile terminal is provided, described method comprises: receive indication from the control terminal connected and carry out the test instruction of event to be measured and the information of monitoring point with the test parameter of being scheduled to, carry out the simulation test of described event to be measured according to described test instruction, and, in carrying out the process of simulation test, detect the rgb value that described monitoring point shows in described mobile terminal screen and record corresponding acquisition time according to the default time interval; Wherein, in described simulation test process, when rgb value that described monitoring point shows on described mobile terminal screen being detected and no longer change, determine the execution time of described event to be measured; The execution result that will comprise the execution time of the described event to be measured of obtaining sends to described control terminal.
The step of the rgb value that preferably, the described monitoring point of described detection shows in described mobile terminal screen comprises: the view data of obtaining described mobile terminal screen; According to the view data acquisition of described mobile terminal screen and the corresponding rgb value of screen coordinate of described monitoring point.
Preferably, when described mobile terminal is Android system, the described step of obtaining the view data of described mobile terminal screen comprises: the view data of obtaining described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
Preferably, describedly determine that the step of the execution time of described event to be measured comprises: when obtaining described simulation test and starting to detect, the rgb value of the time value A of record and described monitoring point becomes given rgb value and corresponding first time value B while no longer changing; Difference between time value A and B is defined as to the execution time of described event to be measured.
Preferably, between the control terminal of described mobile terminal and described connection, by the usb bus agreement, communicate.
According to invention on the other hand, a kind of device of testing the Android application program in mobile terminal is provided, comprise: the command reception unit receives indication for the control terminal from connecting and carries out the test instruction of event to be measured and the information of monitoring point with the test parameter of being scheduled to; Simulation test unit, for carrying out the simulation test of described event to be measured according to described test instruction; The rgb value monitoring means, for carrying out the process of simulation test, detect the rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time according to the default time interval; Acquiring unit as a result, while no longer changing for rgb value that described monitoring point shows on described mobile terminal screen detected when described rgb value monitoring means, determine the execution time of described event to be measured; Data transmission unit, send to described control terminal for the execution result of execution time that will comprise the described event to be measured of obtaining.
Preferably, the processing that described rgb value monitoring means detects the rgb value that described monitoring point shows in described mobile terminal screen comprises: the view data of obtaining described mobile terminal screen; According to the view data acquisition of described mobile terminal screen the corresponding rgb value of screen coordinate of record and described monitoring point.
Preferably, when described mobile terminal is Android system, the processing that described rgb value monitoring means obtains the view data of described mobile terminal screen comprises: the view data of obtaining described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
Preferably, described acquiring unit as a result determines that the processing of the execution time of described event to be measured comprises: when obtaining described simulation test and starting to detect, the rgb value of the time value A of record and described monitoring point becomes given rgb value and corresponding first time value B while no longer changing; Difference between time value A and B is defined as to the execution time of described event to be measured.
Preferably, between the control terminal of described mobile terminal and described connection, by the usb bus agreement, communicate.
According to invention on the other hand, provide a kind of method of being tested in control terminal, comprising: the information of obtaining test parameter and monitoring point; The test instruction of event to be measured is carried out in generation with the test parameter obtained; The information of described test instruction and the monitoring point obtained is sent to the mobile terminal be connected with described control terminal; Receive the execution result of the execution time that comprises described event to be measured from the mobile terminal of described connection.
Preferably, the screen coordinate that described test parameter is operating point.
Preferably, the step that described generation is carried out the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate that generates the operating point to obtain is carried out the test instruction of event to be measured.
Preferably, described test parameter also comprises the loop test number of times.
Preferably, the step that described generation is carried out the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate that generates the operating point to obtain is carried out the test instruction of event to be measured, and described event to be measured is carried out repeatedly according to described loop test number of times; Accordingly, the step that the described mobile terminal from described connection receives the execution result of the execution time that comprises described event to be measured comprises: a plurality of execution results that receive the execution time of described event to be measured from the mobile terminal of described connection.
Preferably, described test parameter also comprises test interval.
Preferably, the step that described generation is carried out the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate that generates the operating point to obtain is carried out the test instruction of a plurality of events to be measured, and sequentially carries out described a plurality of event to be measured according to described test interval; Accordingly, the step that the described mobile terminal from described connection receives the execution result of the execution time that comprises described event to be measured comprises: the execution result that receives the execution time of described a plurality of events to be measured from the mobile terminal of described connection.
Preferably, between described control terminal and the described mobile terminal be connected, by the usb bus agreement, communicate.
According to invention on the other hand, provide a kind of device of being tested in control terminal, comprising: test interface unit, for obtaining the information of test parameter and monitoring point; The instruction generation unit, for generating the test instruction of carrying out event to be measured with the test parameter obtained; Instruction sending unit, send to for the information by described test instruction and the monitoring point obtained the mobile terminal be connected with described control terminal; The data receiver unit, receive the execution result of the execution time comprise described event to be measured for the mobile terminal from described connection.
Preferably, the screen coordinate that described test parameter is operating point.
The screen coordinate of the operating point that preferably, described instruction generation unit generates to obtain is carried out the test instruction of event to be measured.
Preferably, described test parameter also comprises the loop test number of times.
Preferably, the screen coordinate of the operating point that described instruction generation unit generates to obtain is carried out the test instruction of event to be measured, and described event to be measured is carried out repeatedly according to described loop test number of times; Accordingly, described data receiver unit receives a plurality of execution results of the execution time of described event to be measured from the mobile terminal of described connection.
Preferably, described test parameter also comprises test interval.
Preferably, the screen coordinate of the operating point that described instruction generation unit generates to obtain is carried out the test instruction of a plurality of events to be measured, and sequentially carries out described a plurality of event to be measured according to described test interval; Accordingly, described data receiver unit receives the execution result of the execution time of described a plurality of events to be measured from the mobile terminal of described connection.
Preferably, between described control terminal and the described mobile terminal be connected, by the usb bus agreement, communicate.
Beneficial effect
Compared with prior art, the present invention has the following advantages:
The present invention not only can obtain the accurate test execution time, and can increase substantially the efficiency of test.In addition, realized the simulation test of application programs on mobile terminal due to the present invention, thereby avoided manually-operated, can carry out stable and orderly simulation test operation to the application program on mobile terminal for a long time, this has not only alleviated tester's labor capacity, has also effectively guaranteed validity and the science of test data.
The accompanying drawing explanation
By the description of carrying out below in conjunction with accompanying drawing, above and other purpose of the present invention and characteristics will become apparent, wherein:
Fig. 1 is the process flow diagram illustrated according to the method for being tested in mobile terminal of exemplary embodiment of the present invention;
Fig. 2 is the process flow diagram illustrated according to the method for being tested in control terminal of exemplary embodiment of the present invention;
Fig. 3 is the structured flowchart illustrated according to the device of being tested in mobile terminal of exemplary embodiment of the present invention;
Fig. 4 is the structured flowchart illustrated according to the device of being tested in control terminal of exemplary embodiment of the present invention;
Fig. 5 is the schematic diagram illustrated according to the test data production process of exemplary embodiment of the present invention;
Fig. 6 (a)~(c) is the schematic diagram illustrated according to the test interface of certain input method in Android equipment of exemplary embodiment of the present invention.
Embodiment
Below, describe with reference to the accompanying drawings embodiments of the invention in detail.
Main design of the present invention is, for the execution time that the test event of for example clicking is carried out in the tested application of definite mobile terminal exactly, to be identified for the monitoring point of described test event; After this, sent the information of test instruction and described monitoring point to tested mobile terminal by the control terminal such as PC; Be arranged on the test process of mobile terminal after the information that receives described test instruction and described monitoring point, the state of the rgb value constantly of each according to the monitoring point on mobile terminal screen in test process changes the execution time of determining test event.Particularly, the rgb value when described monitoring point is changed to a stationary value, and, after no longer changing, can think and complete described test event, and the time of initial testing and the difference that reaches the time of stationary value are the execution time of described test event.This method of testing not only can obtain the accurate test execution time, the validity of guaranteed performance test data, and can also increase substantially the efficiency of performance test, reduce the input of manual testing's cost.
Fig. 1 shows the process flow diagram of the preferred embodiment of a kind of method of being tested in mobile terminal of the present invention.A kind of device of being tested in mobile terminal shown in Fig. 3 can be used for realizing the method described in Fig. 1.
With reference to Fig. 1, at step S110, described device receives indication from the control terminal connected and carries out the test instruction of event to be measured and the information of monitoring point with the test parameter of being scheduled to, carry out the simulation test of described event to be measured according to described test instruction, and, in carrying out the process of simulation test, detect the rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time according to the default time interval.
It should be noted that, carry out before this step, the control terminal of described connection is carried out the test instruction of event to be measured according to the test parameter obtained and the Information generation of monitoring point with the test parameter obtained, and the information of described test instruction and the monitoring point that obtains is sent to and described mobile terminal.
While carrying out this step, described device starts a simulation test operation process and carries out event to be measured in described mobile terminal according to described test instruction, the event of described simulation test operation is the event to be measured produced according to the test parameter in described test instruction, the mode of this simulated operation not only can be carried out stable simulation test operation to the application program on described mobile terminal for a long time, and can effectively avoid the manual testing to operate interference and the impact on test data.
In the present invention, in order to obtain the execution time of accurate test event, the demonstration occurred in test process that can obtain certain piece zone in described mobile terminal screen changes, and the time that described demonstration variation occurs by calculatings is determined the execution time of described event to be measured.During concrete enforcement, can obtain in described certain piece zone certain any rgb value and this demonstration occurs in test process change the required time and determine execution time of described event to be measured, this each demonstration constantly occurred on described mobile terminal screen when as monitoring point, monitoring described application program and carry out event to be measured of naming a person for a particular job changes.Particularly, described device can be when described application program starts to carry out described event to be measured, start to detect the rgb value that described monitoring point shows on described mobile terminal screen, and the acquisition time of start-of-record detection, then obtain once every 5ms the rgb value that described monitoring point shows on described mobile terminal screen, and record corresponding acquisition time.
In order described monitoring point each rgb value constantly shown in described mobile terminal screen to be detected, according to an optional embodiment of the present invention, the concrete steps that described device detects the rgb value that described monitoring point shows in described mobile terminal screen can comprise: described device obtains the view data of described mobile terminal screen; According to the view data acquisition of described mobile terminal screen and the corresponding rgb value of screen coordinate of described monitoring point.
According to one exemplary embodiment of the present invention, when described mobile terminal is Android system, the concrete steps that described device obtains the view data of described mobile terminal screen can comprise: the view data of obtaining described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
At step S120, wherein, in described simulation test process, when detecting rgb value that described monitoring point shows on described mobile terminal screen, described device becomes while no longer changing, determine the execution time of described event to be measured.
Due to the demonstration of the rgb value of described monitoring point, changing is a progressive process, after so the rgb value shown when described monitoring point is stablized, described device is optional takes away the acquisition time A that the detects start time as simulation test of beginning, the rgb value shown when described monitoring point is changed into a given rgb value and while no longer changing in the simulation test process, very first time value after the rgb value of described monitoring point can being stablized is defined as the concluding time B of simulation test, then determine the execution time of simulation test by the mistiming between calculating A and B, execution time of event to be measured namely, when described event to be measured needs repeated multiple times test, can repeatedly detect the rgb value that described monitoring point shows constantly at each, and obtain a plurality of execution results of event to be measured.
Particularly, according to another optional embodiment of the present invention, described device determines that the concrete steps of the execution time of described event to be measured can comprise: when described device obtains described simulation test and starts to detect, the time value A of record and described monitoring point are changed to described given rgb value and corresponding very first time value B while no longer changing; Described device is defined as the difference between time value A and B the execution time of described event to be measured.The time data tested out like this is accurate, science not only, and interference and the impact that can effectively avoid manual operation to bring to test data.
At step S130, described device will comprise that the execution result of the execution time of the described event to be measured of obtaining sends to described control terminal.
In addition, also it should be noted that, in the embodiment shown in fig. 1, communicate by the usb bus agreement between the control terminal of described mobile terminal and described connection.
Fig. 2 shows the process flow diagram of the preferred embodiment of a kind of method of being tested in control terminal of the present invention.A kind of device of being tested in control terminal shown in Fig. 4 can be used for realizing the method described in Fig. 2.
With reference to Fig. 2, at step S210, described device obtains the information of test parameter and monitoring point.
Wherein, described monitoring point be certain piece viewing area in the mobile terminal screen be connected with described control terminal certain a bit, and described certain piece viewing area, in the front and back process of test, obvious change can occur, the rgb value that therefore described monitoring point shows in the mobile terminal of described connection is carried out the front and back process of test is to there being obvious variation.
It is to be noted, described test parameter can be the control ID in application program to be measured, it can be also the position of control to be measured in described Application Program Interface, this the present invention is not done to concrete restriction, as long as the mobile terminal of described connection can be carried out test operation to described application program according to described test parameter.During concrete enforcement, described device can provide a UI interactive interface in described control terminal, in order to the test parameter that obtains user's input and the information of monitoring point.
Because needing the tester, foregoing these test parameters understand composition and the layout of the interface resources in program code, remove again to be familiar with and to understand program code for fear of the tester, according to a preferred embodiment of the present invention, the screen coordinate that described test parameter is operating point.During concrete enforcement, the user can input by foregoing UI interactive interface the screen coordinate of described operating point, as long as described application program can capture according to the screen coordinate of described operating point the operation that described operating point is carried out, the simulated operation to this control can be realized in the roughly screen position that the tester only need to estimate according to the mobile terminal of described connection control to be measured in described application program like this.
In addition, because the mobile terminal of described connection may be subject to interference and the impact of various abnormal factorses at test process, in order to reduce interference and the impact of abnormal interference on the validity of the test data of the mobile terminal of described connection, according to another preferred embodiment of the invention, described test parameter also comprises the loop test number of times.During specific implementation, the user can be by foregoing UI interactive interface input loop test number of times, repeatedly carry out event to be measured with the mobile terminal of controlling described connection according to described loop test number of times, even if the mobile terminal of described like this connection is subject to the interference of abnormal factors in test process, can obtain a plurality of test datas in order to extremely screen and average value processing by repeatedly carrying out event to be measured, thereby abnormal factors is reduced to minimum to the impact of the validity of the test data of the mobile terminal of described connection, and the accuracy of further guaranteed performance test data.
Consider in test case and also may include a plurality of events to be measured, in order to carry out in order described a plurality of events to be measured, according to another preferred embodiment of the present invention, described test parameter also comprises test interval.During concrete enforcement, the user is except the screen coordinate of a plurality of operating points corresponding by a plurality of events to be measured of foregoing UI interactive interface input, can also carry out the time interval of carrying out between described a plurality of events to be measured by described UI interactive interface input, in order to control the orderly execution of described a plurality of events to be measured.For example, the user can upload repeatedly screen coordinate and the described repeatedly test interval between click event of the operating point of click event, described device converts the test parameter of described user's input to mobile terminal that a concrete test instruction sends to described connection, the mobile terminal of described connection injects orderly test event according to described test instruction in Android system, until complete the execution of a test case.
At step S220, the test parameter that described device generates to obtain is carried out the test instruction of event to be measured.
While carrying out this step, described device can receive the test parameter of user's input and the information of monitoring point by foregoing UI interactive interface, then according to the test parameter of described user's input, generates the test instruction of carrying out event to be measured.
Particularly, the preferred embodiment of the screen coordinate that is operating point according to test parameter of the present invention, the concrete steps that the test parameter that described device generates to obtain is carried out the test instruction of event to be measured can comprise: the screen coordinate of the operating point that described device generates to obtain is carried out the test instruction of event to be measured.
Particularly, the preferred embodiment that also comprises the loop test number of times according to test parameter of the present invention, the concrete steps that the test parameter that described device generates to obtain is carried out the test instruction of event to be measured can comprise: the screen coordinate of the operating point that described device generates to obtain is carried out the test instruction of event to be measured, and described event to be measured is carried out repeatedly according to described loop test number of times.
Particularly, the preferred embodiment that also comprises test interval according to test parameter of the present invention, the concrete steps that the test parameter that described device generates to obtain is carried out the test instruction of event to be measured can comprise: the screen coordinate of the operating point that described device generates to obtain is carried out the test instruction of a plurality of events to be measured, and sequentially carries out described a plurality of event to be measured according to described test interval.
At step S230, described device sends to by the information of described test instruction and the monitoring point obtained the mobile terminal be connected with described control terminal.
During specific implementation, described device can write the information of described test instruction and monitoring point the XML resource file and send to and the described mobile terminal connect, and the mobile terminal of described connection can obtain the information of described test instruction and monitoring point by resolving described XML resource file.
The mobile terminal of described connection receives indication and carries out the test instruction of event to be measured and the information of monitoring point with the test parameter of being scheduled to, carry out the simulation test of described event to be measured according to described test instruction, and, in carrying out the process of simulation test, detect the rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time according to the default time interval; Wherein, in described simulation test process, when rgb value that described monitoring point shows on described mobile terminal screen being detected and no longer change, determine the execution time of described event to be measured; The execution result that will comprise the execution time of the described event to be measured of obtaining sends to described control terminal.
At step S240, described device receives the execution result of the execution time that comprises described event to be measured from the mobile terminal of described connection.
Described device, after obtaining described execution result, carries out Screening Treatment to data, and shows the execution result of the execution time of described event to be measured by UI interactive interface noted earlier.
Particularly, the preferred embodiment that also comprises the loop test number of times according to test parameter of the present invention, the step that described device receives the execution result of the execution time that comprises described event to be measured from the mobile terminal of described connection comprises: described device receives a plurality of execution results of the execution time of described event to be measured from the mobile terminal of described connection.
Particularly, the preferred embodiment that also comprises test interval according to test parameter of the present invention, the step that described device receives the execution result of the execution time that comprises described event to be measured from the mobile terminal of described connection comprises: described device receives the execution result of the execution time of described a plurality of events to be measured from the mobile terminal of described connection.
In addition, also it should be noted that, in the embodiment shown in Figure 2, communicate by the usb bus agreement between the mobile terminal of described control terminal and described connection.
Fig. 3 shows the preferred embodiment structured flowchart of a kind of method of being tested in mobile terminal of the present invention.
With reference to Fig. 3, described device comprises command reception unit 301, simulation test unit 302, rgb value monitoring means 303, acquiring unit 304 and data transmission unit 305 as a result.
Wherein, command reception unit 301, receive indication for the control terminal from connecting and carry out the test instruction of event to be measured and the information of monitoring point with the test parameter of being scheduled to.
Simulation test unit 302, for carrying out the simulation test of described event to be measured according to described test instruction.
Rgb value monitoring means 303, for carrying out the process of simulation test, detect the rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time according to the default time interval.
Acquiring unit 304 as a result, while no longer changing for rgb value that described monitoring point shows on described mobile terminal screen detected when described rgb value monitoring means 303, determine the execution time of described event to be measured.
Data transmission unit 305, send to described control terminal for the execution result of execution time that will comprise the described event to be measured of obtaining.
In order described monitoring point each rgb value constantly shown in described mobile terminal screen to be detected, according to an optional embodiment of the present invention, the concrete processing of the rgb value that the described rgb value monitoring means 303 described monitoring points of detection show in described mobile terminal screen can comprise: the view data of obtaining described mobile terminal screen; According to the view data acquisition of described mobile terminal screen the corresponding rgb value of screen coordinate of record and described monitoring point.
According to one exemplary embodiment of the present invention, when described mobile terminal is Android system, the concrete processing that described rgb value monitoring means 303 obtains the view data of described mobile terminal screen can comprise: the view data of obtaining described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
Due to the demonstration of the rgb value of described monitoring point, changing is a progressive process, therefore according to another optional embodiment of the present invention, described acquiring unit as a result 304 determines that the concrete processing of the execution time of described events to be measured can comprise: corresponding very first time value B when when obtaining described simulation test and starting to detect, the time value A of record and described monitoring point are changed to described given rgb value; Difference between time value A and B is defined as to the execution time of described event to be measured.
In addition, also it should be noted that, in the embodiment shown in fig. 3, communicate by the usb bus agreement between the control terminal of described mobile terminal and described connection.
Fig. 4 shows the preferred embodiment structured flowchart of a kind of method of being tested in control terminal of the present invention.
With reference to Fig. 4, described device comprises test interface unit 401, test instruction generation unit 402, instruction sending unit 403 and data receiver unit 404.
Wherein, test interface unit 401 is for obtaining the information of test parameter and monitoring point.
Instruction generation unit 402 is for generating the test instruction of carrying out event to be measured with the test parameter obtained.
Instruction sending unit 403 sends to for the information by described test instruction and the monitoring point obtained the mobile terminal be connected with described control terminal.
Data receiver unit 404 receives the execution result of the execution time that comprises described event to be measured for the mobile terminal from described connection.
Remove again to be familiar with and to understand program code for fear of the tester, according to a preferred embodiment of the present invention, the screen coordinate that described test parameter is operating point.
Particularly, the preferred embodiment of the screen coordinate that is operating point according to test parameter of the present invention, the screen coordinate of the operating point that described instruction generation unit 402 generates to obtain is carried out the test instruction of event to be measured.
In order to reduce mobile terminal interference and the impact in test process of abnormal factors on described connection, according to another preferred embodiment of the invention, described test parameter also comprises the loop test number of times.
Particularly, the preferred embodiment that also comprises the loop test number of times according to test parameter of the present invention, the screen coordinate of the operating point that described instruction generation unit 402 generates to obtain is carried out the test instruction of event to be measured, and described event to be measured is carried out repeatedly according to described loop test number of times; And described data receiver unit 404 receives a plurality of execution results of the execution time of described event to be measured from the mobile terminal of described connection.
Consider in test case and also may include a plurality of events to be measured, in order to carry out in order described a plurality of events to be measured, according to another preferred embodiment of the present invention, described test parameter also comprises test interval.
Particularly, also comprise test interval according to test parameter of the present invention, the screen coordinate of the operating point that described instruction generation unit 402 generates to obtain is carried out the test instruction of a plurality of events to be measured, and sequentially carries out described a plurality of event to be measured according to described test interval; And described data receiver unit 404 receives the execution result of the execution time of described a plurality of events to be measured from the mobile terminal of described connection.
In addition, also it should be noted that, in the embodiment shown in fig. 4, communicate by the usb bus agreement between the mobile terminal of described control terminal and described connection.
Above each embodiment is except for obtaining the execution time of test, can also be for the described application program of Real-time Obtaining each CPU constantly taken and the internal memory at test process, during concrete enforcement, while on described mobile terminal, being Android system, the API that described device can call Android system to be provided obtains the situation that takies of described CPU usage and internal memory according to the default time interval, and the described data that get are submitted to the PC end and screened and process, thereby obtain the occupation condition data of testing.
Fig. 5 shows the schematic diagram of test data production process of the present invention.
With reference to Fig. 5, described platform user uploads testing software, and test parameter is provided; The data generating test use case that described PC end (being described control terminal) will be uploaded according to the user also is distributed to the mobile terminal execution; Finally, the execution result that described PC end group obtains mobile terminal in historical data carries out denoising, and produces performance report.
Below provide specific embodiment, the present invention is further illustrated.
Fig. 6 shows the interface schematic diagram that in the present invention, certain input method is tested on Android equipment, wherein, what Fig. 6 (a) illustrated is 9 key input panel of this input method, what Fig. 6 (b) illustrated is the symbol input panel of this input method, 26 key input panel of this certain input method that Fig. 6 (c) shows.
Test case 1
Test target: obtain this input method and be switched to the needed time of symbol input panel from 9 key input panel.
During concrete test, the tester can input following screen coordinate at the PC end:
(320,800)
(270,800)
Wherein, what first coordinate meaned is the operating point (referring to Fig. 6 (a)) of " symbol " button correspondence in 9 key input panel, in the simulation of Android equipment, clicking " symbol " button; What the second coordinate meaned is monitoring point (referring to the A point shown in Fig. 6 (a)), for the variation that a certain rectangular area (referring to the rectangle frame shown in Fig. 6 (a) or Fig. 6 (b)) occurs in described simulation test process monitoring screen.
Described PC holds the described coordinate data will got and sends to described Android equipment to carry out, the API that described Android equipment provides by system is to described operating point (320, 800) carrying out simulation clicks, to realize the switching from 9 key input panel to the symbol input panel, in described simulation click process, every 5ms obtains once described monitoring point (270, 800) rgb value shown and corresponding acquisition time thereof, when described monitoring point (270, when 800) rectangular area at place becomes black from white, described monitoring point (270, 800) rgb value is from RGB(255, 255, 255) gradually become RGB(0, 0, 0) and no longer change, according to described monitoring point (270, 800) become RGB(0, 0, 0) first acquisition time time is determined the execution time of this test case.
In addition, the tester also can carry out number of times in PC end input circulation, described Android equipment will repeatedly be simulated and click described operating point (320 according to described testing time, 800), after being finished, described Android equipment will obtain a plurality of time execution results and submit to the PC end, and described PC end to receiving, screened and average value processing by data, and display by web in conjunction with historical data generation test report.
Test case 2
Test target: the performance data of the resource occupation while obtaining this input method input Chinese character.
During concrete test, but tester's input key combines the coordinate stream of corresponding operating point, for example, when input " you ", need to be at the screen coordinate (referring to Fig. 6 (c)) of PC end input " n " button, " i " button and " space " push-botton operation point according to the Pinyin Input rule, owing to relating to a plurality of click event, tester all right input time of interval, the order of clicking in order to control described button.
Described PC end sends to described Android equipment to carry out the coordinate stream got, described Android equipment is carried out simulation to a plurality of coordinates that get and is clicked, to realize the input of " you ", in described simulation click process, every 3s obtains once CPU usage and the EMS memory occupation situation of described input method in equipment, and the data that get are committed to PC end process and display.
As can be seen here, the present invention not only can obtain the accurate test execution time, and can increase substantially the efficiency of test.In addition, realized the simulation test of application programs on described mobile terminal due to the present invention, thereby avoided manually-operated, therefore can carry out stable and orderly simulation test operation to the application program on mobile terminal for a long time, this has not only alleviated tester's labor capacity, has also effectively guaranteed validity and the science of test data.
It may be noted that according to the needs of implementing, each step of describing in the application can be split as to more multi-step, also the part operation of two or more steps or step can be combined into to new step, to realize purpose of the present invention.
Above-mentioned the method according to this invention can be at hardware, in firmware, realize, perhaps be implemented as and can be stored in recording medium (such as CD ROM, RAM, floppy disk, hard disk or magneto-optic disk) in software or computer code, perhaps be implemented the original storage downloaded by network in remote logging medium or nonvolatile machine readable media and the computer code in being stored in the local record medium, thereby method described here can be stored in the use multi-purpose computer, such software on the recording medium of application specific processor or able to programme or specialized hardware (such as ASIC or FPGA) is processed.Be appreciated that, computing machine, processor, microprocessor controller or programmable hardware comprise can store or receive software or computer code memory module (for example, RAM, ROM, flash memory etc.), by computing machine, processor or hardware access and while carrying out, realize disposal route described here when described software or computer code.In addition, when the multi-purpose computer access is used for realizing the code in the processing shown in this, the execution of code is converted to multi-purpose computer for carrying out the special purpose computer in the processing shown in this.
Although with reference to preferred embodiment, mean and described the present invention, it should be appreciated by those skilled in the art that and can carry out various modifications and conversion to these embodiment in the situation that do not break away from the spirit and scope of the present invention that are defined by the claims.

Claims (26)

1. a method of being tested in mobile terminal comprises:
Receive indication from the control terminal connected and carry out the test instruction of event to be measured and the information of monitoring point with the test parameter of being scheduled to, carry out the simulation test of described event to be measured according to described test instruction, and, in carrying out the process of simulation test, detect the rgb value that described monitoring point shows in described mobile terminal screen and record corresponding acquisition time according to the default time interval;
Wherein, in described simulation test process, when rgb value that described monitoring point shows on described mobile terminal screen being detected and no longer change, determine the execution time of described event to be measured;
The execution result that will comprise the execution time of the described event to be measured of obtaining sends to described control terminal.
2. the method for claim 1, is characterized in that, the step of the rgb value that the described monitoring point of described detection shows in described mobile terminal screen comprises:
Obtain the view data of described mobile terminal screen;
According to the view data acquisition of described mobile terminal screen and the corresponding rgb value of screen coordinate of described monitoring point.
3. method as claimed in claim 2, is characterized in that, when described mobile terminal is Android system, the described step of obtaining the view data of described mobile terminal screen comprises:
Obtain the view data of described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
4. method as claimed in claim 3, is characterized in that, the step of the execution time of described definite described event to be measured comprises:
When obtaining described simulation test and starting to detect, the rgb value of the time value A of record and described monitoring point becomes given rgb value and corresponding first time value B while no longer changing;
Difference between time value A and B is defined as to the execution time of described event to be measured.
5. method as described as claim 1~4 any one, is characterized in that, between the control terminal of described mobile terminal and described connection, by the usb bus agreement, communicates.
6. the device of a test Android application program in mobile terminal comprises:
The command reception unit, receive indication for the control terminal from connecting and carry out the test instruction of event to be measured and the information of monitoring point with the test parameter of being scheduled to;
Simulation test unit, for carrying out the simulation test of described event to be measured according to described test instruction;
The rgb value monitoring means, for carrying out the process of simulation test, detect the rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time according to the default time interval;
Acquiring unit as a result, while no longer changing for rgb value that described monitoring point shows on described mobile terminal screen detected when described rgb value monitoring means, determine the execution time of described event to be measured;
Data transmission unit, send to described control terminal for the execution result of execution time that will comprise the described event to be measured of obtaining.
7. device as claimed in claim 6, is characterized in that, the processing that described rgb value monitoring means detects the rgb value that described monitoring point shows in described mobile terminal screen comprises:
Obtain the view data of described mobile terminal screen;
According to the view data acquisition of described mobile terminal screen the corresponding rgb value of screen coordinate of record and described monitoring point.
8. device as claimed in claim 7, is characterized in that, when described mobile terminal is Android system, the processing that described rgb value monitoring means obtains the view data of described mobile terminal screen comprises:
Obtain the view data of described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
9. device as claimed in claim 8, is characterized in that, described acquiring unit as a result determines that the processing of the execution time of described event to be measured comprises:
When obtaining described simulation test and starting to detect, the rgb value of the time value A of record and described monitoring point becomes given rgb value and corresponding first time value B while no longer changing;
Difference between time value A and B is defined as to the execution time of described event to be measured.
10. device as described as claim 6~9 any one, is characterized in that, between the control terminal of described mobile terminal and described connection, by the usb bus agreement, communicates.
11. a method of being tested in control terminal comprises:
Obtain the information of test parameter and monitoring point;
The test instruction of event to be measured is carried out in generation with the test parameter obtained;
The information of described test instruction and the monitoring point obtained is sent to the mobile terminal be connected with described control terminal;
Receive the execution result of the execution time that comprises described event to be measured from the mobile terminal of described connection.
12. method as claimed in claim 11, is characterized in that, the screen coordinate that described test parameter is operating point.
13. method as claimed in claim 12, is characterized in that, the step that described generation is carried out the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate that generates the operating point to obtain is carried out the test instruction of event to be measured.
14. method as claimed in claim 12, is characterized in that, described test parameter also comprises the loop test number of times.
15. method as claimed in claim 14, is characterized in that,
The step that described generation is carried out the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate that generates the operating point to obtain is carried out the test instruction of event to be measured, and described event to be measured is carried out repeatedly according to described loop test number of times; Accordingly,
The step that the described mobile terminal from described connection receives the execution result of the execution time that comprises described event to be measured comprises: a plurality of execution results that receive the execution time of described event to be measured from the mobile terminal of described connection.
16. method as claimed in claim 12, is characterized in that, described test parameter also comprises test interval.
17. will go 16 described methods as right, it is characterized in that,
The step that described generation is carried out the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate that generates the operating point to obtain is carried out the test instruction of a plurality of events to be measured, and sequentially carries out described a plurality of event to be measured according to described test interval; Accordingly,
The step that the described mobile terminal from described connection receives the execution result of the execution time that comprises described event to be measured comprises: the execution result that receives the execution time of described a plurality of events to be measured from the mobile terminal of described connection.
18. method as described as claim 11~17 any one, is characterized in that, communicates by the usb bus agreement between described control terminal and the described mobile terminal be connected.
19. a device of being tested in control terminal comprises:
Test interface unit, for obtaining the information of test parameter and monitoring point;
The instruction generation unit, for generating the test instruction of carrying out event to be measured with the test parameter obtained;
Instruction sending unit, send to for the information by described test instruction and the monitoring point obtained the mobile terminal be connected with described control terminal;
The data receiver unit, receive the execution result of the execution time comprise described event to be measured for the mobile terminal from described connection.
20. device as claimed in claim 19, is characterized in that, the screen coordinate that described test parameter is operating point.
21. device as claimed in claim 20, is characterized in that, the screen coordinate of the operating point that described instruction generation unit generates to obtain is carried out the test instruction of event to be measured.
22. device as claimed in claim 20, is characterized in that, described test parameter also comprises the loop test number of times.
23. device as claimed in claim 22, is characterized in that,
The screen coordinate of the operating point that described instruction generation unit generates to obtain is carried out the test instruction of event to be measured, and described event to be measured is carried out repeatedly according to described loop test number of times; Accordingly,
Described data receiver unit receives a plurality of execution results of the execution time of described event to be measured from the mobile terminal of described connection.
24. device as claimed in claim 20, is characterized in that, described test parameter also comprises test interval.
25. will remove 24 described devices as right, it is characterized in that,
The screen coordinate of the operating point that described instruction generation unit generates to obtain is carried out the test instruction of a plurality of events to be measured, and sequentially carries out described a plurality of event to be measured according to described test interval; Accordingly,
Described data receiver unit receives the execution result of the execution time of described a plurality of events to be measured from the mobile terminal of described connection.
26. device as described as claim 19~25 any one, is characterized in that, communicates by the usb bus agreement between described control terminal and the described mobile terminal be connected.
CN201310375474.XA 2013-08-26 2013-08-26 Method of testing and device Active CN103455403B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310375474.XA CN103455403B (en) 2013-08-26 2013-08-26 Method of testing and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310375474.XA CN103455403B (en) 2013-08-26 2013-08-26 Method of testing and device

Publications (2)

Publication Number Publication Date
CN103455403A true CN103455403A (en) 2013-12-18
CN103455403B CN103455403B (en) 2016-03-30

Family

ID=49737804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310375474.XA Active CN103455403B (en) 2013-08-26 2013-08-26 Method of testing and device

Country Status (1)

Country Link
CN (1) CN103455403B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957504A (en) * 2014-04-21 2014-07-30 百度在线网络技术(北京)有限公司 Positioning service assessment method, device and system
CN103955428A (en) * 2014-04-30 2014-07-30 百度在线网络技术(北京)有限公司 Method and equipment for testing response speed of application
CN104035869A (en) * 2014-06-19 2014-09-10 科大讯飞股份有限公司 Application evaluation method, terminal, and server
CN105224437A (en) * 2014-06-11 2016-01-06 腾讯科技(深圳)有限公司 A kind ofly obtain affairs on mobile terminal and perform method and apparatus consuming time
CN105872534A (en) * 2016-04-05 2016-08-17 Tcl海外电子(惠州)有限公司 Terminal testing method and device
CN108073529A (en) * 2017-08-17 2018-05-25 北京微应软件科技有限公司 The input and output analogy method and simulation system of mobile terminal
CN110954214A (en) * 2018-09-27 2020-04-03 北京京东尚科信息技术有限公司 Equipment testing method, device and system
CN116107911A (en) * 2023-03-29 2023-05-12 杭州海康威视数字技术股份有限公司 Privacy compliance automatic auditing method, device and system based on event replay

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685338A (en) * 2008-09-27 2010-03-31 联想(北京)有限公司 Method of saving system resources of notebook computer and notebook computer
CN101968849A (en) * 2010-09-27 2011-02-09 杭州电子科技大学 Picture red eye removal method based on 3G smart phone
US20120225719A1 (en) * 2011-03-04 2012-09-06 Mirosoft Corporation Gesture Detection and Recognition

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685338A (en) * 2008-09-27 2010-03-31 联想(北京)有限公司 Method of saving system resources of notebook computer and notebook computer
CN101968849A (en) * 2010-09-27 2011-02-09 杭州电子科技大学 Picture red eye removal method based on 3G smart phone
US20120225719A1 (en) * 2011-03-04 2012-09-06 Mirosoft Corporation Gesture Detection and Recognition

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957504A (en) * 2014-04-21 2014-07-30 百度在线网络技术(北京)有限公司 Positioning service assessment method, device and system
CN103955428A (en) * 2014-04-30 2014-07-30 百度在线网络技术(北京)有限公司 Method and equipment for testing response speed of application
CN105224437A (en) * 2014-06-11 2016-01-06 腾讯科技(深圳)有限公司 A kind ofly obtain affairs on mobile terminal and perform method and apparatus consuming time
CN104035869A (en) * 2014-06-19 2014-09-10 科大讯飞股份有限公司 Application evaluation method, terminal, and server
CN105872534A (en) * 2016-04-05 2016-08-17 Tcl海外电子(惠州)有限公司 Terminal testing method and device
CN108073529A (en) * 2017-08-17 2018-05-25 北京微应软件科技有限公司 The input and output analogy method and simulation system of mobile terminal
CN110954214A (en) * 2018-09-27 2020-04-03 北京京东尚科信息技术有限公司 Equipment testing method, device and system
CN116107911A (en) * 2023-03-29 2023-05-12 杭州海康威视数字技术股份有限公司 Privacy compliance automatic auditing method, device and system based on event replay

Also Published As

Publication number Publication date
CN103455403B (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN103455403B (en) Method of testing and device
CN107341098B (en) Software performance testing method, platform, equipment and storage medium
KR102058976B1 (en) Application method and device
CN101778307B (en) Device for testing functions of set top box
CN104331373A (en) Monkey test system and method
CN105528117A (en) Method and device for acquiring scanning frequency of touch panel
CN104035812A (en) Method and system for recommending applications to electronic device
US20140258989A1 (en) Method and system for automating a scene-based test
CN103634592A (en) Automatic test method and system for intelligent televisions
CN103544100A (en) Method, system and client side for testing APP of portable data processing equipment
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN104820565B (en) Slide command processing method and terminal
CN111061555A (en) Operation and maintenance method based on infrastructure and related device
CN104301714A (en) Method and device for detecting channel switching response time of television equipment
CN109739712B (en) FPGA accelerator card transmission performance test method, device, equipment and medium
CN105138463A (en) Testing method and system for mobile terminal software
CN108023905B (en) Internet of things application system and method
CN111723515A (en) Method, device and system for operating operator
CN105446849A (en) Product testing method and device
CN102105868A (en) Performance analysis during visual creation of graphics images
CN104216823A (en) Automatic testing method and master control device
US20180336122A1 (en) Generating application flow entities
CN106708710A (en) Thread jamming identification method and apparatus
CN105138458A (en) Method and system for recording automatic testing scripts by combining intelligent terminal and computer terminal
CN106484604B (en) Application test control 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
C14 Grant of patent or utility model
GR01 Patent grant