[go: up one dir, main page]

CN100417075C - Interface test method - Google Patents

Interface test method Download PDF

Info

Publication number
CN100417075C
CN100417075C CNB011267550A CN01126755A CN100417075C CN 100417075 C CN100417075 C CN 100417075C CN B011267550 A CNB011267550 A CN B011267550A CN 01126755 A CN01126755 A CN 01126755A CN 100417075 C CN100417075 C CN 100417075C
Authority
CN
China
Prior art keywords
interface
information
chained list
field
file
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.)
Expired - Fee Related
Application number
CNB011267550A
Other languages
Chinese (zh)
Other versions
CN1407756A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB011267550A priority Critical patent/CN100417075C/en
Publication of CN1407756A publication Critical patent/CN1407756A/en
Application granted granted Critical
Publication of CN100417075C publication Critical patent/CN100417075C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to an interface test method which comprises the following steps: defining a general command interface structure; recording structure information concerned with an interface in a text file; doing grammar analysis for each line of the text file; converting descriptions in the text file into a linked list with a uniform structure; verifying whether data from the outer layer is right or not; verifying data sent to other layers is right or not by information input for prompting users. The present invention solves the problem that similar functional codes are repeatedly compiled in interface test, and provides a new clew for describing different command structures. Through the use of a file format, a new interface command can be tested without program modification. Thus, the test program is maximally simplified, and is easy to extend and transplant into disparity items.

Description

Interface test method
Technical field
The present invention relates to measuring technology, be specifically related to support to test the interface test method of privately owned interface.
Background technology
In telecommunication management network, according to function managerial grid being carried out layering logic layers is a very important notion, the purpose of layering is in order to deal with the complexity of telecommunication administration more easily, be convenient to management and operation, a kind of typical logical layered architecture is divided into Network Element Layer, NE management layer and NML with whole managerial grid.Wherein, Network Element Layer is meant actual telecommunication apparatus; NE management layer can be participated in the management of or a group NEs directly, is generally provided by telecommunications producer; NML is responsible for management function is exercised in the zone of being managed, and also determines the technical performance of network and controls available network capacity and ability.Each layer is responsible for the function of this layer, provides service to the upper strata simultaneously, manages to lower floor.Adopt the interface of standard to carry out the transmission of information between the layer.
In actual applications, because the privately owned characteristic of some equipment is stronger, be not easy to realize that model from bottom to top is abstract, and owing to do not need to carry out mixed networking with other the equipment and the webmaster of producer, so adopt privately owned interface to carry out the information transmission between Network Element Layer and the NE management layer usually, rather than standard interface.In specific application, this mode has been simplified the complexity of webmaster greatly, and the characteristic that can follow equipment very neatly manages.But still be the standard webmaster at privately owned webmaster no matter, notion layering and interlayer interface all is very important.
When carrying out the exploitation of privately owned webmaster, for more clear on the logical construction, hierarchical setting also may be adopted in Network Element Layer or NE management layer inside, and different layers is developed by different personnel.Adopt self-defining privately owned interface to carry out the information transmission between layer and the layer.Each layer lower floor that makes progress when realizing this layer-management provides service and management.In this stratified structure, interface just becomes the bridge that connects different levels, in total, play crucial effects, each layer should guarantee to offer the data of other layers and the processing of the data to other layers transmission is correct, so in exploitation, write test case, it is also just particularly important that docking port carries out synchronism detection.
Interface testing mainly comprises the content of two aspects: (1) verifies whether the next data of other layers are correct; (2) verify whether this layer sends to the data of other layers correct.Said interface is made up of some interface commands, the information that each order management is different, corresponding different structures.Since the difference of structure, when docking port is tested in the past, the test program that different often interface commands is corresponding different, interface command of every increase just needs to increase by one section test program.The shortcoming of doing like this comprises: (1) test case need with interface command what synchronously; (2) test case need be synchronous with the structure of interface; (3) test case can't be transplanted easily.Especially at the initial stage of exploitation, when interface structure and quantity might change at any time, this method obviously can't satisfy the demand of test.
Summary of the invention
The technical problem to be solved in the present invention is to set up the method that can test the interface that comprises privately owned interface that can be applied to any project of a unification, can verify whether whether correct from the data of other layers and this layer send to the data of other layers correct.
Above-mentioned technical problem of the present invention is achieved in that a kind of interface test method of structure, may further comprise the steps: define general command interface structure; With text record interface dependency structure information; By described text being carried out syntax parsing line by line, the description in the file is converted into the chained list of unified structure; Whether checking is correct from outer field data, and whether send to the data of other layer according to the Information Authentication of prompting user input correct.
Above-mentioned according to interface test method provided by the invention in, described command interface structure comprises the general-purpose interface structure of field information definition and interface message definition, described field information definition comprises record length, field number, field type, field length and field description, and described interface message definition comprises the pointer of Code Number, sense, code implication, the circulation number of plies, field information and next information of sensing.
Above-mentioned according to interface test method provided by the invention in, described by described text being carried out syntax parsing line by line, description in the file is converted into the chained list of unified structure, may further comprise the steps: check whether there is the textual description file, if there is no, request download text description document, if exist or correct the download, read in the textual description file line by line, this of the corresponding generation of every style of writing is met a node of the chained list of unified structure, and the character string that will meet form is converted to numerical data and is saved in the described general-purpose interface structure chained list the corresponding node of each order, a plurality of orders form a chained list, up to the end of file.
Above-mentioned according to interface test method provided by the invention in, each node of described interface chained list is that index is connected with the command code.
Above-mentioned according to interface test method provided by the invention in, whether described checking is correct from outer field data, may further comprise the steps: receive from outer field data, information is with function interface or incident, the mode of message queue sends to the interface testing module, described interface testing module reads the command code field that receives in the message, search the node that has or not in the described chained list should command code, if this command code is arranged in the chained list, then according to the field information of this chained list, length information etc., message is analyzed, show the implication and the numerical value of described field successively, whether correct judge from outer field data in view of the above.
Above-mentioned according to interface test method provided by the invention in, whether the data that described Information Authentication according to prompting user input sends to other layer are correct, may further comprise the steps: start the TELNET service, the prompting user imports the information that comprises command code that needs, whether the command code of searching wherein is present in the interface chained list, if be present in the interface chained list,, this message sent in the application layer handle according to the information package messages such as field length of chained list.
Implement general-purpose interface method of testing provided by the invention, repeat to write the problem of similar functions code when having solved interface testing, a kind of mode that the different command structure is described is provided.By using document form, just can realize privately owned interface being simplified test to new interface command greatly, and be easy to expand and be transplanted in the disparity items at the test program of interior various interface without update routine.
Description of drawings
Fig. 1 is a process schematic diagram of implementing interface test method of the present invention.
Fig. 2 is the flow chart of the process of resolving according to the inventive method docking port description document, relates to functions such as file system and syntax parsing.
Fig. 3 is the process of the data that receive being analyzed according to the inventive method, relates to the functions such as use of TMSGINFO structure.
Fig. 4 is a process of simulating outer input data according to the inventive method, relates to functions such as TELNET.
Embodiment
For the test case that solves interface testing in the past not general, the problem that command interface and program code amount grow proportionately, the present invention proposes the unified interface test platform that can be applied to different system, utilize the legitimacy that this method of testing can the docking port data to detect, whether and can simulate and generate the interface data that other layers transmission comes, specifically be correctly to realize from the data that data and this layer of other layers sends to other layers by checking.
The present invention adopts file format record and interface related structural information by defining a kind of interface structure that is common to any order, and text is carried out syntax parsing, adopts TELNET mode analog input information.Detail is described as follows:
1, general command interface organization definition
Prior art adopts an independent structure to describe to interface command, for example in the Network Element Layer board alarm mask off command is set, and its organization definition is similar to following form:
struct?NcpSetAlmMask{
USHORT portId;
USHORT almType;
USHORT status;
};
If interface has been revised, need to revise the definition of corresponding structure body, the processing of program simultaneously also will be changed.In order to solve this ineffective activity, it is as follows that the present invention defines new version, and this version can be suitable for various interface:
typedef struct LapField_S
{
Unsigned short recLen; / * record length */
Unsigned char num; / * field number */
Unsigned char type[T_MAXFIELDS]; The type * of/* field/
Unsigned short len[T_MAXFIELDS]; The length * of/* field/
char info[T_MAXFIELDS][T_MAXINFOLEN];
The description * of/* field/
}LAPFIELD;
typedef?struct?TmsgStruct_S
{
Unsigned short code; / * Code Number */
Unsigned char direct; The direction * that/* message sends/
Char mean[T_MAXINFOLEN]; The implication * of/* code/
Unsigned char laps; / * be several * of recirculating/
LAPFIELD field[T_MAXLAPS]; The information * of/* field/
Struct TmsgStruct_S * next; / * writes down next pointer
*/
}TMSGINFO;
Top structure has write down the necessary information about interface command.Comprise Code Number, sense, code implication, the circulation number of plies, field information contents such as (field number, field length, field type, descriptors).Any command interface can adopt this form record necessary information.If information in the command interface and foregoing not in full conformity with, then only need slightly make an amendment this structure, it is just passable to increase or reduce some information.But basic structure need not change.By defining such structure, just can realize the unified of distinct interface handled by program.
2, use file logging interface message and test data
For revising the interface content easily, the information that the TMSGINFO structure that interface related information is just top relates to stores by the form of file.File herein is a kind of text form rather than digital information, and the user can be easy to understand the content of file, can make amendment to file easily simultaneously.Be the example of a fileinfo below:
For example, for AGENT MCU alarm shield attribute is set, the description document of textization is adopted in the following method and is described.
0x1010 AGENT is provided with MCU alarm shield item number (2) | port numbers (2), alarm type (2), alarm status (2)
Top description has been write down interface code (0X1010), the implication of code (AGENT is provided with the MCU alarm shield), information number (2), contents such as field information.During use, can carry out suitable modification to file format according to actual conditions.Add some contents or change some information, but one satisfies readable requirement strong and that easily revise surely.
Using above-mentioned file, is very crucial technology in interface test method of the present invention, and it makes that the use of system is more flexible.When interface need be revised, only need the content of revised file, and do not need any modification is made in the processing of program.
3, syntax parsing
The file of above-mentioned easy-to-read and modification is the information of a textization, for this document content is converted to preceding structure information, need carry out syntactic analysis to this description document according to form, for following descriptor:
0x1010 AGENT is provided with MCU alarm shield item number (2) | port numbers (2), alarm type (2), alarm status (2)
Syntax Analysis Module is according to fixed format analyzed file, realize the conversion of character string, the content that interface message is described is taken out directly or indirectly, be saved in the aforementioned TMSGINFO structure to data, the corresponding node of each order, a plurality of orders form a chained list.When needs increase or revise interface, only need the revised file content, start test macro then, carry out syntactic analysis again, just can form new chained list.
4, about the input of simulation from his layer
Need simulate the information that other layers pass over during test, in order to adapt to interface variation, this information data should can be customized by the user fully, just provides the data that need simulation by the user.Therefore, this is a function that needs carry out man-machine interaction, among the present invention, transplants for convenience, has adopted simple T ELNET mode.Start TELNET service, the user uses the TELNET client of PC, though be the mode of order line, can realize generally very easily, and program is changed and can not produced any influence to the user.Can certainly realize in other way.
For further specifying the These characteristics of this clearly demarcated method, in conjunction with specific embodiments, method of testing of the present invention is described further.
In an embodiment, use the testing software of the inventive method at first to use at Network Element Layer, Network Element Layer is divided into AGENT (Agent layer) and two levels of MCU (veneer), and the interface between them is privately owned interface, is referred to as the S mouth.The AGENT layer adopts embedded OS PSOS to develop, and the testing software of embodiment then is embedded among the AGENT, uses as a module.
In conjunction with Fig. 1, what embody first link of the inventive method is exactly that for interface to be tested, the said structure form that adopts the present invention to propose provides its description.Specifically be exactly to write the interface description document, for writing the interface description document, need the support of file system, but owing on PSOS, can't edit, so adopt the method for file system beyond the PSOS and ftp file transfer protocol combination to finish the formation of text, revise and pack into to file.Specifically on PC, text is edited exactly, be delivered in the system by FTP (file transfer protocol (FTP)) then and handle (this process is expressed as step 101 in Fig. 1).Then, just need the text of describing interface is carried out syntax parsing, the descriptor in the file is converted into structure chained list (seeing step 102), its process will be further described below.In step 103, handling procedure master step frame, receive user command or other layer information, be the input data of simulation, adopt the mode of TELNET order line, import needed data according to prompting by the user from other layer, the data that other layer transmits are analyzed and are shown (step 104), and carry out functional simulation, and import the data that need simulate by the user, generate message and send to other layer (step 105).
In the analyzing and processing process that Fig. 2 provides to the textual description file, after beginning step 201, judge in step 202 at first whether description document exists, as not existing, then in step 203, point out the description document of user by FTP mode download command interface, forward step 204 to after receiving description document, there is description document if in step 202, judge, forward step 204 to, in step 204, the information of the file that receives is analyzed line by line, carry out syntactic analysis, and the generation chained list node, and judge that in step 205 whether file finishes, and does not finish as file, come back to step 204, read file line information and carry out syntactic analysis and generate chained list node,, enter end step 206 up to the end of file.
Each row is the complete descriptor about a command interface in the file, therefore in above-mentioned steps 204, row information is resolved and is stored in the chained list of the said TMSGINFO structure in front, a node of the corresponding chained list of the analysis result of delegation.Chained list is that index is connected with the command code.By analyzing whole file successively, can obtain the structural information of all command interfaces.
Fig. 3 is a processing procedure of the data that other layers pass over being analyzed demonstration.Be equivalent to step 104 among Fig. 1.Processing starts from step 301, testing software receives needs extraneous message, at first message is analyzed, in step 302, read out command code field wherein, in step 303, remove to search in the chained list node of corresponding this command code then, as not finding the declarative description file that information about this order is not provided, do not handle, end at step 305.Otherwise, in step 304.According to the field information in the node, length information etc. message is analyzed, shown the implication and the value of all fields successively, end at step 305 at last.
Fig. 4 is the process that is generated message (step 105 among Fig. 1) by testing software.When the user need generate about the message of certain interface command, from step 401, at first import the information that needs step 402 prompting user, promptly give the command code of outgoing interface by the user, whether the command code of checking input in step 403 is present in the chained list, if there is no, the prompting error message also finishes (step 407), if this command code is arranged in the discovery chained list, import corresponding data information (step 404) according to structural information prompting user, then in step 405, according to information package such as the field length generation message of chained list, in step 406, send it to application layer and handle, and in step 407, finish.
According to the operating position checking, the defective of test case has been simplified routine processes before the invention solves, the convenient transplanting.By suitable modification, this method also can be used in other similar occasions, has certain versatility.

Claims (5)

1. an interface test method is characterized in that, may further comprise the steps: define general command interface structure; With text record interface dependency structure information; By described text being carried out syntax parsing line by line, the description in the file is converted into the chained list of unified structure; Whether checking is correct from outer field data, and whether send to the data of other layer according to the Information Authentication of prompting user input correct;
Described by described text being carried out syntax parsing line by line, description in the file is converted into the chained list of unified structure, may further comprise the steps: check whether there is the textual description file, if there is no, request download text description document, if exist or correct the download, read in the textual description file line by line, a node that this of the corresponding generation of every style of writing is met the chained list of unified structure, the character string that will meet form is converted to numerical data and is saved in the described general-purpose interface structure chained list, the corresponding node of each order, a plurality of orders form a chained list, up to the end of file.
2. interface test method according to claim 1, it is characterized in that, described command interface structure comprises the general-purpose interface structure of field information definition and interface message definition, described field information definition comprises record length, field number, field type, field length and field description, and described interface message definition comprises the pointer of Code Number, sense, code implication, the circulation number of plies, field information and next information of sensing.
3. interface test method according to claim 1 is characterized in that, each node of described interface chained list is that index is connected with the command code.
4. interface test method according to claim 1, it is characterized in that, whether described checking is correct from outer field data, may further comprise the steps: receive from outer field data, information is with function interface or incident, the mode of message queue sends to the interface testing module, described interface testing module reads the command code field that receives in the message, search the node that has or not in the described chained list should command code, if this command code is arranged in the chained list, then according to the field information of this chained list, length information etc., message is analyzed, shown the implication and the numerical value of described field successively, whether correct judge from outer field data in view of the above.
5. interface test method according to claim 1, it is characterized in that, whether the data that described Information Authentication according to prompting user input sends to other layer are correct, may further comprise the steps: start the TELNET service, the prompting user imports the information that comprises command code that needs, and whether the command code of searching wherein is present in the interface chained list, if be present in the interface chained list, according to the information package messages such as field length of chained list, this message sent in the application layer handle.
CNB011267550A 2001-09-10 2001-09-10 Interface test method Expired - Fee Related CN100417075C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB011267550A CN100417075C (en) 2001-09-10 2001-09-10 Interface test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB011267550A CN100417075C (en) 2001-09-10 2001-09-10 Interface test method

Publications (2)

Publication Number Publication Date
CN1407756A CN1407756A (en) 2003-04-02
CN100417075C true CN100417075C (en) 2008-09-03

Family

ID=4666760

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB011267550A Expired - Fee Related CN100417075C (en) 2001-09-10 2001-09-10 Interface test method

Country Status (1)

Country Link
CN (1) CN100417075C (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1323526C (en) * 2003-10-29 2007-06-27 华为技术有限公司 Method for establishing service connection in wireless LAN
CN100389556C (en) * 2004-03-05 2008-05-21 华为技术有限公司 A method for implementing parsing of interface code stream
CN100383755C (en) * 2006-02-27 2008-04-23 华为技术有限公司 Software interface testing method and apparatus
CN101695172B (en) * 2009-10-16 2012-06-27 北京天碁科技有限公司 Method and device for independent description and encoding of message interfaces of communication equipment
CN102722592B (en) * 2012-05-15 2015-07-22 中国人民解放军91550部队 Universal digital information recording device and method
CN102928689B (en) * 2012-09-28 2015-02-11 广东电网公司佛山供电局 Power distribution management system IEC61970CIS interface test method
CN105588989B (en) * 2014-10-22 2020-02-07 中兴通讯股份有限公司 Single board testing method and device
CN105681126B (en) * 2015-12-30 2019-07-26 合一网络技术(北京)有限公司 A kind of automated testing method and system based on protocol interface
CN107797933B (en) * 2017-11-22 2020-06-12 中国银行股份有限公司 Method and device for generating simulation message
CN111400171B (en) * 2020-02-27 2023-01-10 苏州浪潮智能科技有限公司 Interface testing method, system and device and readable storage medium
CN112231170B (en) * 2020-09-11 2023-01-10 苏州浪潮智能科技有限公司 A data interaction card supervision method, system, terminal and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1996007281A1 (en) * 1994-09-01 1996-03-07 British Telecommunications Plc Network management system for communications networks
KR20010028229A (en) * 1999-09-20 2001-04-06 이계철 Method for interfacing test command in access network management system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1996007281A1 (en) * 1994-09-01 1996-03-07 British Telecommunications Plc Network management system for communications networks
KR20010028229A (en) * 1999-09-20 2001-04-06 이계철 Method for interfacing test command in access network management system

Also Published As

Publication number Publication date
CN1407756A (en) 2003-04-02

Similar Documents

Publication Publication Date Title
CN107807878B (en) A Keyword-Based Universal Test Resource Driving and Execution Management Method
US5920479A (en) System and method for performing interface independent virtual instrumentation functions in a graphical data flow program
Madden et al. TinyDB: In-network query processing in tinyos
US5847953A (en) System and method for performing class checking of objects in a graphical data flow program
CN102542002B (en) Satellite telemetry data treatment system and realization method thereof
Hu et al. Mapping UML Diagrams to a Petri Net Notation for System Simulation.
CN100417075C (en) Interface test method
US5905649A (en) System and method for performing type checking and class propagation of attributes in a graphical data flow program
CN100511149C (en) Logic emulation testing system and method
CN109062777A (en) A kind of track traffic signal equipment general automation test macro
CN111104106A (en) Visual development method, system and medium for integrating business process and communication message
CN101521899A (en) System and method for on-computer test of mobile applications
CN110928783A (en) RobotFramework-based automatic test datamation reconstruction platform
CN111694547A (en) Automatic coding data processing application design tool based on data state change
CN101303646B (en) A Modeling Method for Telecommunications Domain Based on Executable Meta-Language
CN108460199A (en) CNI modelings
CN106951363A (en) A kind of payload automatic test approach based on ATML
Handley et al. Maintaining the consistency of sysml model exports to XML metadata interchange (XMI)
CN106250134A (en) The code automatic generation method of unicity language
CN103593188B (en) System and method for managing what-you-see-is-what-you-get menus of instrument
CN112988597B (en) Automatic test visualization method and system based on state transition
CN117648833B (en) Simulink to SysML model generation method and device
CN101976196B (en) Quality of service oriented code automatic code generating method
CN113434387A (en) Script-driven-based automatic testing tool and system
CN108959094A (en) A kind of definition and methods for using them of the test program based on data structure

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
ASS Succession or assignment of patent right

Owner name: SHENZHENG CITY ZTE CO., LTD.

Free format text: FORMER OWNER: SHENZHENG CITY ZTE CO., LTD. SHANGHAI SECOND INSTITUTE

Effective date: 20030725

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

Effective date of registration: 20030725

Applicant after: Zhongxing Communication Co., Ltd., Shenzhen City

Applicant before: Shanghai Inst. of No.2, Zhongxing Communication Co., Ltd., Shenzhen City

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080903

Termination date: 20130910