CN1770148A - Automatic generation system and method for script file - Google Patents

Automatic generation system and method for script file Download PDF

Info

Publication number
CN1770148A
CN1770148A CN 200410087145 CN200410087145A CN1770148A CN 1770148 A CN1770148 A CN 1770148A CN 200410087145 CN200410087145 CN 200410087145 CN 200410087145 A CN200410087145 A CN 200410087145A CN 1770148 A CN1770148 A CN 1770148A
Authority
CN
China
Prior art keywords
message
file
module
template
asn
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200410087145
Other languages
Chinese (zh)
Other versions
CN100361127C (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2004100871456A priority Critical patent/CN100361127C/en
Publication of CN1770148A publication Critical patent/CN1770148A/en
Application granted granted Critical
Publication of CN100361127C publication Critical patent/CN100361127C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed is a system for automatically generating script files which comprises: template library for storing template files with different ID; indexing library module for storing indexing files with corresponding relations of all message codes and message names; message library module for storing all the message files with message structures of message names; script generating template for receiving user test case files, wherein the test case files comprises template ID, message codes; script generating module for reading corresponding template, message name, message file according to test case files, and adding the message name, message file into the template to create script file.

Description

A kind of script file automatic creation system and automatic generation method
Technical field
The present invention is a kind of script file automatic creation system and automatic generation method.
Background technology
Abstract syntax rule (Asn, Abstract Syntax Notation) is a kind of linguistic norm of the information format that is used for transmitting between the descriptive system, extensively is used in the information format definition of communication protocol.
Asn.1 is meant the coded document that adopts the Asn coding to generate.The generation of current Asn.1 document is manually to remove to write out the Asn.1 document according to the Asn coding rule.After the ANS.1 document preparation was finished, the user can utilize the Asn compiler that the Asn.1 text is compiled into dynamic link library (dll, dynamic linklibrary) file, and it is compiled into the employed function of dll process is system function.The user is in message call generator program process then, and the dll file that the message generator program calls generation generates message file.
Existing integrated test tools ITT provides a kind of complete manual mode to generate test script, at first manually finish writing of Asn.1 document by the user, then, manually call the Asn compiler and be compiled into the dll file, and then manually the message call generator program generates message, the user removes to write out test script according to the message of wanting test contents and generation then.
Remove to finish the Asn.1 coding by hand owing to existing technology needs the user fully, remove to call the Asn compiler and generate the dll file, manually the message call generator program goes to generate message, removes to generate test script at last more by hand.The work that these are manual not only needs to spend great amount of manpower and time, and cost is higher, and consuming time bigger when needs generate the substantive test script, is disadvantageous for Products Development.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of automatic creation system of script file, realizes that script file generates automatically according to the test case of user's input.
Second purpose of the present invention is to provide a kind of script file to generate method automatically, realizes the automatic generative process of script file according to the test case of user's input.
Realize that script file automatic creation system of the present invention comprises: template base module, index database module, message library module, script generation module.Wherein: the template base module stores the template file that is used for the generation script file, and different template files uses different ID to be numbered storage; The index database module stores the index file of all message codes and message name corresponding relation; The message library module stores all message files, and message file has been described message name and corresponding message structure; Script generation module is used to receive the test case file of user according to the certain format input, wherein, comprises template ID, message code in the test case file at least; Script generation module is according to test case file, read out in template corresponding in the template base module, the index database module corresponding message file in corresponding message name, the message library module, message name, the message file that reads out is written into generation script file in the template that reads.
Wherein, this system further comprises administration module, is used to receive message header defined file, the message structure defined file of user according to the certain format input, generates message file and index file and also stores into respectively in message library module and the index database module.
Wherein, described administration module comprises: message header definition load module, message structure definition load module, index generation module, Asn generation module, collector, text message constructing module, message generating module.Wherein, message header definition load module, message structure definition load module are respectively applied for and receive message header defined file, the message structure defined file of user by the certain format input, and are converted to the document of Asn.1 form respectively; Index generation module and Asn generation module are used to receive message header definition load module, message structure defines the Asn.1 format file after the load module conversion, and generate index file and complete Asn.1 file respectively, wherein index file has write down the corresponding relation of message code and message name; Collector is used for the Asn.1 file that the Asn generation module generates is compiled into the dll file; The text message constructing module is used for the output information of reception hint generation module and message structure definition load module, generates text message according to described information; Message generating module is used to receive the text message that the text message constructing module generates, and receives the dll file that collector generates, and according to dll described text message is resolved the generation message file.
Script file provided by the invention generates method automatically, sets in advance template base, index database, message library, and wherein, template base is being stored the template file that is used for the generation script file, and different template files uses different ID to be numbered storage; Index database is being stored the index file of all message codes and message name corresponding relation; Message library is being stored all message files, and message file has been described message name and corresponding message structure; This method is further comprising the steps of:
The test case file that A4, reception user import according to certain format wherein, comprises template ID, message code at least in the test case file;
B4, the template ID according in the test case file, message code read out in template corresponding in the template base module, the index database module corresponding message file in corresponding message name, the message library module;
C4, message name, the message file that reads out is written into generation script file in the template that reads.
Wherein, this method further comprises the step that generates message file and store message library into, comprising:
A5, reception user press message header defined file, the message structure defined file of certain format input, and are converted to the document of Asn.1 form respectively;
B5, according to the document of the Asn.1 form of message header defined file, message structure defined file conversion, generate index file and complete Asn.1 file respectively, wherein index file has write down the corresponding relation of message code and message name;
C5, generate text message according to the Asn.1 document after the conversion of index file and message structure defined file;
D5, the Asn.1 file is compiled into the dll file;
E5, according to the dll file described text message is resolved and to generate message file and store message library into.
As seen from the above, the present invention frees manpower from uninteresting, loaded down with trivial details hand labour, and the user only needs to write the simple test case of input, and system just can generate required script file.System stores template base, message library, does not therefore need the user to write template, message file part repeatedly, also need not remove to write the Asn.1 document according to the Asn coded format.
Give an example below and analyze explanation advantage of the present invention: with 100,000 line codes is example, according to conventional design: need 3000-4000 integration testing use-case of design, need use three message to be example so that every test test case is minimum, then need to use 9000-12000 bar message, organization definition with every message structure comprises five, and testing final Asn.1 coding needs 45000-60000 capable.
With familiar Test Engineer is example, on average everyone sky is finished 3000 row Asn codings, generates 150 of message, is finished 50 in script and be example, and the time of finishing above need of work is: minimum: 45000/300+9000/150+3000/50=150+60+60=270 (man day); At most: 60000/300+12000/150+4000/50=200+80+80=360 (man day)
Use the present invention, the user only needs the input test use-case, then the rise time of Asn.1 can ignore, the rise time of message can ignore, the rise time of script can ignore, the then final content that only need finish is the simple writing of test case, does not need to write whole script file, and the use-case that adopts this mode to write out also will shorten over half than the time that traditional use-case design needs at least.Therefore, can save the working time greatly, increase work efficiency.Simplify user's input, do not needed the user to remove to learn to understand the compiling form of Asn.
In addition, the present invention also provides management interface, automatically generate the Asn.1 document according to the user by message header defined file, the message structure defined file of certain format input, and generate message file automatically and index file is stored, be convenient to the user maintenance of message library and index database is expanded.In this process, the user does not need to understand the coded format of Asn yet, and the message generative process realizes automatically, does not need manually carrying out of user.
Description of drawings
Fig. 1 is the structural drawing of script file automatic creation system.
Fig. 2 is script product process figure.
Fig. 3 is message product process figure.
Embodiment
Script file automatic creation system provided by the invention, by user's input test use-case, the script file automatic creation system generates test script file according to message file that generates automatically in template that is used for the generation script file and early stage and relevant index file then.And the script automatic creation system also provides administration module to the user, is convenient to the user and expands new message file and index file.
For making purpose of the present invention, technical scheme and advantage clearer, below by specific embodiment with reference to accompanying drawing 1, the present invention is described in more detail.
Show the structural drawing of script file automatic creation system as Fig. 1.This system comprises template (Module) library module, index (Index) library module, message (Msg) library module, script (script) generation module.Wherein:
The template base module stores the template that is used for generation script, and each template all uses an ID (also can be described as Module Number) to be numbered storage.Followingly show a template that adopts the tcl programming language to write, this template ID is 1, this template with the script that generates is: receive an information as solicited message, corresponding then loopback receives the success response information or the response message that takes defeat, and this template is as follows:
#****************************************#Module Type Module 1#****************************************source CommFileDefineset sendercpuid    $SENDIDset senderpid      0x$SENDPIDset receivercpuId  $RECVIDset receiverpid    0x$RECVPIDstatemachine{      test_init{         set channel[opench TestChannel]         if{$channel==-1}{           puts″open channel fail″           goto testend         }         #RECV A<->B MSG         testconfig $channel NodebMsg-recv $RECVID$RECVPID$SENDID$SENDPID         #LOAD REQ/RESP/FAIL MSG FILE         loadmsg-msgfile SS_SPID_RR_RPID_REQ$msgdir/A_B_REQU_MSG         loadmsg-msgfile RR_RPID_SS_SPID_RESP $msgdir/B_A_RESP_MSG         loadmsg-msgfile RR_RPID_SS_SPID_FAIL $msgdir/B_A_FAIL_MSG        <!-- SIPO <DP n="5"> -->        <dp n="d5"/>       #SET REQ MSG IE,Here NEED ADD VALUE UNDER REQUIRMENT       SET_MSG_IE_FLAG_HEAD  }  test_begin{      if{[sendmsg $channel SS_SPID_RR_RPID_RER]==1}{         puts″SEND SS_SPID_RR_RPID_REQ MSG OK!″         goto WAIT_MSG      }else{         puts″SEND SS_SPID_RR_RPID_REQ MSG FAIL!″         goto testend      }  }  WAIT_MSG{       recvmsg-savead msg_received\       $channel RR_RPID_SS_SPID_RESP{puts″SUCCESS TORECV RESP MSG″;goto B_A_RESP}\       $channel RR_RPID_SS_SPID_FAIL{puts″SUCCESS TORECV FAIL MSG″;goto B_A_FAIL}\       -timeout     6000            {goto TIMEOUT}     }    B_A_RESP{       puts″SUCCESS TO RECV B->A RESP MSG!″       goto testend     }     B_A_FAIL{         puts″FAILURE FOR RECV B->A FAIL MSG!″         goto testend      }     TIMEOUT{         puts″SORRY,RECV MSG TIMEOUT!″         goto testend      }     testend{          set CloseFlag[closech$channel]          if{$CloseFlag==-1}{puts″close channel fail″}              goto end;     }}
The index database module stores all message codes and the corresponding relation of message name.Message code is exactly the pairing digital code of message, and for example, the code of request message is 0x0001.Because message code and message name are corresponding relations, therefore also the index of message code as message name can be can be implemented in like this in the index database module and inquires corresponding message name according to index (being message code) easily.The following partial content that shows in the index database:
0x0001?MSG-CFG-XXXX-REQ
0x0002?MSG-CFG-XXXX-RESP
0x0003?MSG-CFG-XXXX-FAIL
The message library module stores all message files.Message file is the description that comprises this message name and message structure, and for example therefore the shared byte of this message etc. can think that the message file in the message library module is exactly the entity of message.The following partial content that shows the message library module:
som-SH-NBOM-CFG-XXXX-REQ <TV,T|LEN-16> [0x0001]
som-NBOM-SH-CFG-XXXX-RESP <TV,T|LEN-16> [0x0002]
som-NBOM-SH-CFG-XXXX-FAIL <TV,T|LEN-16> [0x0003]
Script generation module provides input interface (input3) to the user, is used to receive the test case file of user according to the certain format input, requires to comprise at least template ID, message code in this test case file.Script generation module is according to test case file, read out in template corresponding in the template base module, the index database module corresponding message file in corresponding message name, the message library module, message name, the message file that reads out is written into generation script file in the template that reads.
Give an example below and describe script generation module in detail.The test case file that the user writes is as follows, comprises: use-case number (testcase number), the i.e. numbering of this test case file; The template ID that generation script will use (module_number) is 1; This ID is the message code of 1 the needed message correspondence of template, and wherein this template needs to comprise in the test case 3 message, therefore in the example below 3 message code: 0x0001,0x0002,0x0003 is arranged.
BEGIN
testcase_number=IT-133-001001-01
module_number=1
message_req=0x0001
message_resp=0x0002
message_fail=0x0003
END
Script generation module reads out the template of the correspondence of storing in the template base module according to the template ID in the test case file of user's input, according to the message code in the test case file, from the index database module, retrieve corresponding message name, and the message file that from the message library module, retrieves correspondence according to message code, set up the corresponding relation of message name and message file, and message name, the message file that obtains be input in the selected template, generate the script file of setting form according to template.In this example, the script file of generation is as follows:
#*******************************************************************#Module Type  Module 1#Date:       Script Was built automatic.#*******************************************************************source CommFileDefineset sendercpuid    $SENDIDset senderpid      0x$SENDPIDset receivercpuId  $RECVIDset receiverpid    0x$RECVPIDset TransactionID   0set Handle           0statemachine{    test_init{         set channel[opench TestChannel]         if{$channel==-1}{           puts″open channel fail″           goto testend         }         #RECV A<->B MSG         testconfig $channel Nodeb Msg-recv $RECVID$RECVPID$SENDID$SENDPID         #LOAD REQ/RESP/FAIL MSG FILE         loadmsg-msgfile A_REQ $msgdir/MSG--CFG-XXXX-REQ.msg         loadmsg-msgfile RR_RPID_SS_SPID_RESP$msgdir/MSG-NBOM-SH-CFG-XXXX-RESP.msg         loadmsg-msgfile RR_RPID_SS_SPID_FAIL$msgdir/MSG-NBOM-SH-CFG-XXXX-FAIL.msg         #SET REQ MSG IE,Here NEED ADD VALUE UNDER REQUIRMENT         setie-tree SS_SPID_RR_RPID_REQ msg-header sendercpuid         setie-tree SS_SPID_RR_RPID_REQ msg-header senderpid        <!-- SIPO <DP n="8"> -->        <dp n="d8"/>      setie-tree SS_SPID_RR_RPID_REQ msg-header receivercpuid      setie-tree SS_SPID_RR_RPID_REQ msg-header receiverpid      setie-tree SS_SPID_RR_RPID_REQ struMsg struMsgChoicesom-SH-NBOM-CFG-XXXX-REQ dw TransactionId      setie-tree SS_SPID_RR_RPID_REQ struMsg struMsgChoicesom-SH-NBOM-CFG-XXXX-REQ wUserId      setie-tree SS_SPID_RR_RPID_REQ struMsg struMsgChoicesom-SH-NBOM-CFG-XXXX-REQ wHandle      setie-tree SS_SPID_RR_RPID_REQ struMsg struMsgChoicesom-SH-NBOM-CFG-XXXX-REQ bXXXXCabinetNo      setie-tree SS_SPID_RR_RPID_REQ struMsg struMsgChoicesom-SH-NBOM-CFG-XXXX-REQ bXXXXFrameNo      setie-tree SS_SPID_RR_RPID_REQ struMsg struMsgChoicesom-SH-NBOM-CFG-XXXX-REQ bXXXXSlotId      setie-tree SS_SPID_RR_RPID_REQ struMsg struMsgChoicesom-SH-NBOM-CFG-XXXX-REQ bSwitchStatus   }   test_begin{        if{[sendmsg $channel SS_SPID_RR_RPID_REQ]==1}{           puts″SEND SS_SPID_RR_RPID_REQ MSG OK!″           goto WAIT_MSG        }else{           puts″SEND SS_SPID_RR_RPID_REQ MSG FAIL!″           goto testend        }   }   WAIT_MSG{       recvmsg-savead msg_received\       $channel RR_RPID_SS_SPID_RESP{puts″SUCCESS TORECV RESP MSG″;goto B_A_RESP}\       $channel RR_RPID_SS_SPID_FAIL{puts″SUCCESS TORECV FAIL MSG″;goto B_A_FAIL}\       -timeout     6000            {goto TIMEOUT}     }    B_A_RESP{       puts″SUCCESS TO RECV B->A RESP MSG!″       goto testend     }    B_A_FAIL{       puts″FAILURE FOR RECV B->A FAIL MSG!″        <!-- SIPO <DP n="9"> -->        <dp n="d9"/>       goto testend    }    TIMEOUT{       puts″SORRY,RECV MSG TIMEOUT!″       goto testend   }  testend{       set CloseFlag[closech $channel]       if{$CloseFlag==-1}{puts″close channel fail″}           goto end;   }}
Wherein, set the script file process of form to generation from the template of tcl language compilation, relate to a kind of language of writing to another kind of format conversion of writing language, its conversion is to realize according to the corresponding relation of macaronic syntax rule, the part of how changing about form is not an emphasis of the present invention, no longer is described here.
The script file that provides accordingly generates method automatically can reduce following steps, pre-set the content of template base module, index database module, message library module after, also comprise:
Step 201: receive the test case file of user, wherein, comprise template ID, message code in the test case file at least according to the certain format input;
Step 202:, read out in template corresponding in the template base module, the index database module corresponding message file in corresponding message name, the message library module according to the template ID in the test case file, message code;
Step 203: message name, the message file that reads out is written into generation script file in the template that reads.
As can be seen, by above-described script automatic creation system and corresponding generation method, when the index database module of this system, when the message library module stores enough information, only needing the user to write test case file according to form just can the generation script file.With respect to background technology, the user can not go to understand the form of Asn.1 document, do not need the process of writing the Asn.1 document, removing manual generation message file from.
Script automatic creation system of the present invention also provides administration module to the user, and administration module provides input interface to the user.The user can generate new message file, index file by administration module, and stores in corresponding message library module, the index database module, to realize the expansion of message library, index database content.Like this, when not having required file in message library module, the index database module, the user can utilize the file that this administration module generates to be needed.Referring to accompanying drawing 1, administration module of the present invention is described in detail.
As shown in the figure, this administration module comprises message header definition load module, message structure definition load module, index generation module, Asn generation module, collector, text message constructing module, message generating module.
Message header definition load module, message structure definition load module are respectively the input interface (input1 and input2) that the user provides message header defined file and message structure defined file, import message definition file and structure definition file by the user according to the form of setting.Wherein, message header definition load module converts the message code definition header file (input1) of user's input to the document of Asn.1 form; Message structure definition load module converts the structure definition file (input2) of user's input to the document of Asn.1 form.
The Asn generation module receives the output of message header definition load module, message structure definition load module, and the information that receives is carried out integration processing, generates complete Asn.1 document.All in all, message header definition load module, message structure definition load module, Asn generation module have been realized the conversion of the form of user's input information to the Asn.1 document format, conversion about document format, be that relation according to macaronic syntax rule correspondence realizes, the part of how changing about form is not an emphasis of the present invention, here be not described in detail, only example is sketched under the reference.
What the following user of showing imported writes input1, input2 document with the tcl language, is designated as msg.tcl, struct.tcl respectively
#****************************************# msg.tcl#****************************************define ID_SH_NBOM_CFG_XXXX_SWITCH_REQ 0x0001define ID_NBOM_SH_CFG_XXXX_SWITCH_RESP 0x0002<!--SIPO<DP n="11"〉--〉   <dp n="d11"/〉define ID_NBOM_SH_CFG_XXXX_SWITCH_FAIL     0x0003#****************************************#    struct.tcl#****************************************ifndef_NBOM_MSG_STRUCT_H_define_NBOM_MSG_STRUCT_H_pragma pack (1)typedef struct{  VOS_MSG_HEADER  U16 wMsgType; U32 dwTransactionId; U16 wUserId; U16 wHandle; U8 bXXXXCabinetNo; U8 bXXXXFrameNo; U8 bXXXXSlotId; U8 bSwitchStatus; MSG_SH_NBOM_CFG_XXXX_SWITCH_REQ; Typedef struct{ VOS_MSG_HEADER U16 wMsgTrpe; / * message number */U32 dwTransactionId; / * process number */U16 wUserId; / * user ID */U16 wHandle; / * window slogan */} MSG_NBOM_SH_CFG_XXXX_SWITCH_RESP; Typedef struct{ VOS_MSG_HEADER U16 wMsgType; / * message number */U32 dwTransactionId; / * process number */U16 wUserId; / * user ID */U16 wHandle; / * window slogan */} MSG_NBOM_SH_CFG_XXXX_SWITCH_FAIL;
The Asn generation module receives the document of the Asn.1 form after message header definition load module, the processing of message structure definition load module, and carry out integration processing according to the Asn.1 call format, as add symbol (as end, braces) of line feed, call format etc., generate complete Asn.1 file.Provided the Asn.1 formatted file that is generated below:
ROOT:NodebMsg.ROOT-MSGPROTOCOL:NodebMsg12ENDIAN:BIGBOUND ARY:ALIGNTHREAD:MULTINodebMsg DEFINITIONS::=BEGIN************************************* * * * * * * * * * * * * * * * * * * * * * * * * Root Message * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ROOT-MSG::=<V〉SEQUENCE{ msg-header MsgHeader, struMsg SOM-MSG-STRU}SOM-MSG-STRU::=<LV, L|LEN-32>SEQUENCE{ struMsgChoice SOM-CHOICE-STRU}**************************************** * * * * * * * * * * * * * * * * * * * * * Message Header * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * MsgHeader::=<V〉SEQUENCE{ sendercpuid<V, V|LEN-32>U32, senderpid<V, V|LEN-32>U32, receivercpuid<V, V|LEN-32>U32, receiverpid<V, V|LEN-32>U32}SOM-CHOICE-STRU::=<TV>CHOICE{ som-SH-NBOM-CFG-XXXX-REQ<TV, T|LEN-16>[0x0001] SOM-SH-NBOM-CFG-XXXX-REQ, som-NBOM-SH-CFG-XXXX-RESP<TV, T|LEN-16>[0x0002] SOM-SH-NBOM-CFG-XXXX-RESP, som-NBOM-SH-CFG-XXXX-FAIL<TV, T|LEN-16>[0x0003] SOM-SH-NBOM-CFG-XXXX-FAIL<!--SIPO<DP n=" 13 "〉--〉<dp n=" d13 "/* * */following is the definition/* * * SOM-SH-NBOM-CFG-XXXX-REQ::=<V of the structure division of this part〉SEQUENCE{ dwTransactionId U32, wUserId U16, wHandle U16, bXXXXCabinetNo U8, bXXXXFrameNo U8, bXXXXSlotId U8, bSwitchStatus U8}SOM-SH-NBOM-CFG-XXXX-RESP::=<V〉SEQUENCE{ dwTransactionId U32, wUserId U16, wHandle U16, SOM-SH-NBOM-CFG-XXXX-FAIL::=<V〉SEQUENCE{ dwTransactionId U32, wUserId U16, wHandle U16}
On the other hand, the index generation module receives the document after message header definition load module, the processing of message structure definition load module, corresponding relation according to the message code of key word in the document and definition generates index file, with the corresponding relation of recording messages sign indicating number and message name.Preamble has shown the content of index file, no longer gives an example herein.
The output information of text message constructing module reception hint generation module and message structure definition load module generates text message according to information, and is as follows:
{  msg-header  {  sendercpuid 0,  senderpid 0,receivercpuid 0,  receiverpid 0  },  struMsg        <!-- SIPO <DP n="14"> -->        <dp n="d14"/> {   struMsgChoice som-SH-NBOM-CFG-XXXX-REQ:      {        dw TransactionId 0,        wUserId 0,        wHandle 0,        bXXXXCabinetNo 0,        bXXXXFrameNo 0,        bXXXXSlotId 0,        bSwitchStatus 0      }  }}
Collector generates the dll file with the Asn.1 document compiling that the Asn generation module generates, and this compilation process is finished by the calling system function.
Message generating module receives the text message that the text message constructing module generates, and receives the dll file that collector generates, and according to dll the text message that the text message constructing module generates is resolved to message file, and sends the message library module to and store.Wherein, the function of this message generating module can realize that the creatmsg function is a system function by the creatmsg function, and the present invention just directly calls and uses this createmsg function.Because the creatmsg function is not an emphasis of the present invention, this function is not described here.
The step that corresponding administration module generates message comprises:
Step 301: receive message header defined file, the message structure defined file of user, and be converted to the document of Asn.1 form respectively by the certain format input;
Step 302: the document according to the Asn.1 form of message header defined file, message structure defined file conversion, generate index file and complete Asn.1 file respectively, wherein index file has write down the corresponding relation of message code and message name;
Step 303: generate text message according to the Asn.1 document after index file and the conversion of message structure defined file;
Step 304: the Asn.1 file is compiled into the dll file;
Step 305: according to the dll file described text message is resolved the generation message file and store message library into.
As can be seen, by above-mentioned administration module, the user just can import msg.tcl file, stru.tcl file, generates message file and index file automatically by system, sends to the message library module respectively, the index database module is stored.
Wherein, above-mentioned index generation module and index database module can be realized that message generating module and message library module can be realized by a functional unit by a functional unit.
More than be that example describes to be applied to the tcl language environment automatic generation script that gets off.Being understood that, in actual applications, according to user's the different language environment of needs use, for example also can be c language environment etc.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (5)

1, a kind of script file automatic creation system is characterized in that, this system comprises: template base module, index database module, message library module, script generation module, wherein:
The template base module stores the template file that is used for the generation script file, and different template files uses different ID to be numbered storage;
The index database module stores the index file of all message codes and message name corresponding relation;
The message library module stores all message files, and message file has been described message name and corresponding message structure;
Script generation module is used to receive the test case file of user according to the certain format input, wherein, comprises template ID, message code in the test case file at least; Script generation module is according to test case file, read out in template corresponding in the template base module, the index database module corresponding message file in corresponding message name, the message library module, message name, the message file that reads out is written into generation script file in the template that reads.
2, system according to claim 1, it is characterized in that, this system further comprises administration module, be used to receive message header defined file, the message structure defined file of user, generate message file and index file and also store into respectively in message library module and the index database module according to the certain format input.
3, system according to claim 2, it is characterized in that, described administration module comprises: message header definition load module, message structure definition load module, index generation module, Asn generation module, collector, text message constructing module, message generating module, wherein
Message header definition load module, message structure definition load module are respectively applied for and receive message header defined file, the message structure defined file of user by the certain format input, and are converted to the document of Asn.1 form respectively;
Index generation module and Asn generation module are used to receive message header definition load module, message structure defines the Asn.1 format file after the load module conversion, and generate index file and complete Asn.1 file respectively, wherein index file has write down the corresponding relation of message code and message name;
Collector is used for the Asn.1 file that the Asn generation module generates is compiled into the dll file;
The text message constructing module is used for the output information of reception hint generation module and message structure definition load module, generates text message according to described information;
Message generating module is used to receive the text message that the text message constructing module generates, and receives the dll file that collector generates, and according to dll described text message is resolved the generation message file.
4, a kind of script file generates method automatically, it is characterized in that, sets in advance template base, index database, message library, wherein,
Template base is being stored the template file that is used for the generation script file, and different template files uses different ID to be numbered storage;
Index database is being stored the index file of all message codes and message name corresponding relation;
Message library is being stored all message files, and message file has been described message name and corresponding message structure; This method is further comprising the steps of:
The test case file that A4, reception user import according to certain format wherein, comprises template ID, message code at least in the test case file;
B4, the template ID according in the test case file, message code read out in template corresponding in the template base module, the index database module corresponding message file in corresponding message name, the message library module;
C4, message name, the message file that reads out is written into generation script file in the template that reads.
5, method according to claim 4 is characterized in that, this method further comprises the step that generates message file and store message library into, comprising:
A5, reception user press message header defined file, the message structure defined file of certain format input, and are converted to the document of Asn.1 form respectively;
B5, according to the document of the Asn.1 form of message header defined file, message structure defined file conversion, generate index file and complete Asn.1 file respectively, wherein index file has write down the corresponding relation of message code and message name;
C5, generate text message according to the Asn.1 document after the conversion of index file and message structure defined file;
D5, the Asn.1 file is compiled into the dll file;
E5, according to the dll file described text message is resolved and to generate message file and store message library into.
CNB2004100871456A 2004-11-01 2004-11-01 Automatic generation system and method for script file Expired - Fee Related CN100361127C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100871456A CN100361127C (en) 2004-11-01 2004-11-01 Automatic generation system and method for script file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100871456A CN100361127C (en) 2004-11-01 2004-11-01 Automatic generation system and method for script file

Publications (2)

Publication Number Publication Date
CN1770148A true CN1770148A (en) 2006-05-10
CN100361127C CN100361127C (en) 2008-01-09

Family

ID=36751453

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100871456A Expired - Fee Related CN100361127C (en) 2004-11-01 2004-11-01 Automatic generation system and method for script file

Country Status (1)

Country Link
CN (1) CN100361127C (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221530B (en) * 2008-01-22 2010-06-16 中兴通讯股份有限公司 Method for automatically leading in test cases
CN102004659A (en) * 2009-08-31 2011-04-06 埃森哲环球服务有限公司 Integration environment generator
CN101526919B (en) * 2009-04-29 2011-12-28 福建星网锐捷网络有限公司 Method for generating script files to test Web application software and device thereof
CN102446090A (en) * 2010-10-09 2012-05-09 金蝶软件(中国)有限公司 Method and device for automatically generating test script
CN102521133A (en) * 2011-12-15 2012-06-27 盛科网络(苏州)有限公司 TCL (tool command language)-based white-box testing automation method and TCL-based white-box testing automation system
CN103236959A (en) * 2013-05-09 2013-08-07 中国银行股份有限公司 Test system and test method for testing business processing module
US8527944B2 (en) 2009-01-21 2013-09-03 International Business Machines Corporation Method and apparatus for native method calls
CN103425574A (en) * 2012-05-25 2013-12-04 腾讯科技(深圳)有限公司 Method and device for testing applications
CN104252413A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Automatic script generation method, device and system
CN107688593A (en) * 2017-04-13 2018-02-13 平安科技(深圳)有限公司 Script file generation method and device
CN107797917A (en) * 2016-12-28 2018-03-13 平安科技(深圳)有限公司 Performance test script generation method and device
CN107977206A (en) * 2017-11-14 2018-05-01 北京思特奇信息技术股份有限公司 A kind of batch service data file processing method and device
CN111459800A (en) * 2020-03-04 2020-07-28 福建省农村信用社联合社 Method, device, equipment and medium for verifying availability of service system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6424978B1 (en) * 1997-12-05 2002-07-23 Siemens Corporate Research, Inc. Formatting card-based hypermedia documents by automatic scripting
JP2003006555A (en) * 2001-06-25 2003-01-10 Nova:Kk Content distribution method, scenario data, recording medium and scenario data generation method
CN100421391C (en) * 2003-02-14 2008-09-24 华为技术有限公司 Method for implementing automatic test of intelligent service

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221530B (en) * 2008-01-22 2010-06-16 中兴通讯股份有限公司 Method for automatically leading in test cases
US8527944B2 (en) 2009-01-21 2013-09-03 International Business Machines Corporation Method and apparatus for native method calls
CN101526919B (en) * 2009-04-29 2011-12-28 福建星网锐捷网络有限公司 Method for generating script files to test Web application software and device thereof
CN102004659A (en) * 2009-08-31 2011-04-06 埃森哲环球服务有限公司 Integration environment generator
CN102446090A (en) * 2010-10-09 2012-05-09 金蝶软件(中国)有限公司 Method and device for automatically generating test script
CN102446090B (en) * 2010-10-09 2014-01-29 金蝶软件(中国)有限公司 Method and device for automatically generating test script
CN102521133A (en) * 2011-12-15 2012-06-27 盛科网络(苏州)有限公司 TCL (tool command language)-based white-box testing automation method and TCL-based white-box testing automation system
CN103425574A (en) * 2012-05-25 2013-12-04 腾讯科技(深圳)有限公司 Method and device for testing applications
CN103425574B (en) * 2012-05-25 2018-02-23 腾讯科技(深圳)有限公司 A kind of method and device of test application program
CN103236959A (en) * 2013-05-09 2013-08-07 中国银行股份有限公司 Test system and test method for testing business processing module
CN104252413A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Automatic script generation method, device and system
CN107797917A (en) * 2016-12-28 2018-03-13 平安科技(深圳)有限公司 Performance test script generation method and device
CN107797917B (en) * 2016-12-28 2020-04-17 平安科技(深圳)有限公司 Performance test script generation method and device
CN107688593A (en) * 2017-04-13 2018-02-13 平安科技(深圳)有限公司 Script file generation method and device
CN107977206A (en) * 2017-11-14 2018-05-01 北京思特奇信息技术股份有限公司 A kind of batch service data file processing method and device
CN111459800A (en) * 2020-03-04 2020-07-28 福建省农村信用社联合社 Method, device, equipment and medium for verifying availability of service system
CN111459800B (en) * 2020-03-04 2022-07-08 福建省农村信用社联合社 Method, device, equipment and medium for verifying availability of service system

Also Published As

Publication number Publication date
CN100361127C (en) 2008-01-09

Similar Documents

Publication Publication Date Title
CN1770148A (en) Automatic generation system and method for script file
CN1205537C (en) Methods and apparatus for linking program for remote execution
CN1842081A (en) ABNF character string mode matching and analyzing method and device
CN101841515A (en) Target variable protocol data unit codec code automatic generation implementation method
CN101036123A (en) System, apparatus and methods for automatic program translation
CN101075910A (en) Method and device for fastly registering
CN1764166A (en) Client system with compatible multi instantaneous communication tool and instantaneous communication method
CN1892602A (en) Method for processing library function call in binary translation
CN111427940A (en) Self-adaptive database conversion method and device
CN101076055A (en) Method for converting toll-ticket format
CN1107277C (en) System for enhanced utility of custom characters
CN1949175A (en) Method of displacing data in software
CN1265558C (en) A schematic diagram inspection method for hardware design
CN100343815C (en) Method for restoring mobile terminal key parameter
CN100337198C (en) A mobile communications device application processing system
CN1320456C (en) Automatic forming method for intelligent instrument interface
CN1601970A (en) General command line inputting device based on man-machine interactive languages, and its method
CN1656447A (en) Software development tool for ensuring links between UML models and the implementation thereof in a CORBA environment
CN1859268A (en) Method and system for backward-forward analytic message at background
CN1764131A (en) Protocol testing system and method
CN1252586C (en) Generating optimized computer data field conversion routines
CN1885888A (en) Call ticket sorting method and system
CN101059758A (en) Screen transition program generating method and device
CN1738309A (en) Data exchanging method
CN1900905A (en) Realizing method and its device for detecting descriptive language

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080109

Termination date: 20171101