CN1417678A - TTCN test example executing method - Google Patents

TTCN test example executing method Download PDF

Info

Publication number
CN1417678A
CN1417678A CN 01134616 CN01134616A CN1417678A CN 1417678 A CN1417678 A CN 1417678A CN 01134616 CN01134616 CN 01134616 CN 01134616 A CN01134616 A CN 01134616A CN 1417678 A CN1417678 A CN 1417678A
Authority
CN
China
Prior art keywords
class
ttcn
internal memory
test case
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.)
Granted
Application number
CN 01134616
Other languages
Chinese (zh)
Other versions
CN100403264C (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 CNB011346167A priority Critical patent/CN100403264C/en
Publication of CN1417678A publication Critical patent/CN1417678A/en
Application granted granted Critical
Publication of CN100403264C publication Critical patent/CN100403264C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The TTCN test sample executing method includes inputting test sample or test sample kit written in MP file format; converting all elements in MP file into corresponding memory targets; and executing and debugging the memory targets to complete the execution of the TTCN test sample. This omits the conversion from MP file to C program, linkage to library function and other procedures, and thus has high execution efficiency. Through the operation on some controllable target, it is possible to obtain the value of some target, set the value of some target, set break point, single-step tracking and perform other debugging.

Description

The TTCN test example executing method
Technical field
The present invention relates to be used for the test example executing method of TTCN (the Tree and TabularCombined Notation) international standard of testing protocol consistency.
Background technology
The TTCN standard is a kind of representation of test case, the language of a programming is provided, has come the data of description structure with Tabular (table) among the TTCN, described implementation with Tree (tree), by combining of implementation and data structure, realize the description of test case.
After the user write the test case script according to the TTCN standard, test case was preserved with MP (meeting TTCN normative text file) file layout, generally comprised the test suite that a plurality of test cases are formed in this MP file.Just need provide methodology to carry out this MP file afterwards, thereby reach the purpose of operation test case, the manner of execution that present TTCN commercial tool adopts is to be the MP file conversion C linguistic source file, with other C language tools these codes are compiled, link again, obtain an executable file (EXE) at last, realize the execution of test case that the user is write by carrying out this EXE file, detailed process also comprises:
The TTCN instrument generally provides some built-in functions, and the user also needs the Lib (built-in function) that provides according to the TTCN instrument to programme, the programming content comprise coding/decoding module, with the communication module of system under test (SUT).The C programmer that C programmer that the user writes and MP file generate is added the built-in function that the TTCN instrument provides, and compiles together, links, and generates an independently executable file at last, and the execution of test case is exactly to carry out this executable file.
The shortcoming of this method is:
1) need be the C language codes, compile then, link, debug process complexity that speed is slow to the MP file conversion.And in writing the use-case process, often need to revise use-case, test case, need constantly repeat these processes, inefficiency.
2) use the method to need extra support such as C CompilerTools, tool storage room function, dependence is more intense.
3) the EXE file that generates at last can only move simply, perhaps utilize C debug instruction device to debug, and this debugging can only be that carry out on the basis, can not be that debug on the basis with the TTCN statement with the C statement, so can not directly locate.
Summary of the invention
The object of the present invention is to provide a kind of TTCN test example executing method of carrying out and debugging be convenient to, do not need that C CompilerTools, tool storage room function etc. are extra to be supported.
The technical solution used in the present invention is: a kind of TTCN test example executing method, at first import the test suite that the test case of writing with the MP file layout or a plurality of test case are formed, again all elements in the MP file is converted into object in the corresponding internal memory, by the execution of finishing the TTCN test case is carried out, debugged to object in the described internal memory.
After adopting the inventive method, as input, the MP file is compiled as object in the internal memory, then this object is carried out, debugged with the MP file.By this method, saved the MP file conversion and be c program, with processes such as linking of built-in function, improved execution efficient greatly.And since the MP file in all elements be converted into object in the internal memory one by one, these objects all are controlled, can to these objects carry out such as the value of obtaining certain object, be provided with certain object value, debugging such as breakpoint, single step tracking are set.
Description of drawings
Fig. 1 is TTCN test case implementation figure in the prior art.
Fig. 2 is the inventive method overall process synoptic diagram.
Fig. 3 is the class composition diagram in the inventive method embodiment.
Embodiment
Below in conjunction with drawings and Examples the present invention is further described, shown in Figure 1 is TTCN test case implementation in the prior art.
With reference to Fig. 2, TTCN test example executing method of the present invention comprises three processes generally, at first, the input test use-case, the i.e. test suite formed of the test case of writing with the MP file layout or a plurality of test case, again all elements in the MP file is converted into object in the corresponding internal memory, last, by the execution of finishing the TTCN test case is carried out, debugged to object in the described internal memory.
With reference to Fig. 3, the inventive method is the C++ class of the correspondence of every kind of element design in the MP file, and this type of is as the manifestation mode of this element in internal memory.During the compiling of MP file, each element is separately converted to the class of representative oneself, and the form of corresponding information with object is saved in the internal memory.After compiling is finished, whole M P file has become a series of objects in the internal memory, these a series of objects can intactly reflect the information that whole M P file is comprised, and object can comprise numerical operation class CValue, statement class CLine, test case class CTestCase and four fundamental types of test suite class CTestSuit in the internal memory; A test suite class object can comprise a plurality of test case class objects, and a test case class object can comprise a plurality of statement class objects, and a statement class object is made up of a plurality of numerical operation class objects; Wherein:
The numerical operation class comprises numerical value class and expression formula class CExpr, the numerical value class comprises following eight classes: (1) integer class CIntegerValue, (2) boolean's class CBoolValue, (3) floating-point class CFloatValue, (4) structure class CSetValue, (5) collection class CSetOfValue, (6) have Ser.No. category CSequenceValue, (7) out-of-order array class CSequenceOfValue, (8) associating class CChoiceValue; Above class is used for realizing the expression of numerical value at internal memory corresponding to all kinds of numerical value in the MP file;
The expression formula class comprises following eight classes: (1) additive operation class CPlusExpr, (2) subtraction class CMinusExpr, (3) multiplying class CMultiplyExpr, (4) division arithmetic class CDivideExpr, (5) equal class CIsEqualExpr, (6) do not wait class CNotEqualExpr, (7) and computing class CAndExpr, (8) exclusive disjunction class COrExpr; Above class is used for realizing the expression of expression formula at internal memory corresponding to all kinds of expression formulas in the MP file;
The statement class comprises following a few class: (1) condition turns to class CWhileLine, (2) condition judgment class CIfLine, (3) circulation class CForLine, (4) send classes of messages CSendLine, (5) receive classes of messages CReceiveLine, (6) unconditionally turn to class CGotoLine, (7) return class CReturnLine, (8) assignment class CAssignmentLine; Above class is used for realizing the expression of TTCN statement at internal memory corresponding to each quasi-sentence in the MP file;
Object in the internal memory is carried out, debugged can be that a plurality of threads to the TTCN script are made time-division processing, and each thread is preserved the thread current state with a thread state object; Following four contents of each thread state object record:
(1) the internal memory pointer of dynamic assignment;
(2) function executing state in the record thread and the storehouse that calls order;
(3) array of recording events formation;
(4) system clock.
Carry out use-case according to memory object and carry out, need in the process of implementation to distribute and reclaim various operations such as internal memory, messaging, beginning and termination clock.The TTCN standard is supported the multithreading function, relate to the switching of cross-thread in the implementation, preserve its operation context with a thread state object CRunContext object for each thread, promptly preserve each thread current state, after thread is switched, can also obtain the final state of operation last time, and continue operation from final state.Can be defined as follows class CRunContext in concrete the enforcement: class CRunContext{ CMemArray m_ContextMemArray; ∥ is used to write down the internal memory of dynamic assignment in service, carries out internal memory and reclaims, and realizes memory management
ARRAY (CFunc) m_FuncStack; ∥ function call storehouse
ARRAY (CEvent) m_EventQueue; The ∥ event queue
CTimerPool m_TimerPool; ∥ clock queue }
M_ContextMemArray is used for the internal memory pointer of operational process dynamic assignment is preserved, unified release behind function of existence operation in these.
The level that comprises a plurality of functions in thread calls, and m_FuncStack is used to write down the function call storehouse.Before calling a function function pointer is pressed in this storehouse, a function call is finished and is retreated stack, thereby realizes stack management.Can also observe present procedure by this storehouse and carry out which function, information such as calling order of function, thus realize debug function.
M_EventQueue is used for the recording events formation, with array form record as message, the clock incident of can trigger moving such as overtime, incident is put in this array after receiving an incident, waits pending.
M_TimerPool has write down the clock of present system start-up, and scheduler program judges constantly whether these clocks are overtime, if overtime, then it deleted from m_TimerPool, and increases an overtime incident in m_EventQueue.
When executive routine switches to a CRunContext object, the m_TimerPool in this object is judged that it is overtime to see if there is clock, and check whether to have among the m_EventQueue and need the incident handled, if having then allow this thread operation.Each statement can be handled these incidents during the thread operation.Behind the some statements of thread execution, switch to another CRunContext object, carry out several statements again, realized that the timesharing of a plurality of threads is carried out, and can be in operation and comprise the various debugging such as value that breakpoint, single step are followed the tracks of, obtained certain object are set.

Claims (3)

1, a kind of TTCN test example executing method, it is characterized in that: at first import the test suite that the test case of writing with the MP file layout or a plurality of test case are formed, again all elements in the MP file is converted into object in the corresponding internal memory, by the execution of finishing the TTCN test case is carried out, debugged to object in the described internal memory.
2, TTCN test example executing method as claimed in claim 1 is characterized in that: object comprises numerical operation class, statement class, test case class and four fundamental types of test suite class in the described internal memory; A test suite class object can comprise a plurality of test case class objects, and a test case class object can comprise a plurality of statement class objects, and a statement class object is made up of a plurality of numerical operation class objects; Wherein:
The numerical operation class comprises numerical value class and expression formula class, and the numerical value class comprises following eight classes: (1) integer class, and (2) boolean's class, (3) floating-point class, (4) structure class, (5) collection class, (6) have the Ser.No. category, (7) out-of-order array class, (8) associating class; The expression formula class comprises following eight classes: (1) additive operation class, and (2) subtraction class, (3) multiplying class, (4) division arithmetic class, (5) equal class, and (6) do not wait class, (7) and computing class, (8) exclusive disjunction class;
The statement class comprises following eight classes: (1) condition turns to class, (2) condition judgment class, and (3) circulation class, (4) send classes of messages, and (5) receive classes of messages, and (6) unconditionally turn to class, and (7) return class, (8) assignment class.
3, TTCN test example executing method as claimed in claim 1, it is characterized in that: described object in the internal memory is carried out, debugged is that a plurality of threads to the TTCN script are made time-division processing, and each thread is preserved the thread current state with a thread state object; Following four contents of each thread state object record:
(1) the internal memory pointer of dynamic assignment;
(2) function executing state in the record thread and the storehouse that calls order;
(3) array of recording events formation;
(4) system clock.
CNB011346167A 2001-11-07 2001-11-07 TTCN test example executing method Expired - Fee Related CN100403264C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB011346167A CN100403264C (en) 2001-11-07 2001-11-07 TTCN test example executing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB011346167A CN100403264C (en) 2001-11-07 2001-11-07 TTCN test example executing method

Publications (2)

Publication Number Publication Date
CN1417678A true CN1417678A (en) 2003-05-14
CN100403264C CN100403264C (en) 2008-07-16

Family

ID=4672615

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB011346167A Expired - Fee Related CN100403264C (en) 2001-11-07 2001-11-07 TTCN test example executing method

Country Status (1)

Country Link
CN (1) CN100403264C (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100377108C (en) * 2005-04-30 2008-03-26 华为技术有限公司 Executing method for test samples
CN100435113C (en) * 2005-03-08 2008-11-19 中国科学院软件研究所 TTCN-3 testing system basedon C++ mapping and its testing method
CN101930362A (en) * 2010-08-06 2010-12-29 中国科学院软件研究所 Method for integrating TTCN language and data description language
CN1984171B (en) * 2006-04-06 2011-04-13 华为技术有限公司 System and method for realizing speech apparatus function test
CN102195773A (en) * 2010-03-03 2011-09-21 中国人民解放军信息工程大学 Method and system for analyzing block cipher algorithm
CN102395141A (en) * 2011-11-04 2012-03-28 大唐移动通信设备有限公司 Recurrence method and equipment based on consistency testing
CN101727345B (en) * 2008-10-29 2013-09-04 国际商业机器公司 Method and system for controlling loading state of dynamic link library DLL

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0779373B2 (en) * 1993-02-18 1995-08-23 株式会社高度通信システム研究所 Compatibility test suite creation device
JPH0815281B2 (en) * 1993-09-13 1996-02-14 株式会社高度通信システム研究所 Abstract test case dividing device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100435113C (en) * 2005-03-08 2008-11-19 中国科学院软件研究所 TTCN-3 testing system basedon C++ mapping and its testing method
CN100377108C (en) * 2005-04-30 2008-03-26 华为技术有限公司 Executing method for test samples
CN1984171B (en) * 2006-04-06 2011-04-13 华为技术有限公司 System and method for realizing speech apparatus function test
CN101727345B (en) * 2008-10-29 2013-09-04 国际商业机器公司 Method and system for controlling loading state of dynamic link library DLL
CN102195773A (en) * 2010-03-03 2011-09-21 中国人民解放军信息工程大学 Method and system for analyzing block cipher algorithm
CN101930362A (en) * 2010-08-06 2010-12-29 中国科学院软件研究所 Method for integrating TTCN language and data description language
CN101930362B (en) * 2010-08-06 2013-04-24 中国科学院软件研究所 Method for integrating TTCN language and data description language
CN102395141A (en) * 2011-11-04 2012-03-28 大唐移动通信设备有限公司 Recurrence method and equipment based on consistency testing
CN102395141B (en) * 2011-11-04 2014-06-04 大唐联仪科技有限公司 Recurrence method and equipment based on consistency testing

Also Published As

Publication number Publication date
CN100403264C (en) 2008-07-16

Similar Documents

Publication Publication Date Title
US7316005B2 (en) Data race detection using sequential program analysis
KR20210002701A (en) Execution control through cross-level trace mapping
EP1074911B1 (en) Aspect-oriented programming
US7950001B2 (en) Method and apparatus for instrumentation in a multiprocessing environment
US8458681B1 (en) Method and system for optimizing the object code of a program
US20040205720A1 (en) Augmenting debuggers
US8752020B2 (en) System and process for debugging object-oriented programming code leveraging runtime metadata
US20100325359A1 (en) Tracing of data flow
US20130318504A1 (en) Execution Breakpoints in an Integrated Development Environment for Debugging Dataflow Progrrams
US8429632B1 (en) Method and system for debugging merged functions within a program
CN101408849A (en) Method and system for compiling and executing TTCN-3 language
EP2011004A2 (en) Method and system for providing a visual debugger for an interpreted statistical language
CN102591777A (en) Unit test code generation method and device
CN109542444B (en) JAVA application monitoring method, device, server and storage medium
US7185322B2 (en) Method and apparatus for parallel action processing
WO2001018649A2 (en) Method and system for split-compiling a hybrid language program
CN112765032A (en) Program debugging method, device, equipment and storage medium
CN1417678A (en) TTCN test example executing method
JPH09237202A (en) Method for executing debugging processing
Qin et al. Discovering use cases from source code using the branch-reserving call graph
EP3619612B1 (en) Temporary de-optimization of target functions in a cloud debugger
Hammacher Design and implementation of an efficient dynamic slicer for Java
WO2020073200A1 (en) Program debugging method and system
US20030182596A1 (en) Method and system for isolating exception related errors in java JVM
Maruyama et al. Debugging with reverse watchpoint

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
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

Granted publication date: 20080716

Termination date: 20161107

CF01 Termination of patent right due to non-payment of annual fee