CN103455403B - Method of testing and device - Google Patents

Method of testing and device Download PDF

Info

Publication number
CN103455403B
CN103455403B CN201310375474.XA CN201310375474A CN103455403B CN 103455403 B CN103455403 B CN 103455403B CN 201310375474 A CN201310375474 A CN 201310375474A CN 103455403 B CN103455403 B CN 103455403B
Authority
CN
China
Prior art keywords
test
measured
event
mobile terminal
instruction
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.)
Active
Application number
CN201310375474.XA
Other languages
Chinese (zh)
Other versions
CN103455403A (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

Landscapes

  • Debugging And Monitoring (AREA)
  • Telephone Function (AREA)

Abstract

A kind of method providing method and apparatus and carrying out in control terminal carrying out testing in the terminal to test and device.Wherein, a kind of method of carrying out testing in the terminal, comprise: receive instruction from control terminal and perform the test instruction of event to be measured and the information of monitoring point with predetermined test parameter, perform the simulation test of event to be measured according to test instruction, detect according to the time interval of presetting rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time; When the rgb value detecting that described monitoring point shows on described mobile terminal screen no longer changes, determine the execution time of described event to be measured; The execution result of the execution time of described event to be measured is sent to described control terminal.Adopt the method for the invention and device can not only obtain the accurate test execution time, and the efficiency of test can be increased substantially.

Description

Method of testing and device
Technical field
The application relate to a kind of carry out testing in the terminal method and apparatus and a kind of method and apparatus carrying out testing in control terminal, particularly relate to a kind of rgb value according to each moment display of monitoring point in test process and determine the technology of 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 get more and more, consider that these equipment are subject to all many-sided restrictions such as size, volume, hardware, meeting can be more and more higher to the performance requirement of the application program that equipment carries, and thus how to obtain accurate performance test data in such devices and be of great significance for Develop Application System tool on these equipment.But, because performance test is very high to data accuracy requirement, so difficulty of test is very large, part-time performance test needs to be accurate to Millisecond, and manual testing cannot realize at all, and the test item that manually can complete individually also needs to drop into a large amount of manpower and carries out long data acquisition.So not only consume a large amount of manpower, extend the construction cycle, simultaneously also cannot the science of guaranteed performance test data.
At present, market mainly comprises following three types of technology scheme for the performance test of application software on smart machine: first kind scheme is the difference of the encoding scheme by comparison Code obtaining place Project Product and competing product, and Performance Evaluation is carried out to code efficiency, output performance analysis result.But this scheme can be subject to a large amount of human factor impacts in implementation process, and the data therefore obtained are rigorous not, and the performance test very high for some accuracy requirements has little significance.Equations of The Second Kind scheme is mode performance computing time being performed surrounding time by the mode printing of injecting codes.Because this mode needs tester to understand the implementation of the code of each competing product in detail, then obtain performance test data by coding, therefore the cost of this scheme acquisition data is too high; In addition, because each software vendor is for the process protection of self rights and interests often being prevented to decompiling to code, further increase code injection and the cost comparing encoding scheme.3rd class scheme utilizes the operating process of software control high-speed camera to software to record and analyze, to obtain the time performance that application software operation performs.But this scheme needs buy expensive test equipment and drop into suitable manpower, and thus testing cost is higher, and efficiency is lower.
Summary of the invention
The object of the present invention is to provide a kind of carry out testing in the terminal method and apparatus and control terminal in carry out the method and apparatus tested.Adopt the method for the invention and device can not only obtain the accurate test execution time, and the efficiency of test can be increased substantially.
According to an aspect of of the present present invention, a kind of method of carrying out testing in the terminal is provided, described method comprises: receive instruction from the control terminal connected and perform the test instruction of event to be measured and the information of monitoring point with predetermined test parameter, the simulation test of described event to be measured is performed according to described test instruction, and in the process performing simulation test, detect according to the time interval of presetting rgb value that described monitoring point shows in described mobile terminal screen and record corresponding acquisition time; Wherein, in described simulation test process, when the rgb value detecting that described monitoring point shows on described mobile terminal screen no longer changes, determine the execution time of described event to be measured; The execution result of the execution time comprising the event to be measured of described acquisition is sent to described control terminal.
Preferably, the step of rgb value that the described monitoring point of described detection shows in described mobile terminal screen comprises: the view data obtaining described mobile terminal screen; View data according to described mobile terminal screen obtains the rgb value corresponding to the screen coordinate of described monitoring point.
Preferably, when described mobile terminal is Android system, the step of the view data of the described mobile terminal screen of described acquisition comprises: the view data 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: obtain first time value B corresponding when the time value A of record and the rgb value of described monitoring point become given rgb value and no longer change when described simulation test starts to detect; Difference between time value A and B is defined as the execution time of described event to be measured.
Preferably, communicated by usb bus agreement between the control terminal of described mobile terminal and described connection.
According to the another aspect of invention, a kind of device testing Android application program is in the terminal provided, comprising: instruction reception unit, performing the test instruction of event to be measured and the information of monitoring point for receiving instruction from the control terminal connected with predetermined test parameter; Simulation test unit, for performing the simulation test of described event to be measured according to described test instruction; Rgb value monitoring means, in the process performing simulation test, detects according to the time interval of presetting rgb value that described monitoring point shows on described mobile terminal screen and records corresponding acquisition time; Result acquiring unit, for when described rgb value monitoring means detects that the rgb value that described monitoring point shows on described mobile terminal screen no longer changes, determines the execution time of described event to be measured; Data transmission unit, the execution result for the execution time of the event to be measured by comprising described acquisition sends to described control terminal.
Preferably, the process that described rgb value monitoring means detects the rgb value that described monitoring point shows in described mobile terminal screen comprises: the view data obtaining described mobile terminal screen; Obtain according to the view data of described mobile terminal screen and record the rgb value corresponding to the screen coordinate of described monitoring point.
Preferably, when described mobile terminal is Android system, the process that described rgb value monitoring means obtains the view data of described mobile terminal screen comprises: the view data 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 result acquiring unit determines that the process of the execution time of described event to be measured comprises: obtain first time value B corresponding when the time value A of record and the rgb value of described monitoring point become given rgb value and no longer change when described simulation test starts to detect; Difference between time value A and B is defined as the execution time of described event to be measured.
Preferably, communicated by usb bus agreement between the control terminal of described mobile terminal and described connection.
According to the another aspect of invention, a kind of method of carrying out testing in control terminal is provided, comprises: the information obtaining test parameter and monitoring point; Generate the test instruction performing event to be measured with the test parameter obtained; Described test instruction and the information of the monitoring point of acquisition are sent to the mobile terminal be connected with described control terminal; The execution result comprising the execution time of described event to be measured is received from the mobile terminal of described connection.
Preferably, described test parameter is the screen coordinate of operating point.
Preferably, the step that described generation performs the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate generating the operating point obtained performs the test instruction of event to be measured.
Preferably, described test parameter also comprises loop test number of times.
Preferably, the step that described generation performs the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate generating the operating point obtained performs the test instruction of event to be measured, and described event to be measured performs repeatedly according to described loop test number of times; Accordingly, the step that the described reception of the mobile terminal from described connection comprises the execution result of the execution time of described event to be measured comprises: the multiple execution results receiving 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 performs the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate generating the operating point obtained performs the test instruction of multiple event to be measured, and performs described multiple event to be measured according to described test interval order; Accordingly, the step that the described reception of the mobile terminal from described connection comprises the execution result of the execution time of described event to be measured comprises: the execution result receiving the execution time of described multiple event to be measured from the mobile terminal of described connection.
Preferably, communicated by usb bus agreement between described control terminal with the described mobile terminal be connected.
According to the another aspect of invention, a kind of device carrying out testing in control terminal is provided, comprises: test interface unit, for obtaining the information of test parameter and monitoring point; Instruction generation unit, the test parameter for generating to obtain performs the test instruction of event to be measured; Instruction sending unit, for sending to the mobile terminal be connected with described control terminal by described test instruction and the information of the monitoring point of acquisition; Data receipt unit, receives for the mobile terminal from described connection the execution result comprising the execution time of described event to be measured.
Preferably, described test parameter is the screen coordinate of operating point.
Preferably, described instruction generation unit generates the test instruction performing event to be measured with the screen coordinate of the operating point obtained.
Preferably, described test parameter also comprises loop test number of times.
Preferably, described instruction generation unit generates the test instruction performing event to be measured with the screen coordinate of the operating point obtained, and described event to be measured performs repeatedly according to described loop test number of times; Accordingly, described data receipt unit receives multiple 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, described instruction generation unit generates the test instruction performing multiple event to be measured with the screen coordinate of the operating point obtained, and performs described multiple event to be measured according to described test interval order; Accordingly, described data receipt unit receives the execution result of the execution time of described multiple event to be measured from the mobile terminal of described connection.
Preferably, communicated by usb bus agreement between described control terminal with the described mobile terminal be connected.
Beneficial effect
Compared with prior art, the present invention has the following advantages:
The present invention can not only obtain the accurate test execution time, and can increase substantially the efficiency of test.In addition, because the present invention achieves the simulation test of application programs on mobile terminals, thus manual operation is avoided, stable and orderly simulation test operation can be carried out for a long time to the application program on mobile terminal, this not only alleviates the labor capacity of tester, also effectively ensure that validity and the science of test data.
Accompanying drawing explanation
By the description carried out below in conjunction with accompanying drawing, above and other object of the present invention and feature will become apparent, wherein:
Fig. 1 illustrates the process flow diagram carrying out the method for testing in the terminal according to exemplary embodiment of the present invention;
Fig. 2 illustrates the process flow diagram carrying out the method for testing in control terminal according to exemplary embodiment of the present invention;
Fig. 3 illustrates the structured flowchart carrying out the device tested in the terminal according to exemplary embodiment of the present invention;
Fig. 4 illustrates the structured flowchart carrying out the device tested in control terminal according to exemplary embodiment of the present invention;
Fig. 5 is the schematic diagram of the test data production process illustrated according to exemplary embodiment of the present invention;
Fig. 6 (a) ~ (c) is the schematic diagram of the test interface of certain input method in Android device illustrated according to exemplary embodiment of the present invention.
Embodiment
Below, embodiments of the invention are described in detail with reference to the accompanying drawings.
Central scope of the present invention is, in order to determine that the tested application of mobile terminal performs the execution time of the test event such as clicked exactly, determines 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 of such as PC; The test process being arranged on mobile terminal is after the information receiving described test instruction and described monitoring point, and the state according to the rgb value in each moment of the monitoring point on mobile terminal screen in test process changes the execution time 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 is the execution time of described test event with the difference of the time reaching stationary value.This method of testing can not only obtain the accurate test execution time, the validity of guaranteed performance test data, and the efficiency that can also increase substantially performance test, reduces the input of manual testing's cost.
Fig. 1 shows a kind of process flow diagram carrying out the preferred embodiment of the method for testing in the terminal of the present invention.A kind of device carrying out testing in the terminal shown in Fig. 3 can be used for the method realized described in Fig. 1.
With reference to Fig. 1, in step S110, described device receives instruction from the control terminal connected and performs the test instruction of event to be measured and the information of monitoring point with predetermined test parameter, the simulation test of described event to be measured is performed according to described test instruction, and in the process performing simulation test, detect according to the time interval of presetting rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time.
It should be noted that, before performing this step, the control terminal of described connection generates according to the information of the test parameter obtained and monitoring point the test instruction performing event to be measured with the test parameter obtained, and the information of the monitoring point of described test instruction and acquisition is sent to and described mobile terminal.
When performing this step, described device starts a simulation test operation process according to described test instruction and performs event to be measured in described mobile terminal, 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 carry out stable simulation test operation to the application program on described mobile terminal for a long time, and can effectively avoid manual testing to operate interference on test data and impact.
In the present invention, in order to the execution time of accurate test event can be obtained, the display occurred in the test process change in certain block region in described mobile terminal screen can being obtained, determining the execution time of described event to be measured by calculating the time that described display change occurs.During concrete enforcement, the execution time that certain any rgb value time occurred in test process needed for this display change determines described event to be measured can be obtained in certain block region described, this display change occurred in each moment monitored as monitoring point when described application program performs event to be measured on described mobile terminal screen.Particularly, described device can when described application program starts to perform described event to be measured, start to detect the rgb value that described monitoring point shows on described mobile terminal screen, and record starts the acquisition time of detection, then obtain the once rgb value that shows on described mobile terminal screen of described monitoring point every 5ms, and record corresponding acquisition time.
In order to the rgb value of described monitoring point each moment display in described mobile terminal screen be detected, according to an 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; View data according to described mobile terminal screen obtains the rgb value corresponding to the 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 obtaining described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
In step S120, wherein, in described simulation test process, when described device detects that the rgb value change that described monitoring point shows on described mobile terminal screen no longer changes, determine the execution time of described event to be measured.
Display change due to the rgb value of described monitoring point is a progressive process, so after the rgb value of described monitoring point display is stable, the described device optional start time of acquisition time A as simulation test taking away detection of beginning, when the rgb value shown when described monitoring point is changed into a given rgb value and no longer changes in simulation test process, very first time value after the rgb value of described monitoring point can being stablized is defined as the end time B of simulation test, then the execution time of simulation test is determined by the mistiming calculated between A and B, the namely execution time of event to be measured, when described event to be measured needs repeated multiple times test, repeatedly can detect the rgb value that described monitoring point showed in each moment, and obtain multiple execution results of event to be measured.
Particularly, according to another embodiment of the present invention, described device determines that the concrete steps of the execution time of described event to be measured can comprise: described device to obtain when described simulation test starts to detect very first time value B corresponding when the time value A of record and described monitoring point are changed to described given rgb value and no longer change; Difference between time value A and B is defined as the execution time of described event to be measured by described device.The time data tested out so not only accurately, science, and the interference can effectively avoiding manual operation to bring to test data and impact.
In step S130, the execution result of the execution time comprising the event to be measured of described acquisition is sent to described control terminal by described device.
In addition, also it should be noted that, in the embodiment shown in fig. 1, communicated by usb bus agreement between the control terminal of described mobile terminal and described connection.
Fig. 2 shows a kind of process flow diagram carrying out the preferred embodiment of the method for testing in control terminal of the present invention.A kind of device carrying out testing in control terminal shown in Fig. 4 can be used for the method realized described in Fig. 2.
With reference to Fig. 2, in step S210, described device obtains the information of test parameter and monitoring point.
Wherein, described monitoring point be certain block viewing area in the mobile terminal screen be connected with described control terminal certain a bit, and certain block viewing area described, in the front and back process of test, obvious change can occur, therefore described monitoring point to perform in the front and back process of test the rgb value that shows to there being obvious change at the mobile terminal of described connection.
It is to be noted, described test parameter can be the control ID in application program to be measured, also can be the position of control to be measured in described Application Program Interface, the mobile terminal of described connection concrete restriction do not done to this present invention, as long as can perform test operation according to described test parameter to described application program.During concrete enforcement, described device can provide a UI interactive interface in described control terminal, in order to obtain test parameter and the information of monitoring point of user's input.
Because these test parameters foregoing need tester to understand composition and the layout of the interface resources in program code, in order to avoid tester goes to be familiar with and to understand program code again, according to a preferred embodiment of the present invention, described test parameter is the screen coordinate of operating point.During concrete enforcement, user inputs the screen coordinate of described operating point by foregoing UI interactive interface, as long as described application program can capture according to the screen coordinate of described operating point the operation performed described operating point, such tester only needs to estimate the roughly screen position of control to be measured in described application program according to the mobile terminal of described connection can realize the simulated operation to this control.
In addition, because the mobile terminal of described connection may to be subject to interference and the impact of various abnormal factors at test process, in order to reduce abnormal interference to the interference of the validity of the test data of the mobile terminal of described connection and impact, according to another preferred embodiment of the invention, described test parameter also comprises loop test number of times.During specific implementation, user is by foregoing UI interactive interface input loop test number of times, event to be measured is repeatedly performed according to described loop test number of times with the mobile terminal controlling described connection, even if the mobile terminal of described like this connection is subject to the interference of abnormal factors in test process, multiple test data can be obtained to carry out screening anomaly and average value processing by repeatedly performing event to be measured, thus the impact of abnormal factors on the validity of the test data of the mobile terminal of described connection is reduced to minimum, and the accuracy of further guaranteed performance test data.
Consider in test case and also may include multiple event to be measured, in order to perform described multiple event to be measured in order, according to another preferred embodiment of the present invention, described test parameter also comprises test interval.During concrete enforcement, user is except inputting the screen coordinate of multiple operating points corresponding to multiple event to be measured by foregoing UI interactive interface, the time interval performed between described multiple event to be measured can also be performed, in order to control the orderly execution of described multiple event to be measured by described UI interactive interface input.Such as, user can upload repeatedly the screen coordinate of the operating point of click event and described test interval repeatedly between click event, the test parameter that described user inputs is converted to the mobile terminal that a concrete test instruction sends to described connection by described device, 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.
In step S220, described device generates the test instruction performing event to be measured with the test parameter obtained.
When performing this step, described device receives the test parameter of user's input and the information of monitoring point by foregoing UI interactive interface, then generates according to the test parameter that described user inputs the test instruction performing event to be measured.
Particularly, be the preferred embodiment of the screen coordinate of operating point according to test parameter of the present invention, the concrete steps that described device generation performs the test instruction of event to be measured with the test parameter obtained can comprise: described device generates the test instruction performing event to be measured with the screen coordinate of the operating point obtained.
Particularly, the preferred embodiment of loop test number of times is also comprised according to test parameter of the present invention, the concrete steps that described device generation performs the test instruction of event to be measured with the test parameter obtained can comprise: described device generates the test instruction performing event to be measured with the screen coordinate of the operating point obtained, and described event to be measured performs repeatedly according to described loop test number of times.
Particularly, the preferred embodiment of test interval is also comprised according to test parameter of the present invention, the concrete steps that described device generation performs the test instruction of event to be measured with the test parameter obtained can comprise: described device generates the test instruction performing multiple event to be measured with the screen coordinate of the operating point obtained, and sequentially performs described multiple event to be measured according to described test interval.
In step S230, described test instruction and the information of the monitoring point of acquisition are sent to the mobile terminal be connected with described control terminal by described device.
During specific implementation, the information write XML resource file of described test instruction and monitoring point can send to and the described mobile terminal connect by described device, and the mobile terminal of described connection obtains the information of described test instruction and monitoring point by resolving described XML resource file.
The mobile terminal of described connection receives instruction and performs the test instruction of event to be measured and the information of monitoring point with predetermined test parameter, the simulation test of described event to be measured is performed according to described test instruction, and in the process performing simulation test, detect according to the time interval of presetting rgb value that described monitoring point shows on described mobile terminal screen and record corresponding acquisition time; Wherein, in described simulation test process, when the rgb value detecting that described monitoring point shows on described mobile terminal screen no longer changes, determine the execution time of described event to be measured; The execution result of the execution time comprising the event to be measured of described acquisition is sent to described control terminal.
In step S240, described device receives from the mobile terminal of described connection the execution result comprising the execution time of described event to be measured.
Described device, after the described execution result of acquisition, carries out Screening Treatment to data, and is shown the execution result of the execution time of described event to be measured by UI interactive interface noted earlier.
Particularly, also comprise the preferred embodiment of loop test number of times according to test parameter of the present invention, described device receives from the mobile terminal of described connection the step comprising the execution result of the execution time of described event to be measured and comprises: described device receives multiple execution results of the execution time of described event to be measured from the mobile terminal of described connection.
Particularly, also comprise the preferred embodiment of test interval according to test parameter of the present invention, described device receives from the mobile terminal of described connection the step comprising the execution result of the execution time of described event to be measured and comprises: described device receives the execution result of the execution time of described multiple event 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, communicated by usb bus agreement between the mobile terminal of described control terminal and described connection.
Fig. 3 shows a kind of preferred embodiment structured flowchart carrying out the method for testing in the terminal of the present invention.
With reference to Fig. 3, described device comprises instruction reception unit 301, simulation test unit 302, rgb value monitoring means 303, result acquiring unit 304 and data transmission unit 305.
Wherein, instruction reception unit 301, performs the test instruction of event to be measured and the information of monitoring point for receiving instruction from the control terminal connected with predetermined test parameter.
Simulation test unit 302, for performing the simulation test of described event to be measured according to described test instruction.
Rgb value monitoring means 303, in the process performing simulation test, detects according to the time interval of presetting rgb value that described monitoring point shows on described mobile terminal screen and records corresponding acquisition time.
Result acquiring unit 304, for when described rgb value monitoring means 303 detects that the rgb value that described monitoring point shows on described mobile terminal screen no longer changes, determines the execution time of described event to be measured.
Data transmission unit 305, the execution result for the execution time of the event to be measured by comprising described acquisition sends to described control terminal.
In order to the rgb value of described monitoring point each moment display in described mobile terminal screen be detected, according to an embodiment of the present invention, the concrete process that described rgb value monitoring means 303 detects the rgb value that described monitoring point shows in described mobile terminal screen can comprise: the view data obtaining described mobile terminal screen; Obtain according to the view data of described mobile terminal screen and record the rgb value corresponding to the screen coordinate of described monitoring point.
According to one exemplary embodiment of the present invention, when described mobile terminal is Android system, the concrete process that described rgb value monitoring means 303 obtains the view data of described mobile terminal screen can comprise: the view data obtaining described mobile terminal screen according to the video memory device file/dev/graphics/fb0 of the Android system of described mobile terminal.
Display change due to the rgb value of described monitoring point is a progressive process, therefore according to another embodiment of the present invention, described result acquiring unit 304 determines that the concrete process of the execution time of described event to be measured can comprise: to obtain when described simulation test starts to detect very first time value B corresponding when 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 the execution time of described event to be measured.
In addition, also it should be noted that, in the embodiment shown in fig. 3, communicated by usb bus agreement between the control terminal of described mobile terminal and described connection.
Fig. 4 shows a kind of preferred embodiment structured flowchart carrying out the method for testing 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 receipt unit 404.
Wherein, test interface unit 401 is for obtaining the information of test parameter and monitoring point.
Instruction generation unit 402 performs the test instruction of event to be measured for the test parameter generating to obtain.
Instruction sending unit 403 is for sending to the mobile terminal be connected with described control terminal by described test instruction and the information of the monitoring point of acquisition.
Data receipt unit 404 receives for the mobile terminal from described connection the execution result comprising the execution time of described event to be measured.
In order to avoid tester goes to be familiar with and to understand program code again, according to a preferred embodiment of the present invention, described test parameter is the screen coordinate of operating point.
Particularly, be the preferred embodiment of the screen coordinate of operating point according to test parameter of the present invention, the screen coordinate that described instruction generation unit 402 generates the operating point obtained performs the test instruction of event to be measured.
In order to reduce the interference of the mobile terminal of abnormal factors on described connection in test process and impact, according to another preferred embodiment of the invention, described test parameter also comprises loop test number of times.
Particularly, the preferred embodiment of loop test number of times is also comprised according to test parameter of the present invention, the screen coordinate that described instruction generation unit 402 generates the operating point obtained performs the test instruction of event to be measured, and described event to be measured performs repeatedly according to described loop test number of times; And described data receipt unit 404 receives multiple 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 multiple event to be measured, in order to perform described multiple event to be measured in order, according to another preferred embodiment of the present invention, described test parameter also comprises test interval.
Particularly, also test interval is comprised according to test parameter of the present invention, described instruction generation unit 402 generates the test instruction of the multiple event to be measured of screen coordinate execution of the operating point obtained, and performs described multiple event to be measured according to described test interval order; And described data receipt unit 404 receives the execution result of the execution time of described multiple event 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, communicated by usb bus agreement between the mobile terminal of described control terminal and described connection.
Each embodiment is except the execution time for obtaining test above, CPU that each moment in test process of application program described in Real-time Obtaining takies and internal memory can also be used for, during concrete enforcement, when described mobile terminal is Android system, described device can call API that Android system provides according to the time interval of presetting obtain described CPU usage and internal memory take situation, and the described data got are submitted to PC end carry out screening and processing, thus obtain test occupation condition data.
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 provides test parameter; Described PC holds (i.e. described control terminal) by the data genaration test case uploaded according to user and is distributed to mobile terminal and performs; Finally, described PC end group carries out denoising in historical data to the execution result that mobile terminal obtains, and produces performance report.
Provide specific embodiment below, the present invention is further illustrated.
Fig. 6 shows the interface schematic diagram that certain input method in the present invention carries out testing in Android device, wherein, 9 key input panel of this input method that what Fig. 6 (a) illustrated is, the symbol input panel of this input method that what Fig. 6 (b) illustrated is, 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 time required for symbol input panel from 9 key input panel.
During concrete test, tester can input following screen coordinate at PC end:
(320,800)
(270,800)
Wherein, what first coordinate represented is the operating point (see Fig. 6 (a)) that " symbol " button is corresponding in 9 key input panel, clicks " symbol " button for simulation in Android device; What the second coordinate represented is monitoring point (the A point see shown in Fig. 6 (a)), for monitoring the change that a certain rectangular area in screen (rectangle frame see shown in Fig. 6 (a) or Fig. 6 (b)) occurs in described simulation test process.
Described PC holds the described coordinate data got and sends to described Android device to perform, the API that described Android device is provided by system is to described operating point (320, 800) perform simulation to click, to realize the switching from 9 key input panel to 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, 800) when the rectangular area at place becomes black from white, described monitoring point (270, 800) rgb value is from RGB(255, 255, 255) RGB(0 is gradually become, 0, 0) and no longer change, according to described monitoring point (270, 800) RGB(0 is become, 0, 0) first acquisition time time determines the execution time of this test case.
In addition, tester also can perform number of times in PC end input circulation, described Android device repeatedly will be simulated according to described testing time and click described operating point (320,800), after being finished, multiple for acquisition time execution result is submitted to PC end by described Android device, and described PC end screens and average value processing receiving data, and is displayed by web in conjunction with historical data generation test report.
Test case 2
Test target: obtain the performance data of resource occupation during this input method input Chinese character.
During concrete test, tester can the coordinate stream of operating point corresponding to input key combination, such as, when inputting " you ", the screen coordinate (see Fig. 6 (c)) at PC end input " n " button, " i " button and " space " push-botton operation point is needed according to Pinyin Input rule, owing to relating to multiple click event, tester interval all right input time, in order to control the order that described button is clicked.
The coordinate stream got sends to described Android device to perform by described PC end, described Android device performs simulation to the multiple coordinates got and clicks, to realize the input of " you ", in described simulation click process, every 3s obtains once described input method CPU usage in a device and EMS memory occupation situation, and the data got is committed to PC end and processs and displays.
As can be seen here, the present invention can not only obtain the accurate test execution time, and can increase substantially the efficiency of test.In addition, because the present invention achieves the simulation test of application programs on the mobile terminal, thus avoid manual operation, therefore stable and orderly simulation test operation can be carried out to the application program on mobile terminal for a long time, this not only alleviates the labor capacity of tester, also effectively ensure that validity and the science of test data.
It may be noted that the needs according to implementing, each step described can be split as more multi-step, also the part operation of two or more step or step can be combined into new step, to realize object of the present invention in the application.
Above-mentioned can at hardware according to method of the present invention, realize in firmware, or be implemented as and can be stored in recording medium (such as CDROM, RAM, floppy disk, hard disk or magneto-optic disk) in software or computer code, or be implemented and will be stored in the computer code in local recording medium by the original storage of web download in remote logging medium or nonvolatile machine readable media, thus method described here can be stored in use multi-purpose computer, such software process on the recording medium of application specific processor or able to programme or specialized hardware (such as ASIC or FPGA).Be appreciated that, computing machine, processor, microprocessor controller or programmable hardware comprise and can store or receive the memory module of software or computer code (such as, RAM, ROM, flash memory etc.), when described software or computer code by computing machine, processor or hardware access and perform time, realize disposal route described here.In addition, when the code for realizing the process shown in this accessed by multi-purpose computer, multi-purpose computer is converted to the special purpose computer for performing the process shown in this by the execution of code.
Although show and describe the present invention with reference to preferred embodiment, it should be appreciated by those skilled in the art that when not departing from the spirit and scope of the present invention be defined by the claims, various amendment and conversion can be carried out to these embodiments.

Claims (26)

1. carry out a method of testing in the terminal, comprising:
Receive instruction from the control terminal connected and perform the test instruction of event to be measured and the information of monitoring point with predetermined test parameter, the simulation test of described event to be measured is performed according to described test instruction, and in the process performing simulation test, detect according to the time interval of presetting rgb value that described monitoring point shows in described mobile terminal screen and record corresponding acquisition time;
Wherein, in described simulation test process, when the rgb value detecting that described monitoring point shows on described mobile terminal screen no longer changes, determine the execution time of described event to be measured;
The execution result of the execution time comprising the event to be measured of described acquisition is sent 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;
View data according to described mobile terminal screen obtains the rgb value corresponding to the screen coordinate of described monitoring point.
3. method as claimed in claim 2, it is characterized in that, when described mobile terminal is Android system, the step of the view data of the described mobile terminal screen of described acquisition comprises:
The view data of described mobile terminal screen is obtained 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, describedly determines that the step of the execution time of described event to be measured comprises:
Obtain first time value B corresponding when the time value A of record and the rgb value of described monitoring point become given rgb value and no longer change when described simulation test starts to detect;
Difference between time value A and B is defined as the execution time of described event to be measured.
5. the method as described in any one of Claims 1 to 4, is characterized in that, is communicated between the control terminal of described mobile terminal and described connection by usb bus agreement.
6. test a device for Android application program in the terminal, comprising:
Instruction reception unit, performs the test instruction of event to be measured and the information of monitoring point for receiving instruction from the control terminal connected with predetermined test parameter;
Simulation test unit, for performing the simulation test of described event to be measured according to described test instruction;
Rgb value monitoring means, in the process performing simulation test, detects according to the time interval of presetting rgb value that described monitoring point shows on described mobile terminal screen and records corresponding acquisition time;
Result acquiring unit, for when described rgb value monitoring means detects that the rgb value that described monitoring point shows on described mobile terminal screen no longer changes, determines the execution time of described event to be measured;
Data transmission unit, the execution result for the execution time of the event to be measured by comprising described acquisition sends to described control terminal.
7. device as claimed in claim 6, it is characterized in that, the process 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;
Obtain according to the view data of described mobile terminal screen and record the rgb value corresponding to the screen coordinate of described monitoring point.
8. device as claimed in claim 7, it is characterized in that, when described mobile terminal is Android system, the process that described rgb value monitoring means obtains the view data of described mobile terminal screen comprises:
The view data of described mobile terminal screen is obtained 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, it is characterized in that, described result acquiring unit determines that the process of the execution time of described event to be measured comprises:
Obtain first time value B corresponding when the time value A of record and the rgb value of described monitoring point become given rgb value and no longer change when described simulation test starts to detect;
Difference between time value A and B is defined as the execution time of described event to be measured.
10. the device as described in any one of claim 6 ~ 9, is characterized in that, is communicated between the control terminal of described mobile terminal and described connection by usb bus agreement.
11. 1 kinds are carried out the method for testing, comprising in control terminal:
Obtain the information of test parameter and monitoring point;
Generate the test instruction performing event to be measured with the test parameter obtained;
Described test instruction and the information of the monitoring point of acquisition are sent to the mobile terminal be connected with described control terminal;
The execution result comprising the execution time of described event to be measured is received from the mobile terminal of described connection.
12. methods as claimed in claim 11, it is characterized in that, described test parameter is the screen coordinate of operating point.
13. methods as claimed in claim 12, is characterized in that, the step that described generation performs the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate generating the operating point obtained performs the test instruction of event to be measured.
14. methods as claimed in claim 12, it is characterized in that, described test parameter also comprises loop test number of times.
15. methods as claimed in claim 14, is characterized in that,
The step that described generation performs the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate generating the operating point obtained performs the test instruction of event to be measured, and described event to be measured performs repeatedly according to described loop test number of times; Accordingly,
The described mobile terminal from described connection receives the step comprising the execution result of the execution time of described event to be measured and comprises: the multiple execution results receiving the execution time of described event to be measured from the mobile terminal of described connection.
16. methods as claimed in claim 12, it is characterized in that, described test parameter also comprises test interval.
17. will go the method as described in 16 as right, it is characterized in that,
The step that described generation performs the test instruction of event to be measured with the test parameter obtained comprises: the screen coordinate generating the operating point obtained performs the test instruction of multiple event to be measured, and performs described multiple event to be measured according to described test interval order; Accordingly,
The described mobile terminal from described connection receives the step comprising the execution result of the execution time of described event to be measured and comprises: the execution result receiving the execution time of described multiple event to be measured from the mobile terminal of described connection.
18. methods as described in any one of claim 11 ~ 17, be is characterized in that, communicated between described control terminal with the described mobile terminal be connected by usb bus agreement.
19. 1 kinds are carried out the device tested, comprising in control terminal:
Test interface unit, for obtaining the information of test parameter and monitoring point;
Instruction generation unit, the test parameter for generating to obtain performs the test instruction of event to be measured;
Instruction sending unit, for sending to the mobile terminal be connected with described control terminal by described test instruction and the information of the monitoring point of acquisition;
Data receipt unit, receives for the mobile terminal from described connection the execution result comprising the execution time of described event to be measured.
20. devices as claimed in claim 19, it is characterized in that, described test parameter is the screen coordinate of operating point.
21. devices as claimed in claim 20, is characterized in that, described instruction generation unit generates the test instruction performing event to be measured with the screen coordinate of the operating point obtained.
22. devices as claimed in claim 20, it is characterized in that, described test parameter also comprises loop test number of times.
23. devices as claimed in claim 22, is characterized in that,
Described instruction generation unit generates the test instruction performing event to be measured with the screen coordinate of the operating point obtained, and described event to be measured performs repeatedly according to described loop test number of times; Accordingly,
Described data receipt unit receives multiple execution results of the execution time of described event to be measured from the mobile terminal of described connection.
24. devices as claimed in claim 20, it is characterized in that, described test parameter also comprises test interval.
25. will remove the device as described in 24 as right, it is characterized in that,
Described instruction generation unit generates the test instruction performing multiple event to be measured with the screen coordinate of the operating point obtained, and performs described multiple event to be measured according to described test interval order; Accordingly,
Described data receipt unit receives the execution result of the execution time of described multiple event to be measured from the mobile terminal of described connection.
26. devices as described in any one of claim 19 ~ 25, be is characterized in that, communicated between described control terminal with the described mobile terminal be connected by usb bus agreement.
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 CN103455403A (en) 2013-12-18
CN103455403B true 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)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957504B (en) * 2014-04-21 2018-05-04 百度在线网络技术(北京)有限公司 Positioning service appraisal procedure, apparatus 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
CN105872534B (en) * 2016-04-05 2018-11-02 Tcl海外电子(惠州)有限公司 terminal test method and device
CN108073529A (en) * 2017-08-17 2018-05-25 北京微应软件科技有限公司 The input and output analogy method and simulation system of mobile terminal
CN110954214B (en) * 2018-09-27 2024-05-17 北京京东尚科信息技术有限公司 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 (2)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9619035B2 (en) * 2011-03-04 2017-04-11 Microsoft Technology Licensing, Llc Gesture detection and recognition

Patent Citations (2)

* 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

Also Published As

Publication number Publication date
CN103455403A (en) 2013-12-18

Similar Documents

Publication Publication Date Title
CN103455403B (en) Method of testing and device
CN107341098B (en) Software performance testing method, platform, equipment and storage medium
CN107562610B (en) Method, device, terminal and medium for acquiring page loading time
CN106557424B (en) Memory test method, tested terminal, test client and system
CN101778307B (en) Device for testing functions of set top box
CN108959068B (en) Software interface testing method, device and storage medium
KR102058976B1 (en) Application method and device
CN104536888A (en) Game testing method and system for mobile devices
CN111078539B (en) Test method, device, system and computer readable storage medium
CN104035812A (en) Method and system for recommending applications to electronic device
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN111782492A (en) Page first screen loading duration testing method and device, computer equipment and medium
CN104834597A (en) Method and system for measuring application response duration
CN102467442A (en) Software testing method, system and equipment
CN106469113A (en) Applied program testing method and system
CN202795345U (en) Application software test system
CN106301975B (en) Data detection method and device
US9378109B1 (en) Testing tools for devices
CN112948224A (en) Data processing method, device, terminal and storage medium
CN110888781A (en) Application blockage detection method and detection device
CN107632760B (en) Handwriting circle selection method and device, touch equipment and readable storage medium
CN108287781B (en) Memory occupation monitoring method, device and system
CN105138458A (en) Method and system for recording automatic testing scripts by combining intelligent terminal and computer terminal
CN111260759B (en) Path determination method and device
CN106302011B (en) Multi-terminal-based test method and terminal

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