CN102981938B - Input method method of testing, the method and electronic installation for generating test case - Google Patents

Input method method of testing, the method and electronic installation for generating test case Download PDF

Info

Publication number
CN102981938B
CN102981938B CN201210458605.6A CN201210458605A CN102981938B CN 102981938 B CN102981938 B CN 102981938B CN 201210458605 A CN201210458605 A CN 201210458605A CN 102981938 B CN102981938 B CN 102981938B
Authority
CN
China
Prior art keywords
input method
action
input
predetermined state
test
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
CN201210458605.6A
Other languages
Chinese (zh)
Other versions
CN102981938A (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.)
Baidu International Technology Shenzhen Co Ltd
Original Assignee
Baidu International Technology Shenzhen 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 Baidu International Technology Shenzhen Co Ltd filed Critical Baidu International Technology Shenzhen Co Ltd
Priority to CN201210458605.6A priority Critical patent/CN102981938B/en
Publication of CN102981938A publication Critical patent/CN102981938A/en
Application granted granted Critical
Publication of CN102981938B publication Critical patent/CN102981938B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of input method method of testing, the method and device of generation test case.Wherein, the method for generation test case includes:Under the predetermined state of input method, the action that input method can be responded is classified, the number of states at least two of the predetermined state of input method;Obtain the situation that the sorted predetermined state for each acting corresponding trigger condition and/or input method follows the change of action and changed;The different corresponding test cases of action of situation generation that predetermined state according to corresponding trigger condition and/or input method is acted follows the change of action and changed.By the above-mentioned means, the present invention can make the test case of acquisition cover the input of user's actual key on a large scale, the coverage rate of test case is improved.

Description

Input method method of testing, the method and electronic installation for generating test case
Technical field
The present invention relates to input method field, more particularly to input method method of testing, the method for generation test case and electricity Sub-device.
Background technology
Input method refers to the coding method in order to which various symbols are inputted into computer or other equipment (such as mobile phone) and used.
The evaluation of input method performance is generally completed using input method method of testing.Input method general at present is tested Verified using input/output test use-case.A character string is such as inputted, is checked according to produced by the character string of input Alternating content it is whether correct etc..As can be seen here, test case is the core place of input method test.Rational test is set to use Example can effectively improve the efficiency of input method test and ensure the accuracy of input method test result.
Present invention applicant has found that the acquisition of existing test case at least has the following disadvantages in long-term research: The situation that buttons all in input method are produced can not be completely covered in the test case obtained using random button;And if root According to the test case that Functional Design is limited, the problem of design is not complete is equally also faced.And carried out using these test cases defeated When entering method test, it is often based on candidate item to be contrasted, the simple property for evaluating input method by the verification of candidate item Can, it is not accurate enough to input method test result.
The content of the invention
The present invention solves the technical problem of provide a kind of input method method of testing, generate test case method and Electronic installation, the coverage rate of the test case of acquisition is big, the accuracy of follow-up input method test can either be improved, while can also carry The stability of high test case.
In order to solve the above technical problems, one aspect of the present invention is:A kind of generation input method test is provided The method of use-case, including:Under the predetermined state of the input method, the action that the input method can be responded is classified; The predetermined state for obtaining the corresponding trigger condition of sorted each action and the input method follows the action The situation for changing and changing;According to being followed the predetermined state of the corresponding trigger condition of the action and/or the input method The change of action and the corresponding test cases of the different actions of situation generation changed.
Wherein, step that is described under the predetermined state of input method, being classified to the action that the input method can be responded Suddenly include:Under the predetermined state of the input method, the action that can be responded to the input method and produced by the action Result classified.
Wherein, step that is described under the predetermined state of input method, being classified to the action that the input method can be responded Suddenly include:In at least one of the pre-input state of the input method, normal input state and transition status predetermined state Under, the action that the input method can be responded is classified.
In order to solve the above technical problems, another technical solution used in the present invention is:A kind of input method test side is provided Method, including:Extract test case, the test case be the trigger condition that acts under the predetermined state based on input method and/or The predetermined state of input method follows the situation for acting change and changing and produced;Using the input method to the test The corresponding character of use-case is inputted;Process to the input is verified, and completes the input method test.
Wherein, the process of described pair of input is verified, and completing the step of input method is tested includes:The process of the input The predetermined state of middle input method is verified;If the verification to the predetermined state of the input method passes through, to the input method Predetermined state under action verified;If the verification to the action passes through, the trigger condition to the action is carried out Verification;If the verification to the trigger condition passes through, using custom rule to inputting the corresponding character of the test case Produced candidate item is verified;If the verification to the candidate item passes through, it is judged as that the input method is successfully tested, it is complete Into input method test.
Wherein, the step of predetermined state to input method in input process is verified includes:Judge the input Whether the predetermined state of the predetermined state of the input method of process corresponding input method with the test case is consistent;If the input During input method predetermined state corresponding input method with the test case predetermined state it is consistent, then be judged as described defeated Enter the predetermined state of method by verification, otherwise, be judged as the input method test crash, terminate input method test.
Wherein, the step of action under the predetermined state to input method is verified includes:Judge the input method Predetermined state under action it is corresponding with the test case action it is whether consistent;If under the predetermined state of the input method Action is corresponding with the test case to keep strokes, then is judged as that the verification of the action passes through, otherwise, is judged as described defeated Enter method test crash, terminate input method test.
Wherein, the step of trigger condition of described pair of action is verified includes:Judge the trigger condition of the action with Whether the trigger condition of the corresponding action of the test case is consistent;If the trigger condition of the action and the test case pair The trigger condition for the action answered is consistent, then is judged as that the verification of the trigger condition of action passes through, otherwise, is judged as the input method Test crash, terminates the input method test.
Wherein, the step of use custom rule is verified to candidate item includes:Predetermined context is extracted, it is right The corresponding designated character string of the predetermined context is inputted, and judges the candidate often inputted produced by a designated character string Whether the 4th of item is face word;If it is described often input a designated character string produced by the 4th of candidate item be not face Word, then be judged as the input method test crash, terminates the input method test;If described often input a designated character string The 4th of produced candidate item is face word, then is judged as that input method is successfully tested, and completes input method test.
Wherein, the step of use custom rule is verified to candidate item is including extracting predetermined context;It is right The corresponding designated character string of the predetermined context is inputted, and is judged when completing under the output of candidate above followed by inputs During literary corresponding designated character string, whether the first choice of produced candidate item is described specify hereafter;If described then defeated The first choice for entering candidate item hereafter produced by corresponding designated character string be it is described specify hereafter, then be judged as the input method It is successfully tested, completes the input method test, otherwise, be then judged as the input method test crash, terminate the input method and survey Examination.
Wherein, it is described to include the step of inputted using input method to the corresponding character of the test case:Using institute Input method is stated, the corresponding character of the test case is inputted by virtual client, and be sent to input method service Device.
In order to solve the above technical problems, another technical solution used in the present invention is:Including sort module, acquisition module And Test cases technology module, wherein:The sort module is used under the predetermined state of the input method, to the input The action that method can be responded is classified, and by the sorted action output to the acquisition module;The acquisition module For according to the sorted action from sort module, obtaining the corresponding trigger condition of sorted each described action And/or the predetermined state of the input method situation that follows the change of the action and change and export and give test case life Into module;The Test cases technology module be used for according to the corresponding trigger condition of the action from the acquisition module with And the corresponding test of the different actions of situation generation that the predetermined state of the input method follows the change of the action and changed is used Example.
Wherein, the sort module specifically for the pre-input state of the input method, normal input state and turn Change under at least one of state predetermined state, the action that the input method can be responded is classified, and will be sorted The action output is to the acquisition module.
In order to solve the above technical problems, another technical solution used in the present invention is:Including abstraction module, input module And correction verification module, wherein:The abstraction module is used to extract test case, and the test case is predetermined based on input method The trigger condition and the predetermined state of input method acted under state follows the situation for acting change and changing and produced; The corresponding character of the test case that the input module is used to extract the abstraction module using input method is inputted; The process that the correction verification module is used for the input to the input module is verified, and completes input method test.
Wherein, the correction verification module includes the first verification unit, the second verification unit, the 3rd verification unit and the 4th school Verification certificate member, wherein:The predetermined state of input method is verified during first verification unit is used for the input, when When the predetermined state of input method is by verifying, send the instruction that is verified to the action under the predetermined state of the input method to Second verification unit;Second verification unit is used to verify the action under the predetermined state of the input method, When the action under the predetermined state of the input method is by verifying, the finger verified to the trigger condition of the action is sent Make to the 3rd verification unit;3rd verification unit is used to verify the trigger condition of the action, works as action Trigger condition by verifying when, send the instruction that is verified to candidate item to the 4th verification unit;4th school Verification certificate member is used to verify the candidate item using custom rule.
Wherein, predetermined state of first verification unit specifically for input method during by judging the input Whether the predetermined state of input method corresponding with the test case unanimously comes verifies to the predetermined state of the input method, When the predetermined state of the predetermined state of input method input method corresponding with the test case during the input is consistent, It is judged as that the predetermined state of the input method, by verification, sends the finger verified to the action under the predetermined state of input method Make to second verification unit, otherwise, the instruction that the action under the predetermined state to input method is verified is not sent; Second verification unit is specifically for responding the action under the predetermined state to input method from the first verification unit The instruction verified, the action under predetermined state by judging input method action corresponding with the test case is It is no unanimously to be verified come the action under the predetermined state to the input method, the action under the predetermined state of the input method It is corresponding with the test case to keep strokes, it is judged as that the action under the predetermined state of the input method by verification, is then sent out The instruction that is verified to the trigger condition of action is sent to the 3rd verification unit, otherwise, does not send and described action is touched The instruction that clockwork spring part is verified;3rd verification unit is specifically for responding the described pair of action from the second verification unit The instruction that is verified of trigger condition, acted by the way that the trigger condition for judging the action is corresponding with the test case Trigger condition whether unanimously come to verify the trigger condition of the action, when the action trigger condition with it is described survey The trigger condition acted accordingly in example on probation is consistent, is judged as that the trigger condition of the action by verification, is then sent to waiting Otherwise the instruction that option is verified, the instruction verified to candidate item is not sent to the 4th verification unit;Described Four verification units are specifically for responding the instruction verified to candidate item from the 3rd verification unit, by judging State whether candidate item meets predetermined requirement to verify the candidate item, when candidate item meets predetermined requirement, judge Be candidate item by verification, input method is successfully tested, and completes input method test, otherwise, and input method test crash terminates input method Test.
Wherein, the input module is specifically for utilizing the input method, by virtual client to the extraction mould The corresponding character of test case that block is extracted is inputted, and the corresponding character of the test case is sent into input method service Device.
The beneficial effects of the invention are as follows:The situation of prior art is different from, the present invention is by under the predetermined state of input method The situation that the trigger condition of action and the predetermined state of input method follow the action change and changed designs corresponding test Use-case.It is pre- by collecting input method due to being the predetermined state that the input process of user is split as to basic input methods Determine the trigger condition of the action under state and/or action to generate the corresponding test case of action, with less test case come The situation of covering user actual key input, improves the coverage rate of test case on a large scale;Simultaneously because test case amount is few And it is accurate, it is possible to increase the degree of accuracy of follow-up input method test.
In addition, being carried out using the test case obtained in input method test, completed by being verified to input process Input method is tested.And the input process both predetermined state comprising input method, the action under predetermined state, triggerings of generation action Generation of condition and candidate item etc., is verified to input process and is verified by the various pieces to during, endless Input method performance is evaluated dependent on the verification of candidate item entirely, the accuracy of input method test is improved, used while also improving to test The stability of example.
Brief description of the drawings
Fig. 1 is the flow chart of the embodiment of method one of present invention generation input method test case;
Fig. 2 is the schematic diagram of state transition diagram in method one embodiment of the invention for generating input method test case;
Fig. 3 is the flow chart of the embodiment of input method method of testing one of the present invention;
Fig. 4 is the flow chart verified to the process of input in the embodiment of input method method of testing one of the present invention;
Fig. 5 is the schematic diagram at candidate interface under a certain input method;
Fig. 6 is the structural representation of electronic installation first embodiment of the present invention;
Fig. 7 is the structural representation of electronic installation second embodiment of the present invention;
Fig. 8 is the structural representation of correction verification module in the embodiment of electronic installation the 3rd of the present invention.
Embodiment
Refering to Fig. 1, the embodiment of method one of present invention generation input method test case includes:
Step S101:Under the predetermined state of input method, the action that input method can be responded is classified;
Under the predetermined state of input method, the action that input method can be responded is classified, at the same can also include pair The result that action is produced is classified.The predetermined state of input method can be one or more kinds of predetermined states.Such as but It is not limited to any one in pre-input state, normal input state and transition status or two or more states.
Action refers to some operation behaviors for the user that can be responded under the predetermined state of input method.It is generally pre- at some Under the predetermined state of fixed input method, it is only capable of responding some actions specified.Such as under pre-input state or Input transformation shape Under state, it is only capable of responding such as page turning, the mobile action of text section.Again such as under normal input state, it is only capable of responding such as " Backspace ", " Cancel ", " Commit ", " 33 kinds of actions such as Convert To Half Width ".
And act the result that the result produced refers to input method response action and produced.Such as response action " cancel " is produced The raw result deleted, response action " convert To Full Alphanumeric " and produce and be transformed into the female result of full word.
Wherein, the action that can be responded to input method carry out classification refer to action under the predetermined state for input method by Classified according to the type of action.Such as input character behavior, select word behavior, page turning behavior, text section mobile behavior etc..
Step S102:Obtain the sorted predetermined state for each acting corresponding trigger condition and input method and follow action Change and situation about changing;
Obtain the change that the sorted predetermined state for each acting corresponding trigger condition and/or input method follows action And situation about changing.For a certain action, possible more than one trigger condition, all triggerings at this moment needing acquisition to act Condition.Such as page turning This move, there are " pgDn ", " ctrl+l " two kinds of trigger conditions, then obtain both trigger conditions. The situation that the predetermined state of input method follows the change of action and changed, refers to that some actions cause the predetermined state of input method to be sent out The situation for changing.It can be returned to by esc under such as transition status and press esc under normal input state, normal input state and can return To pre-input state etc..
Step S103:Predetermined state according to corresponding trigger condition and/or input method is acted follow the change of action and The situation of change, generates the different corresponding test cases of action;
The situation that predetermined state according to corresponding trigger condition and input method is acted follows the change of action and changed, it is raw Into state transition diagram (i.e. the situation that the predetermined state of input method follows action to change and changed).Fig. 2 is see, is life of the present invention Into the schematic diagram of one of state transition diagram in the embodiment of method one of input method test case.Different actions is given birth to Into corresponding different test case.Such as page turning This move correspondence " pgDn ", " ctrl+l " two kinds of trigger conditions, original defeated It is " a ", " ska " to enter string, then the test case generated is respectively " (a { pgDn }, a { Ctrl+l }, ska { pgDn }, ska { Ctrl+ l})”.Here the string that is originally inputted refers to the input string that is produced under pre-input state.Design input method test case when Wait, some special input strings under pre-input state, the test case different from different Design of State can be found.
Pass through the elaboration of above-mentioned embodiment, it will be understood that the method for present invention generation input method test case, by receiving The trigger condition and/or the predetermined state of input method acted under the predetermined state for collecting input method follows the action change and changed Situation, for the different corresponding test cases of movements design, use can be covered on a large scale with less test case The situation of family actual key input, improves the coverage rate of test case;Simultaneously because test case amount is few and accurate, it is possible to increase The degree of accuracy of follow-up input method test.
Referring to Fig. 3, the embodiment of input method method of testing one of the present invention includes:
Step S201:Extract test case;
Extract test case, test case here be the trigger condition that acts under the predetermined state based on input method and/ Or the predetermined state of input method follows the situation for acting change and changing and produced.
Wherein, above-mentioned test case is to obtain in the following manner:Under the predetermined state of input method, to input method Can the action of response classified, then obtain and sorted each act the pre- of corresponding trigger condition and/or input method The situation determined state to follow the change of action and changed, further according to the predetermined shape for acting corresponding trigger condition and/or input method The situation that state follows the change of action and changed, generates the different corresponding test cases of action.
Step S202:The corresponding character of test case is inputted using input method;
Under normal circumstances, it is all the elements information shown in user interface, such as how many page of candidate item, candidate item, defeated Enter method in what state etc., corresponding xml document generation is had when input method is tested.Therefore, under normal circumstances in order to The automation of input method test is realized, generally there is two ways:1st, Simulation of keyboard input, this mode appears like someone and existed Typewriting is the same, carries out input method test with this, the process has user interface participation;2nd, the logical program that input method is handled is beaten Compressed file is bundled into, is triggered by providing some character strings, so, although do not inputted on interface, but is also produced corresponding Xml document, input method test can also be carried out.
, can be using any one of above two mode when being inputted using input method for the test case of extraction Kind.In embodiments of the present invention, the server of simulation (mock) virtual client (client) and input method is passed through (server) communication between carry out process, is inputted, and send by virtual client to the corresponding character of test case To input method server.The automation of input method test so can have both been realized, user in input method test process can be solved again The problem of inefficiency that showing interface is brought.
Step S203:Process to input is verified, and completes input method test;
Process to input test use-case is verified, including predetermined state to the input method of input process, input method Predetermined state under action, action trigger condition and candidate item verified one by one, all verifications pass through, then judge It is successfully tested for input method, completes input method test.
Specifically, referring to Fig. 4, the process progress verification to input includes following sub-step:
Sub-step S301:The predetermined state of input method is verified during to input;
During input test use-case, the predetermined state of input method is verified, if check results are input The predetermined state of method then carries out sub-step S302 by verification;Otherwise, sub-step S306 is carried out.
The predetermined state of input method is verified, is by judging the predetermined state of the input method of input process with test Whether use-case corresponding input method status are unanimously realized.If the input method status of input process are corresponding defeated with test case Enter method state consistency, be then judged as that the predetermined state of input method, by verification, carries out sub-step S302.Otherwise, it is judged as input The predetermined state of method carries out sub-step S306 not by verification.
Sub-step S302:Action under the predetermined state of input method is verified;
If the predetermined state of the input method of input process is entered by verification to the action under the predetermined state of input method Row verification.
If check results for input method predetermined state under action by verification, carry out sub-step S303, otherwise, Carry out sub-step S306.
It is by judging the action under the predetermined state of input method to carry out verification to the action under the predetermined state of input method Whether action corresponding with test case is consistent, keeps strokes if the action under input method status is corresponding with test case, It is judged as that action, by verification, carries out sub-step S303.Otherwise, it is judged as that action, not by verification, carries out sub-step S306.
Sub-step S303:Trigger condition to action is verified;
If action is verified by verification to acting corresponding trigger condition, if check results are action Trigger condition then carries out sub-step S304 by verification, otherwise, carries out sub-step S306.
Trigger condition to action verify the trigger condition action corresponding with test case for being to act by judgement Trigger condition it is whether consistent, if action trigger condition action corresponding with test case trigger condition it is consistent, judge Pass through verification, progress sub-step S304 for the trigger condition of action.Otherwise, it is judged as that action, not by verification, carries out sub-step S306。
Sub-step S304:Candidate item is verified using custom rule;
If action is verified by verification using custom rule to candidate item, if check results are candidate Item then carries out sub-step S305 by verification, otherwise, carries out sub-step S306.
In embodiments of the present invention, two ways can be had by carrying out verification to candidate item using custom rule:
First way:The predetermined context by extracting, to the corresponding designated character of predetermined context of the extraction String is inputted, and judges often to input a designated character string, whether the 4th of candidate item is face word, if the 4th of candidate item the Position is not face word, then is judged as that candidate item, not by verification, carries out sub-step S306;Designated character string refers to above and below extraction The corresponding corresponding character string of text.That such as extract is " everybody ", then the character string specified is " dajia ".
Here face word refers to the picture with the composition such as word or various lines, symbol, and it is one of ASCII Art Point.Such as described in Figure 5 under a certain input method input " hua " after corresponding interface schematic diagram, its corresponding 5th and The candidate of the 9th is face word.
If the 4th of candidate item is face word, it is judged as that candidate item, by verification, carries out sub-step S305, otherwise, Then it is judged as that candidate item, not by verification, carries out sub-step S306.
The second way:The predetermined context by extracting, to the corresponding designated character of predetermined context of the extraction String is inputted, when judging that candidate's output when completion above followed by inputs hereafter corresponding character, produced candidate item First choice whether be to specify hereafter, if then input hereafter corresponding character, the first choice of produced candidate item refers to It is fixed to be hereafter then judged as that candidate item passes through and verify, progress sub-step S305.Otherwise, then it is judged as candidate item not by verification, Carry out sub-step S306.Such as Chinese idiom " killing two birds with one stone ", after the output for judging completion " stone ", then inputs character Whether " two birds " is the first in candidate item produced by " erniao ".
In actual application, any one mode of above two mode can be selected to come to waiting according to actual needs Option is verified.
Sub-step S305:Input method is successfully tested, and completes input method test;
When the predetermined state of input method in input process, action, the trigger condition of action and candidate item are all by verification, Then input method is successfully tested, and completes input method test.
Sub-step S306:Input method test crash, terminates input method test;
When the predetermined state of input method, action, the trigger condition of action and candidate item any one do not have in input process By verification, then input method test crash, terminates input method test.
Pass through the description of above-mentioned embodiment, it will be understood that input method method of testing of the invention, by collecting input method Predetermined state under the predetermined state of the trigger condition that acts and/or input method follow the situation that action changes and changed, generation Act corresponding test case.Input method is tested using the action of generation corresponding test case, due to test case Amount is accurate less, it is possible to increase the degree of accuracy of input method test.
In addition, in being tested using the corresponding test case of action of generation input method, by entering to input process Row verification is tested to complete input method.And the input process both predetermined state comprising input method, the action under predetermined state, productions Generation of trigger condition and candidate item vividly made etc., input method test to the various pieces in input process by carrying out school Test, be not entirely dependent on the verification of candidate item to evaluate input method performance, the accuracy of input method test improved, while also improving The stability of test case.
Meanwhile, test case is inputted by virtual client in test process, and be sent to input method service Device.Both the automation of input method test can have been realized, the effect that user interface presentation is brought in input method test process can be solved again The problem of rate is low.
Referring to Fig. 6, electronic installation first embodiment of the present invention includes sort module 11, acquisition module 12 and test Use-case generation module 13, wherein:
Sort module 11 is used under the predetermined state of input method, and the action that input method can be responded is classified, and By sorted action output to acquisition module 12;
Sort module 11 is to action that under input method predetermined state, input method can be responded and/or the knot produced by action Fruit is classified, and the result produced by sorted action and/or by action is exported to acquisition module 12.
Under the predetermined state of input method, the action that input method can be responded is classified, at the same can also include pair The result that action is produced is classified.The predetermined state of input method can be one or more kinds of predetermined states.Such as but It is not limited to any one in pre-input state, normal input state and transition status or two or more states.
Action refers to some operation behaviors for the user that can be responded under the predetermined state of input method.It is generally pre- at some Under the predetermined state of fixed input method, it is only capable of responding some actions specified.Such as under pre-input state or Input transformation shape Under state, it is only capable of responding such as page turning, the mobile action of text section.Again such as under normal input state, it is only capable of responding such as " Backspace ", " Cancel ", " Commit ", " 33 kinds of actions such as Convert To Half Width ".
And act the result that the result produced refers to input method response action and produced.Such as response action " cancel " is produced The raw result deleted, response action " convert To Full Alphanumeric " and produce and be transformed into the female result of full word.
Wherein, the action that can be responded to input method carry out classification refer to action under the predetermined state for input method by Classified according to the type of action.Such as input character behavior, select word behavior, page turning behavior, text section mobile behavior etc..
Acquisition module 12 is used for according to the sorted action from sort module 11, obtains sorted each action pair The situation that the trigger condition and/or the predetermined state of input method answered follow the change of action and changed, and export to test case Generation module 13;
Acquisition module 12 obtains the sorted shape for each acting corresponding trigger condition and/or input of categorized module 11 The situation that state follows the change of action and changed, the predetermined of corresponding trigger condition and/or input method is each acted by acquisition The situation that state follows the change of action and changed is exported to Test cases technology module 13.
For a certain action, possible more than one trigger condition, all trigger conditions at this moment needing acquisition to act.Such as For page turning This move, there are " pgDn ", " ctrl+l " two kinds of trigger conditions, then obtain both trigger conditions.Input method The situation that predetermined state follows the change of action and changed, refers to that some actions cause what the predetermined state of input method changed Situation.It can be returned to by esc under such as transition status and press esc under normal input state, normal input state and can return to pre-input State etc..
Test cases technology module 13 is used for according to the corresponding trigger condition of action from acquisition module 12 and/or input The different corresponding test cases of action of situation generation that the predetermined state of method follows the change of action and changed.
Test cases technology module 13 follows action according to the predetermined state for acting corresponding trigger condition and/or input method Change and the corresponding test case of the different actions of situation generation that changes.
The situation that predetermined state according to corresponding trigger condition and input method is acted follows the change of action and changed, it is raw Into state transition diagram (i.e. the situation that the predetermined state of input method follows action to change and changed).Fig. 2 is see, is life of the present invention Into the schematic diagram of one of state transition diagram in the embodiment of method one of input method test case.Different actions is given birth to Into corresponding different test case.Such as page turning This move correspondence " pgDn ", " ctrl+l " two kinds of trigger conditions, original defeated It is " a ", " ska " to enter string, then the test case generated is respectively " (a { pgDn }, a { Ctrl+l }, ska { pgDn }, ska { Ctrl+ l})”.Here the string that is originally inputted refers to the input string that is produced under pre-input state.Design input method test case when Wait, some special input strings under pre-input state, the test case different from different Design of State can be found.
Referring to Fig. 7, electronic installation second embodiment of the present invention includes abstraction module 21, input module 22 and verification Module 23, wherein:
Abstraction module 21 is used to extract test case, and test case is the triggering acted under the predetermined state based on input method The predetermined state of condition and/or input method follows the situation for acting change and changing and produced;
Abstraction module 21 extracts the test case tested for input method, and the test case of extraction is based on the pre- of input method Determine situation that the predetermined state of the trigger condition and/or input method acted under state follows the change of action and change and produce 's.
Here test case is the predetermined of the trigger condition that acts under the predetermined state based on input method and/or input method State follows the situation for acting change and changing and produced.
Wherein, above-mentioned test case is to obtain in the following manner:Under the predetermined state of input method, to input method Can the action of response classified, then obtain and sorted each act the pre- of corresponding trigger condition and/or input method The situation determined state to follow the change of action and changed, further according to the predetermined shape for acting corresponding trigger condition and/or input method The situation that state follows the change of action and changed, generates the different corresponding test cases of action.
Input module 22 is used to input the corresponding character of test case that abstraction module 21 is extracted using input method;
The corresponding character of test case of 22 pairs of extractions of input module is inputted.Input module 22 can be by virtual Client is inputted to the corresponding character of test case that abstraction module 21 is extracted, and is sent to input method server.
Under normal circumstances, it is all the elements information shown in user interface, such as how many page of candidate item, candidate item, defeated Enter method in what state etc., corresponding xml document generation is had when input method is tested.Therefore, under normal circumstances in order to The automation of input method test is realized, generally there is two ways:1st, Simulation of keyboard input, this mode appears like someone and existed Typewriting is the same, carries out input method test with this, the process has user interface participation;2nd, the logical program that input method is handled is beaten Compressed file is bundled into, is triggered by providing some character strings, so, although do not inputted on interface, but is also produced corresponding Xml document, input method test can also be carried out.
, can be using any one of above two mode when being inputted using input method for the test case of extraction Kind.In embodiments of the present invention, input module 22 is by simulating (mock) virtual client (client) and input Communication between server (server) carry out process of method, is carried out defeated by virtual client to the corresponding character of test case Enter, and be sent to input method server.The automation of input method test so can have both been realized, input method can be solved again and was tested The problem of inefficiency that user interface presentation is brought in journey.
The process that correction verification module 23 is used for the input to input module 22 is verified, and completes input method test.
Correction verification module 23 is verified to the process of input test use-case, includes the predetermined shape of the input method to input process State, the action under the predetermined state of input method, the trigger condition of action and candidate item are verified one by one, and all verifications are led to Cross, be then judged as that input method is successfully tested, complete input method test.
Referring to Fig. 8, in the embodiment of electronic installation the 3rd of the present invention, correction verification module includes the first verification unit 111, the Two verification units 112, the 3rd verification unit 113 and the 4th verification unit 114, wherein:
The predetermined state of input method is verified during first verification unit 111 is used for input, input method it is pre- When determining state by verifying, the instruction verified to the action under the predetermined state of input method is sent to the second verification unit 112;
First verification unit 111 is corresponding with test case defeated by the predetermined state for judging input method during inputting Whether the predetermined state for entering method unanimously comes to verify the predetermined state of input method.When the predetermined state of input method is used with test When the predetermined state of the corresponding input method of example is consistent, when being judged as the predetermined state of input method by verifying, send to input method Predetermined state under the instruction that is verified of action to the second verification unit 112.Otherwise, the predetermined shape to input method is not sent The instruction that action under state is verified.
Second verification unit 112 is used to verify the action under the predetermined state of input method, in the state of input Action by verifying when, send the instruction verified to the trigger condition of action to the 3rd verification unit 113;
Second verification unit 112 is when the predetermined state of the input method in the first verification unit 111 is by verifying, by sentencing Whether the action action corresponding with test case under the predetermined state of disconnected input method unanimously comes under the predetermined state to input method Action verified.When the action under the predetermined state of input method is corresponding with test case keeps strokes, it is judged as defeated Enter the action under the predetermined state of method by verification, then send the instruction verified to the trigger condition of action to the 3rd verification Unit 113.Otherwise, the instruction verified to the trigger condition of action is not sent.
3rd verification unit 113 is used to verify the trigger condition of action;
3rd verification unit 113 passes through verification when the action under the predetermined state of the input method in the second verification unit 112 When, whether the trigger condition acted by judgement the trigger condition acted whether corresponding with test case is unanimously come to action Trigger condition verified.When whether corresponding with test case the trigger condition of the action trigger condition acted be consistent When, it is judged as that the trigger condition of action by verification, then sends the instruction verified to candidate item to the 4th verification unit 114.Otherwise, the instruction verified to candidate item is not sent.
4th verification unit 114 is used to verify candidate item using custom rule.
4th verification unit 114 when in the 3rd verification unit 113 to the trigger condition of action by verifying when, pass through and judge Whether candidate item meets predetermined requirement to verify candidate item.When candidate item meets predetermined requirement, it is judged as waiting Option is successfully tested by verification, input method, completes input method test.Otherwise, input method test crash, terminates input method and surveys Examination.
The beneficial effects of the invention are as follows:It is different from the situation of prior art, the side of present invention generation input method test case The trigger condition and/or the predetermined state of input method acted under method, the predetermined state by collecting input method follows the action The situation for changing and changing, can be with less test case come big model for the different corresponding test cases of movements design The situation of exclosure covering user actual key input, improves the coverage rate of test case;Simultaneously because test case amount is few and accurate Really, it is possible to increase the degree of accuracy of follow-up input method test.
On the other hand, in being tested using the corresponding test case of action of generation input method, by inputting Cheng Jinhang verifications are tested to complete input method.And input process had both included the predetermined state of input method, moving under predetermined state Work, generation of trigger condition and candidate item of generation action etc., input method is tested by the various pieces in input process Verified, be not entirely dependent on the verification of candidate item to evaluate input method performance, improve the accuracy of input method test, simultaneously Also the stability of test case is improved.
Meanwhile, test case is inputted by virtual client in test process, and be sent to input method service Device.Both the automation of input method test can have been realized, the effect that user interface presentation is brought in input method test process can be solved again The problem of rate is low.
In several embodiments provided by the present invention, it should be understood that disclosed apparatus and method, it can pass through Other modes are realized.For example, device embodiments described above are only schematical, for example, stroke of the module Point, only a kind of division of logic function can have other dividing mode when actually realizing, such as multiple module or components can To combine or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or beg for The coupling each other of opinion or direct-coupling or communication connection can be the INDIRECT COUPLINGs of device or unit by some interfaces Or communication connection, can be electrical, machinery or other forms.
The functional module illustrated as separating component can be or may not be physically separate, be used as list The part of member display can be or may not be physical location, you can with positioned at a place, or can also be distributed to On multiple NEs.Some or all of unit therein can be selected to realize the present invention program's according to the actual needs Purpose.
In addition, each functional module in each embodiment of the invention can be integrated in a processing unit, also may be used To be that each functional module is individually physically present, can also two or more functional modules it is integrated in a unit.On Stating integrated unit can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
Embodiments of the present invention are the foregoing is only, are not intended to limit the scope of the invention, it is every to utilize this Equivalent structure or equivalent flow conversion that description of the invention and accompanying drawing content are made, or directly or indirectly it is used in other correlations Technical field, is included within the scope of the present invention.

Claims (15)

1. a kind of method for generating input method test case, it is characterised in that including:
Under the predetermined state of the input method, the action that the input method can be responded is classified;
The predetermined state for obtaining the corresponding trigger condition of sorted each action and the input method follows described move The change of work and situation about changing;
The change of the action is followed according to the predetermined state of the corresponding trigger condition of the action and/or the input method and become The different corresponding test cases of action of situation generation of change.
2. according to the method described in claim 1, it is characterised in that described under the predetermined state of input method, to the input The step of action that method can be responded is classified includes:
Under the predetermined state of the input method, the action that can be responded to the input method and the knot produced by the action Fruit is classified.
3. according to the method described in claim 1, it is characterised in that described under the predetermined state of input method, to the input The step of action that method can be responded is classified includes:
Under at least one of the pre-input state of the input method, normal input state and transition status predetermined state, The action that the input method can be responded is classified.
4. a kind of input method method of testing, it is characterised in that including:
Test case is extracted, the test case is the trigger condition and/or input acted under the predetermined state based on input method The predetermined state of method follows the situation for acting change and changing and produced;
The corresponding character of the test case is inputted using the input method;
Process to the input is verified, and completes the input method test;
The process of described pair of input is verified, and completing the step of input method is tested includes:
The predetermined state of input method is verified during to the input;
If the verification to the predetermined state of the input method passes through, school is carried out to the action under the predetermined state of the input method Test;
If the verification to the action passes through, the trigger condition to the action is verified;
If the verification to the trigger condition passes through, using custom rule to inputting the corresponding character institute of the test case The candidate item of generation is verified;
If the verification to the candidate item passes through, it is judged as that the input method is successfully tested, completes the input method test.
5. method according to claim 4, it is characterised in that the predetermined state to input method in input process is carried out The step of verification, includes:
Judge that the predetermined state of corresponding input method is with the test case for the predetermined state of input method of the input process It is no consistent;
If the predetermined state of the predetermined state of input method corresponding input method with the test case is consistent in the input process, Then it is judged as that the predetermined state of the input method, by verification, otherwise, is judged as the input method test crash, terminates input method Test.
6. method according to claim 5, it is characterised in that the action under the predetermined state to input method carries out school The step of testing includes:
Judge whether the action action corresponding with the test case under the predetermined state of the input method is consistent;
Keep strokes if action under the predetermined state of the input method is corresponding with the test case, be judged as described dynamic The verification of work passes through, otherwise, is judged as the input method test crash, terminates input method test.
7. method according to claim 5, it is characterised in that the step of trigger condition of described pair of action is verified is wrapped Include:
Judge whether the trigger condition of the trigger condition action corresponding with the test case of the action is consistent;
If the trigger condition of the trigger condition of action action corresponding with the test case is consistent, it is judged as action The verification of trigger condition passes through, otherwise, is judged as the input method test crash, terminates the input method test.
8. method according to claim 5, it is characterised in that what the use custom rule was verified to candidate item Step includes:
Predetermined context is extracted, designated character string corresponding to the predetermined context is inputted, judgement often inputs one Whether the 4th of candidate item produced by individual designated character string is face word;
If it is described often input a designated character string produced by the 4th of candidate item be not face word, be judged as described defeated Enter method test crash, terminate the input method test;If the of the candidate item often inputted produced by a designated character string Four are face words, then are judged as that the input method is successfully tested, and complete the input method test.
9. method according to claim 5, it is characterised in that what the use custom rule was verified to candidate item Step includes:
Extract predetermined context;
Designated character string corresponding to the predetermined context is inputted, and judges that the candidate when completion above exports followed by When inputting hereafter corresponding designated character string, whether the first choice of produced candidate item is described specify hereafter;
If it is described then input candidate item hereafter produced by corresponding designated character string first choice be it is described specify hereafter, Then it is judged as that the input method is successfully tested, completes the input method test, otherwise, is then judged as that the input method test is lost Lose, terminate the input method test.
10. the method according to claim any one of 5-9, it is characterised in that the utilization input method is used the test The step of corresponding character of example is inputted includes:
Using the input method, the corresponding character of the test case is inputted by virtual client, and is sent to Input method server.
11. a kind of electronic installation, it is characterised in that including sort module, acquisition module and Test cases technology module, its In:
The sort module is used under the predetermined state of input method, and the action that the input method can be responded is classified, And by the sorted action output to the acquisition module;
The acquisition module is used for according to the sorted action from sort module, obtains sorted each described dynamic Make corresponding trigger condition and/or the input method predetermined state follow the action change and situation about changing and output To the Test cases technology module;
The Test cases technology module be used for according to from the acquisition module the corresponding trigger condition of the action and The different corresponding test cases of action of situation generation that the predetermined state of the input method follows the change of the action and changed.
12. device according to claim 11, it is characterised in that the sort module is specifically in the input method Under at least one of pre-input state, normal input state and transition status predetermined state, the input method can be rung The action answered is classified, and by the sorted action output to the acquisition module.
13. a kind of electronic installation, it is characterised in that including abstraction module, input module and correction verification module, wherein:
The abstraction module is used to extract test case, and the test case is touching of acting under the predetermined state based on input method Clockwork spring part and the predetermined state of input method follow the situation for acting change and changing and produced;
The corresponding character of the test case that the input module is used to extract the abstraction module using input method is carried out Input;
The process that the correction verification module is used for the input to the input module is verified, and completes input method test;
The correction verification module includes the first verification unit, the second verification unit, the 3rd verification unit and the 4th verification unit, its In:
The predetermined state of input method is verified during first verification unit is used for the input, when input method When predetermined state is by verifying, the instruction verified to the action under the predetermined state of the input method is sent to described second Verification unit;
Second verification unit is used to verify the action under the predetermined state of the input method, when the input method When action under predetermined state is by verifying, the instruction verified to the trigger condition of the action is sent to the 3rd school Verification certificate member;
3rd verification unit is used to verify the trigger condition of the action, when the trigger condition of action passes through verification When, the instruction verified to candidate item is sent to the 4th verification unit;
4th verification unit is used to verify the candidate item using custom rule.
14. device according to claim 13, it is characterised in that
First verification unit is surveyed specifically for the predetermined state of input method during by judging the input with described Whether the predetermined state of the corresponding input method of example on probation unanimously comes to verify the predetermined state of the input method, when described defeated When the predetermined state of the predetermined state of input method input method corresponding with the test case is consistent during entering, it is judged as institute The predetermined state of input method is stated by verification, the instruction verified to the action under the predetermined state of input method is sent to described Second verification unit, otherwise, the instruction that the action under the predetermined state to input method is verified is not sent;
Second verification unit is specifically for responding under the predetermined state to input method from the first verification unit The instruction verified is acted, the action under predetermined state by judging the input method is corresponding with the test case to be moved The action for making whether unanimously to come under the predetermined state to the input method is verified, when under the predetermined state of the input method Action is corresponding with the test case to keep strokes, and is judged as the action under the predetermined state of the input method by verification, The instruction verified to the trigger condition of action is then sent to the 3rd verification unit, otherwise, described pair of action is not sent The instruction that is verified of trigger condition;
3rd verification unit carries out school specifically for responding the trigger condition of the described pair of action from the second verification unit The instruction tested, by the trigger condition for judging the action trigger condition acted corresponding with the test case whether one Cause verifies come the trigger condition to the action, is moved when the trigger condition of the action is corresponding with the test case The trigger condition of work is consistent, is judged as that the trigger condition of the action by verification, then sends the finger verified to candidate item Make to the 4th verification unit, otherwise, the instruction verified to candidate item is not sent;
4th verification unit specifically for responding the instruction verified to candidate item from the 3rd verification unit, The candidate item is verified by judging whether the candidate item meets predetermined requirement, when candidate item meets predetermined It is required that, it is judged as candidate item by verification, input method is successfully tested, completes input method test, otherwise, input method test crash, Terminate input method test.
15. device according to claim 14, it is characterised in that the input module is specifically for utilizing the input Method, the corresponding character of test case extracted by virtual client to the abstraction module is inputted, and is surveyed described The corresponding character of example on probation is sent to input method server.
CN201210458605.6A 2012-11-15 2012-11-15 Input method method of testing, the method and electronic installation for generating test case Active CN102981938B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210458605.6A CN102981938B (en) 2012-11-15 2012-11-15 Input method method of testing, the method and electronic installation for generating test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210458605.6A CN102981938B (en) 2012-11-15 2012-11-15 Input method method of testing, the method and electronic installation for generating test case

Publications (2)

Publication Number Publication Date
CN102981938A CN102981938A (en) 2013-03-20
CN102981938B true CN102981938B (en) 2017-10-31

Family

ID=47855993

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210458605.6A Active CN102981938B (en) 2012-11-15 2012-11-15 Input method method of testing, the method and electronic installation for generating test case

Country Status (1)

Country Link
CN (1) CN102981938B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106919943A (en) * 2015-12-25 2017-07-04 北京搜狗科技发展有限公司 A kind of data processing method and device
CN106990853B (en) * 2017-03-21 2020-04-10 方欣科技有限公司 Data input method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1971535A (en) * 2005-11-21 2007-05-30 中国科学院软件研究所 Testing method and system of safety input output automation based on time
CN101025686A (en) * 2007-03-22 2007-08-29 中兴通讯股份有限公司 Automation test system and test script generating and operating method
CN101236523A (en) * 2008-02-29 2008-08-06 深圳华为通信技术有限公司 Input method test method and device
CN102253887A (en) * 2011-07-13 2011-11-23 南京中兴软创科技股份有限公司 Method for constructing test use case of software-as-a-service (SaaS) software based on durable X-machine (DXM) model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1971535A (en) * 2005-11-21 2007-05-30 中国科学院软件研究所 Testing method and system of safety input output automation based on time
CN101025686A (en) * 2007-03-22 2007-08-29 中兴通讯股份有限公司 Automation test system and test script generating and operating method
CN101236523A (en) * 2008-02-29 2008-08-06 深圳华为通信技术有限公司 Input method test method and device
CN102253887A (en) * 2011-07-13 2011-11-23 南京中兴软创科技股份有限公司 Method for constructing test use case of software-as-a-service (SaaS) software based on durable X-machine (DXM) model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Linux输入方法自动测试技术的实现;张立强;《民族语言文字信息技术研究——第十一届全国民族语言文字信息学术研讨会论文集》;20070228;正文第194-195页 *
基于UML2.0模型的测试与验证方法;张琛;《万方学位论文全文数据库》;20120930;正文部分第45-65页 *

Also Published As

Publication number Publication date
CN102981938A (en) 2013-03-20

Similar Documents

Publication Publication Date Title
US10706332B2 (en) Analog circuit fault mode classification method
Afshan et al. Evolving readable string test inputs using a natural language model to reduce human oracle cost
CN104956362B (en) Analyze the structure of weblication
CN104156224B (en) A kind of software building continuous integrating method and system
CN105868114B (en) FPGA software systems and its each module test system and method
CN101013452A (en) Symbolized model detection method
CN101689216B (en) Compact circuit-simulation output
CN103995780B (en) A kind of program error localization method based on sentence frequency statistics
CN111694937A (en) Interviewing method and device based on artificial intelligence, computer equipment and storage medium
CN105575206A (en) Ordnance soldier vocational skill identification virtual examine and training system
CN106802863A (en) Interprocess communication security formalization analysis checking system based on micro-kernel prototype
CN107193743A (en) One kind application assessment method, device, computer equipment and storage medium
CN103853863B (en) Implementation method for PDK (process design kit) automatic test interface
CN105991517B (en) Vulnerability mining method and apparatus
CN102981938B (en) Input method method of testing, the method and electronic installation for generating test case
CN103617114A (en) Third-party component vulnerability test method based on conditions and parameter variations
CN103577557A (en) Device and method for determining capturing frequency of network resource point
CN109101414B (en) Massive UI test generation method and device based on buried point data
CN106484913A (en) Method and server that a kind of Target Photo determines
US9672317B2 (en) Quality of results system
CN103440391B (en) Semiconductor process corner scanning and simulating method based on numerical value selection function
CN101763453B (en) Standardized IP core evaluating method and system
US20200327027A1 (en) Automated Self-Check of a Closed Loop Emulation Replay
CN110209572A (en) Ui testing method, ui testing system and terminal
CN111259581A (en) Failure connection detection method and device for pressure contact type conductive contact piece and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant