CN1949186A - Program testing system and mapping method for said program testing system - Google Patents

Program testing system and mapping method for said program testing system Download PDF

Info

Publication number
CN1949186A
CN1949186A CNA2006101451969A CN200610145196A CN1949186A CN 1949186 A CN1949186 A CN 1949186A CN A2006101451969 A CNA2006101451969 A CN A2006101451969A CN 200610145196 A CN200610145196 A CN 200610145196A CN 1949186 A CN1949186 A CN 1949186A
Authority
CN
China
Prior art keywords
variable
mapping
script
function
space
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.)
Pending
Application number
CNA2006101451969A
Other languages
Chinese (zh)
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.)
Lingce Sci & Tech Co Ltd Shenzhen City
Original Assignee
Lingce Sci & Tech Co Ltd Shenzhen City
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 Lingce Sci & Tech Co Ltd Shenzhen City filed Critical Lingce Sci & Tech Co Ltd Shenzhen City
Priority to CNA2006101451969A priority Critical patent/CN1949186A/en
Publication of CN1949186A publication Critical patent/CN1949186A/en
Priority to PCT/CN2007/003244 priority patent/WO2008058473A1/en
Priority to CN2007800016987A priority patent/CN101401075B/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention supplies software line up using program mapping method and its program line up system. The method includes the following steps: supplying testing agent by the tested target machine; the testing agent according to the testing data base to generate tested program symbol table and type list; it according to the preset script to map the variable and function in the symbol table and type list to variable container, generate script language mapping variable and function. The invention maps variable read-write and function call of the tested system into connate grammar of the script language which can increase software line up ability and line up script exploiting efficiency.

Description

A kind of program testing system and be used for the mapping method of program testing system
Technical field
The present invention relates to software debugging and field tests, particularly at the software debugging of C language development environment and the C language mapped system and the method for test.
Background technology
In field of software development, the Tornado programmed environment of supporting the exploitation of VxWorks real time operating system is one of programmed environment that accent survey performance is put up the best performance in numerous embedded programming language.Tornado test command explanation module instrument is supported the measured variable read-write and tested function call of scripting, and function ratio is more powerful.Fig. 1 has shown that Tornado transfers the structure of survey system.The architecture that this accent is surveyed comprises the Test Host and the target machine system of Test Host system.The target machine system is tested goal systems (as PPC veneer and operation software thereon).Test Host and test command explanation module etc. are transferred the survey module to transmit to transfer to the target machine system through the destination server module and are surveyed order.Test agent (Test Agent) realizes transferring the survey operation as revising variable, call function, breakpoint, suspended task, Reset Board etc. being set after receiving order.In this system, resident in the destination server have a symbol table.When Tornado test command explanation module sends certain variable that an instruction will be modified in veneer operation, arrive first the address of this variable of target machine server lookup in target machine that is arranged on the Test Host end, test agent through communicating to connect in target machine sends request then, finally realizes this variable modification by test agent.
Although Tornado test command explanation module is powerful, but owing to use two kinds of interpreters is C interpreter and TCL interpreter, and the symbol table that has only owing to residing in the target machine server does not have type list, thereby makes its accent survey ability be subjected to many restrictions.These restrictions mainly comprise: 1) because the type list of variable and function is not resident, cause being difficult to support at the operation of compound type; 2) be used to transfer the C interpreter of observing and controlling system and TCL interpreter to reside at the Test Host end, cause transferring observing and controlling system and tested code to have and to support to transfer survey under the mutual situation of tight coupling; 3) the variable read-write and function calls with controls such as if, else and realizes in two scripts respectively, therefore, when the survey instruction is transferred in the operation of test command explanation module, often will switch between C interpreter and TCL interpreter, and is very loaded down with trivial details.Exchanges data is mainly passed through global variable between two interpreters.Although the C interpreter can call the TCL script by an embedded API, the TCL script also can embedded C interpreter, still inconvenience in the use, and also operational efficiency is low.4) and, because above-mentioned 3) reason, C interpreter and TCL interpreter belong to two cover systems, are difficult to merge in the grammatical and semantic rank, have increased user's learning burden, also are unfavorable for transferring the expansion of brake.
On the other hand, the 4th generation the white-box testing method synthesis best practices of software white-box testing, reflected the developing direction of white-box testing now, belong to the universal method opinion of public sphere.For meet the 4th generation the white-box testing method requirement, need do following improvement to accent survey system based on the Tornado technology:
1, introduce a kind of instant system of surveying of transferring of supporting, test control should be in the same execution body with tested code.
2, use a kind of script, control (being similar to the C interpreter among the Tornado Shell) at tested C variable and function had both been described, also describe test control (being similar to the TCL interpreter among the Tornado Shell), this two class description must be kept identical diction.
Summary of the invention
The present invention surveys scarce capacity and the not good enough problem of testing efficiency in order to improve the ubiquitous accent of current embedded software, and satisfy the 4th generation the white-box testing method requirement, relevant method of testing opinion is applied to the C language development field of embedded product, overlap the programming language mapping techniques and propose one, that is: with the operation of the variable of C language, function operation map to a script language system, this script language system is resided in the system under test (SUT), make these scripts both realize the test description of scripting, can directly control variable in the system under test (SUT), function etc. again.And, introduce a kind of instant system of surveying of transferring of supporting, make test control and tested code be in one together and carry out in the body.The present invention uses a kind of script both to describe control at the variable and function of tested C language, also describes test control, and keeps this two class description to have identical style.
According to the present invention, a kind of program testing system is provided, comprise Test Host and target machine, described Test Host is transferred survey to the program in the described target machine, wherein, comprise test agent in the described target machine, described test agent comprises: table generates the unit, according to the tune-up data storehouse that in the compilation process of tested program, generates, generate the symbol table and the type list of tested program, with the mapping support module, according to symbol table that is generated and type list, with the variable of described tested program and Function Mapping mapping variable and mapping function to script; Described Test Host comprises: the variable container unit, be used to deposit described mapping change and mapping function, to handle the assignment of described mapping variable and value and redirect to of assignment and the value operation of described mapping variable, and calling of described mapping function redirect to calling of respective function in the c program code at its C instance space; The test command explanation module, receive the test command of script file form, utilize the steering operation of described variable container unit, described test command is converted into the order that described target machine can be handled, send the test agent of described target machine to described mapping variable and described mapping function.
According to a further aspect in the invention, a kind of mapping method that is applied in the program testing system is provided, described program testing system comprises Test Host and target machine, described Test Host is transferred survey to the program in the described target machine, comprise test agent in the described target machine, comprise the mapping support module in the described test agent, described method comprises: 1) provide test agent at described target machine; 2) described test agent is according to the symbol table and the type list that are produced described tested program by line up procedure by the tune-up data storehouse after compiling; 3) described test agent all maps in the variable container mapping variable of generation script language and mapping function to variable in described type list, the symbol table and function according to predetermined script.
By system and method for the present invention, the calculation process to software commissioning can be assigned to Test Host and target machine.The script of handling the test case of tested program by Test Host is write and is explained.The script system that resides in target machine is finished mapping and the control to tested end C linguistic variable and function.
Program data base) or GDB (GNU debugged program, it is the subsidiary supporting debugged program of GCC compiler) and the symbol table and the type list that produce the mapping of script is based on three aspects: one, the PDB that generates by the C CompilerTools according to target machine (Program Data Base:; Two, at the script of test agent end to the mapping definition of object; Three, generate the variable container of the overall situation, make it contain variables corresponding and function.When the order of user test when Test Host is sent to target machine because the present invention makes test control and test be coded in a place and compatible, thereby can regulate and control immediately effectively flexibly.
Mapping techniques of the present invention has promoted the debugging capability and the white-box testing ability of software product effectively.Compare with Tornado test command explanation module, the present invention surveys module and mapping block by comprised accent in the script system of test agent, makes test control and tested code all in a system.The observing and controlling system of accent is tightr with tested code coupling.Tight coupling does not have two systems alternately because of communicating to connect the time delay of bringing, and the complicacy of test control procedure also has been lowered.Therefore, the variable and function in the system under test (SUT) can be directly by script operation.Realize that in script the ability that the variable read-write and function calls almost approaches to write the C code in system under test (SUT), emulation preferably the C syntax rule, do not stay the dead angle.Test required real-time control ability in addition and also be protected, the accent that is specially adapted under the real time operating system is surveyed.
In sum, the invention has the advantages that:, make the behavior that script can directly be controlled system under test (SUT) of surveying of transferring by adopting a kind of mapping techniques.Because the online definition of script, the characteristic of online execution have improved greatly and have transferred the development efficiency of surveying script, strong guarantee the on-line testing that requires of white-box testing method of the 4th generation transfer the tool realization of surveying with grey box.With respect to Tornado test command explanation module, transfer survey efficient to be improved.In addition, needn't switch between two kinds of scripts through being everlasting in test, data transfer is transmitted free more with control.
Therefore, the present invention can promote the accent of embedded software and survey ability, reduces the study threshold of test statement, and significantly the development efficiency of surveying script is transferred in lifting.
Description of drawings
Fig. 1 has shown that existing Tornado transfers the survey architecture;
Fig. 2 has shown the debugging framework of Tornado Shell;
Fig. 3 has shown framed structure of the present invention;
Fig. 4 is the hierarchical structure of test agent among the present invention;
Fig. 5 is the initialization procedure of mapping support module;
Fig. 6 is a mapping example generative process;
Fig. 7 has exemplarily shown the TData and the TType corresponding relation of a mapping example;
Fig. 8 has exemplarily shown the attribute according to mapping example of the present invention.
Embodiment
Program language mapping method of surveying and the program testing system of using this method give detailed explanation to being used for the embedded software accent below in conjunction with accompanying drawing.For ease of explanation, will be that example describes below with the C language.But design of the present invention and scheme also can be used for the program of other Languages, for example C Plus Plus.
Existing measuring technology is that main calculating section is finished by Test Host, the instruction that comes interpreting user to import by the command interpretation module, and the instruction after will explaining is communicated to destination server.Destination server is operated, and finishes instruction by the test agent of target machine.And in the present invention, then be that original some calculating and operation at Test Host moved on to target machine.
In order to realize purpose of the present invention, need on expression way, satisfy following describing mode to the script that uses among the present invention:
1, pointer operation and C diction are consistent, comprise ">" operational character using method, for example use " pStruct->Member1 " to describe certain structured fingers and point to certain member, the rule that also comprises pen travel, for example " pInt+2 ", the int pointer is moved 2 backward, and actual sensing will be offset the individual byte of 2*sizeof (int).
2, access array member's the mode and the style of C language are consistent.Use bracket to get sub-member, for example use the 3rd the sub-member of " ArrayVar[2] " expression access array variable ArrayVar by subscript.
3, access struct and union member's mode and C diction are consistent.Use period to separate struct/union variable and its member, such as certain Struct type definition two sub-member Member1 and Member2, first sub-member's of access the type variable StruVar description form is " StruVar.Member1 ".
4, support the following dual operation consistent with the C language meaning, it is all consistent with priority that operational character is expressed mode.
Arithmetic type Operational character
Mathematical operation + - * /
Relational calculus == != < > <= >=
The bit field operation 《 》 & | ^
Logical operation ‖ &&
More than relate to the assignment that should adapt to equally that value describes and describe, as " pStruct->Member1=3 ", " ArrayVar[2]=3 ", " StruVar.Member1=3 ".
Simultaneously, for reaching high-level efficiency test and supporting necessary extended capability, reside in that script preferably should be able to satisfy following requirement in the test agent:
1, all the variable and functions in the script can be realized managing automatically life cycle, and most scripts all possess this characteristic, and common use is quoted the metering technology and realized managing automatically life cycle.
2, support common data type, as 4 byte integer, single precision or double-precision floating points, word string, array sequence, dictionary etc.
3, support basic branch and cycle controls such as if, else, while.
4, support function definition expansion and module definition expansion.
5, support class definition and class to inherit.This is because the mapping ruler that the present invention uses depends on specific class definition form.Therefore the function that needs class definition.
6, do not restarting under the script system prerequisite, can online additions and deletions variable, function, and the definition of class, existing many scripts can both be supported this point in the technology now.
The script system that satisfies above-mentioned requirements all can obtain from prior art, and as Python, Ruby etc., they all support online increase or deletion variable-definition or function definition.
Fig. 3 is the schematic block diagram that drives test macro according to script interpreter of the present invention.As shown in the figure, Test Host 1 comprises test shell (Test Shell) 11, be used for initiating to transfer surveying order, and the platform that exploitation, test are provided.The Test Host end can adopt personal desktop system (as Windows, Linux etc.).Test shell 11 can be one of them executable program.
Target machine 2 is tested single board normally, or a simulated program.Resident in the target machine 2 have a test agent (Test Agent) 21.This test agent 21 can be a script language system.In the present invention, to the not qualification of kind of script, as long as can satisfy the mapping ruler of the present invention's regulation.The symbol table and the type list that in the test agent 21 of target machine 2, include tested program.To illustrate below about symbol table and type list.
Target machine 2 can with Test Host 1 shared same equipment, for example computing machine.In the case, tested program is the exe program, and Test Host also is the exe program, and both can operate on the operating system (platform of the support multi-process as windows) of a machine simultaneously.
The test shell 11 of Test Host 1 has with test agent 21 and communicates to connect.The communication mode of this connection can be that (for situation, the tcp/ip communication of target machine and shared same the computing machine of Test Host, or other is as forms such as serial communications in shared drive communication.
As shown in Figure 4, test agent 21 comprises script system 211 and communication unit 212.The above-mentioned of test shell 11 that communication unit 212 is responsible for processing test agent 21 and Test Host 1 communicates to connect.
Script system 211 comprises embedded accent survey support module 2111 and mapping support module 2112.Support module 2111 surveyed in embedded accent is set that application programming interface (API) surveyed in conventional accent, provides such as the reset object machine, starts or stops certain task, breakpoint is set, function such as deletion breakpoint.Mapping support module 2112 is used for realizing the function of the C linguistic variable and function of system under test (SUT) to the script system mapping.After finishing mapping, generate variable and function mapping variable and mapping function of the same name in the script system 211 with the C language.
In order to realize purpose of the present invention, require Test Host 1 and target machine 2 that the processing power of pair script file all should be arranged.For this reason, an order line editor input block and command interpretation module (not shown) have been comprised in the test shell 11 of Test Host 1, order line editor's input block is used to support the accent of user's input pin presents form to survey order, the command interpretation module is surveyed order to the accent of input and is converted into and can explains the test command of carrying out by the script interpreter in the test agent 21, and sends the test agent 21 of target machine 2 to.Correspondingly comprise a script interpreter (not shown) in the test agent 21, be used for realizing test control.Script interpreter receives the test command that the command interpretation module sends, and this order is made an explanation and implements corresponding actions.The form of actual transfer is the intermediate code form, and similar Java Virtual Machine explains that the bytecode order is the same, and this intermediate code form also claims pseudo-coding and decoding.
Carry out test and feedback result or sent type information in test process when target machine 2, the test shell 11 of Test Host 1 will receive this result or information and handle.
Referring to Fig. 5, at first, target machine 2 will carry out initialization process.When the program of Test Host 1 startup command explanation module, target machine 2 starts tested program (S501).Then, the script system 211 that target machine 2 initialization wherein comprise comprises the relevant configuration (S502) that test agent 21 is set.In this process, the table of test agent 21 generates the information of extracting GDB that the unit (not shown) generates in its last compiling back from the tested softwares of target machine 2 or the PDB tune-up data storehouse with mapped variable/functional dependence, generate symbol table and type list (hereinafter will illustrate), and be recorded in (S503) in the test agent 21.Then, the script system 211 of test agent 21 is mapped to symbol table and type list in the variable container (S504) of an overall situation.According to predetermined script the symbol of type list, symbol table is all mapped to (S505) in the variable container.This operation is described as mapping object (being the TData class object of script) with the variable and function in the tested program in script system.Because the whole symbols of conversion can cause CPU and memory source waste, therefore according to an embodiment of the invention, symbol are not done disposable whole conversion, and only shine upon according to the test needs.For example, operation is during test script, and script comprises the variable and function of which mapping, with regard to those variablees of dynamic translation or function, perhaps determines voluntarily that by the user rule changes as required, does not shine upon such as the symbol of all external definitions.
After this, carry out the proper testing (S506) of system under test (SUT).At Test Host 1, the user uses the script file of similar C language that the coding that sends is operated.The input of the command interpretation module interpreting user in the test shell 11, and send corresponding test instruction.This order is sent to test target machine 2, and operation in its script system 211, thereby obtains by the resulting test run result of codimg logic.This test run result can be fed back to Test Host 1, and is shown to the user.In said method, owing to can write test script online, to check or revise measured variable intuitively, call tested function, What You See Is What You Get can be seen test result at once, also retrofit testing at once, thus improved the efficient of test.
Because the C speech encoding is very strict to structure/type requirement of its data,, must be able to support the function and the requirement of basic C programming as the script after its mapping.
In order to realize above-mentioned mapping to the C speech encoding, according to the present invention, the resident symbol table and the data type table of tested program in the test agent 21 of target machine 2.These two tables will directly be supported the realization of the mapping ruler that the present invention stipulates.Mapping method of the present invention depends on collection and the analysis to the various symbols and the type information thereof of target machine system.The tune-up data storehouse is produced by compiler in compilation process, for example can produce the PDB file in the Visual C/C++ compilation process, and GCC also is compiled into the GDB Debugging message in the target program when compiling.As mentioned above, extract in the tune-up data storehouse that these information can be produced by compiler in compilation process, according to corresponding generation symbol table of the information of being extracted and type list.
The tune-up data library format that different C compilers generates is also different.The present invention has reached unification to different-format by the generation to type list and symbol table.The all kinds that type list record system under test (SUT) defined.These types must comprise: host type information, sub-type information and take byte number.Table 1 is the example of type definition form:
Table 1:
Host type Subtype Take byte number
Basic data type Char 1
unsigned char 1
Short 2
unsigned short 2
Int 3
unsigned int 3
float 4
double 8
void 0
Pointer type The type of pointed (SubType) 4
Enumeration type Each enumerated value tabulation 4
The TypeDef type Former type (OrgType) --
Array type Array subtype and dimension --
The UDT type The sub-member's tabulation of struct or union --
Type function Call style, each parameter type, rreturn value --
The Public symbol Do not have --
To guarantee that simultaneously each column has uniqueness under the type list, that is, and by identical host type and subtype and account for the same word joint number and can only there be one in the type item that constitutes.
The address value of symbol table record variable or function and type i D thereof.Wherein symbolic address has two kinds of forms, both can write down specific address, also can write down relative address.For example, local variable or when importing parameter in the access function then uses the off-set value with respect to current stack top location.For another example, certain variable exists under another variable space, and its address also adds Last Offset by the address of this another variable and expresses.
Symbols From has dual mode, and the one, derive from another mapping object, the 2nd, derive from certain specific address.The latter is a usual manner of describing variable or function, and the former uses when being everlasting same memory headroom being regarded as polytype variable and operate, and for example forced type conversion is to regard a certain skew of certain word string array as the integer type variable.
After having generated symbol table and type list, easy to operate for script, data transformed the script class object accordingly during system will define and show, and promptly the TType class object is corresponding to type list, and the TData class object is corresponding to symbol table.Instantiation data in the definition of TType class object will comprise following information: the sign that the type is unique, the other information of type main classes, type subcategory information, size of type.Each sign map is the instantiation data of TData class definition, comprise following information: the type i D of this symbol correspondence, whether the source of symbol with respect to the inclined to one side location in source, is automatic releasing memory.
The mapping process of table content is undertaken by Fig. 6.At first, script system 211 is found out symbol (comprising variable and the function) information that needs in symbol table, as designation, and Symbol Type ID and symbolic address (S601).Script system 211 is searched the TType class object whether corresponding type has generation by the type ID then, if then do not create this TType class object earlier, promptly by definition of T Data or TType class object, the construction function that calls class definition is created the example (S602) of this class object.At last, according to the source of this symbol, affiliated TType object, address offset and whether automatically information such as releasing memory create the TData class object (S603) of mapped symbol.
When the mapping example of creating comprises mapping variable and mapping function, at first to there be corresponding TType object to indicate type information.After every in the type list changed into TType class example, original type information table was die on, and its resource that takies can discharge, and formed a new table, i.e. TType type list with each newly-generated TType class example.Mapping variable and mapping function all are TData class examples.As shown in Figure 7, each TData class example uses the type i D (Data type) of this symbol correspondence to indicate its to use which type in TType type list.
The object that it is noted that the TType class may nestedly be quoted.Some compound type such as struct/union/ pointer etc. have comprised subtype, and same subtype may be quoted by a plurality of compound types.So when creating each TType object, other type that the type relates to also is created simultaneously.
Because the system resource of Test Host and target machine is limited,, be crucial to the processing of using resource in corresponding period in order more effectively to test.According to the present invention, in order effectively to utilize system resource, variable, function, class object etc. exist as an entity in script, have realized managing automatically life cycle.Resource application automatically, release automatically that these entities are shared.Mapping (enum) data is also supported the automatic application and the release of its related resource as the script class object.
For example, script system 21 will be created a mapping variable buff, it is the word string array that a length is 24 bytes, at this moment script system 21 can be applied for the internal memory that it takies automatically to target machine 2, comprise the memory headroom that the buff variable will take as script TData class example, and 24 byte spaces of word string array.For convenience of description, in the present invention, last space-like is called the example script space, one space-like, back is called the C instance space.When finish the life cycle of the mapping variable of new establishment, these two kinds of spaces all will be automatically released.
But, since the programming complicacy, example script space and C instance space not always simultaneously the application or simultaneously release.For example for the global variable of system under test (SUT), it takes up room is static allocation, and the mapping example of global variable should only discharge the example script space, and should not discharge the C instance space when finish life cycle.For another example, behind mapping variable a of establishment, the example script space and the C instance space of this variable should apply for or discharge simultaneously in the use script file.But, if this mapping variable a is regarded as the mapping variable b of another type, for example during the conversion of the forced type in the C language, with certain variable under the same address space, regard the variable of another type as, should newly apply for the example script space when then creating variable b, but should not repeat to apply for the C instance space.In addition, when variable a or variable b are deleted, no matter deletion earlier which, all should guarantee still also effective in the operated C instance space of another variable that uses.Also promptly: the C instance space can be shared by a plurality of mapping variable, and the mapping variable of having only this C instance space all to be related to has all discharged, and this C instance space just is released automatically.In addition, the C instance space that mapping variable is used also need cooperate test, can revise sign wherein under the necessary situation.For example the Autofree attribute is set for mapping variable, this attribute is that TRUE represents that the C instance space of this mapping variable is to discharge with its example script space, otherwise the attribute value is FALSE, and expression C instance space does not discharge with the example script space.
For achieving the above object, according to an embodiment of the invention, the mapping example is provided with 3 attributes.Fig. 8 has shown an example of mapping example.As shown in Figure 8, this attribute comprises: whether automatically releasing memory (Autofree), Symbols From (Owner), with respect to the offset address (Offset) in source.Wherein the attribute of " whether automatically releasing memory " is used to indicate the C instance space of this mapping variable whether to follow the example script space to discharge together." Symbols From " is used to indicate the ownership object of this mapping example, and its value both can be certain specific address value, also can be another mapping example.How many start addresses that is used to indicate the used C instance space of this mapping example with respect to the offset address in source is with respect to the side-play amount of the space address that its Symbols From is indicated.Because script possesses automatic management characteristic life cycle, so, just realized that same C instance space also can be realized the automatic management of resource when shared by a plurality of mapping examples if make the Symbols From attribute indicate another mapping example.
After the step of these starting stages was finished, system also will generate the variable container of an overall situation.This global variable container is used to comprise all variablees and function, and they are placed under the uniform platform.The variable container can be caught at the attribute value of this example and the operation of assignment, and operates escape according to particular case.Container also is the class object of script in essence, and only during its attribute of access, system can do specific intercepting and capturing and handle.
For example, the variable container that defines with reference to following formula:
vc=newVarContainer();
vc.Var3=MapString(“Another string”);
vc.Var3=“Change value”;
vc.Var4=MapString(“It is example!”);
vc.Var4=vc.Var3;
In this example, the 3rd row and last column are respectively assignment and the values at Var3, and last column is described according to the C diction.For realizing this point, the value of the mapping variable under the variable container and assignment will be carried out escape, following two statements:
vc.Var3=“Change value”;
vc.Var4=vc.Var3;
Be equal to:
vc.Var3.setValue(“Change value”);
vc.Var4.setValue(vc.Var3.getValue());
Can see that vc.Var3=" Change value " is the assignment that conforms with the C style, and vc.Var3.setValue (" Change value ") is to call, and is not assignment, away from the C style.
For supporting escape, the class methods operation of script itself will be supported orientating function, and directed back uses assignment statement finally to carry out this call statement (vc.Var3.setValue (" Change value ")).
The variable container also will be supported the variable assignments by script mode except that supporting above value and assignment escape, that is: the value with appointment replaces the original value of variable, and no matter original value is a mapping variable.For example:
vc.Var4=MapString(“It is example!”);
setVcValue(vc,“Var4”,“Another string”);
In this example, first statement is created word string mapping variable Var4 under the variable container, and the second statement replaces to this Var4 the word string value of script.After this sentence was carried out, Var4 had been a mapping variable no longer, but as conventional script variable assignment, its type is dynamic change.For this reason, the present invention requires to be provided for the api function (being similar to this routine setVcValue) of dynamic assignment.
The use of variable container also is important for function calls.For example, realize that cdecl and stdcall call, callCdecl and two methods of callStdcall are added in definition in the TData class, call the C function in script as follows:
vc.result1=vc.func1.callCdecl(IntType,3,“example”);
vc.result2=vc.func2.callStdcall(CharType,‘A’,‘B’);
These two methods all require to indicate the rreturn value type that this calls with first parameter, and other parameter is to finish each parameter value that this C calls successively.Initiated to call not based on a kind of function prototype by these two methods, use a bit trouble, because will specify the rreturn value type when calling, and whether the type of respectively importing parameter into mates, whether number of parameters correctly all can't be checked.For improving this point, in the present invention TData has been added the support that right _ call_ calls, its using method is as follows:
vc.result1=vc.func1._call_(3,“example”);
vc.result2=vc.func2._call_(‘A’,‘B’);
In order to make describing method simpler, the embedded call of support that the present invention defines the script class turns to function, thereby top script is rewritten into following mode:
vc.result1=vc.func1(3,“example”);
vc.result2=vc.func2(‘A’,‘B’);
Rewrite the back implementation effect and be equal to, that is: when class object self goes to call as function, system automatically it is redirect to this object _ the call_ method.Some existing scripts can be supported this turning to as Python and CSE.The present invention realizes new application by this mechanism, that is, allow mapping function (being example script) call with the C language and be consistent on expressing, as vc.func._call_ (3, " example ") be not consistent, and vc.func (3, " example ") is consistent.So far, it is just consistent with the C diction to use script to call the style of C function.
Except the cdecl of above-mentioned routine and calling of stdcall preset parameter type, the present invention also needs to support the elongated parameter call of cdecl style, the prototype of for example elongated parametric function MyPrint be " void MyPrint (char*format; ...) ", according to the present invention, can call it as follows:
vc.result=vc.MyPrint.callCdecl(“name:%s”,“george”);
At this, elongated parameter call will be imported value into by parameter and be assembled into the pop down data before the C function call be initiated.Simulate the C language call then, obtain the rreturn value that simulation is called.
If mapping function has rreturn value, then call mapping function and should return a mapping variable.The return type that is former C function is got its type and the numerical value that returns when the void, generate mapping variable.

Claims (10)

1. program testing system comprises Test Host and target machine, and described Test Host is transferred survey to the program of described target machine, wherein,
Comprise test agent in the described target machine, described test agent comprises:
Table generates the unit, according to the tune-up data storehouse that in the compilation process of tested program, generates, generate the symbol table of tested program and type list and
The mapping support module is according to symbol table that is generated and type list, with the variable of described tested program and Function Mapping mapping variable and the mapping function to script;
Described Test Host comprises:
The variable container unit, be used to deposit described mapping change and mapping function, to handle the assignment of described mapping variable and value and redirect to of assignment and the value operation of described mapping variable, and calling of described mapping function redirect to calling of respective function in the c program code at its C instance space;
The test command explanation module, receive the test command of script file form, utilize the steering operation of described variable container unit, described test command is converted into the order that described target machine can be handled, send the test agent of described target machine to described mapping variable and described mapping function.
2. program testing system according to claim 1, wherein said type list comprise host types all types of in the described tested program, subtype and take byte number;
The symbolic address and the type i D of each variable and function in the described symbol table record tested program.
3. program testing system according to claim 2, wherein said symbolic address are specific address or relative address, and described relative address comprises with respect to the off-set value of current stack top or with respect to the off-set value of another variable.
4. C language mapped system according to claim 2, the type item that has identical host type and subtype and same word joint number in the wherein said type list is unique.
5. according to each described program testing system of claim 1-4, the mapping of wherein said variable function produces the TData object of mapping example as script, and described TData object comprises following attribute:
Be used to indicate the attribute of the data type of described mapping example;
Be used to indicate the C instance space of described mapping example whether to follow the attribute that the example script space discharges together;
Be used to indicate the attribute of ownership object of the C instance space of described mapping example; With
Relative its of C instance space that is used to indicate described mapping example to use belongs to the attribute of the skew of object.
6. mapping method that is applied in the program testing system, described program testing system comprises Test Host and target machine, described Test Host is transferred the program in the described target machine and is surveyed described method and comprise:
1) provides test agent at described target machine;
2) described test agent is according to the symbol table and the type list that are produced described tested program by line up procedure by the tune-up data storehouse after compiling;
3) described test agent all maps in the variable container mapping variable of generation script language and mapping function to variable in described type list, the symbol table and function according to predetermined script.
7. method according to claim 6, wherein said mapping step comprises:
From symbol table, determine the information of variable symbol to be mapped, comprise title, type i D and the symbolic address of variable symbol;
According to the pairing scripting object type of the sign pattern that comprises in the described information, determine the attribute of variable symbol to be mapped, whether automatically described attribute comprises the source, offset address of symbol and releasing memory; With
According to the information and the attribute of described variable symbol, create the mapping example of described symbol,
Wherein, describedly determine that the step of the information of variable symbol to be mapped comprises:
Whether the type of determining described variable symbol has the type of corresponding script object;
If there is not the type of corresponding script class object, then create the type.
8. method according to claim 7, wherein said tested program is a C programmer, the automatic management resource of described mapping example space, described resource space comprises C instance space and example script space, described automatic management comprises:
Example script space and C instance space are applied for simultaneously and are discharged;
The resource space of global variable is managed automatically: described C instance space is not applied for described example script space and is discharged;
Resource space when generating another mapping variable by a mapping variable is managed automatically: described C instance space applies for the example script space of first mapping variable, and discharges with the release in the example script space of the mapping variable of last shared described C instance space; And
Support the manual sign of revising mapping variable, whether described C instance space is discharged with the release in the example script space of variable control.
9. according to each described method of claim 6-8, wherein
When to the mapping variable assignment in the described variable container, described assignment step comprises:
Defined attribute value and assignment catches the processing function in the class of scripting object;
Judge assignment and whether be mapping variable by the assignment object;
Make corresponding assignment and value operation redirect to of assignment and the value operation of described mapping variable according to judged result, wherein, the default C instance space according to this mapping variable of the mapping variable assignment in the described variable container is carried out assignment at its C entity space.
10. according to each described method of claim 6-8, wherein
When the mapping function in the described variable container is called, calling of described mapping function redirect to the corresponding C function calls, and,
When the mapping function in the described variable container is carried out the elongated parameter call of cdecl style, before described C function call is initiated, import value into by parameter and be assembled into the pop down data, simulate the C language call then to obtain the rreturn value that simulation is called; If mapping function has rreturn value, return a mapping variable after then calling this mapping function.
CNA2006101451969A 2006-11-17 2006-11-17 Program testing system and mapping method for said program testing system Pending CN1949186A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CNA2006101451969A CN1949186A (en) 2006-11-17 2006-11-17 Program testing system and mapping method for said program testing system
PCT/CN2007/003244 WO2008058473A1 (en) 2006-11-17 2007-11-16 Mapping method in the program testing system and program testing system
CN2007800016987A CN101401075B (en) 2006-11-17 2007-11-16 Mapping method in the program testing system and program testing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2006101451969A CN1949186A (en) 2006-11-17 2006-11-17 Program testing system and mapping method for said program testing system

Publications (1)

Publication Number Publication Date
CN1949186A true CN1949186A (en) 2007-04-18

Family

ID=38018710

Family Applications (2)

Application Number Title Priority Date Filing Date
CNA2006101451969A Pending CN1949186A (en) 2006-11-17 2006-11-17 Program testing system and mapping method for said program testing system
CN2007800016987A Active CN101401075B (en) 2006-11-17 2007-11-16 Mapping method in the program testing system and program testing system

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN2007800016987A Active CN101401075B (en) 2006-11-17 2007-11-16 Mapping method in the program testing system and program testing system

Country Status (2)

Country Link
CN (2) CN1949186A (en)
WO (1) WO2008058473A1 (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008058473A1 (en) * 2006-11-17 2008-05-22 Shenzhen Lingce Technology Co., Ltd. Mapping method in the program testing system and program testing system
CN102135935A (en) * 2010-01-22 2011-07-27 华为技术有限公司 Software optimizing and debugging method and device
CN101114940B (en) * 2007-06-26 2011-12-07 中兴通讯股份有限公司 Method for implementing module logicalization
CN102629277A (en) * 2012-03-21 2012-08-08 北京英孚斯迈特信息技术有限公司 General structured query language (SQL) data processing method and system
CN102696019A (en) * 2009-10-01 2012-09-26 克里特里翁公司 Maintaining a secure computing device in a test taking environment
CN103049377A (en) * 2012-12-14 2013-04-17 中国信息安全测评中心 Parallel symbolic execution method based on path cluster reductions
CN103176894A (en) * 2011-12-22 2013-06-26 ***股份有限公司 Test data automatic derivative method and automatic derivative device facing database
CN103559123A (en) * 2013-10-24 2014-02-05 烽火通信科技股份有限公司 Function call stack analyzing method and device based on VxWorks operation system
CN104731695A (en) * 2013-12-19 2015-06-24 广州凯乐软件技术有限公司 Unit testing system and method supporting table-driven underlying input
US9092991B2 (en) 2010-08-04 2015-07-28 Kryterion, Inc. Peered proctoring
CN104881358A (en) * 2015-05-28 2015-09-02 南京南瑞继保电气有限公司 Program simulation testing method and system
US9137163B2 (en) 2010-08-04 2015-09-15 Kryterion, Inc. Optimized data stream upload
WO2015165078A1 (en) * 2014-04-30 2015-11-05 Hewlett-Packard Development Company, L.P. Performing mirror test for localization testing
US9280907B2 (en) 2009-10-01 2016-03-08 Kryterion, Inc. Proctored performance analysis
CN106126431A (en) * 2016-08-23 2016-11-16 腾讯科技(深圳)有限公司 Performance test methods and system
CN106610838A (en) * 2016-12-27 2017-05-03 北京酷我科技有限公司 Method for converting multiple script languages
CN109344083A (en) * 2018-11-05 2019-02-15 郑州云海信息技术有限公司 A kind of program debugging method, device, equipment and readable storage medium storing program for executing
WO2019090994A1 (en) * 2017-11-08 2019-05-16 平安科技(深圳)有限公司 Script testing automated execution method, apparatus, equipment and storage medium
CN110853327A (en) * 2019-11-02 2020-02-28 杭州雅格纳科技有限公司 Ship cabin equipment data field debugging and collecting method and device based on single chip microcomputer
US10672286B2 (en) 2010-03-14 2020-06-02 Kryterion, Inc. Cloud based test environment
CN114124772A (en) * 2021-11-05 2022-03-01 中国航空工业集团公司雷华电子技术研究所 Network debugging method based on VxWorks operating system

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729288B (en) * 2013-11-01 2016-02-24 华中科技大学 The adjustment method of application program under a kind of embedded multi-core environment
CN105573903A (en) * 2014-10-11 2016-05-11 中兴通讯股份有限公司 Automatic test method, automatic test device, automatic test system and access proxy
CN104298600A (en) * 2014-10-23 2015-01-21 广州华多网络科技有限公司 Software testing method and device
CN105808421A (en) * 2014-12-31 2016-07-27 中兴通讯股份有限公司 White box test realization method and test control end
CN106445829A (en) * 2016-10-21 2017-02-22 天津海量信息技术股份有限公司 Debugging debug method with large data indexing rules
CN107729254A (en) * 2017-11-10 2018-02-23 郑州云海信息技术有限公司 A kind of implementation method for safeguarding Batch orders technique automatically by shell scripts
CN109960590B (en) * 2019-03-26 2021-05-18 北京简约纳电子有限公司 Method for optimizing diagnostic printing of embedded system
CN110347594B (en) * 2019-06-28 2023-03-10 上海电气泰雷兹交通自动化***有限公司 Static variable synchronization and setting method in CBTC system safety function module test
CN113407454B (en) * 2021-06-29 2022-08-05 山东派盟网络科技有限公司 Method, device and equipment for comprehensive test
CN114629830B (en) * 2022-03-02 2023-08-11 深圳市吉祥腾达科技有限公司 Method and system for automatically controlling test center instrument test
CN117171044B (en) * 2023-08-16 2024-06-07 上海同星智能科技有限公司 Development and debugging system and method based on automatic read-write method of automobile calibration signals

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5600579A (en) * 1994-07-08 1997-02-04 Apple Computer, Inc. Hardware simulation and design verification system and method
CN1310446C (en) * 2002-08-20 2007-04-11 华为技术有限公司 Mirror image test method
KR20040087767A (en) * 2003-04-09 2004-10-15 바산네트워크(주) Development of Realtime, Embedded S/W Component Testing and Realtime Analysis Methods and Systems
CN100370432C (en) * 2004-08-18 2008-02-20 华为技术有限公司 Automated testing apparatus and method for embedded software
CN100389391C (en) * 2005-11-24 2008-05-21 北京中星微电子有限公司 System and method for calling host software functions by using script and its compiler
CN1949186A (en) * 2006-11-17 2007-04-18 深圳市领测科技有限公司 Program testing system and mapping method for said program testing system

Cited By (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008058473A1 (en) * 2006-11-17 2008-05-22 Shenzhen Lingce Technology Co., Ltd. Mapping method in the program testing system and program testing system
CN101114940B (en) * 2007-06-26 2011-12-07 中兴通讯股份有限公司 Method for implementing module logicalization
CN102696019A (en) * 2009-10-01 2012-09-26 克里特里翁公司 Maintaining a secure computing device in a test taking environment
US9280907B2 (en) 2009-10-01 2016-03-08 Kryterion, Inc. Proctored performance analysis
US9430951B2 (en) 2009-10-01 2016-08-30 Kryterion, Inc. Maintaining a secure computing device in a test taking environment
US9141513B2 (en) 2009-10-01 2015-09-22 Kryterion, Inc. Maintaining a secure computing device in a test taking environment
CN102135935A (en) * 2010-01-22 2011-07-27 华为技术有限公司 Software optimizing and debugging method and device
US10672286B2 (en) 2010-03-14 2020-06-02 Kryterion, Inc. Cloud based test environment
US9092991B2 (en) 2010-08-04 2015-07-28 Kryterion, Inc. Peered proctoring
US9984582B2 (en) 2010-08-04 2018-05-29 Kryterion, Inc. Peered proctoring
US9137163B2 (en) 2010-08-04 2015-09-15 Kryterion, Inc. Optimized data stream upload
US10225336B2 (en) 2010-08-04 2019-03-05 Kryterion, Inc. Optimized data stream upload
US9716748B2 (en) 2010-08-04 2017-07-25 Kryterion, Inc. Optimized data stream upload
US9378648B2 (en) 2010-08-04 2016-06-28 Kryterion, Inc. Peered proctoring
CN103176894A (en) * 2011-12-22 2013-06-26 ***股份有限公司 Test data automatic derivative method and automatic derivative device facing database
CN102629277A (en) * 2012-03-21 2012-08-08 北京英孚斯迈特信息技术有限公司 General structured query language (SQL) data processing method and system
CN103049377A (en) * 2012-12-14 2013-04-17 中国信息安全测评中心 Parallel symbolic execution method based on path cluster reductions
CN103049377B (en) * 2012-12-14 2016-01-13 中国信息安全测评中心 Based on the parallel symbol manner of execution of path cluster reduction
CN103559123B (en) * 2013-10-24 2016-02-10 烽火通信科技股份有限公司 Based on function call stack analytical approach and the device of vxworks operating system
CN103559123A (en) * 2013-10-24 2014-02-05 烽火通信科技股份有限公司 Function call stack analyzing method and device based on VxWorks operation system
CN104731695A (en) * 2013-12-19 2015-06-24 广州凯乐软件技术有限公司 Unit testing system and method supporting table-driven underlying input
CN104731695B (en) * 2013-12-19 2018-11-09 广州凯乐软件技术有限公司 A kind of unit test system and method for supporting the input of table driving bottom
US11003570B2 (en) 2014-04-30 2021-05-11 Micro Focus Llc Performing a mirror test for localization testing
WO2015165078A1 (en) * 2014-04-30 2015-11-05 Hewlett-Packard Development Company, L.P. Performing mirror test for localization testing
CN104881358A (en) * 2015-05-28 2015-09-02 南京南瑞继保电气有限公司 Program simulation testing method and system
CN104881358B (en) * 2015-05-28 2018-02-16 南京南瑞继保电气有限公司 A kind of procedure simulation method of testing and system
CN106126431A (en) * 2016-08-23 2016-11-16 腾讯科技(深圳)有限公司 Performance test methods and system
CN106610838B (en) * 2016-12-27 2020-04-24 北京酷我科技有限公司 Conversion method of multiple scripting languages
CN106610838A (en) * 2016-12-27 2017-05-03 北京酷我科技有限公司 Method for converting multiple script languages
WO2019090994A1 (en) * 2017-11-08 2019-05-16 平安科技(深圳)有限公司 Script testing automated execution method, apparatus, equipment and storage medium
CN109344083A (en) * 2018-11-05 2019-02-15 郑州云海信息技术有限公司 A kind of program debugging method, device, equipment and readable storage medium storing program for executing
CN109344083B (en) * 2018-11-05 2022-07-08 郑州云海信息技术有限公司 Program debugging method, device and equipment and readable storage medium
CN110853327A (en) * 2019-11-02 2020-02-28 杭州雅格纳科技有限公司 Ship cabin equipment data field debugging and collecting method and device based on single chip microcomputer
CN114124772A (en) * 2021-11-05 2022-03-01 中国航空工业集团公司雷华电子技术研究所 Network debugging method based on VxWorks operating system

Also Published As

Publication number Publication date
WO2008058473A1 (en) 2008-05-22
CN101401075A (en) 2009-04-01
CN101401075B (en) 2012-01-04

Similar Documents

Publication Publication Date Title
CN1949186A (en) Program testing system and mapping method for said program testing system
CN1146788C (en) Device and method used in instruction selection of multiplatform environment
US10402208B2 (en) Adaptive portable libraries
US10540148B2 (en) Complex constants
EP1174791B1 (en) Unified data type system and method
CN100541445C (en) A kind of program testing system and method
US6795962B1 (en) Machine independent debugger
US6526570B1 (en) File portability techniques
DK1174791T3 (en) Total data type system and method
US6874140B1 (en) Debug annotations
JP2005050312A (en) Software development infrastructure
JPH08202545A (en) Object-oriented system and method for generation of target language code
US20040003377A1 (en) Converting byte code instructions to a new instruction set
US10120655B2 (en) Seamless high performance interoperability between different type graphs that share a garbage collector
EP2659362A2 (en) Emulating pointers
US20180365033A1 (en) Compatible dictionary layout
Lu et al. Gradual soundness: Lessons from static python
CN112416313B (en) Compiling method supporting large integer data type and operator
US20170083298A1 (en) Resilient format for distribution of ahead-of-time compiled code components
JP2000347875A (en) File transplanting technique
Goretkin et al. Advancing The Robotics Software Development Experience: Bridging Julia's Performance and Python's Ecosystem
Milne et al. Interpreting computer code in a computer‐based learning system for novice programmers
Harvey et al. Actors: The Ideal Abstraction for Programming Kernel-Based Concurrency
KR20150063798A (en) Method for code conversion using target-independent debugging information, 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
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication