Summary of the invention
In view of this, the purpose of the embodiment of the invention is to provide a kind of method and apparatus of automatic test signal, realizes efficiently test.
For achieving the above object, the embodiment of the invention provides following technical scheme:
A kind of automatic test method comprises:
Generation is used for operation signal that current device is tested;
Utilize described operation signal that current device is tested.
Described generation is used for the operation signal that current device is tested is comprised:
Form list entries;
The operation map that prestores according to this locality concerns the operation signal of determining described list entries correspondence.
Described generation is used for the operation signal that current device is tested is comprised:
According to what preserve current device is tested the new operation signal of employed historical operation signal generation.
After forming list entries, also comprise:
Determine described list entries time information corresponding;
The operation signal of determining described list entries correspondence according to the operation map relation also comprises afterwards:
Be the described temporal information of described operation signal affix;
Utilizing described operation signal that current device is tested is specially:
Utilization has the operation signal of temporal information current device is tested.
After forming list entries, also comprise:
Determine the list entries time information corresponding, and enclose described temporal information for described list entries;
Determine the described pairing operation signal of list entries of enclosing described temporal information according to the operation map relation;
Utilizing described operation signal that current device is tested is specially:
Utilization has the operation signal of temporal information current device is tested.
Described operation information is the key value.
A kind of device of automatic test comprises:
Generation unit generates and to be used for operation signal that current device is tested;
Test cell is used to utilize described operation signal that current device is tested.
Described generation unit comprises:
Form subelement, be used to form list entries;
The conversion subelement, the operation map relation that is used for prestoring according to this locality is determined the operation signal of described list entries correspondence.
Described generation unit comprises:
The record subelement is used to write down current device is tested used historical operation signal;
Storing sub-units is used for that current device is tested used historical operation signal and preserves;
Generate subelement, be used for current device being tested the new operation signal of employed historical operation signal generation according to what preserve.
Preferably, described device also comprises:
Acquiring unit is used to obtain described list entries time information corresponding;
Associative cell is used to the described temporal information of described operation signal affix;
Described test cell also is used to utilize the operation signal with temporal information that current device is tested.
As seen, in embodiments of the present invention, generate and to be used for operation signal that current device is tested; Utilize described operation signal that current device is tested, the method that the embodiment of the invention provided need not the tester and participates in and can test automatically according to the operation signal that generates, and has greatly improved testing efficiency.
Embodiment
The embodiment of the invention discloses a kind of automatic test method and device, for making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail.
Referring to Fig. 1, the method that one embodiment of the invention provided specifically comprises:
S101: generate and to be used for operation signal that current device is tested.
S102: utilize described operation signal that current device is tested.
Why loaded down with trivial details existing method of testing is, inefficiency, and its root all is that the tester need manually produce operation signal repeatedly according to test case, and this operation signal is offered testing equipment to be tested.And the method that the embodiment of the invention provided can generate the operation signal that is used for current device is tested usefulness voluntarily, the controller of equipment to be detected just can be tested current device according to this operation signal after receiving this operation signal, thereby the tester is freed from loaded down with trivial details test job, improve use test efficient, promoted user experience.
In the practical application, can generate in several ways and be used for operation signal that current device is tested, the method that the embodiment of the invention provided is elaborated below in conjunction with specific embodiment.
Referring to Fig. 2, the method that the embodiment of the invention provided comprises:
S201: form list entries.
Described list entries is an analog input information that generates at random according to certain rule at random.In certain embodiments, can utilize existing random function, for example random () or rand () or the like can certainly be out of shape according to these existing random functions, and to this, the present invention does not do qualification.
S202: the operation map that prestores according to this locality concerns the operation signal of determining described list entries correspondence.
Described list entries is the input signal of a simulation, treats testing apparatus without any meaning, have only by operation map relation list entries and operation signal are associated after, described list entries has just possessed the operation implication.By the operation map relation, a list entries is corresponding with an operation signal.In test process, generally all can carry out a series of operation, correspondingly required list entries can not have only one yet, but form a list entries group by a plurality of list entries, closing by described operation map is that each list entries in this list entries group finds corresponding operation signal, and these operation signals couple together and just formed a series of operation.
S203: utilize described operation signal that current device is tested.
Preferably, in some cases, in order to promote the controllability of test, can enclose temporal information for list entries or operation signal, that is:
After step 201, before step 202, also comprise:
Obtain the temporal information of described list entries, and enclose described temporal information for described list entries.
Described temporal information can obtain according to certain rule or obtain the interval information good input time from access in advance.
Accordingly, the operation signal in the step 203 is just for to have adhered to the operation signal of temporal information.
Be equivalent to cover a timestamp by this step for each time series.This temporal information can be a concrete time, for example, a list entries, its time can be 10:50, the operation signal that promptly shows this list entries correspondence will act on current device at 10:50 and test.
This temporal information also can be a relative time, this situation can be used for the list entries group that a plurality of list entries are formed, be the temporal information of first list entries regulation in this group, thereafter list entries is to move after the basis is carried out accordingly to get final product with first time all, for example the temporal information of a list entries is 10 minutes, carries out after it can be represented current list entries the pairing test operation of operation signal of first list entries correspondence is finished 10 minutes in the list entries group at its place so.
Obviously, the reference time of described relative time point is changeable, can be multiple modes such as reference time point with a last list entries of current list entries also, contrast, and the embodiment of the invention is not done qualification.
No matter adopt which kind of as temporal information, as can be seen, its effect all is to make that the operation signal of each list entries correspondence is more controlled, and is more orderly time.
Another embodiment of the present invention can also provide the method for another kind of additional period information, that is:
After step 202, also comprise:
Obtain the temporal information of described operation signal, and enclose described temporal information for described operation signal.
Described temporal information can obtain according to certain rule or obtain the interval information good input time from access in advance.
Accordingly, the operation signal in the step 203 is just for to have adhered to the operation signal of temporal information.
For the character of this additional temporal information of operation signal is identical with characteristics with this operation signal character of adding for list entries, repeat no more herein.
In fact, no matter be for list entries additional period information or be operation signal additional period information that both differences are just in additional period, its purpose all is identical, all is to have realized that operation signal in order and controlled.
After operation signal has been arranged, just can utilize this operation signal to treat testing apparatus and operate.As seen the method for testing that the embodiment of the invention provided need not artificial participation and can realize test to current device the tester being freed from loaded down with trivial details test job, has promoted user experience, has greatly improved testing efficiency.
Among Fig. 3, the embodiment of the invention is further introduced the method that the embodiment of the invention was provided with a test process with telepilot of 8 buttons.
S301: generate list entries according to random number.
In the embodiment of the invention, at first existing random function is carried out certain improvement, the output valve of this random function is converted to certain integer between 0~7, corresponding with 8 buttons respectively, can both simulated by the action of each key guaranteeing.
S302: obtain the temporal information of current list entries, and enclose temporal information for described list entries.
S303: the operation map that prestores according to this locality concerns the operation signal of determining described list entries correspondence.
Be an operation map relation table that uses in the embodiment of the invention below, preserve by the mode of array, corresponding with 8 buttons, write down VK_UP~VK_HOME totally 8 operations now in this array.From this array as can be seen, each member in this array comprises two elements altogether, with { " VK_UP ", 0xfc03ff00, it is example, first element " VK_UP " is the pairing key value of a current number group membership title, and second parameter " 0xfc03ff00 " then is real key value, uses when being used to flow to current device and testing for current device.
stKEY?lenovoKEY[]=
{
{″VK_UP″,0xfc03ff00,},
{″VK_DOWN″,0xfd02ff00,},
{″VK_RIGHT″,0xe51aff00,},
{″VK_LEFT″,0xf10eff00,},
{″VK_ENTER″,0xf807ff00,},
{″VK_RETURN″,0xfa05ff00,},
{″VK_ZOOMOUT″,0xec?13ff00,},
{″VK_HOME″,0xe718ff00,},
};
Wherein, the key value is a necessary operations information in the embodiment of the invention, by this operation information current device is tested.
Preferably, described operation information also comprises this key value title.
Obviously the key value generally all is very abstract data, if key value title has been arranged, can be more readily understood the operation of this key value correspondence.
The process that obtains the corresponding keys code value according to list entries is:
Supposing provides a random function by the embodiment of the invention, and the value that has obtained a list entries is 5, so 5 pairs of this list entries the 6th member (because first of array is 0, and the scope of list entries also is 0~7) in should the corresponding relation array.Search this array, learn that the 6th member is { " VK_RETURN ", 0xfa05ff00, }, the key value of list entries 5 correspondences be " VK_RETURN ", 0xfa05ff00, and certain return that we carry out as can be seen from this key value title is perfectly clear intuitively.
S304: send pipeline by information described operation information is sent to information process unit.
Because being described list entries, S302 adhered to temporal information, so the operation information that obtains through the operation map relationship map has also adhered to the time.
S305: described information process unit is tested current device according to the temporal information of adhering on the operation information that receives.
The method that the embodiment of the invention provided, the input signal that the list entries that generates according to random function is formed for testing utilizes this input signal that current device is tested, and does not need artificial participation fully, has greatly improved the efficient of test.
Referring to Fig. 4, the method that another embodiment of the present invention provided comprises:
S401: what preservation was write down in advance tests employed historical operation signal to current device.
S402: generate new operation signal according to described historical operation signal.
Generating new operation signal according to the historical operation signal comprises:
Enclose new temporal information for described historical operation signal, make the historical operation signal become new operation signal.
Identical with the description of front, described temporal information can be the concrete time, also can be relative time.
Preferably, when described historical operation signal when being a plurality of, can be a plurality of operation signals rearrangements by relative time is set.
S403: utilize described new operation to carry out current device is tested.
We know, why loaded down with trivial details consuming time exactly because the tester need constantly carry out similar operation formation operation signal test of the prior art is, and the method that the embodiment of the invention provided, make and just can utilize this operation signal to carry out follow-up a large amount of test job as long as the initial operation signal several times of tester noted, alleviate tester's load burden, greatly improved testing efficiency.
Embodiment is corresponding with method, and the embodiment of the invention also provides a kind of device of automatic test, and referring to Fig. 5, this device comprises:
Generation unit 501 generates and to be used for operation signal that current device is tested;
Test cell 502 is used to utilize described operation signal that current device is tested.
Referring to Fig. 6, in an embodiment of the present invention, described generation unit 501 comprises:
Form subelement 5011, be used to form list entries;
Conversion subelement 5012, the operation map relation that is used for prestoring according to this locality is determined the operation signal of described list entries correspondence.
The device that the embodiment of the invention provided, the input signal that the list entries that generates according to random function is formed for testing utilizes this input signal that current device is tested, and does not need artificial participation fully, has greatly improved the efficient of test.
Referring to Fig. 7, in another embodiment of the present invention, described generation unit 501 comprises:
Record subelement 5013 is used to write down current device is tested used historical operation signal;
Storing sub-units 5014 is used for that current device is tested used historical operation signal and preserves;
Generate subelement 5015, be used for current device being tested the new operation signal of employed historical operation signal generation according to what preserve.
The device that the embodiment of the invention provided makes as long as the initial operation signal several times of tester noted just can utilize this operation signal to carry out follow-up a large amount of test job, has alleviated tester's load burden, has greatly improved testing efficiency.
For the device that the embodiment of the invention is provided has sequential and controllability more, this device also comprises:
Acquiring unit 503 is used to obtain described list entries time information corresponding;
Associative cell 504 is used to the described temporal information of described operation signal affix;
Described test cell 502 also is used to utilize the operation signal with temporal information that current device is tested.
The present invention can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment, put into practice the present invention, in these distributed computing environment, by by communication network connected teleprocessing equipment execute the task.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.