Summary of the invention
The problem that the present invention solves realizes carrying out efficiently and the test of low cost mobile terminal protocol stack.
For solving the problem, the invention provides a kind of mobile terminal protocol stack method of testing, comprising:
According to test case, the mobile terminal protocol stack to be measured transplanted in testing equipment sends protocol stack instruction to mobile terminal identification card;
The data corresponding with described protocol stack instruction of described mobile terminal protocol stack mobile terminal receive identification card feedback to be measured;
Feedback after described mobile terminal protocol stack to be measured receives described data is analyzed, obtains the test result to described mobile terminal protocol stack to be measured;
Wherein, mutual between described mobile terminal protocol stack to be measured and mobile terminal identification card carries out via the mobile terminal identification card driver element in described testing equipment.
Optionally, identification card simulator is adopted to simulate mobile terminal identification card.
Optionally, described mobile terminal protocol stack method of testing also comprises: described mobile terminal protocol stack to be measured obtains the active data in described mobile terminal identification card; Wherein, described active data constructs based on test purpose.
Optionally, the active data that described mobile terminal protocol stack to be measured obtains in described mobile terminal identification card comprises: the active data received from mobile terminal identification card notifies; Active data reading command is sent to described mobile terminal identification card; Receive the active data that described mobile terminal identification card returns.
Optionally, the data of described mobile terminal identification card feedback are the replies pre-set based on testing requirement.
Optionally, when there is not the default reply for the protocol stack instruction from mobile terminal protocol stack to be measured in described mobile terminal identification card, the data of described mobile terminal identification card feedback are the replies constructed based on the EF file stored in described protocol stack instruction and mobile terminal identification card.
Optionally, batch processing instrument is adopted to manage test case and run control.
Optionally, described test result refers to that mobile terminal protocol stack to be measured is to the compatibility of mobile terminal identification card and conforming test result.
For solving the problem, the present invention also provides a kind of mobile terminal protocol stack method of testing, adopts identification card simulator to simulate mobile terminal identification card; Described method comprises:
Receive the protocol stack instruction produced based on test case of the mobile terminal protocol stack that self-testing device is transplanted;
Described protocol stack instruction is resolved, to the data that described mobile terminal protocol stack feedback is corresponding with described instruction;
Wherein, mutual between described mobile terminal protocol stack and identification card simulator carries out via the identification card simulator driver element in testing equipment.
Optionally, describedly to comprise to the described mobile terminal protocol stack feedback data corresponding with described instruction: search the reply pre-set based on testing requirement stored in identification card simulator, send described reply.
Optionally, when there is not the default reply for the protocol stack instruction from mobile terminal protocol stack in described identification card simulator, the data of described identification card simulator feedback are the replies constructed based on the EF file stored in described protocol stack instruction and identification card simulator.
Optionally, described mobile terminal protocol stack method of testing also comprises: described identification card simulator provides active data to described mobile terminal protocol stack; Wherein, described active data constructs based on test purpose.
Optionally, described identification card simulator provides active data to comprise to described mobile terminal protocol stack: send active data notice to described mobile terminal protocol stack; Receive the active data reading command from described mobile terminal protocol stack; Active data is returned to described mobile terminal protocol stack.
For solving the problem, the present invention also provides a kind of testing equipment, comprising:
Protocol stack acquiring unit, obtains mobile terminal protocol stack to be measured for the mode by transplanting;
First transmitting element, is sent to mobile terminal identification card for the protocol stack instruction produced according to test case by mobile terminal protocol stack to be measured;
First receiving element, for the transfer of data corresponding with the described protocol stack instruction extremely mobile terminal protocol stack to be measured fed back by mobile terminal identification card;
Analytic unit, analyzes for the feedback after receiving described data to described mobile terminal protocol stack to be measured, obtains the test result to described mobile terminal protocol stack to be measured.
Optionally, described testing equipment also comprises: carry out mutual network analog unit for analog network side apparatus and mobile terminal protocol stack to be measured.
Optionally, described testing equipment also comprises: be sent to the data capture unit of mobile terminal protocol stack to be measured for the active data that obtains in described mobile terminal identification card; Wherein, described active data constructs based on test purpose.
Optionally, described data capture unit notifies for the active data received from mobile terminal identification card; Send active data reading command to described mobile terminal identification card, receive the active data that described mobile terminal identification card returns.
Optionally, described first transmitting element, the first receiving element and data capture unit are integrated in described mobile terminal protocol stack to be measured.
Optionally, the data of described mobile terminal identification card feedback are the replies pre-set based on testing requirement.
Optionally, described testing equipment also comprises: for managing and run the batch processing unit of control to test case.
For solving the problem, the present invention also provides a kind of identification card simulator, comprising:
Second receiving element, the protocol stack instruction that the mobile terminal protocol stack transplanted for receiving testing equipment produces based on test case;
Resolution unit, for resolving described protocol stack instruction, to the data that described mobile terminal protocol stack feedback is corresponding with described instruction;
Driver element, for transmitting the information between mobile terminal protocol stack and mobile terminal identification card.
Optionally, described identification card simulator also comprises: memory cell, for storing the reply pre-set based on testing requirement; Described resolution unit by searching the reply stored in memory cell, using described reply as the data feedback corresponding with described instruction to described mobile terminal protocol stack.
Optionally, described identification card simulator also comprises: judging unit and reply structural unit, and whether described judging unit exists the reply for the protocol stack instruction from mobile terminal protocol stack for judging in described memory cell; Described reply structural unit is used for when judged result is no, replys, using described reply as the data corresponding with described instruction based on the EF file build stored in described protocol stack instruction and memory cell.
Optionally, described identification card simulator also comprises: for providing the second transmitting element of active data to described mobile terminal protocol stack; Wherein, described active data constructs based on test purpose.
Optionally, described second transmitting element is used for sending active data notice to described mobile terminal protocol stack; Receive the active data reading command from described mobile terminal protocol stack; Active data is returned to described mobile terminal protocol stack.
Optionally, described identification card simulator also comprises: control unit, for controlling the work of unit each in identification card simulator.
For solving the problem, the present invention also provides a kind of mobile terminal protocol stack test macro, comprising: above-mentioned testing equipment and identification card simulator.
Compared with prior art, technical scheme of the present invention has following beneficial effect:
Protocol stack instruction is sent to mobile terminal identification card by the mobile terminal protocol stack to be measured transplanted in testing equipment, and the data corresponding with described protocol stack instruction of mobile terminal receive identification card feedback, analyze mobile terminal protocol stack to be measured receive described data after feedback, to obtain the test result to described mobile terminal protocol stack to be measured; For manual test, because testing equipment possesses powerful disposal ability, what can realize on the one hand between mobile terminal protocol stack to be measured and identification card is comprehensively mutual, comprehensively test between mobile terminal protocol stack to be measured and identification card, on the other hand, the testing efficiency to testing between mobile terminal protocol stack to be measured and mobile terminal identification card is also improved.
Further, simulate owing to have employed the behavior of identification card simulator to mobile terminal identification card, simulate the different behaviors of mobile terminal identification card, particularly, can the normal behaviour of simulating mobile terminal identification card and abnormal behaviour.For instrument test, because it can the normal behaviour of simulating mobile terminal identification card and abnormal behaviour, and then the compatibility can tested between different mobile terminal identification cards and mobile terminal protocol stack to be measured, expand the test specification between mobile terminal protocol stack to be measured and identification card, achieve the integrality to testing between mobile terminal protocol stack to be measured and identification card, and, because test does not need to carry out based on real identification card, therefore reduce testing cost.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage more become apparent, and are described in detail the specific embodiment of the present invention below in conjunction with accompanying drawing.
Set forth detail in the following description so that fully understand the present invention.But the present invention can be different from alternate manner described here to implement with multiple, those skilled in the art can when without prejudice to doing similar popularization when intension of the present invention.Therefore the present invention is not by the restriction of following public embodiment.
Due in prior art, all there is corresponding defect in manual test protocol stack and instrument test protocol stack, therefore, inventor proposes, protocol stack instruction is sent to mobile terminal identification card, to improve the testing efficiency to compatible between mobile terminal protocol stack and identification card and uniformity test by the mobile terminal protocol stack to be measured transplanted in testing equipment.Further, adopt identification card simulator simulating mobile terminal identification card, realize the integrality of test, reduce testing cost.
In order to the mobile terminal protocol stack method of testing of the present embodiment, testing equipment, identification card simulator and mobile terminal protocol stack test macro can be understood better, first related terms is illustrated.
In the present embodiment, test case is for testing the corresponding function point of mobile terminal protocol stack to be measured, testing equipment is by performing different test cases, miscellaneous service test, complex scene test etc. are carried out to mobile terminal protocol stack to be measured, to realize consistency between described mobile terminal protocol stack and identification card and compatible test.
In the present embodiment, mobile terminal identification card for identify user identity, store user-dependent data etc.It can be SIM card (SubscriberIdentityModule), also can be usim card (UniversalSubscriberIdentityModule).
In the present embodiment, mobile terminal identification card driver element is for transmitting the data between mobile terminal protocol stack to be measured and mobile terminal identification card, particularly, receive the data that mobile terminal protocol stack to be measured sends, described data are sent to mobile terminal identification card, and receive data that described mobile terminal identification card returns and send it to mobile terminal protocol stack to be measured.
In the present embodiment, identification card simulator is used for the behavior of simulating mobile terminal identification card.
Refer to Fig. 1, Fig. 1 is the basic structure schematic diagram of the mobile terminal protocol stack test macro of the embodiment of the present invention, as shown in Figure 1, described mobile terminal protocol stack test macro comprises testing equipment 1 and identification card simulator 2, by described testing equipment 1, described mobile terminal protocol stack to be measured is transplanted in testing equipment 1, and then by the data interaction in testing equipment 1 between mobile terminal protocol stack to be measured and identification card simulator 2, to realize the test to mobile terminal protocol stack to be measured.
Particularly, testing equipment 1 described in the present embodiment can be computer, for transplanting mobile terminal protocol stack to be measured, and the test case run for testing mobile terminal protocol stack to be measured, because identification card simulator 2 is for the behavior of simulating mobile terminal identification card, therefore can simulate with computer, and this computer can be the computer identical with described testing equipment 1, therefore, described identification card simulator 2 may operate in described testing equipment 1, certainly, described identification card simulator 2 also can be simulated with other computers, now, need the passage setting up transfer of data between described testing equipment 1 and identification card simulator 2, as adopted data wire, the two is interconnected.
Refer to Fig. 2, Fig. 2 is the flow chart of the mobile terminal protocol stack method of testing of the embodiment of the present invention; As shown in Figure 2, in the test process to described mobile terminal protocol stack, the action that testing equipment performs comprises:
S11: according to test case, the mobile terminal protocol stack to be measured transplanted in testing equipment sends protocol stack instruction to mobile terminal identification card;
S12: the data corresponding with described protocol stack instruction of described mobile terminal protocol stack mobile terminal receive identification card feedback to be measured;
S13: the feedback after described mobile terminal protocol stack to be measured receives described data is analyzed, obtains the test result to described mobile terminal protocol stack to be measured; Wherein, mutual between described mobile terminal protocol stack to be measured and mobile terminal identification card carries out via the mobile terminal identification card driver element in described testing equipment.
In the present embodiment, testing equipment obtains mobile terminal protocol stack to be measured by the mode of transplanting, particularly, by testing equipment, the ARM engineering of all for mobile terminal protocol stack to be measured modules is transplanted on Win32 platform exactly, make VC engineering and ARM engineering one_to_one corresponding, therefore transplanting the protocol stack code that the code of mobile terminal protocol stack to be measured and real handset that obtain run is same set of code.
In the present embodiment, in order to can consistency between full test mobile terminal protocol stack and identification card and compatibility, preferably, adopt identification card simulator simulating mobile terminal identification card.Particularly, be exactly normal behaviour and the abnormal behaviour passing through identification card simulator simulating mobile terminal identification card.Therefore, below for mobile terminal identification card for identification card simulator, be described the mobile terminal protocol stack method of testing of the present embodiment, correspondingly, the identification card simulator driver element below mentioned is then corresponding with mobile terminal identification card driver element.
In the present embodiment, testing equipment is by calling test case stored therein and performing described test case, based on the execution to described test case, the mobile terminal protocol stack to be measured transplanted in testing equipment sends protocol stack instruction to identification card simulator and carries out corresponding business to trigger identification card simulator, such as: trigger the business that identification card simulator carries out sending short message; The instruction of protocol stack described in the present embodiment can be triggered by AT order, corresponding business is carried out to make described identification card simulator, as: ATD10086, carry out alternately for triggering between mobile terminal protocol stack to be measured and described identification card simulator, and then call 10086.
In the present embodiment, to before testing between described mobile terminal protocol stack and identification card simulator, can according to the demand of test, the data that described identification card simulator feeds back after receiving the protocol instructions of mobile terminal protocol stack to be measured transmission are arranged, particularly, be exactly that the specific reply corresponding with described protocol stack instruction is set.
Refer to Fig. 3, Fig. 3 is that mobile terminal protocol stack sends protocol stack instruction, the flow chart of the data that identification card simulator feedback is corresponding with described protocol stack instruction, as shown in Figure 3: described mobile terminal protocol stack sends protocol stack instruction, the identification card simulator feedback data corresponding with described protocol stack instruction comprise:
S121: identification card simulator driver element receives protocol stack instruction, and is sent to identification card simulator.
S122: described identification card simulator judges whether to there are the reply data corresponding with described protocol stack instruction.
S123: if exist, then these reply data are taken out.
S124: if do not exist, then reply data based on element files (EF, the ElementFile) structure stored in described protocol stack instruction and identification card simulator.
S125: send described reply data to mobile terminal protocol stack by described identification card simulator driver element.
Particularly, in the present embodiment when described testing equipment implementation of test cases, according to test case, the mobile terminal protocol stack to be measured transplanted in testing equipment sends protocol stack instruction, and be sent to identification card simulator by described identification card simulator driver element, identification card simulator is after receiving described protocol stack instruction, first described protocol stack instruction and the protocol stack instruction be stored in the memory of identification card simulator can be contrasted, if there is the protocol stack instruction that described mobile terminal protocol stack sends in the memory of described identification card simulator, and there are the reply data corresponding with this protocol stack instruction, then the reply data corresponding with the protocol stack instruction that described mobile terminal protocol stack sends can be taken out by identification card simulator, and send described reply data to mobile terminal protocol stack to be measured by identification card simulator driver element.
If identification card simulator is searched for the data stored in its memory, particularly, exactly the protocol stack instruction stored in its memory is searched for, judge whether to there is the protocol stack instruction identical with the protocol stack instruction that described mobile terminal protocol stack sends, and the reply data corresponding with this protocol stack instruction.If when identification card simulator finds the reply data of the protocol stack instruction do not sent for described mobile terminal protocol stack, the protocol stack instruction that then first described identification card simulator can send described mobile terminal protocol stack is resolved accordingly, based on the parsing to described protocol stack instruction, read EF file, described EF file is analyzed, then carry out corresponding structure based on described EF file and reply data to obtain, and then by described identification card simulator driver element, the reply data of structure are sent to mobile terminal protocol stack to be measured.
Mobile terminal protocol stack to be measured can feed back accordingly after the reply data receiving the transmission of described identification card simulator driver element, analyzed by the feedback after receiving described reply data to described mobile terminal protocol stack to be measured, just can obtain the test result to described mobile terminal protocol stack to be measured.
From the above, identification card simulator both can the normal behaviour of simulating mobile terminal identification card also can the abnormal behaviour of simulating mobile terminal identification card, generally, the normal behaviour of mobile terminal identification card refers to and the reply that feedback is corresponding with described protocol stack instruction after the protocol stack instruction receiving mobile terminal protocol stack feeds back to the reply that protocol stack is correct in other words; The abnormal behaviour of mobile terminal identification card refers to and the reply that feedback is not corresponding with described protocol stack instruction after the protocol stack instruction receiving mobile terminal protocol stack feeds back to the reply of protocol stack mistake in other words; Carry out analyzing the test result that just can obtain described mobile terminal protocol stack to be measured to the feedback of mobile terminal protocol stack to described correct reply or error return.
For example, mobile terminal protocol stack to be measured sends protocol stack instruction, identification card simulator feeds back to the reply data corresponding to described protocol stack instruction, mobile terminal protocol stack to be measured can feed back accordingly after receiving described reply data, by judging that whether this feedback is consistent with the feedback of the mobile terminal to be measured write in test case after receiving described reply data, can the consistency between mobile terminal protocol stack to be measured and identification card simulator correspondingly be tested.Particularly, if by running multiple test case, mobile terminal protocol stack to be measured is all consistent with the feedback write in test case to the feedback of the correct reply that identification card simulator sends, then illustrate that the consistency of mobile terminal protocol stack to be measured and described identification card simulator is better, otherwise, then illustrate that the consistency of mobile terminal protocol stack to be measured and described identification card simulator is poor, need correspondingly to revise mobile terminal protocol stack to be measured.
In addition, if mobile terminal protocol stack to be measured sends protocol stack instruction, identification card simulator has fed back wrong reply data, receives the feedback after the reply data of described mistake correspondingly test the compatibility between mobile terminal protocol stack to be measured and described identification card simulator by analyzing described mobile terminal protocol stack to be measured.Particularly, if by running multiple test case, the error return data that mobile terminal protocol stack to be measured sends identification card simulator, correspondingly fault-tolerant processing can be carried out, and continue to run, then illustrate that the compatibility of mobile terminal protocol stack to be measured and described identification card simulator is better, otherwise, then illustrate that the compatibility of mobile terminal protocol stack to be measured and described identification card simulator is poor, need correspondingly to revise mobile terminal protocol stack to be measured.
In the present embodiment, to the test of mobile terminal protocol stack except initiatively sending except protocol stack instruction by mobile terminal protocol stack to be measured, can also send instruction to mobile terminal protocol stack by mobile terminal identification card, the active data that mobile terminal protocol stack obtains in described mobile terminal identification card is carried out.
Please continue to refer to Fig. 2, as shown in Figure 2: described mobile terminal protocol stack method of testing also comprises:
S21: described mobile terminal protocol stack to be measured obtains the active data in described mobile terminal identification card; Wherein, described active data constructs based on test purpose.
And then analyzed by the feedback after obtaining described active data to mobile terminal protocol stack to be measured, obtain the test result to described mobile terminal protocol stack to be measured.
Below still with mobile terminal identification card for identification card simulator is described.Refer to Fig. 4, Fig. 4 is the flow chart of the active data in the mobile terminal protocol stack acquisition identification card simulator of the embodiment of the present invention.As shown in Figure 4, the active data that described mobile terminal protocol stack obtains in identification card simulator comprises:
S211: the active data received from identification card simulator notifies.
S212: send protocol stack instruction to described identification card simulator.
S213: described identification card simulator judges whether described protocol stack instruction is active data reading command.
S214: if so, then active data is sent to mobile terminal protocol stack.
S215: if not, then perform described protocol stack instruction.
Particularly, according to test case, described identification card simulator can inform mobile terminal protocol stack to be measured in the mode of status word, and it has active data, and mobile terminal protocol stack to be measured is after receiving this status word, protocol stack instruction can be sent to described identification card simulator, identification card simulator is after receiving described protocol stack instruction, directly its active data that will send can't be sent to mobile terminal protocol stack to be measured, but the protocol stack instruction that mobile terminal protocol stack to be measured sends is judged, judge whether described protocol stack instruction is active data reading command.
If so, then the active data be stored in the memory of identification card simulator is sent to mobile terminal protocol stack to be measured by identification card simulator driver element.
If not, then described identification card simulator can first correspondingly be resolved described protocol stack instruction, then performs described protocol stack instruction.
For example, to carry out call business by identification card simulator, mobile terminal protocol stack to be measured is tested, the active data that then first mobile terminal protocol stack to be measured will receive from identification card simulator notifies, particularly, its active data will carrying out calling out implication that contains received from identification card simulator notifies, mobile terminal protocol stack to be measured is after receiving this active data notice, protocol stack instruction can be sent to identification card simulator, identification card simulator is after the protocol stack instruction receiving mobile terminal protocol stack transmission, first to judge, whether this protocol stack instruction is the instruction of reading the data relevant with call business, namely whether be active data reading command, if, then be sent to mobile terminal protocol stack to be measured by being stored in data relevant to call business in the memory of identification card simulator by identification card simulator driver element.Mobile terminal protocol stack to be measured can carry out corresponding feedback after receiving the data relevant to call business, by analyzing the feedback of mobile terminal protocol stack to be measured after receiving the data relevant to call business, then can obtain the test result to described mobile terminal protocol stack to be measured.
Protocol stack instruction is sent to identification card simulator by above-mentioned mobile terminal protocol stack to be measured, and identification card simulator transmission active data informs described mobile terminal protocol stack to be measured, and then by analyzing the behavior of described mobile terminal protocol stack to be measured after the reply data receiving the transmission of identification card simulator or active data, can test the consistency between mobile terminal protocol stack and mobile terminal identification card and compatibility more all sidedly.
In the present embodiment, can be managed test case by batch processing instrument and control, particularly, the each test case in testing results equipment in a certain order can be carried out exactly by batch processing instrument, and can according to the result finally run multiple test case, as: the successfully number of test case, the number of failed test case, the running time of test case, the title of failed test case, percent of pass etc., described percent of pass refers to the ratio of the number of successful test case and the test case number of operation, obtain the compatibility between mobile terminal protocol stack and mobile terminal identification card and conforming test result.
By batch processing tool management and testing results use-case, identification card simulator is tested the mobile terminal protocol stack to be measured transplanted, and achieves fast and the automatic regression test of low cost.As: often run a test case, just be equivalent to test between a mobile terminal identification card and mobile terminal protocol stack, according to the speed of service of present computer, within 1 day, at least can perform 5 times to 1000 test cases, therefore, it just can be tested between 1000 mobile terminal identification cards and mobile terminal protocol stack at 1 day, and analyze according to the test case of test result to failure, and then mobile terminal protocol stack to be measured is correspondingly revised, to improve the function of the protocol stack of mobile terminal to be measured.Therefore, achieve the high and regression test that cost is low of testing efficiency.
It should be noted that, the network environment of Simulation of Complex can also be carried out to test accordingly mobile terminal protocol stack by network simulator in the present embodiment, by network simulator to simulate under different network environments, compatibility between mobile terminal protocol stack and identification card simulator and consistency, particularly, by writing corresponding program in test case, can come in realize the various different network environment of simulation to carry out corresponding configuration to the different layers of mobile terminal protocol stack.In addition, if carry out based on the network environment of reality the test of described mobile terminal protocol stack, then without the need to network simulator, or when to described mobile terminal protocol stack test, when not needing the cooperation of network to realize data between described mobile terminal protocol stack and described identification card simulator mutual, as: the deletion of short message, also without the need to network simulator.
In addition, in order to comprehensively test between mobile terminal protocol stack and mobile terminal identification card in the present embodiment, have employed identification card simulator to simulate described mobile terminal identification card, and then mutual by between the mobile terminal protocol stack to be measured transplanted in testing equipment and identification card simulator, to test accordingly described mobile terminal protocol stack to be measured.But, in other embodiments also can mutual directly by between the mobile terminal protocol stack to be measured transplanted in testing equipment and mobile terminal identification card, to test accordingly described mobile terminal protocol stack to be measured, therefore adopting identification card simulator to simulate described mobile terminal identification card should as the restriction to technical solution of the present invention.
The method of testing of above-mentioned mobile terminal protocol stack, mainly with in test process, is described from the method for testing of angle to mobile terminal protocol stack of the action of testing equipment execution.In other embodiments, the method for testing of mobile terminal protocol stack can also be described from the test of angle to mobile terminal protocol stack of the action of identification card simulator execution.
Refer to Fig. 5, Fig. 5 is the flow chart of the mobile terminal protocol stack method of testing of another embodiment of the present invention, described mobile terminal protocol stack method of testing, identification card simulator is adopted to simulate mobile terminal identification card, as shown in Figure 5, in test process, the action that identification card simulator performs comprises:
S31: the protocol stack instruction produced based on test case receiving the mobile terminal protocol stack that self-testing device is transplanted.
S32: resolve described protocol stack instruction, to the data that described mobile terminal protocol stack feedback is corresponding with described instruction; Wherein, mutual between described mobile terminal protocol stack and identification card simulator carries out via the identification card simulator driver element in testing equipment.
In the present embodiment, described testing equipment transplants mobile terminal protocol stack, testing results use-case, identification card simulator receive the protocol stack instruction that described transplanting mobile terminal protocol stack sends, and sends the process of the data corresponding with described protocol stack instruction according to the reply pre-set based on testing requirement that it stores; When there is not the reply for the protocol stack instruction from mobile terminal protocol stack in identification card simulator, described identification card simulator is first resolved described protocol stack instruction, and the EF file build then stored in identity-based identification card simulator replys the process that Data Concurrent delivers to described mobile terminal protocol stack; And identification card simulator sends active data notice to described mobile terminal protocol stack, receives the active data reading command from described mobile terminal protocol stack, returns the process of active data to described mobile terminal protocol stack; And mobile terminal protocol stack described in said process and mutual between identification card simulator carry out via the identification card simulator driver element in testing equipment; With above-mentioned to perform described mobile terminal protocol stack method of testing from testing equipment angle similar, therefore, no longer launch to describe in detail herein.
The embodiment of the present invention also provides a kind of testing equipment, refers to Fig. 6, and Fig. 6 is the structural representation of the testing equipment of the embodiment of the present invention; As shown in Figure 6, the testing equipment 1 of the embodiment of the present invention comprises:
Protocol stack acquiring unit 101, obtains mobile terminal protocol stack to be measured for the mode by transplanting;
First transmitting element 102, is sent to mobile terminal identification card for the protocol stack instruction produced according to test case by mobile terminal protocol stack to be measured;
First receiving element 103, for the transfer of data corresponding with the described protocol stack instruction extremely mobile terminal protocol stack to be measured fed back by mobile terminal identification card;
Analytic unit 104, analyzes for the feedback after receiving described data to described mobile terminal protocol stack to be measured, obtains the test result to described mobile terminal protocol stack to be measured.
In the present embodiment, protocol stack acquiring unit 101, mobile terminal protocol stack to be measured is obtained by the mode of transplanting, particularly, the ARM engineering of all for mobile terminal protocol stack to be measured modules can be transplanted on Win32 platform by protocol stack acquiring unit 101, make VC engineering and ARM engineering one_to_one corresponding, therefore transplanting the protocol stack code that the code of mobile terminal protocol stack to be measured and real handset that obtain run is same set of code.Described first transmitting element 102, first receiving element 103, analytic unit 104 are connected with described protocol stack acquiring unit 101 respectively.
It should be noted that, in the present embodiment, described testing equipment 1 can also comprise and being connected with described protocol stack acquiring unit 101, mutual network analog unit 105 is carried out for analog network side apparatus and mobile terminal protocol stack, described network analog unit 105 is similar with the function of the network simulator when describing mobile terminal protocol stack method of testing, see the above-mentioned description to network simulator, can no longer launch concrete detailed description in detail herein particularly.
In the present embodiment, described testing equipment 1 also comprises: be sent to the data capture unit 106 of mobile terminal protocol stack to be measured for the active data that obtains in described mobile terminal identification card; Described data capture unit 106 is connected with described protocol stack acquiring unit 101, and wherein, described active data constructs based on test purpose.Particularly, the active data that described data capture unit 106 receives from mobile terminal identification card notifies; Send active data reading command to described mobile terminal identification card, receive the active data that described mobile terminal identification card returns.
Described in the present embodiment, the first transmitting element 102, first receiving element 103, data capture unit 106 can be integrated in described mobile terminal protocol stack to be measured 3.
Testing equipment 1 described in the present embodiment also comprises the batch processing unit (not shown) for managing and run control to test case.
In the present embodiment, described testing equipment can be carried out from the described mobile terminal protocol stack method of testing of testing equipment angle execution see above-mentioned the test of mobile terminal protocol stack to be measured, repeats no more herein.
The embodiment of the present invention also provides a kind of identification card simulator, refers to Fig. 7, and Fig. 7 is the structural representation of the identification card simulator of the embodiment of the present invention, and as shown in Figure 7, described identification card simulator 2 comprises:
Second receiving element 201, the protocol stack instruction that the mobile terminal protocol stack transplanted for receiving testing equipment produces based on test case.
Resolution unit 202, for resolving described protocol stack instruction, to the data that described mobile terminal protocol stack feedback is corresponding with described instruction.
Driver element 203, for transmitting the information between mobile terminal protocol stack and identification card simulator.
In the present embodiment, described resolution unit 202, second receiving element 201 is connected by described driver element 203.
In the present embodiment, described identification card simulator 2 also comprises:
Memory cell 204, for storing the reply pre-set based on testing requirement; Described resolution unit 202 is connected with described memory cell 204, by searching the reply stored in memory cell 204, using described reply as the data feedback corresponding with described instruction to described mobile terminal protocol stack.
Judging unit 205, is connected with described memory cell 204, for judging the reply that whether exists in described memory cell 204 for the protocol stack instruction from mobile terminal protocol stack.
Reply structural unit 206, be connected with described judging unit 205, memory cell 204, driver element 203 and the second receiving element 201, during for being no in judged result, based on described second receiving element 201 receive protocol stack instruction and memory cell 204 in store EF file build reply, described reply is sent to mobile terminal protocol stack to be measured as the data corresponding with described instruction via described driver element 203.
Second transmitting element 207, is connected with described driver element 203, and for providing active data to described mobile terminal protocol stack, wherein, described active data constructs based on test purpose.Particularly, described second transmitting element 207 is for sending active data notice to described mobile terminal protocol stack; Receive the active data reading command from described mobile terminal protocol stack; Active data is returned to described mobile terminal protocol stack.
Control unit 208, respectively with described second receiving element 201, resolution unit 202, driver element 203, memory cell 204, judging unit 205, reply structural unit 206, second transmitting element 207 and be connected, for controlling the work of unit each in identification card simulator.
In the present embodiment, described memory cell 204 also comprises: buffer unit (not shown), the protocol stack instruction of identification card simulator 2 is sent to for buffer memory mobile terminal protocol stack, based on the data corresponding with described protocol stack instruction of identification card simulator 2 feedback that testing requirement pre-sets, and buffer memory sends to the active data of mobile terminal protocol stack according to the identification card simulator 2 that test purpose designs, described memory cell 204 is also for storing EF file, particularly, include the content of EF file, relation between EF file structure and EF file.
In the present embodiment, described control unit 208 is for controlling the work of unit each in identification card simulator 2.Particularly, control the stack instruction of resolution unit 202 analysis protocol, and feed back the data corresponding with described protocol stack instruction, the protocol stack instruction controlled in buffer unit accessed cache unit, control the second transmitting element 207 and provide active data etc. to described mobile terminal protocol stack.
In addition, identification card simulator 2 in the present embodiment is except can except the normal behaviour of simulating mobile terminal identification card and abnormal behaviour, STK (the STK of value-added service order can also be developed in simulating mobile terminal identification card, SIMToolkit), and USIM application tool (USAT, USIMApplicationToolkit) and simulating mobile terminal identification card authentication and encryption behavior etc.
It should be noted that, the internal structure of above-mentioned identification card simulator 2 and mobile terminal identification card is also incomplete same, as not necessarily there is buffer unit in the mobile terminal identification card of reality, but, in the present embodiment, for identification card simulator 2, its behavior is the same with the behavior of mobile terminal identification card, particularly, concerning mobile terminal protocol stack, on the interface of mobile terminal protocol stack and described identification card simulator 2, the behavior that identification card simulator 2 send/receive data is consistent with the behavior that mobile terminal identification card send/receive data.
In the present embodiment, the course of work of described identification card simulator 2 can perform described mobile terminal protocol stack method of testing see above-mentioned identification card simulator is carried out, and no longer launches specifically to describe in detail herein.
In sum, the technical scheme of the embodiment of the present invention, at least has following beneficial effect:
Protocol stack instruction is sent to mobile terminal identification card by the mobile terminal protocol stack to be measured transplanted in testing equipment, and the data corresponding with described protocol stack instruction of mobile terminal receive identification card feedback, analyze mobile terminal protocol stack to be measured receive described data after feedback, to obtain the test result to described mobile terminal protocol stack to be measured; For manual test, because testing equipment possesses powerful disposal ability, what can realize on the one hand between mobile terminal protocol stack to be measured and identification card is comprehensively mutual, comprehensively test between mobile terminal protocol stack to be measured and identification card, on the other hand, the testing efficiency to testing between mobile terminal protocol stack to be measured and mobile terminal identification card is also improved.
Further, simulate owing to have employed the behavior of identification card simulator to mobile terminal identification card, simulate the different behaviors of mobile terminal identification card, particularly, can the normal behaviour of simulating mobile terminal identification card and abnormal behaviour.For instrument test, because it can the normal behaviour of simulating mobile terminal identification card and abnormal behaviour, and then the compatibility can tested between different mobile terminal identification cards and mobile terminal protocol stack to be measured, expand the test specification between mobile terminal protocol stack to be measured and identification card, achieve the integrality to testing between mobile terminal protocol stack to be measured and identification card, and, because test does not need to carry out based on real identification card, therefore reduce testing cost.
Although the present invention with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; the Method and Technology content of above-mentioned announcement can be utilized to make possible variation and amendment to technical solution of the present invention; therefore; every content not departing from technical solution of the present invention; the any simple modification done above embodiment according to technical spirit of the present invention, equivalent variations and modification, all belong to the protection range of technical solution of the present invention.