CN109002390A - A kind of test case dynamic state of parameters configuration method and device - Google Patents

A kind of test case dynamic state of parameters configuration method and device Download PDF

Info

Publication number
CN109002390A
CN109002390A CN201810660673.8A CN201810660673A CN109002390A CN 109002390 A CN109002390 A CN 109002390A CN 201810660673 A CN201810660673 A CN 201810660673A CN 109002390 A CN109002390 A CN 109002390A
Authority
CN
China
Prior art keywords
parameter
test case
target detection
test
detection example
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
CN201810660673.8A
Other languages
Chinese (zh)
Other versions
CN109002390B (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.)
RADIOSKY (BEIJING) TECHNOLOGY Co.,Ltd.
THE STATE RADIO MONITORING CENTER TESTING CENTER
Tian Wei Xunda (Shanghai) Communication Technology Co.,Ltd.
Original Assignee
Tianwei Signal (beijing) Technology 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 Tianwei Signal (beijing) Technology Co Ltd filed Critical Tianwei Signal (beijing) Technology Co Ltd
Priority to CN201810660673.8A priority Critical patent/CN109002390B/en
Publication of CN109002390A publication Critical patent/CN109002390A/en
Application granted granted Critical
Publication of CN109002390B publication Critical patent/CN109002390B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version

Abstract

The present invention provides a kind of test case dynamic state of parameters configuration method and device, this method includes obtaining test case parameter from multiple preparatory XML files for describing to have test case parameter;Test case parameter based on acquisition constructs parameter set, and the parameter set of building is stored into preset parameter collection list;The target detection example that user chooses is received, parameter set corresponding with target detection example is searched from preset parameter collection list;Corresponding parameter configuration interface is generated according to the dynamic state of parameters in the parameter set found, target detection example parameter is reconfigured by parameter configuration interface reception;The content in the corresponding XML file of target detection example is updated based on the parameter reconfigured.The test case dynamic state of parameters configuration process of the embodiment of the present invention is simple, convenient, and the configuration speed of test case parameter not only can be improved, also support the multiplexing to test case parameter, have high flexibility and scalability.

Description

A kind of test case dynamic state of parameters configuration method and device
Technical field
The present invention relates to software testing technology fields, more particularly to a kind of test case dynamic state of parameters configuration method and dress It sets.
Background technique
TTCN3 (Testing and Test Control Notation Version 3) is International standardization test language Speech has built-in matching decision mechanism exclusively for the language that Black-box Testing and authentication test design, and supported protocol consistency is surveyed Examination, concurrent test, timer delay testing etc. are a kind of measuring technologies suitable for various application fields, logical in 3G, LTE It is verified in the large-scale and complex industrial test such as communication network.
Test case is the basic unit of measuring instrumentss, and test case parameter is the important input configuration before test case starting, is The man-machine interface that measuring instrumentss developer opens to measuring instrumentss user, measuring instrumentss user can be matched by test case parameter Planning testing scheme is set, test case is controlled, reaches expected test purpose, can be opened after test parameter configure-ack It is dynamic to be tested and obtain test result.Realize that the comprehensive of test case parameter configuration, friendly, dynamic expansion are to measure one Measuring instrumentss device is convenient for exploitation and the important indicator used.
Legacy protocol measuring instrumentss based on TTCN3 language development are merely able to support the configuration of fixed test parameter, support Test parameter configuration it is often inflexible, scalability is poor.In addition, the scene of legacy protocol measuring instrumentss test actual requirement More, the parameter configuration of support is personalized strong, the range of number, parameter value including parameter, and the display mode of parameter is not active The configuration of state, for measuring instrumentss, development difficulty is big, and release maintenance is at high cost, and the development cycle is long.
The configuration method of existing test parameter there is a problem of more.For example, the parameter configuration needed in test case is all It need to be cured in the template of TTCN3 code, if test case needs to adjust parameter configuration therein, also need to original TTCN3 code is modified, and Suitable content is related to multiple modules, heavy workload, and scalability is low.In another example for same Test case code when different scenes needs different parameter configurations cannot be multiplexed, therefore also need to safeguard multiple software versions, Poor universality, maintenance cost are high.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind State the test case dynamic state of parameters configuration method and device of problem.
One side according to the present invention provides a kind of test case dynamic state of parameters configuration method, comprising:
Test case parameter is obtained from multiple preparatory XML files for describing to have test case parameter;
Test case parameter based on acquisition constructs parameter set, and the parameter set of building is stored to the preset parameter collection list In, wherein the corresponding test case parameter of a test case constructs a parameter set;
The target detection example that user chooses is received, it is right with the target detection example to search from the preset parameter collection list The parameter set answered;
Corresponding parameter configuration interface is generated according to the dynamic state of parameters in the parameter set found, passes through the parameter configuration Interface receives and reconfigures to the target detection example parameter;
The content in the corresponding XML file of the target detection example is updated based on the parameter reconfigured.
Optionally, each parameter set in the preset parameter collection list is identified with the unique identification of corresponding test case, described The target detection example that user chooses is received, parameter corresponding with the target detection example is searched from the preset parameter collection list Collection, comprising:
The target detection example that user chooses is received, the unique identification of the target detection example is obtained;
Parameter set corresponding with the unique identification of the target detection example is searched from preset parameter collection list.
Optionally, it before obtaining test case parameter in multiple preparatory XML files for describing to have test case parameter, also wraps It includes: the multiple preparatory XML files for describing to have test case parameter of load.
Optionally, multiple preparatory XML files for describing to have test case parameter are loaded, comprising:
The TestScript file under test program catalogue is searched, from the next stage catalogue of TestScript file Traverse different test scene files, wherein be previously stored with the XML file in the test scene file;
The corresponding XML file of different test cases is loaded from each test scene file.
Optionally, the parameter in the parameter set includes displaying sequence, the parameter in parameter set that the foundation is found The corresponding parameter configuration interface of dynamic generation, comprising:
According to displaying sequence, the corresponding ginseng of each test case parameter in the parameter set found is shown in displaying control Number configuration control, the corresponding parameter configuration interface of parameter configuration control dynamic generation based on displaying.
Optionally, the content in the corresponding XML file of the target detection example is updated based on the parameter reconfigured, wrapped It includes:
The corresponding parameter set of target detection example in the preset parameter collection list is carried out more using the parameter reconfigured Newly;
The content in corresponding XML file is updated according to the corresponding updated parameter set of target detection example.
Optionally, the method also includes: tool is executed by test case by reconfiguring the target detection example after parameter Ranging sequence is treated to be tested.
Optionally, tool is executed by reconfiguring the target detection example after parameter by test case treat ranging sequence surveyed Examination, comprising:
Corresponding pre-defined of tool matching is executed by test case by reconfiguring the target detection example after parameter Test case encoder;
The test case parameter in the corresponding updated XML file of the target detection example is read, successful match is utilized Test case encoder is encoded according to test case parameter of the preset protocol to reading and generates protocol data;
The protocol data is sent in program to be measured, the program to be measured is tested.
Optionally, corresponding pre- of tool matching is executed by test case by reconfiguring the target detection example after parameter The test case encoder first defined, comprising:
Passed through the test case and executed tool by reconfiguring the target detection example after parameter and calls corresponding test letter Number, wherein define test template in the formal parameter of the test function;
Test function based on calling obtains corresponding test template, and the type matching according to the test template is fixed in advance The test case encoder of justice.
Another aspect according to the present invention additionally provides a kind of test case dynamic state of parameters configuration device, comprising:
Module is obtained, suitable for obtaining test case parameter from multiple preparatory XML files for describing to have test case parameter;
Module is constructed, parameter set is constructed suitable for the test case parameter based on acquisition, the parameter set of building is stored to described In preset parameter collection list, wherein the corresponding test case parameter of a test case constructs a parameter set;
Receiving module, the target detection example chosen suitable for receiving user, lookup and institute from the preset parameter collection list State the corresponding parameter set of target detection example;
Generation module leads to suitable for generating corresponding parameter configuration interface according to the dynamic state of parameters in the parameter set found The parameter configuration interface reception is crossed to reconfigure the target detection example parameter;
Update module, suitable for being updated based on the parameter reconfigured in the corresponding XML file of the target detection example Hold.
In embodiments of the present invention, by obtaining test case from multiple preparatory XML files for describing to have test case parameter Parameter, and the test case parameter based on acquisition constructs parameter set, and the parameter set of building is stored into preset parameter collection list, With after the target detection example for receiving user's selection, it is right with target detection example to search directly from preset parameter collection list The parameter set answered.Then, corresponding ginseng is generated according to the dynamic state of parameters in the parameter set corresponding with target detection example found Number configuration interface.User can reconfigure target detection example parameter by parameter configuration interface, and then can be based on The parameter reconfigured updates the content in the corresponding XML file of target detection example.The embodiment of the present invention is by being based on as a result, XML file describes test case parameter, and generates corresponding parameter configuration interface according to test case parameter, so as to directly pass through Parameter configuration interface is adjusted test case parameter, to modified in XML file based on the test case parameter of adjustment Hold, such as increase, modification, deletion to parameter, it is not necessary to modify the codes in test program at all for the process, and parameter adjusted Journey is simple, convenient, not only improves regulating the speed for test case parameter, can also support the multiplexing to test case parameter, has pole High flexibility and scalability.
Further, this programme stores parameter set into preset parameter collection list, when it is subsequent using test case parameter or When person's parameter set, can directly it be obtained from the preset parameter collection list, without traversing the content in each XML file, So as to improve the acquisition efficiency of test case parameter.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
According to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will be brighter The above and other objects, advantages and features of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the flow diagram of test case dynamic state of parameters configuration method according to an embodiment of the invention;
Fig. 2 shows load XML file according to an embodiment of the invention and obtain the test case parameter in XML file Process schematic;
Fig. 3 shows the structural schematic diagram of test case dynamic state of parameters configuration device according to an embodiment of the invention;With And
Fig. 4 shows the structural schematic diagram of test case dynamic state of parameters configuration device in accordance with another embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
In order to solve the above technical problems, the embodiment of the invention provides a kind of test case dynamic state of parameters configuration method, the party Method can be applied to the Dynamic Configuration Process that the test case based on TTCN3 language carries out test case parameter.Fig. 1 is shown according to this The flow diagram of the test case dynamic state of parameters configuration method of invention one embodiment.Referring to Fig. 1, this method includes at least step S102 to step S110.
Step S102 obtains test case parameter from multiple preparatory XML files for describing to have test case parameter.
The step is based on XML file and describes test parameter, can be facilitated by the node in modification XML file subsequent Adjustment of the realization to test case parameter.
Step S104, the test case parameter based on acquisition construct parameter set, the parameter set of building are stored to preset parameter Collect in list, wherein the corresponding test case parameter of a test case constructs a parameter set.
Step S106 receives the target detection example that user chooses, searches and target detection example from preset parameter collection list Corresponding parameter set.
In this step, each parameter set in the list of preset parameter collection is identified with the unique identification of corresponding test case, from When searching parameter set corresponding with target detection example in preset parameter collection list, unique mark of target detection example can be first obtained Know, and then searches parameter set corresponding with the unique identification of target detection example from preset parameter collection list.
Step S108 generates corresponding parameter configuration interface according to the dynamic state of parameters in the parameter set found, passes through ginseng Number configuration interface reception reconfigures target detection example parameter.
It in this step, may include increase, deletion, modification etc. to parameter to reconfiguring for target detection example parameter Configuration operation.
Step S110 updates the content in the corresponding XML file of target detection example based on the parameter reconfigured.
In this step, when updating the content in the corresponding XML file of target detection example based on the parameter reconfigured, tool Body can be updated the corresponding parameter set of target detection example in preset parameter collection list first with the parameter reconfigured, into And the content in corresponding XML file is updated according to the corresponding updated parameter set of target detection example.
The embodiment of the present invention describes test case parameter by being based on XML file, and corresponding according to the generation of test case parameter Parameter configuration interface, so as to be directly adjusted by parameter configuration interface to test case parameter, thus based on adjustment Test case parameter modifies the content in XML file, such as increase, modification, deletion to parameter, the process at all it is not necessary to modify Code in test program, and parameter tuning process is simple, convenient not only improves regulating the speed for test case parameter, can be with It supports the multiplexing to test case parameter, there is high flexibility and scalability.Further, this programme by parameter set store to It, can be directly from the preset parameter collection list when subsequent use test case parameter or parameter set in preset parameter collection list Middle acquisition, without traversing the content in each XML file, so as to improve the acquisition efficiency of test case parameter.
Step S102 is seen above, in an embodiment of the present invention, from multiple preparatory XML texts for describing to have test case parameter When obtaining test case parameter in part, it is also necessary to first load it is multiple it is preparatory describe have the XML files of test case parameter, and then from load XML file in obtain test case parameter.Referring to fig. 2, preparatory descriptions multiple to load below have the XML files of test case parameter And the process of acquisition test case parameter is introduced.
Step S202, the TestScript file under test program catalogue is searched.Test program is i.e. current to execute program.
Step S204, different test scene files are traversed from the next stage catalogue of TestScript file, wherein The XML file that description in advance has test case parameter is housed in test scene file.
Step S206, the corresponding XML file of different test cases being successively read in test scene file.
Since this programme can read the XML configuration file in different test scenes, the survey based on this programme exploitation Test program in examination software can support the test of more scrnario testing modes.
Step S208, the format of the XML file read is verified, and judges whether to be proved to be successful, if so, holding Row step S210, if it is not, thening follow the steps S206.
In this step, the verification information content verified to the format of XML file is set in advance in XML file. Verification information may include the relevant verification information such as the type of test case parameter, range in XML file.
Step S210, test case parameter is obtained from the XML file read.
Step S212, judge whether to complete the reading to whole XML files under different test scene files, if so, Terminate, if it is not, thening follow the steps S206.
In conjunction with above step S104, the corresponding test case parameter of a test case is had been described above above and constructs a parameter Collection.In this embodiment, test case parameter is obtained from the XML file read, the test case parameter based on acquisition constructs ginseng Manifold, and the process that parameter set is stored to preset parameter collection list can be such that and circuit sequentially owning in traversal XML file Attribute in every a line node in XML file is stored in corresponding parameter set structural body, then by parameter set structure by node Body is inserted into parameter set list predetermined.
The XML file of the embodiment of the present invention can use the structure type of hierarchical tree, file beginning setting file explanation Sentence is used for supporting paper version number and coding mode.Followed by root node params parameter set, it is after root node Param parameter child node, param have 14 attributes, including id unique identification, order displaying sequence, name parameter name, Title parameter display title, value parameter value, selectValue selective value, defaultValue default value, unit unit, Whether type control type, enable can operate, and whether visible shows, min minimum value, max maximum value, hint prompt letter Breath.Wherein, in type control type include input input frame, select drop-down list box, table pop up three kinds of table, be used for Different types of exhibition method is provided.Test case configuration parameter is constructed using XML file, parameter and program can be effectively realized Separation, the content in XML file need to be only modified when modifying test case parameter, it is not necessary to modify program codes.
One embodiment of the invention provides the partial content of an XML file, as follows:
Step S106 is seen above, in an embodiment of the present invention, according to the dynamic state of parameters in the parameter set found It, can be according to the order displaying sequence in parameter set, in (such as Grid control of display control when generating corresponding parameter configuration interface Part) in show the corresponding parameter configuration control of each test case parameter, parameter configuration control be used for corresponding test case parameter into Row configuration, thus the corresponding parameter configuration interface of parameter configuration control dynamic generation based on displaying.Utilize the ginseng in parameter set Number dynamic generation parameter configuration interface is also the initialization procedure to display control, as according to test case parameter to control is shown The contents such as title, display order, type, default value are initialized.
In this embodiment, being also possible in the list of preset parameter collection can be comprising the parameter of some defaults, and user can not be to it It modifies.Therefore, it is also desirable to determine that the parameter of default includes by each parameter set in traversal preset parameter collection list Visible is display " true ", does not still show " false ".
If visible is " false ", directly skip, and searches the visible of next parameter set until preset parameter Collect the last one parameter set in list.If visible is " true ", it is dynamically inserted into a line in GRID (display control), Wherein, first it is classified as hiding id value, second is classified as title title, and third is classified as the codomain of parameter, and the 4th is classified as unit unit Value.Wherein, codomain control is initialized according to type value, tpye is the input frame that " input " control is default, and tpye is " select " control is dynamic creation drop-down list box, and tpye is " table " control to be inserted into button, for example, if tpye is " select " then can fill drop-down list option using the value of selectValue.
In turn, " value " can also be read with the codomain of pad parameter, read " enable ", if read " enable " is " false ", then the codomain after pad parameter will be set as modifying.
In an embodiment of the present invention, it is being updated in the corresponding XML file of target detection example based on the parameter reconfigured Content after, can use the target detection example after reconfiguring parameter by test case execute tool treat ranging sequence carry out Test.Specific test process is:
Firstly, executing corresponding preparatory of tool matching by test case by reconfiguring the target detection example after parameter Fixed test case encoder.
Then, the test case parameter in the corresponding updated XML file of target detection example is read, successful match is utilized Test case encoder is encoded according to test case parameter of the preset protocol to reading and generates protocol data.
Finally, protocol data is sent in program to be measured, treats ranging sequence and tested.
In this embodiment, using reconfigure the target detection example after parameter by test case execute tool matching and When its corresponding test case encoder predetermined, it can be held by reconfiguring the target detection example after parameter by test case Row tool calls corresponding test function, wherein defines test template in the formal parameter of test function.And then based on tune Test function obtains corresponding test template, the type matching test case encoder predetermined according to test template.
The process of program to be measured is tested to more clearly embody the present invention using the test case after reconfiguring parameter, It is specifically introduced below with an embodiment.For example, target detection example is the test case designed based on TTCN, also, mention herein And TTCN test case refer to reconfiguring the test case after parameter.
The first step, user, which click, to be started to execute test program, starts TTCN test case.
Second step, TTCN test case call corresponding test function (test function), join in the form of function It is defined in number template (test template), according to template type matching encoder predetermined.
Third step, the ID for obtaining test case, it is right therewith that the ID according to test case is found from different document scene folders The updated XML file answered.Wherein, not only description has test case parameter in XML file, but also including for recognizing which being The ID of the parameter of one test case is identified.
4th step, traversal XML file in each node parameter, parameter name name and parameter value value are put into In dictionary.
Content in 5th step, reading dictionary, encoder carry out the content of reading according to the requirement of preset protocol format It encodes and generates protocol data.
6th step, encoder send the protocol data after encoding into program to be measured, are tested with treating ranging sequence.
7th step, the feedback information for receiving program to be measured, call corresponding test function, according in function Template type matching decoder predetermined, to be decoded to feedback information.
For example, the feedback information returned includes test crash, the identification informations such as is successfully tested, needs to retest.
The parameter reconfigured can also be uniformly converted to dictionary key/value, such as name/ by the embodiment of the present invention The unification of interface may be implemented in the form of value, improves the expansion and flexibility of software.This programme does not have to modification software journey The quick exploitation of test case parameter configuration can be realized in sequence, in the profession using TTCN3 language development protocol measure metering device On the basis of property, the scalability and versatility of software in metering device are improved.In addition, different test scenes need to only configure difference XML file, only one version of software, unified software version substantially increase in measuring instrumentss device the research and development of software and Maintenance efficiency.
In addition, if the embodiment of the present invention is based on TTCN3 language development test case, can with supported protocol consistency, it is parallel, The test of time delay etc., while can also support graphical representation test process, the transmitting-receiving of each protocol interaction is believed in the process Breath can intuitively be shown compared with judgement.
Based on the same inventive concept, the embodiment of the invention also provides a kind of test case dynamic state of parameters configuration device, Fig. 3 shows The structural schematic diagram of test case dynamic state of parameters configuration device according to an embodiment of the invention is gone out.Referring to Fig. 3, test case ginseng Number dynamic configuration devices 400 include at least obtain module 410, building module 420, receiving module 430, generation module 440 and Update module 450.
Now introduce the function of each composition or device based on test case dynamic state of parameters configuration device 400 of the embodiment of the present invention And the connection relationship between each section:
Module 410 is obtained, suitable for obtaining test case parameter from multiple preparatory XML files for describing to have test case parameter;
Module 420 is constructed, is coupled with module 410 is obtained, parameter set is constructed suitable for the test case parameter based on acquisition, by structure The parameter set built is stored into preset parameter collection list, wherein the corresponding test case parameter of a test case constructs a parameter Collection;
Receiving module 430, couples with building module 420, the target detection example chosen suitable for receiving user, from preset parameter Collect and searches parameter set corresponding with target detection example in list;
Generation module 440 is coupled with receiving module 430, suitable for generating according to the dynamic state of parameters in the parameter set found Corresponding parameter configuration interface reconfigures target detection example parameter by parameter configuration interface reception;
Update module 450 is coupled with generation module 440, right suitable for updating target detection example based on the parameter reconfigured The content in XML file answered.
In an embodiment of the present invention, if each parameter set in preset parameter collection list is identified with the unique of corresponding test case Mark receives the target detection example that user chooses, and receiving module 430 is further adapted for, and receives the target detection example that user chooses, and obtains The unique identification of target detection example searches parameter corresponding with the unique identification of target detection example from preset parameter collection list Collection.
In an embodiment of the present invention, if the parameter in parameter set includes displaying sequence, generation module 440 is further adapted for foundation The displaying sequence of parameter identification, shows the corresponding parameter configuration control of each test case parameter, base in displaying control in parameter set In the corresponding parameter configuration interface of parameter configuration control dynamic generation of displaying.
In an embodiment of the present invention, update module 450 is further adapted for, and is arranged using the parameter reconfigured preset parameter collection The corresponding parameter set of target detection example is updated in table, is updated according to the corresponding updated parameter set of target detection example corresponding XML file in content.
In an embodiment of the present invention, referring to fig. 4, test case dynamic state of parameters configuration device 400 is in addition to including above-mentioned module Except, it can also include loading module 460 and test module 470.
Loading module 460 is coupled with module 410 is obtained, suitable for having test case from multiple preparatory descriptions in acquisition module 410 Before obtaining test case parameter in the XML file of parameter, multiple preparatory XML files for describing to have test case parameter are loaded.
Test module 470 is coupled with update module 450, suitable for passing through survey by reconfiguring the target detection example after parameter Examination example execution tool is treated ranging sequence and is tested.
In an embodiment of the present invention, loading module 460 is further adapted for, and searches the TestScript text under test program catalogue Part folder, traverses different test scene files, wherein test scene file from the next stage catalogue of TestScript file It is previously stored with XML file in folder, the corresponding XML file of different test cases is loaded from each test scene file.
In an embodiment of the present invention, test module 470 is further adapted for, and is passed through by reconfiguring the target detection example after parameter Test case executes the corresponding test case encoder predetermined of tool matching, after reading the corresponding update of target detection example XML file in test case parameter, using the test case encoder of successful match according to preset protocol to the test case of reading Parameter is encoded and is generated protocol data, and protocol data is sent in program to be measured, is treated ranging sequence and is tested.
In an embodiment of the present invention, test module 470 is further adapted for, and is passed through by reconfiguring the target detection example after parameter Test case executes tool and calls corresponding test function, wherein test template, base are defined in the formal parameter of test function Corresponding test template is obtained in the test function of calling, the test case coding predetermined of the type matching according to test template Device.
According to the combination of any one above-mentioned preferred embodiment or multiple preferred embodiments, the embodiment of the present invention can reach It is following the utility model has the advantages that
In embodiments of the present invention, by obtaining test case from multiple preparatory XML files for describing to have test case parameter Parameter, and the test case parameter based on acquisition constructs parameter set, and the parameter set of building is stored into preset parameter collection list, With after the target detection example for receiving user's selection, it is right with target detection example to search directly from preset parameter collection list The parameter set answered.Then, corresponding ginseng is generated according to the dynamic state of parameters in the parameter set corresponding with target detection example found Number configuration interface.User can reconfigure target detection example parameter by parameter configuration interface, and then can be based on The parameter reconfigured updates the content in the corresponding XML file of target detection example.The embodiment of the present invention is by being based on as a result, XML file describes test case parameter, and generates corresponding parameter configuration interface according to test case parameter, so as to directly pass through Parameter configuration interface is adjusted test case parameter, to modified in XML file based on the test case parameter of adjustment Hold, such as increase, modification, deletion to parameter, it is not necessary to modify the codes in test program at all for the process, and parameter adjusted Journey is simple, convenient, not only improves regulating the speed for test case parameter, can also support the multiplexing to test case parameter, has pole High flexibility and scalability.Further, this programme stores parameter set into preset parameter collection list, uses survey when subsequent It when trying example parameter or parameter set, can directly be obtained from the preset parameter collection list, without traversing each XML file In content, so as to improve the acquisition efficiency of test case parameter.
It is apparent to those skilled in the art that the specific work of the system of foregoing description, device and unit Make process, can refer to corresponding processes in the foregoing method embodiment, for brevity, does not repeat separately herein.
In addition, each functional unit in each embodiment of the present invention can be physically independent, can also two or More than two functional units integrate, and can be all integrated in a processing unit with all functional units.It is above-mentioned integrated Functional unit both can take the form of hardware realization, can also be realized in the form of software or firmware.
Those of ordinary skill in the art will appreciate that: if the integrated functional unit is realized and is made in the form of software It is independent product when selling or using, can store in a computer readable storage medium.Based on this understanding, Technical solution of the present invention is substantially or all or part of the technical solution can be embodied in the form of software products, The computer software product is stored in a storage medium comprising some instructions, with so that calculating equipment (such as Personal computer, server or network equipment etc.) various embodiments of the present invention the method is executed when running described instruction All or part of the steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM), random access memory Device (RAM), the various media that can store program code such as magnetic or disk.
Alternatively, realizing that all or part of the steps of preceding method embodiment can be (all by the relevant hardware of program instruction Such as personal computer, the calculating equipment of server or network equipment etc.) it completes, described program instruction can store in one In computer-readable storage medium, when described program instruction is executed by the processor of calculating equipment, the calculating equipment is held The all or part of the steps of row various embodiments of the present invention the method.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Present invention has been described in detail with reference to the aforementioned embodiments for pipe, those skilled in the art should understand that: at this Within the spirit and principle of invention, it is still possible to modify the technical solutions described in the foregoing embodiments or right Some or all of the technical features are equivalently replaced;And these are modified or replaceed, and do not make corresponding technical solution de- From protection scope of the present invention.

Claims (10)

1. a kind of test case dynamic state of parameters configuration method, comprising:
Test case parameter is obtained from multiple preparatory XML files for describing to have test case parameter;
Test case parameter based on acquisition constructs parameter set, and the parameter set of building is stored into the preset parameter collection list, Wherein, the corresponding test case parameter of a test case constructs a parameter set;
The target detection example that user chooses is received, is searched from the preset parameter collection list corresponding with the target detection example Parameter set;
Corresponding parameter configuration interface is generated according to the dynamic state of parameters in the parameter set found, passes through the parameter configuration interface Reception reconfigures the target detection example parameter;
The content in the corresponding XML file of the target detection example is updated based on the parameter reconfigured.
2. according to the method described in claim 1, wherein, each parameter set in the preset parameter collection list is identified with corresponding survey Try example unique identification, it is described receive user choose target detection example, from the preset parameter collection list search with it is described The corresponding parameter set of target detection example, comprising:
The target detection example that user chooses is received, the unique identification of the target detection example is obtained;
Parameter set corresponding with the unique identification of the target detection example is searched from preset parameter collection list.
3. method according to claim 1 or 2, wherein obtained from multiple preparatory XML files for describing to have test case parameter Before taking test case parameter, further includes: the multiple preparatory XML files for describing to have test case parameter of load.
4. according to the method described in claim 3, wherein, loading multiple preparatory XML files for describing to have test case parameter, packet It includes:
Search the TestScript file under test program catalogue;
Different test scene files are traversed from the next stage catalogue of TestScript file, wherein the test scene The XML file is previously stored in file;
The corresponding XML file of different test cases is loaded from each test scene file.
5. method according to claim 1 or 2, wherein the parameter in the parameter set includes displaying sequence, the foundation Dynamic state of parameters in the parameter set found generates corresponding parameter configuration interface, comprising:
According to displaying sequence, show that the corresponding parameter of each test case parameter is matched in the parameter set found in displaying control Set control;
The corresponding parameter configuration interface of parameter configuration control dynamic generation based on displaying.
6. method according to claim 1 or 2, wherein it is right to update the target detection example based on the parameter reconfigured The content in XML file answered, comprising:
The corresponding parameter set of target detection example in the preset parameter collection list is updated using the parameter reconfigured;
The content in corresponding XML file is updated according to the corresponding updated parameter set of target detection example.
7. method according to claim 1 or 2, wherein further include:
It tool is executed by reconfiguring the target detection example after parameter by test case treats ranging sequence and tested.
8. method according to claim 1 or 2, wherein pass through test case by reconfiguring the target detection example after parameter Execution tool is treated ranging sequence and is tested, comprising:
The corresponding survey predetermined of tool matching is executed by test case by reconfiguring the target detection example after parameter Try example encoder;
The test case parameter in the corresponding updated XML file of the target detection example is read, the test of successful match is utilized Example encoder is encoded according to test case parameter of the preset protocol to reading and generates protocol data;
The protocol data is sent in program to be measured, the program to be measured is tested.
9. according to the method described in claim 8, wherein, passes through test case by reconfiguring the target detection example after parameter and execute The corresponding test case encoder predetermined of tool matching, comprising:
Tool is executed by the test case by reconfiguring the target detection example after parameter and calls corresponding test function, In, test template is defined in the formal parameter of the test function;
Test function based on calling obtains corresponding test template, and the type matching according to the test template is predetermined Test case encoder.
10. a kind of test case dynamic state of parameters configuration device, comprising:
Module is obtained, suitable for obtaining test case parameter from multiple preparatory XML files for describing to have test case parameter;
Module is constructed, parameter set is constructed suitable for the test case parameter based on acquisition, the parameter set of building is stored to described preset In parameter set list, wherein the corresponding test case parameter of a test case constructs a parameter set;
Receiving module, the target detection example chosen suitable for receiving user, is searched and the mesh from the preset parameter collection list Mark the corresponding parameter set of test case;
Generation module passes through institute suitable for generating corresponding parameter configuration interface according to the dynamic state of parameters in the parameter set found Parameter configuration interface reception is stated to reconfigure the target detection example parameter;
Update module, suitable for updating the content in the corresponding XML file of the target detection example based on the parameter reconfigured.
CN201810660673.8A 2018-06-25 2018-06-25 Test case parameter dynamic configuration method and device Active CN109002390B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810660673.8A CN109002390B (en) 2018-06-25 2018-06-25 Test case parameter dynamic configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810660673.8A CN109002390B (en) 2018-06-25 2018-06-25 Test case parameter dynamic configuration method and device

Publications (2)

Publication Number Publication Date
CN109002390A true CN109002390A (en) 2018-12-14
CN109002390B CN109002390B (en) 2021-07-27

Family

ID=64600730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810660673.8A Active CN109002390B (en) 2018-06-25 2018-06-25 Test case parameter dynamic configuration method and device

Country Status (1)

Country Link
CN (1) CN109002390B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359057A (en) * 2018-12-25 2019-02-19 上海创功通讯技术有限公司 A kind of application testing method and equipment
CN110618927A (en) * 2019-06-20 2019-12-27 北京无限光场科技有限公司 Method and apparatus for testing applications
CN110781088A (en) * 2019-10-30 2020-02-11 口碑(上海)信息技术有限公司 Software system testing method and device
CN111209195A (en) * 2019-12-30 2020-05-29 瑞庭网络技术(上海)有限公司 Method and device for generating test case

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102665231A (en) * 2012-05-23 2012-09-12 北京中创信测科技股份有限公司 Method of automatically generating parameter configuration file for LTE (Long Term Evolution) system
CN102760062A (en) * 2012-06-19 2012-10-31 株洲南车时代电气股份有限公司 Parameter setting method for embedded software based on rail transit
CN103186460A (en) * 2011-12-30 2013-07-03 金蝶软件(中国)有限公司 Method, device and system for generating script of test case
US20140359360A1 (en) * 2013-06-03 2014-12-04 MiCOM Labs, Inc. Method and apparatus for a remote modular test system
CN107844349A (en) * 2017-10-19 2018-03-27 上海斐讯数据通信技术有限公司 A kind of control method and device based on user interface

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186460A (en) * 2011-12-30 2013-07-03 金蝶软件(中国)有限公司 Method, device and system for generating script of test case
CN102665231A (en) * 2012-05-23 2012-09-12 北京中创信测科技股份有限公司 Method of automatically generating parameter configuration file for LTE (Long Term Evolution) system
CN102760062A (en) * 2012-06-19 2012-10-31 株洲南车时代电气股份有限公司 Parameter setting method for embedded software based on rail transit
US20140359360A1 (en) * 2013-06-03 2014-12-04 MiCOM Labs, Inc. Method and apparatus for a remote modular test system
CN107844349A (en) * 2017-10-19 2018-03-27 上海斐讯数据通信技术有限公司 A kind of control method and device based on user interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张德民等: ""基于TTCN-3重建测试架构的设计与实现"", 《自动化仪表》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359057A (en) * 2018-12-25 2019-02-19 上海创功通讯技术有限公司 A kind of application testing method and equipment
CN110618927A (en) * 2019-06-20 2019-12-27 北京无限光场科技有限公司 Method and apparatus for testing applications
CN110781088A (en) * 2019-10-30 2020-02-11 口碑(上海)信息技术有限公司 Software system testing method and device
CN111209195A (en) * 2019-12-30 2020-05-29 瑞庭网络技术(上海)有限公司 Method and device for generating test case
CN111209195B (en) * 2019-12-30 2023-08-15 瑞庭网络技术(上海)有限公司 Method and device for generating test case

Also Published As

Publication number Publication date
CN109002390B (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN109002390A (en) A kind of test case dynamic state of parameters configuration method and device
CN106919509B (en) Client generation method and device and electronic equipment
CN106990952B (en) Form verification method and system based on Vue
CN106021102B (en) The generation method and device of automatic test file
CN104636139A (en) Visualized cross-platform mobile application development and generation system
CN105204871B (en) A kind of plug-in type development approach and device
US20060282453A1 (en) Methods and systems for transforming an and/or command tree into a command data model
WO2017133447A1 (en) Intelligent device control method and apparatus, and computer storage medium
CN104484216A (en) Method and device for generating service interface document and on-line test tool
US20070006196A1 (en) Methods and systems for extracting information from computer code
CN110673847A (en) Configuration page generation method and device, electronic equipment and readable storage medium
CN107220096A (en) A kind of json data analysis methods and device
CN107122295B (en) Test case script generation method and device
CN106155769B (en) A kind of workflow processing method, device and workflow engine
CN104615463B (en) A kind of system property setting method and terminal
CN112256321A (en) Static library packaging method and device, computer equipment and storage medium
CN109558525A (en) A kind of generation method of test data set, device, equipment and storage medium
CN104572644A (en) Database updating device and database updating method
CN106227821B (en) A kind for the treatment of method and apparatus of order line command
CN110377275A (en) Automatically create the method and storage medium of application program
US11204860B2 (en) Methods and apparatuses for generating smart contract test case
KR20150092880A (en) Method and Apparatus for Re-Configuring Design Decisions after Developing Graphic User Interface
CN111026670A (en) Test case generation method, test case generation device, and storage medium
CN109902251A (en) Scheme Choice method, apparatus, terminal and readable storage medium storing program for executing based on decision tree
CN106371994B (en) Dynamic mobile APP test methods based on natural language processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190524

Address after: 100041 China Radio Detection Building, 30 Shixing Street, Shijingshan District, Beijing

Applicant after: Tianwei Xunda (Beijing) Technology Co., Ltd.

Applicant after: Tian Wei Xunda (Shanghai) Communication Technology Co., Ltd.

Address before: 100041 China Radio Detection Building, 30 Shixing Street, Shijingshan District, Beijing

Applicant before: Tianwei signal (Beijing) Technology Co., Ltd.

CI02 Correction of invention patent application

Correction item: Applicant|Address|Applicant

Correct: Tianwei Schindler (Beijing) Technology Co., Ltd.|100041 China Radio Detection Building, 30 Shixing Street, Shijingshan District, Beijing|Tian Wei Xunda (Shanghai) Communication Technology Co., Ltd.

False: Tianwei Xunda (Beijing) Technology Co., Ltd.|100041 China Radio Detection Building, 30 Shixing Street, Shijingshan District, Beijing|Tian Wei Xunda (Shanghai) Communication Technology Co., Ltd.

Number: 24-02

Volume: 35

CI02 Correction of invention patent application
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Tao Hongbo

Inventor after: Wen He

Inventor after: Cao Jingnan

Inventor before: Wen He

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210209

Address after: 100041 China Radio Detection Building, 30 Shixing Street, Shijingshan District, Beijing

Applicant after: RADIOSKY (BEIJING) TECHNOLOGY Co.,Ltd.

Applicant after: Tian Wei Xunda (Shanghai) Communication Technology Co.,Ltd.

Applicant after: THE STATE RADIO MONITORING CENTER TESTING CENTER

Address before: 100041 China Radio Detection Building, 30 Shixing Street, Shijingshan District, Beijing

Applicant before: RADIOSKY (BEIJING) TECHNOLOGY Co.,Ltd.

Applicant before: Tian Wei Xunda (Shanghai) Communication Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant