CN102426534A - Method and system for converting test script language into executable instruction - Google Patents

Method and system for converting test script language into executable instruction Download PDF

Info

Publication number
CN102426534A
CN102426534A CN2011103421901A CN201110342190A CN102426534A CN 102426534 A CN102426534 A CN 102426534A CN 2011103421901 A CN2011103421901 A CN 2011103421901A CN 201110342190 A CN201110342190 A CN 201110342190A CN 102426534 A CN102426534 A CN 102426534A
Authority
CN
China
Prior art keywords
control primitive
primitive
decoding
control
encoding
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
CN2011103421901A
Other languages
Chinese (zh)
Other versions
CN102426534B (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.)
Datang Lianyi Technology Co., Ltd.
Original Assignee
Datang Mobile Communications Equipment 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 Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201110342190.1A priority Critical patent/CN102426534B/en
Publication of CN102426534A publication Critical patent/CN102426534A/en
Application granted granted Critical
Publication of CN102426534B publication Critical patent/CN102426534B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and system for converting test script language into an executable instruction, and aims to enhance the speed, efficiency and success rate for converting test script language into an executable instruction. The method comprises the following steps: receiving a conversion request carrying a test script to be converted; determining a control primitive to be converted according to the test script to be converted; determining coding/decoding corresponding to the control primitive to be converted according to the relationship between the stored control primitive and coding/decoding; and coding the control primitive to be converted by using the determined coding/decoding to form the corresponding executable instruction. The technical scheme disclosed by the invention enhances the coding/decoding acquisition speed corresponding to the control primitive, thereby enhancing the conversion speed from the control primitive into the executable instruction, and further enhancing the conversion speed and efficiency from test script language into the executable instruction on the whole, which is especially obvious under the conditions of more control primitives.

Description

A kind of test script language conversion that realizes becomes the method and system of executable instruction
Technical field
The present invention relates to the communications field, relate in particular to a kind of test script language conversion that realizes and become the method and system of executable instruction.
Background technology
TTCN3 (Testing and Test Control Notation vesion3; Test and test control representation the 3rd edition) as the test script language of a kind of standardized test description and test implementation; Be widely used in various telecom agreements and the Internet protocol field tests, as comprising uniformity test, interoperability test, unit testing etc.Because coding/decoding module is an important software function in the TTCN3 system; Therefore; When carrying out the test macro exploitation; The developer needs at first according to different test platforms corresponding coding/decoding module to be set, and based on the coding/decoding module that is provided with corresponding system under test (SUT) is carried out follow-up development.
TTCN3 is a kind of descriptive script, can not directly be used to drive system under test (SUT), has only TTCN3 is changed into executable instruction (can be binary executable instruction) could to realize the control to system under test (SUT) afterwards; Therefore, before operation TTCN3 script, need carry out encoding and decoding, be about to the TTCN3 script and convert executable instruction to the TTCN3 script; Then seem particularly important in the TTCN3 encoding and decoding that the TTCN3 script is carried out being used in the encoding-decoding process.
At present, generate the mode of TTCN3 encoding and decoding, mainly manually generate, specifically may further comprise the steps through the developer:
Step 1, developer are to current TTCN3 test script, and combing goes out needed all the test primitive of this TTCN3 test script.
Each bar test primitive that step 2, developer go out to combing; Analyze the data structure that this test primitive is adopted in the TTCN3 test script; And the compilation tool that is used in combination; Determine API (Application Programming Interface, the API) function that this test primitive is carried out the required use of encoding and decoding.
Step 3, developer determine every test primitive pairing control interface (control interface is meant the control stream that encoding and decoding are corresponding) in current test macro.
Step 4, developer adopt compilation tool according to corresponding control interface, data structure and the api function of this test primitive the corresponding software program to be compiled to every test primitive, generate and the corresponding TTCN3 encoding and decoding of this test primitive.
Adopt the mode of existing generation TTCN3 encoding and decoding, have following technological deficiency:
(1) can successfully generate the bigger self diathesis that depends on the developer of TTCN3 encoding and decoding, not only understand TTCN3 test script grammer, also need understand the corresponding programming language of api function etc. like the needs developer.
The scale of (2) combing, analytical test primitive and current test macro is closely connected, and test macro is more complicated, needs the test primitive quantity of combing, analysis many more, workload more greatly, loaded down with trivial details more; In the Development Engineering of reality, often may be owing to the omission or the mistake of combing in early stage, analytical work, work such as will bring bigger correction to the development in later stage, augment.
(3) when in test macro, increasing new test primitive; Also need the technician test primitive that increases newly to be carried out the work of above-mentioned (1) and (2); When the test primitive that increases newly more for a long time; Big through the artificial mode workload that generates encoding and decoding of this kind, efficient is low, overall is unfavorable for exploitation, upgrading etc. to test macro.
Summary of the invention
The embodiment of the invention provides a kind of test script language conversion that realizes to become the method and system of executable instruction, to improve speed, efficient and the success ratio that the test script language conversion is become executable instruction.
A kind of test script language conversion that realizes becomes the method for executable instruction, comprising:
Reception carries the conversion request of test script to be converted;
From said test script to be converted, determine control primitive to be converted;
From the corresponding relation of control primitive and the encoding and decoding of storage, determine and the corresponding encoding and decoding of said control primitive to be converted;
The encoding and decoding that employing is determined are encoded to said control primitive to be converted, form corresponding executable instruction.
Preferably, said corresponding relation is the pairing corresponding relation of test macro of the said test script to be converted of current operation.
Preferably, said method before receiving said conversion request, also can comprise step:
From all test script source files, extract control primitive;
To each test macro, from the control primitive that extracts, choose and the corresponding control primitive of said test macro; Generate respectively and the corresponding encoding and decoding of choosing of control primitive, and set up the corresponding relation and the storage of the control primitive chosen and corresponding encoding and decoding.
Preferably, in the said method, from the test script source file, extract control primitive, can comprise: from said test script source file, search the corresponding organization definition symbol of control output end mouth; The control primitive that needs extraction confirmed as in the corresponding primitive of organization definition symbol that finds.
Preferably; In the said method; Generate respectively and the corresponding encoding and decoding of choosing of control primitive; Can comprise step: to every control primitive of choosing, analyze the data structure of said control primitive correspondence, and determine each data member corresponding application program programming api interface in the said data structure according to the organization definition symbol of the corresponding control output end mouth of the control primitive of choosing; Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
Preferably, the language of said test script to be converted is test and the 3rd edition TTCN3 language of test control representation.
Based on preceding method, the embodiment of the invention also provides a kind of test script language conversion that realizes to become the system of executable instruction, and this system comprises:
Receiving trap is used to receive the conversion request that carries test script to be converted;
Device confirmed in control primitive, is used for determining control primitive to be converted from said test script to be converted;
Device is confirmed in encoding and decoding, is used for determining and the corresponding encoding and decoding of said control primitive to be converted from the control primitive of storage and the corresponding relation of encoding and decoding;
Conversion equipment is used to adopt encoding and decoding that said encoding and decoding confirm that device determines that said control primitive is confirmed that the control primitive of determining the unit encodes, and forms corresponding executable instruction.
Preferably, said corresponding relation is the pairing corresponding relation of test macro of the said test script to be converted of current operation.
Preferably, said system also can comprise:
The encoding and decoding generating apparatus was used for before said receiving trap receives said conversion request, from all test script source files, extracted control primitive; To each test macro; From the control primitive that extracts, choose and the corresponding control primitive of said test macro; Generate respectively and the corresponding encoding and decoding of choosing of control primitive, and set up the corresponding relation and the storage of the control primitive chosen and corresponding encoding and decoding.
Preferably, can above-mentioned coding generating apparatus be divided into:
The unit searched in control primitive, is used for extracting control primitive from all test script source files;
Control primitive cutting unit is used for to each test macro, searches the control primitive that the unit extracts from said control primitive and chooses and the corresponding control primitive of said test macro;
The encoding and decoding generation unit is used for to each test macro, generates corresponding with said test macro respectively choosing and controls the corresponding encoding and decoding of primitive;
Storage unit is used to set up the corresponding relation of the control primitive chosen and corresponding encoding and decoding, and stores said corresponding relation.
Preferably, the unit searched in said control primitive, specifically is used for: search the corresponding organization definition symbol of control output end mouth from said test script source file; The control primitive that needs extraction confirmed as in the corresponding primitive of organization definition symbol that finds.
Preferably, said encoding and decoding generation unit specifically is used for:
To every control primitive of choosing; Organization definition symbol based on the corresponding control output end mouth of the control primitive of choosing analyzes the corresponding data structure of said control primitive, and determines each data member corresponding application program programming api interface in the said data structure;
Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
The embodiment of the invention also provides a kind of encoding and decoding generating apparatus that is applied in the test script language conversion process, and this encoding and decoding generating apparatus can comprise:
The unit searched in control primitive, is used for extracting control primitive from all test script source files;
Control primitive cutting unit is used for to each test macro, searches the control primitive that the unit extracts from said control primitive and chooses and the corresponding control primitive of said test macro;
The encoding and decoding generation unit is used for to each test macro, generates corresponding with said test macro respectively choosing and controls the corresponding encoding and decoding of primitive;
Storage unit is used to set up the corresponding relation of the control primitive chosen and corresponding encoding and decoding, and stores said corresponding relation.
Preferably, the unit searched in said control primitive, specifically is used for: search the corresponding organization definition symbol of control output end mouth from said test script source file; The control primitive that needs extraction confirmed as in the corresponding primitive of organization definition symbol that finds.
Preferably, said encoding and decoding generation unit specifically is used for:
To every control primitive of choosing; Organization definition symbol based on the corresponding control output end mouth of the control primitive of choosing analyzes the corresponding data structure of said control primitive, and determines each data member corresponding application program programming api interface in the said data structure;
Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
In the embodiment of the invention; When receiving the conversion request that carries test script to be converted; From this test script to be converted, determine control primitive to be converted, and from the corresponding relation of control primitive and the encoding and decoding of storage, determine and the corresponding encoding and decoding of said control primitive to be converted; And then adopt the encoding and decoding of determining that said control primitive to be converted is encoded, form corresponding executable instruction.Adopt technical scheme of the present invention; When the control primitive in treating the conversion testing script is encoded; The encoding and decoding of being adopted can be directly obtained from the corresponding relation of control primitive that prestores and encoding and decoding; With respect to obtaining the encoding and decoding corresponding to operations such as the corresponding api interface of each data member compile through artificial the carrying out of the technician api interface that each data member is corresponding in data structure analysis, the specified data structure, the corresponding compilation tool of employing to every control primitive in the prior art with this control primitive; Technical scheme of the present invention has improved the speed of obtaining the corresponding encoding and decoding of control primitive to a certain extent; Thereby improved and to have controlled the speed that primitive converts executable instruction to; Then improved the speed and the efficient that the test script language are changed into executable instruction on the whole, under the more situation of control primitive, seemed particularly evident; In addition; Technical scheme of the present invention need not depend on technician's skill level; Therefore; Reduced human factor to a certain extent and caused control primitive is converted to the problem of executable instruction failure, will control the success ratio that primitive converts executable instruction to improve, the data structure of human factor such as analysis and Control primitive correspondence is inaccurate, inaccurate, the compile error of the api interface of each data member etc. in the specified data structure.
Description of drawings
Fig. 1 becomes the method flow diagram of executable instruction for realizing the test script language conversion in the embodiment of the invention;
Fig. 2 is the method flow diagram of the corresponding relation of default control primitive and encoding and decoding in the embodiment of the invention;
Fig. 3 is for searching the method flow diagram of control primitive from all test script source files in the embodiment of the invention;
Fig. 4 becomes one of structural representation of the system of executable instruction for realization test script language conversion in the embodiment of the invention;
Fig. 5 becomes two of the structural representation of the system of executable instruction for realization test script language conversion in the embodiment of the invention;
Fig. 6 is the structural representation of encoding and decoding generating apparatus in the embodiment of the invention.
Embodiment
To the technical matters that prior art exists, the embodiment of the invention provides a kind of test script language conversion that realizes to become the method and system of executable instruction, to improve speed, efficient and the success ratio that the test script language conversion is become executable instruction.Realize that the test script language conversion becomes the method for executable instruction, comprising: receive the conversion request that carries test script to be converted; From said test script to be converted, determine control primitive to be converted; From the corresponding relation of control primitive and the encoding and decoding of storage, determine and the corresponding encoding and decoding of said control primitive to be converted; The encoding and decoding that employing is determined are encoded to said control primitive to be converted, form corresponding executable instruction.Adopt technical scheme of the present invention; When the control primitive in treating the conversion testing script is encoded; The encoding and decoding of being adopted can be directly obtained from the corresponding relation of control primitive that prestores and encoding and decoding; With respect to obtaining the encoding and decoding corresponding to operations such as the corresponding api interface of each data member compile through artificial the carrying out of the technician api interface that each data member is corresponding in data structure analysis, the specified data structure, the corresponding compilation tool of employing to every control primitive in the prior art with this control primitive; Technical scheme of the present invention has improved the speed of obtaining the corresponding encoding and decoding of control primitive to a certain extent; Thereby improved and to have controlled the speed that primitive converts executable instruction to; Then improved the speed and the efficient that the test script language are changed into executable instruction on the whole, under the more situation of control primitive, seemed particularly evident; In addition; Technical scheme of the present invention need not depend on technician's skill level; Therefore; Reduced human factor to a certain extent and caused control primitive is converted to the problem of executable instruction failure, will control the success ratio that primitive converts executable instruction to improve, the data structure of human factor such as analysis and Control primitive correspondence is inaccurate, inaccurate, the compile error of the api interface of each data member etc. in the specified data structure.
Below in conjunction with Figure of description technical scheme of the present invention is carried out detailed description.
Referring to Fig. 1, become the method flow diagram of executable instruction for realizing the test script language conversion in the embodiment of the invention, this method can comprise step:
Step 101, reception carry the conversion request of test script to be converted.
Step 102, from said test script to be converted, determine control primitive to be converted.
Step 103, from the corresponding relation of control primitive and the encoding and decoding of storage, determine and the corresponding encoding and decoding of said control primitive to be converted.
The encoding and decoding that step 104, employing are determined are encoded to said control primitive to be converted, form corresponding executable instruction.
Preferably; In the embodiment of the invention; Can be directed against all test script source files in advance; From this test script source file, extract control primitive (the control primitive that from each test script source file, extracts can constitute the set of control primitive); And generate corresponding encoding and decoding to the control primitive that extracts, and set up corresponding relation and the storage of respectively controlling between primitive and the encoding and decoding, so that directly obtain the corresponding encoding and decoding of control primitive when encoding for the follow-up control primitive of treating in the conversion testing script.Preferably; Because same test script can be applied to different test macros, and the compilation tool of control primitive that different test macros possibly need and use is different, therefore; For adapting to different test macros; So that operation is gone back test script and can be controlled this test macro accurately in test macro, in the embodiment of the invention, to each test macro; Can from the set of control primitive, choose and the corresponding control primitive of said test macro; And generate respectively and the corresponding encoding and decoding of choosing of control primitive, and set up the corresponding relation of the control primitive chosen and corresponding encoding and decoding, promptly each test macro is corresponding to the corresponding relation of control primitive and corresponding encoding and decoding; Promptly when test script moves in current test macro; The encoding and decoding that control primitive in this test script is encoded are to determine according to deserving the corresponding control primitive of Pretesting system and the corresponding relation of encoding and decoding; Thereby make the executable instruction that obtains of encoding of the control primitive in the test script is more met current test macro, move this executable instruction and can control current test macro more accurately.Based on foregoing, in the embodiment of the invention, before the said method flow process, also comprise the preset flow process of the corresponding relation of control source code and corresponding encoding and decoding, this preset flow process is as shown in Figure 2, can comprise step:
Step 201, from all test script source files, extract control primitive.
Step 202, to each test macro, from the control primitive that step 201 extracts, choose and the corresponding control primitive of said test macro.
Step 203, to the test macro that relates in the step 202, be that every corresponding control primitive of this test macro generates corresponding encoding and decoding; And set up the corresponding relation of the corresponding control primitive encoding and decoding corresponding of this test macro with it.
Preferably, in the embodiment of the invention, for realizing accurately current test macro being controlled, the corresponding relation that uses in the step 103 in the said method flow process is and the corresponding corresponding relation of current test macro.
Preferably; In test macro; Possibly have a lot of control primitive, but be not that primitive all in the test script all needs coding, the primitive that the encoding and decoding of exploitation only need relate to the organization definition symbol of control output end mouth in the test script is encoded and is got final product; Therefore, in the above-mentioned steps 201, concrete implementation is following: to each test script source file, from this test script source file, search the corresponding organization definition symbol of control output end mouth; The control primitive that need from this test script source file, extract confirmed as in the corresponding primitive of organization definition symbol that finds.From all test script source files, extract the mode of control primitive, concrete flow process can be as shown in Figure 3.The language of the test script to be converted in the embodiment of the invention can be TTCN3 or TTCN2; Because test script to be converted has the specific syntax (being the TTCN grammer) of self, such as: how definition structure, how to define Union, how to define Port (being aforementioned control output end mouth); Therefore, in the step 103 of said method flow process, can from said test script to be converted, determine control primitive to be converted through searching and lexical analysis.Lexical analysis mainly is in the test script source file, to search corresponding definition and record according to the TTCN grammer; Search all Port like needs, the character string (being aforesaid organization definition symbol) of then in source file, searching " Type port port title message{} " gets final product.
Preferably, in the step 203 in the said method flow process,, generate and the corresponding encoding and decoding of this control primitive, comprising to every corresponding control primitive of each test macro:
To every control primitive, analyze the data structure of said control primitive correspondence according to the organization definition symbol of the corresponding control output end mouth of this control primitive, and determine each data member corresponding application program programming api interface in the said data structure; Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
Referring to Fig. 3, for from all test script source files, extracting the method flow diagram of control primitive in the embodiment of the invention, this method comprises:
Step 301, from current test script source file, search the corresponding organization definition symbol of control output end mouth, deserve Pretesting script source file and be in the script test source file of the current organization definition symbol search operation of not carrying out the control output end mouth one of them.
The organization definition symbol of the control output end mouth that step 302, record find from deserve Pretesting script source file.
Step 303, judge whether all test script files to have been carried out searching of control output end mouth structure delimiter; If then execution in step 304, otherwise the script test source file execution in step 301 of the next one not carried out the organization definition symbol search operation of control output end mouth.
Step 304, from step 302, choose organization definition symbol to be analyzed in the organization definition symbol of the control output end mouth of record; And the corresponding control primitive of this organization definition to be analyzed symbol analyzed; Obtain the data structure that relates to this control primitive; If this data structure comprises minor structure, also obtain the minor structure of this data structure, said current control output end mouth is current one of them that also do not control in the control output end mouth that primitive analyzes in the record in the step 302.
The data structure and the minor structure thereof of the correspondence that obtains analyzed in the corresponding control primitive of organization definition symbol of step 305,304 pairs of current control output ends of recording step mouth.
Step 306, judge whether the corresponding control primitive of organization definition symbol of all control output end mouths of step 302 record is analyzed; If then execution in step 307, otherwise the next one controlled the organization definition symbol execution in step 304 of the control output end mouth that primitive analyzes.
Step 307, process ends.
Preferably; For minimizing redundant information further, guarantee to control the accuracy of test macro, to reduce the transmission load of test macro; In the above-mentioned steps 202; Choose and the corresponding control primitive of test macro, specific as follows: according to test macro the function that will realize, be used to the control primitive of realizing that each function is corresponding according to choosing; Convert each control primitive to executable instruction, and set the needed bit number of each executable instruction.
Based on the preceding method flow process, the embodiment of the invention also provides a kind of test script language conversion that realizes to become the system of executable instruction, and the structure of this system can be as shown in Figure 4, comprising:
Receiving trap 41 is used to receive the conversion request that carries test script to be converted;
Device 42 confirmed in control primitive, is used for determining control primitive to be converted from said test script to be converted;
Device 43 is confirmed in encoding and decoding, is used for determining and the corresponding encoding and decoding of said control primitive to be converted from the control primitive of storage and the corresponding relation of encoding and decoding;
Conversion equipment 44 is used to adopt encoding and decoding that encoding and decoding confirm that device 43 determines that control primitive is confirmed that the control primitive of determining unit 42 encodes, and forms corresponding executable instruction.
Preferably, said corresponding relation is the pairing corresponding relation of test macro of the said test script to be converted of current operation.
Preferably, said system also can comprise encoding and decoding generating apparatus 45, can be as shown in Figure 5:
Encoding and decoding generating apparatus 45 was used for before receiving trap 41 receives said conversion request, from all test script source files, extracted control primitive; To each test macro; From the control primitive that extracts, choose and the corresponding control primitive of said test macro; Generate respectively and the corresponding encoding and decoding of choosing of control primitive, and set up the corresponding relation and the storage of the control primitive chosen and corresponding encoding and decoding.
Preferably, the embodiment of the invention also can be divided encoding and decoding generating apparatus 45, and unit 451, control primitive cutting unit 452, encoding and decoding generation unit 453, storage unit 454 searched in the control primitive that is divided into as shown in Figure 6, wherein:
Unit 451 searched in control primitive, is used for extracting control primitive from all test script source files;
Control primitive cutting unit 452 is used for to each test macro, searches the control primitive that the unit extracts from said control primitive and chooses and the corresponding control primitive of said test macro;
Encoding and decoding generation unit 453 is used for to each test macro, generates corresponding with said test macro respectively choosing and controls the corresponding encoding and decoding of primitive;
Storage unit 454 is used to set up the corresponding relation of the control primitive chosen and corresponding encoding and decoding, and stores said corresponding relation.
Preferably, unit 451 searched in control primitive, specifically is used for: search the corresponding organization definition symbol of control output end mouth from said test script source file; The control primitive that needs extraction confirmed as in the corresponding primitive of organization definition symbol that finds.
Preferably; Encoding and decoding generation unit 453; Specifically be used for: to every control primitive of choosing; Organization definition symbol according to the corresponding control output end mouth of the control primitive of choosing analyzes the corresponding data structure of said control primitive, and determines each data member corresponding application program programming api interface in the said data structure; Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
The embodiment of the invention also provides a kind of encoding and decoding generating apparatus that is applied in the test script language conversion process; The structure of this encoding and decoding generating apparatus is as shown in Figure 6; Comprise that controlling primitive searches unit 451, control primitive cutting unit 452, encoding and decoding generation unit 453, storage unit 454; The function of each unit repeats no more at this as previously mentioned.
In the embodiment of the invention; On the one hand; When the control primitive in treating the conversion testing script is encoded; The encoding and decoding of being adopted can be directly obtained from the corresponding relation of control primitive that prestores and encoding and decoding; With respect to obtaining the encoding and decoding corresponding to operations such as the corresponding api interface of each data member compile through artificial the carrying out of the technician api interface that each data member is corresponding in data structure analysis, the specified data structure, the corresponding compilation tool of employing to every control primitive in the prior art with this control primitive; Technical scheme of the present invention has improved the speed of obtaining the corresponding encoding and decoding of control primitive to a certain extent; To control the speed that primitive converts executable instruction to thereby improved, improve the speed and the efficient that the test script language are changed into executable instruction then on the whole, under the more situation of control primitive, seem particularly evident; In addition; Technical scheme of the present invention need not depend on technician's skill level; Therefore; Reduced human factor to a certain extent and caused control primitive is converted to the problem of executable instruction failure, will control the success ratio that primitive converts executable instruction to improve, the data structure of human factor such as analysis and Control primitive correspondence is inaccurate, inaccurate, the compile error of the api interface of each data member etc. in the specified data structure; On the other hand; When in advance the corresponding relation of control primitive and encoding and decoding being set; To different test macros corresponding corresponding relation is set; Promptly when test script moves in current test macro; The encoding and decoding that control primitive in this test script is encoded are to determine with the corresponding relation of encoding and decoding according to deserving the corresponding control primitive of Pretesting system, thereby feasible the executable instruction that obtains of encoding of control primitive in the test script are more met current test macro, move this executable instruction and can control current test macro more accurately; Again on the one hand; When being directed against the corresponding relation of each test macro default control primitive and encoding and decoding, be that the control primitive corresponding with this test macro that selects is generated corresponding encoding and decoding and stores corresponding relation, therefore need not generate corresponding coding-decoding operation to the not corresponding control primitive of test macro; Therefore; Not only improved the encoding and decoding formation speed, but also minimizing redundant information further, to reduce the transmission load of test macro.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.

Claims (15)

1. realize that the test script language conversion becomes the method for executable instruction for one kind, it is characterized in that, comprising:
Reception carries the conversion request of test script to be converted;
From said test script to be converted, determine control primitive to be converted;
From the corresponding relation of control primitive and the encoding and decoding of storage, determine and the corresponding encoding and decoding of said control primitive to be converted;
The encoding and decoding that employing is determined are encoded to said control primitive to be converted, form corresponding executable instruction.
2. the method for claim 1 is characterized in that, said corresponding relation is the pairing corresponding relation of test macro of the said test script to be converted of current operation.
3. method as claimed in claim 2 is characterized in that, before receiving said conversion request, also comprises:
From all test script source files, extract control primitive;
To each test macro, from the control primitive that extracts, choose and the corresponding control primitive of said test macro; Generate respectively and the corresponding encoding and decoding of choosing of control primitive, and set up the corresponding relation and the storage of the control primitive chosen and corresponding encoding and decoding.
4. method as claimed in claim 3 is characterized in that, from the test script source file, extracts control primitive, comprising:
From said test script source file, search the corresponding organization definition symbol of control output end mouth;
The control primitive that needs extraction confirmed as in the corresponding primitive of organization definition symbol that finds.
5. method as claimed in claim 4 is characterized in that, said generation respectively with the corresponding encoding and decoding of choosing of control primitive, comprising:
To every control primitive of choosing; Organization definition symbol based on the corresponding control output end mouth of the control primitive of choosing analyzes the corresponding data structure of said control primitive, and determines each data member corresponding application program programming api interface in the said data structure;
Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
6. like each described method of claim 1~5, it is characterized in that the language of said test script to be converted is test and the 3rd edition TTCN3 language of test control representation.
7. realize that the test script language conversion becomes the system of executable instruction for one kind, it is characterized in that, comprising:
Receiving trap is used to receive the conversion request that carries test script to be converted;
Device confirmed in control primitive, is used for determining control primitive to be converted from said test script to be converted;
Device is confirmed in encoding and decoding, is used for determining and the corresponding encoding and decoding of said control primitive to be converted from the control primitive of storage and the corresponding relation of encoding and decoding;
Conversion equipment is used to adopt encoding and decoding that said encoding and decoding confirm that device determines that said control primitive is confirmed that the control primitive of determining the unit encodes, and forms corresponding executable instruction.
8. system as claimed in claim 7 is characterized in that, said corresponding relation is the pairing corresponding relation of test macro of the said test script to be converted of current operation.
9. system as claimed in claim 8 is characterized in that, also comprises:
The encoding and decoding generating apparatus was used for before said receiving trap receives said conversion request, from all test script source files, extracted control primitive; To each test macro; From the control primitive that extracts, choose and the corresponding control primitive of said test macro; Generate respectively and the corresponding encoding and decoding of choosing of control primitive, and set up the corresponding relation and the storage of the control primitive chosen and corresponding encoding and decoding.
10. system as claimed in claim 9 is characterized in that, said encoding and decoding generating apparatus comprises:
The unit searched in control primitive, is used for extracting control primitive from all test script source files;
Control primitive cutting unit is used for to each test macro, searches the control primitive that the unit extracts from said control primitive and chooses and the corresponding control primitive of said test macro;
The encoding and decoding generation unit is used for to each test macro, generates corresponding with said test macro respectively choosing and controls the corresponding encoding and decoding of primitive;
Storage unit is used to set up the corresponding relation of the control primitive chosen and corresponding encoding and decoding, and stores said corresponding relation.
11. system as claimed in claim 10 is characterized in that, the unit searched in said control primitive, specifically is used for: search the corresponding organization definition symbol of control output end mouth from said test script source file; The control primitive that needs extraction confirmed as in the corresponding primitive of organization definition symbol that finds.
12. system as claimed in claim 10 is characterized in that, said encoding and decoding generation unit specifically is used for:
To every control primitive of choosing; Organization definition symbol based on the corresponding control output end mouth of the control primitive of choosing analyzes the corresponding data structure of said control primitive, and determines each data member corresponding application program programming api interface in the said data structure;
Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
13. an encoding and decoding generating apparatus that is applied in the test script language conversion process is characterized in that, comprising:
The unit searched in control primitive, is used for extracting control primitive from all test script source files;
Control primitive cutting unit is used for to each test macro, searches the control primitive that the unit extracts from said control primitive and chooses and the corresponding control primitive of said test macro;
The encoding and decoding generation unit is used for to each test macro, generates corresponding with said test macro respectively choosing and controls the corresponding encoding and decoding of primitive;
Storage unit is used to set up the corresponding relation of the control primitive chosen and corresponding encoding and decoding, and stores said corresponding relation.
14. device as claimed in claim 13 is characterized in that, the unit searched in said control primitive, specifically is used for: search the corresponding organization definition symbol of control output end mouth from said test script source file; The control primitive that needs extraction confirmed as in the corresponding primitive of organization definition symbol that finds.
15. device as claimed in claim 13 is characterized in that, said encoding and decoding generation unit specifically is used for:
To every control primitive of choosing; Organization definition symbol based on the corresponding control output end mouth of the control primitive of choosing analyzes the corresponding data structure of said control primitive, and determines each data member corresponding application program programming api interface in the said data structure;
Adopt the corresponding compilation tool of said test macro that the corresponding api interface of the data member in the said data structure is compiled, the compiling result who obtains is the pairing encoding and decoding of choosing of control primitive.
CN201110342190.1A 2011-11-02 2011-11-02 Method and system for converting test script language into executable instruction Active CN102426534B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110342190.1A CN102426534B (en) 2011-11-02 2011-11-02 Method and system for converting test script language into executable instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110342190.1A CN102426534B (en) 2011-11-02 2011-11-02 Method and system for converting test script language into executable instruction

Publications (2)

Publication Number Publication Date
CN102426534A true CN102426534A (en) 2012-04-25
CN102426534B CN102426534B (en) 2014-06-04

Family

ID=45960523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110342190.1A Active CN102426534B (en) 2011-11-02 2011-11-02 Method and system for converting test script language into executable instruction

Country Status (1)

Country Link
CN (1) CN102426534B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103500141A (en) * 2013-10-09 2014-01-08 中国联合网络通信集团有限公司 Automated testing method and device
CN103809933A (en) * 2012-11-06 2014-05-21 财团法人工业技术研究院 Reconfigurable instruction encoding method, execution method and electronic device
CN103984539A (en) * 2014-04-14 2014-08-13 美的集团股份有限公司 Operation method and operation system for household appliance
CN107908679A (en) * 2017-10-26 2018-04-13 平安科技(深圳)有限公司 Script sentence conversion method, device and computer-readable recording medium
CN108415826A (en) * 2018-01-12 2018-08-17 深圳壹账通智能科技有限公司 Test method, terminal device and the computer readable storage medium of application
CN110231935A (en) * 2019-06-12 2019-09-13 上海达梦数据库有限公司 A kind of method, apparatus, equipment and the storage medium of script execution and update

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02183338A (en) * 1988-11-29 1990-07-17 Internatl Business Mach Corp <Ibm> Apparatus and method for generating program language translator
CN1786925A (en) * 2005-03-08 2006-06-14 中国科学院软件研究所 TTCN-3 testing system basedon C++ mapping and its testing method
US7447697B2 (en) * 2004-06-08 2008-11-04 Oracle International Corporation Method of and system for providing path based object to XML mapping
CN101408849A (en) * 2008-12-01 2009-04-15 中国科学技术大学 Method and system for compiling and executing TTCN-3 language

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02183338A (en) * 1988-11-29 1990-07-17 Internatl Business Mach Corp <Ibm> Apparatus and method for generating program language translator
US7447697B2 (en) * 2004-06-08 2008-11-04 Oracle International Corporation Method of and system for providing path based object to XML mapping
CN1786925A (en) * 2005-03-08 2006-06-14 中国科学院软件研究所 TTCN-3 testing system basedon C++ mapping and its testing method
CN101408849A (en) * 2008-12-01 2009-04-15 中国科学技术大学 Method and system for compiling and executing TTCN-3 language

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103809933A (en) * 2012-11-06 2014-05-21 财团法人工业技术研究院 Reconfigurable instruction encoding method, execution method and electronic device
CN103500141A (en) * 2013-10-09 2014-01-08 中国联合网络通信集团有限公司 Automated testing method and device
CN103984539A (en) * 2014-04-14 2014-08-13 美的集团股份有限公司 Operation method and operation system for household appliance
CN107908679A (en) * 2017-10-26 2018-04-13 平安科技(深圳)有限公司 Script sentence conversion method, device and computer-readable recording medium
CN108415826A (en) * 2018-01-12 2018-08-17 深圳壹账通智能科技有限公司 Test method, terminal device and the computer readable storage medium of application
CN108415826B (en) * 2018-01-12 2021-10-29 深圳壹账通智能科技有限公司 Application testing method, terminal device and computer readable storage medium
CN110231935A (en) * 2019-06-12 2019-09-13 上海达梦数据库有限公司 A kind of method, apparatus, equipment and the storage medium of script execution and update

Also Published As

Publication number Publication date
CN102426534B (en) 2014-06-04

Similar Documents

Publication Publication Date Title
CN102426534B (en) Method and system for converting test script language into executable instruction
US8091071B2 (en) Method and system for template-based code generation
CN101841515B (en) Target variable protocol data unit codec code automatic generation implementation method
US20030208743A1 (en) Workflow code generator
CN103077111B (en) A kind of localization method of continuous integrating failure use-case and system
JP2007515013A (en) Software code migration and conversion equipment from any source platform to any target platform
US6934940B2 (en) Source code transformation-temporary object reduction
CN1526104A (en) Parsing structured data
CN105718251A (en) Multilanguage SDK (software development kit) automatic implementation method and system
CN110197072B (en) Method and system for discovering software security vulnerability, storage medium and computer equipment
CN101071385A (en) Compile method, debug method, compile program and debug program
CN109101236A (en) The project that rule-based engine and maven plug-in unit are realized relies on management method and system
CN112269566B (en) Script generation processing method, device, equipment and system
CN106383734A (en) Method for extracting detailed design from codes
CN103984539A (en) Operation method and operation system for household appliance
WO2004051470A1 (en) Program automatic converting method and program automatic converting device
CN110362317B (en) Code conversion method, device and storage medium
Al Salem et al. A review on grammar-based fuzzing techniques
CN104731707A (en) Transplanting method for iSCSI consistency testing software IscsiSim between platforms
CN114036055A (en) System for converting xmind test case and jmeter script
CN109977019B (en) Compiler optimization sequence test method based on incremental sampling
CN113448591A (en) Method for quickly creating iOS engineering based on python
CN110069250B (en) Method, system and medium for encoding and decoding LTE-V2X standard application layer data
CN111680474A (en) Method and device for repairing messy codes of files
KR101670726B1 (en) Method for code conversion using debugging information of intermediate language code, apparatus and computer-readable recording medium with program therefor

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: DATANG LIANYI TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: DATANG MOBILE COMMUNICATION EQUIPMENT CO., LTD.

Effective date: 20120607

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20120607

Address after: 100083, room 92, Building 29, No. 104-106, Haidian District, Beijing, Xueyuan Road

Applicant after: Datang Lianyi Technology Co., Ltd.

Address before: 100083 Haidian District, Xueyuan Road, No. 29,

Applicant before: Datang Mobile Communication Equipment Co., Ltd.

C14 Grant of patent or utility model
GR01 Patent grant