CN109656813A - A kind of test case operation method and device - Google Patents

A kind of test case operation method and device Download PDF

Info

Publication number
CN109656813A
CN109656813A CN201811390827.2A CN201811390827A CN109656813A CN 109656813 A CN109656813 A CN 109656813A CN 201811390827 A CN201811390827 A CN 201811390827A CN 109656813 A CN109656813 A CN 109656813A
Authority
CN
China
Prior art keywords
configuration file
test case
sentence
output data
test
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
CN201811390827.2A
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.)
Constant Technology (shanghai) Ltd By Share Ltd
Original Assignee
Constant Technology (shanghai) Ltd By Share 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 Constant Technology (shanghai) Ltd By Share Ltd filed Critical Constant Technology (shanghai) Ltd By Share Ltd
Priority to CN201811390827.2A priority Critical patent/CN109656813A/en
Publication of CN109656813A publication Critical patent/CN109656813A/en
Pending legal-status Critical Current

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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3692Test management for test results analysis

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)
  • Debugging And Monitoring (AREA)

Abstract

The present invention provides a kind of test case operation method and device, after obtaining the second test case, the configuration file based on the second Test cases technology can be obtained, configuration file is parsed, obtain the sentence in configuration file, execute the sentence in configuration file, obtain the test result of the corresponding test case that can be run by machine of configuration file, it thus can be realized by way of executing the sentence in configuration file to can be executed and test result automatically obtains by the automatic of the test case that machine is run, eliminate the step of triggering test case executes manually.And the sentence in configuration file is at least: configuration parameter, input order, control instruction and output data it is expected logic judgment, this means that configuration file can embody whole logics of test case, therefore it only needs to modify configuration file when needing to modify test case, to reduce the maintenance cost of test case.

Description

A kind of test case operation method and device
Technical field
The invention belongs to the field of test technology, more specifically more particularly to a kind of test case operation method and device.
Background technique
Test case is one group of test input, execution condition and the expected knot worked out to test some special objective Fruit, so as to test some Program path whether the special objective, therefore test case be system testing core where.It is logical at present It is often used natural language, structuring table and writes the mode of shell script and describe test case, these three modes write program The mode of script is optimal, but also needs to modify shell script when modifying test case every time, increases the maintenance of test case Cost.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of test case operation method and devices, for reducing test The maintenance cost of use-case.Technical solution is as follows:
The present invention provides a kind of test case operation method, which comprises
Obtain the first test case that user is write using natural language;
Obtain the second test case that will be obtained after first test case formalization;
Obtain the configuration file based on second Test cases technology;
The configuration file is parsed, the sentence in the configuration file, the sentence in the configuration file are obtained At least: configuration parameter, input order, control instruction and output data it is expected logic judgment;
The sentence in the configuration file is executed, the corresponding test that can be run by machine of the configuration file is obtained and uses The test result of example.
Preferably, the method also includes:
User is obtained to macro modification to be modified in the configuration file, obtains modified configuration file;
Described to parse to the configuration file, obtaining the sentence in the configuration file includes: to match to modified It sets file to be parsed, obtains the sentence in the modified configuration file.
Preferably, described to parse to the configuration file, the sentence obtained in the configuration file includes:
Construct the abstract syntax tree of the configuration file;
Each node in the abstract syntax tree is traversed, and the content of each node is carried out in ergodic process Pattern match, with sentence representated by the content of determination each node.
Preferably, before the abstract syntax tree for constructing the configuration file, further includes: to each in the configuration file Data carries out syntax check and exports prompt information if the grammer of any data is wrong in pieces of data;
If any data is syntactically correct in pieces of data, the abstract syntax for executing and constructing the configuration file is triggered The step of tree.
Preferably, the sentence executed in the configuration file, obtaining that the configuration file is corresponding can be by machine The test result of the test case of operation includes:
The configuration parameter is input in the input order, and the input order is controlled based on the control instruction Execution;
The output data obtained after the input order executes is obtained, and decision logic pair it is expected based on the output data The output data is judged, the judging result of the output data is obtained, and the judging result of the output data is used for table The test result of the corresponding test case that can be run by machine of the bright configuration file.
The present invention also provides a kind of test case running gear, described device includes:
Use-case obtaining unit, the first test case write for obtaining user using natural language, and obtain institute State the second test case obtained after the formalization of the first test case;
File obtaining unit, for obtaining the configuration file based on second Test cases technology;
Resolution unit obtains the sentence in the configuration file, the configuration for parsing to the configuration file Sentence in file is at least: configuration parameter, input order, control instruction and output data it is expected logic judgment;
Execution unit, for executing the sentence in the configuration file, obtaining that the configuration file is corresponding can be by machine The test result of the test case of device operation.
Preferably, the file obtaining unit is obtained for obtaining user to macro modification to be modified in the configuration file To modified configuration file;
The resolution unit obtains the modified configuration file for parsing to modified configuration file In sentence.
Preferably, the resolution unit, for constructing the abstract syntax tree of the configuration file, and to the abstract syntax Each node is traversed in tree, and carries out pattern match to the content of each node in ergodic process, described each with determination Sentence representated by the content of a node;
And/or
The execution unit for the configuration parameter to be input in the input order, and is referred to based on the control The execution for enabling the control input order obtains the output data obtained after the input order executes, and is based on the output Data expectation decision logic judges the output data, obtains the judging result of the output data, the output number According to judging result be used for show the configuration file it is corresponding can by machine run test case test result.
The present invention also provides a kind of processor, the processor executes above-mentioned for running program, described program when running Test case operation method.
The present invention also provides a kind of storage medium, computer program code, the calculating are stored on the storage medium Machine program code realizes above-mentioned test case operation method when running.
From above-mentioned technical proposal it is found that after obtaining the second test case, it can obtain based on the second Test cases technology Configuration file, configuration file is parsed, obtains the sentence in configuration file, the sentence in configuration file is executed, obtains The test result of the corresponding test case that can be run by machine of configuration file, thus can be by executing in configuration file The mode of sentence is realized to that can be executed and test result automatically obtains by the automatic of the test case that machine is run, and be saved The step of manual triggering test case executes.And the sentence in configuration file is at least: configuration parameter, input order, control System instruction and output data it is expected logic judgment, this means that configuration file can embody whole logics of test case, because This only needs to modify configuration file when needing to modify test case, to reduce the maintenance cost of test case.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is a kind of flow chart of test case operation method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of configuration file provided in an embodiment of the present invention;
Fig. 3 and Fig. 4 is the abstract syntax tree of configuration file shown in Fig. 2;
Fig. 5 is the flow chart of another test case operation method provided in an embodiment of the present invention;
Fig. 6 is the schematic diagram of macro modification to be modified provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram of test case running gear provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Referring to Fig. 1, being used for it illustrates a kind of flow chart of test case operation method provided in an embodiment of the present invention The maintenance cost for reducing test case, may comprise steps of:
101: obtaining the first test case that user is write using natural language.It is to be understood that so-called natural language It is a kind of language to develop naturally with culture, such as common Chinese, English are a kind of natural languages, which is A kind of tester (user) common language when writing test case, can by the first test case that natural language is write The test purpose of first test case is understood convenient for different testers, as shown in table 1, is shown a kind of using natural language The first test case write, first test case are used for the MAC learning of test network agreement.
The first test case that table 1 is write using natural language
But the first test case is logically easy to produce ambiguity, therefore is used using the first test that natural language is write Example has ambiguity and ambiguousness, and is difficult to support the automation of test case, is needed thus to using natural language to write The first test case converted, with eliminate the first test case in terms of ambiguity and ambiguousness the problem of.
102: obtaining the second test case that will be obtained after the formalization of the first test case.Wherein formalization is in logistics A term, so-called formalization refers in a manner of strict logical and describes test case, such as in the present embodiment, by first Test case is described in the form of pseudocode, obtains the second test case described in the form of pseudocode, uses nature language to eliminate Say the ambiguousness of the first test case of description.
Such as it is as follows to the pseudocode form of the first test case shown in above-mentioned table 1:
103: obtaining the configuration file based on the second Test cases technology.Except configuration ginseng is written in needs in the configuration file Except number, it is also necessary to which write-in input order, control instruction and output data it is expected logic judgment, wherein input order is that test is used Each item order for the test equipment that example is directed to, control instruction are then the execution logic and input order for controlling input order Correction judgement is executed, output data expectation logic judgment is then whether the output data obtained after executing to input order meets Expected judgement can also specify the corresponding data structure of output data, so that configuration file is not merely remembered in practical applications Configuration file is recorded, whole logics of test case are also embodied.
In the present embodiment, configuration file can be, but not limited to JOSN format, such as above-mentioned second test case, The configuration file of corresponding JOSN format is as shown in Fig. 2, the configuration file of JSON format shown in Fig. 2 is continuous with key-value Nested mode describes the test case that can be run by machine, wherein every input order step is the set of a plurality of order, Every input order step, which is defined, to be returned to prompt prompt, executes time timeout, return value (i.e. output data) matching Match etc., wherein match supports regular expression, according to default parameters if input order does not define these parameters It is arranged, default parameters is artificially arranged in the shared level where input order on level, further for for complexity Loop control order can also be added in circulate operation in step.
The part control in configuration file is the control instruction for controlling the execution logic between step, and the part parse is The parsing of order return value, after order return value parsing refers to the output data domain match matching for executing each step, Matched output data is stored in some data structure, is such as stored in data structure map.The part expect is expectation logic Conditional expression, to judge whether a test case is successfully tested by the part expect, if the part expect is a phase The ordered set of the logical expression of prestige value, by the logical table for the output data domain part except for obtaining the part parse The part parse and the expect to determine whether test case is successfully tested, therefore in above-mentioned configuration file are compared up to formula Part is that the output data in configuration file it is expected logic judgment.
The part except as shown in Figure 2 passes through logical expression and provides two Rule of judgment, and one is to instrument side of giving out a contract for a project The limitation of the sum of mouthful 2 (ixia_port2) and port 3 (ixia_port3) Counter Value, another is to instrument port of giving out a contract for a project The limitation of 1 (ixia_port1) and the Counter Value to instrument port 3 (ixia_port3) of giving out a contract for a project, and these Counter Values are then The output data that the part parse obtains illustrates test case if the output data that the part parse obtains meets Rule of judgment It is successfully tested, otherwise test crash.
104: configuration file being parsed, the sentence in configuration file is obtained.In the present embodiment, configuration file is obtained In sentence a kind of mode may is that building configuration file abstract syntax tree, to node each in abstract syntax tree carry out Traversal, and pattern match is carried out to the content of each node in ergodic process, representated by the content of each node of determination Sentence.
The process for wherein constructing the abstract syntax tree of configuration file can be found in the building process of existing abstract syntax tree, to this The present embodiment is not illustrating that as shown in Figure 3 and Figure 4, it illustrates the part abstract syntax trees of configuration file shown in above-mentioned Fig. 2.
Each node in abstract syntax tree can be traversed based on ergodic algorithm after obtaining abstract syntax tree, such as It is traversed based on ergodic algorithm from left to right, it can be by regular expression mode in each node in ergodic process Hold and carry out pattern match, with sentence representated by the content of each node of determination, such as above-mentioned configuration parameter, input order, control Instruction and output data expectation logic judgment etc., the process the present embodiment for carrying out pattern match for regular expression is not being explained It states.
Herein it should be noted is that: building configuration file abstract syntax tree before, need to configuration file In pieces of data (field in such as configuration file or one section of code being made of field) carry out syntax check, if pieces of data In any data grammer it is wrong, then export prompt information;If any data is syntactically correct in pieces of data, trigger The abstract syntax tree of building configuration file is executed, is surveyed caused by being reduced when executing the sentence of configuration file in this way because of syntax error Examination failure.
105: executing the sentence in configuration file, obtain the corresponding test case that can be run by machine of configuration file Test result.Such as configuration parameter is input in input order, and controls the execution of input order based on control instruction, is obtained defeated Enter the output data obtained after order executes, and output data is judged based on output data expectation decision logic, obtains The judging result of output data, wherein the judging result of output data can be run for showing that configuration file is corresponding by machine Test case test result.
Still shown in above-mentioned Fig. 2 for configuration file, for include in configuration file cmd sentence in, cmds_cli pairs The input order of the corresponding Devices to test of test case is answered, and cmds_ixia corresponds to the defeated of the corresponding instrument of giving out a contract for a project of test case Enter order, when executing input order by configuration parameter, as in Fig. 41,10, CLI, success be input in input order, Then every executed judges next step step according to control instruction after control field after a step;It is every to have executed one The data of the step are output in the data structure that the part paesr provides by step, are such as output in data structure map and are stored. Such as sentence " get ixia_port1_num rx as ixia_port1_num ", it is meant that obtaining ixia gives out a contract for a project instrument side The counter of mouth 1 is simultaneously stored in variable i xia_port1_num, sentence " get ixia_port3_num rx as ixia_ Port3_num_1 ", be meant that obtain ixia give out a contract for a project instrument port 3 Counter Value and be stored in variable i xia_port3_ Num_1, then data structure map is { ' ' ' 1000 ' ixia_port1_num, ' ' ' 0 ' ixia_port3_num_1 }.
Based on the expect logical expression that provides of part to being stored in data structure map after the completion of all step are executed Data judged, if the judging result that each logical expression obtains be it is true, show to be successfully tested, if each logical table It is vacation up to the judging result for having a logical expression to obtain in formula, then shows test crash.
In the present embodiment, step 104 and step 105 can realize that the interpreter is based on by means of an interpreter Clojure language, so that interpreter is based on advantage macro in Clojure language, so that executing 104 He of above-mentioned steps in interpreter Dynamic modification can be carried out to the description in configuration file during 105.
From above-mentioned technical proposal it is found that after obtaining the second test case, it can obtain based on the second Test cases technology Configuration file, configuration file is parsed, obtains the sentence in configuration file, the sentence in configuration file is executed, obtains The test result of the corresponding test case that can be run by machine of configuration file, thus can be by executing in configuration file The mode of sentence is realized to that can be executed and test result automatically obtains by the automatic of the test case that machine is run, and be saved The step of manual triggering test case executes.And the sentence in configuration file is at least: configuration parameter, input order, control System instruction and output data it is expected logic judgment, this means that configuration file can embody whole logics of test case, because This only needs to modify configuration file when needing to modify test case, to reduce the maintenance cost of test case.
Referring to Fig. 5, it illustrates the flow chart of another test case operation method provided in an embodiment of the present invention, it can With the following steps are included:
501: obtaining the first test case that user is write using natural language.
502: obtaining the second test case that will be obtained after the formalization of the first test case.
503: obtaining the configuration file based on the second Test cases technology.
In the present embodiment, step 501 is to 503: it is identical as above-mentioned steps 101 to 103, this present embodiment is not being explained It states.
504: obtaining user to macro modification to be modified in configuration file, obtain modified configuration file.Why need Modifying is the cognition in order to enable configuration file more meets tester, carries out code development convenient for tester and is surveyed with realizing The automation of example on probation, it is to be modified in the present embodiment macro to be specified by tester and modified.That is configuration file In which sentence (can be considered as to be modified macro) need to modify and modified content that is is specified by tester.
Such as the grammer of if sentence is (if logical-expression expression), but sometimes for making Syntactic representation is more intuitive, and if sentence is replaced with when sentence i.e. (when logical-expression Expression), just need to be redefined a macro when at this time with this keyword of defmacro to indicate if sentence Function is modified.The form that Do statement generallys use recur carrys out recurrence, but it sometimes appear that does not know that recur is to follow The case where ring sentence, therefore the foreach grammer that can be revised as in programming language known to tester, traverse some Iteration object and it can be applied in body statement body, as shown in fig. 6, can thus construct simple and clear meets tester It is required that syntactic structure.
505: modified configuration file being parsed, the sentence in modified configuration file is obtained.
506: executing the sentence in modified configuration file, obtaining that modified configuration file is corresponding can be by machine The test result of the test case of operation.In the present embodiment, step 505 and 506 please refers to phase in above method embodiment It speaks on somebody's behalf bright, this present embodiment is no longer illustrated.
From above-mentioned technical proposal it is found that by macro modification to be modified in configuration file, so that modified configuration is literary Furthermore the syntactic structure that part meets tester's requirement may be used also in order to the understanding of tester by macro modification to be modified Redundancy in configuration file and interminable code to be modified, to reduce code line and duplicated code.
For the various method embodiments described above, for simple description, therefore, it is stated as a series of action combinations, but Be those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because according to the present invention, certain A little steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know that, it is retouched in specification The embodiment stated belongs to preferred embodiment, and related actions and modules are not necessarily necessary for the present invention.
Corresponding with above method embodiment, the embodiment of the present invention also provides a kind of test case running gear, structure As shown in fig. 7, may include: use-case obtaining unit 11, file obtaining unit 12, resolution unit 13 and execution unit 14.
Use-case obtaining unit 11, the first test case write for obtaining user using natural language, and incited somebody to action The second test case obtained after the formalization of first test case.
It is to be understood that so-called natural language is a kind of language to develop naturally with culture, such as common Chinese, English Language etc. is a kind of natural language, which is a kind of tester (user) common language when writing test case Speech, the first test case write by natural language can understand the test mesh of first test case convenient for different testers 's.
But it is logically easy to produce ambiguity using the first test case that natural language is write, therefore use nature language It says that the first test case write has ambiguity and ambiguousness, and is difficult to support the automation of test case, need thus The first test case for using natural language to write is converted, to eliminate the first test case in ambiguity and ambiguousness side The problem of face.
Wherein formalization is a term in logistics, and so-called formalization, which refers in a manner of strict logical, to describe to survey First test case such as in the present embodiment describe by example on probation in the form of pseudocode, obtains the of in the form of pseudocode description Two test cases, to eliminate the ambiguousness of the first test case using natural language description.
File obtaining unit 12, for obtaining the configuration file based on the second Test cases technology.In the configuration file In addition to needing that configuration parameter is written, it is also necessary to write-in input order, control instruction and output data it is expected logic judgment, wherein Input order is each item order for the test equipment that test case is directed to, and control instruction is then the execution for controlling input order Logic and input order execute correction judgement, and output data expectation logic judgment is obtained after executing to input order Whether output data meets expected judgement, can also specify the corresponding data structure of output data in practical applications, so that Configuration file not merely record profile, also embodies whole logics of test case.
In the present embodiment, configuration file can be, but not limited to JOSN format, referring specifically in above method embodiment Related description, this present embodiment is no longer illustrated.
Resolution unit 13 obtains the sentence in configuration file, the language in configuration file for parsing to configuration file Sentence is at least: configuration parameter, input order, control instruction and output data it is expected logic judgment.In the present embodiment, matched A kind of mode for setting the sentence in file may is that the abstract syntax tree of building configuration file, to section each in abstract syntax tree Point is traversed, and carries out pattern match to the content of each node in ergodic process, with the content institute of each node of determination The sentence of representative.
The process for wherein constructing the abstract syntax tree of configuration file can be found in the building process of existing abstract syntax tree, to this The present embodiment do not illustrating, after obtaining abstract syntax tree can based on ergodic algorithm to each node in abstract syntax tree into Row traversal, is such as traversed based on ergodic algorithm from left to right, can be by regular expression mode to each in ergodic process The content of a node carries out pattern match, with sentence representated by the content of each node of determination, such as above-mentioned configuration parameter, input Order, control instruction and output data expectation logic judgment etc., carry out this implementation of the process of pattern match for regular expression Example is not illustrating.
Execution unit 14 obtains that configuration file is corresponding to be run by machine for executing the sentence in configuration file Test case test result.Such as configuration parameter is input in input order, and based on control instruction control input order Execution, obtain obtained output data after input order executes, and based on output data expectation decision logic to output data Judged, obtain the judging result of output data, wherein the judging result of output data is for showing that configuration file is corresponding The test result for the test case that can be run by machine.
From above-mentioned technical proposal it is found that after obtaining the second test case, it can obtain based on the second Test cases technology Configuration file, configuration file is parsed, obtains the sentence in configuration file, the sentence in configuration file is executed, obtains The test result of the corresponding test case that can be run by machine of configuration file, thus can be by executing in configuration file The mode of sentence is realized to that can be executed and test result automatically obtains by the automatic of the test case that machine is run, and be saved The step of manual triggering test case executes.And the sentence in configuration file is at least: configuration parameter, input order, control System instruction and output data it is expected logic judgment, this means that configuration file can embody whole logics of test case, because This only needs to modify configuration file when needing to modify test case, to reduce the maintenance cost of test case.
In addition, the file obtaining unit 12 in the present embodiment, is repaired for obtaining user to be modified macro in configuration file Change, obtains modified configuration file.Why need to modify be in order to enable configuration file more meets the cognition of tester, Carry out code development convenient for tester to realize the automation of test case, it is to be modified in the present embodiment it is macro be by tester Member it is specified and modify.That is which sentence in configuration file (can be considered as to be modified macro) needs to modify and modify Content afterwards is what is specified by tester.After tester modifies configuration file and uploads, file obtaining unit 12 can obtain modified configuration file.Correspondingly, resolution unit 13 is used to parse modified configuration file, The sentence in modified configuration file is obtained, detailed process please refers to the related description in embodiment of the method.
By to macro modification to be modified in configuration file, so that modified configuration file meets tester's requirement Syntactic structure, in order to the understanding of tester, furthermore by macro modification to be modified can also by redundancy in configuration file and Interminable code is modified, to reduce code line and duplicated code.
In addition, the embodiment of the present invention also provides a kind of processor, processor is executed for running program, when program is run State test case operation method.
The present invention also embodiment provides a kind of storage medium, and computer program code, computer are stored on storage medium Program code realizes above-mentioned test case operation method when running.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.
The foregoing description of the disclosed embodiments can be realized those skilled in the art or using the present invention.To this A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and the general principles defined herein can Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited It is formed on the embodiments shown herein, and is to fit to consistent with the principles and novel features disclosed in this article widest Range.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of test case operation method, which is characterized in that the described method includes:
Obtain the first test case that user is write using natural language;
Obtain the second test case that will be obtained after first test case formalization;
Obtain the configuration file based on second Test cases technology;
The configuration file is parsed, obtains the sentence in the configuration file, the sentence in the configuration file is at least Have: configuration parameter, input order, control instruction and output data expectation logic judgment;
The sentence in the configuration file is executed, the corresponding test case that can be run by machine of the configuration file is obtained Test result.
2. the method according to claim 1, wherein the method also includes:
User is obtained to macro modification to be modified in the configuration file, obtains modified configuration file;
Described to parse to the configuration file, obtaining the sentence in the configuration file includes: to modified configuration text Part is parsed, and the sentence in the modified configuration file is obtained.
3. being obtained described the method according to claim 1, wherein described parse the configuration file Sentence in configuration file includes:
Construct the abstract syntax tree of the configuration file;
Each node in the abstract syntax tree is traversed, and mode is carried out to the content of each node in ergodic process Matching, with sentence representated by the content of determination each node.
4. according to the method described in claim 3, it is characterized in that, before the abstract syntax tree for constructing the configuration file, Further include: syntax check is carried out to the pieces of data in the configuration file, if there is the grammer of any data in pieces of data Accidentally, then prompt information is exported;
If any data is syntactically correct in pieces of data, triggers and execute the abstract syntax tree for constructing the configuration file Step.
5. the method according to claim 1, wherein the sentence executed in the configuration file, obtains institute State that configuration file is corresponding to include: by the test result of test case that machine is run
The configuration parameter is input in the input order, and holding for the input order is controlled based on the control instruction Row;
The output data obtained after the input order executes is obtained, and based on output data expectation decision logic to described Output data is judged, obtains the judging result of the output data, the judging result of the output data is for showing institute State the test result of the corresponding test case that can be run by machine of configuration file.
6. a kind of test case running gear, which is characterized in that described device includes:
Use-case obtaining unit, the first test case write for obtaining user using natural language, and obtain described the The second test case obtained after the formalization of one test case;
File obtaining unit, for obtaining the configuration file based on second Test cases technology;
Resolution unit obtains the sentence in the configuration file, the configuration file for parsing to the configuration file In sentence at least: configuration parameter, input order, control instruction and output data it is expected logic judgment;
Execution unit obtains that the configuration file is corresponding to be transported by machine for executing the sentence in the configuration file The test result of capable test case.
7. device according to claim 6, which is characterized in that the file obtaining unit, for obtaining user to described Macro modification to be modified, obtains modified configuration file in configuration file;
The resolution unit obtains in the modified configuration file for parsing to modified configuration file Sentence.
8. device according to claim 6, which is characterized in that the resolution unit, for constructing the configuration file Abstract syntax tree, and each node in the abstract syntax tree is traversed, and in each node in ergodic process Hold and carry out pattern match, with sentence representated by the content of determination each node;
And/or
The execution unit for the configuration parameter to be input in the input order, and is based on the control instruction control The execution for making the input order obtains the output data obtained after the input order executes, and is based on the output data It is expected that decision logic judges the output data, the judging result of the output data is obtained, the output data Judging result is used to show the test result of the corresponding test case that can be run by machine of the configuration file.
9. a kind of processor, which is characterized in that the processor is executed for running program, when described program is run as right is wanted Test case operation method described in asking any one of 1 to 5.
10. a kind of storage medium, which is characterized in that be stored with computer program code, the computer on the storage medium The test case operation method as described in claim 1 to 5 any one is realized when program code is run.
CN201811390827.2A 2018-11-21 2018-11-21 A kind of test case operation method and device Pending CN109656813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811390827.2A CN109656813A (en) 2018-11-21 2018-11-21 A kind of test case operation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811390827.2A CN109656813A (en) 2018-11-21 2018-11-21 A kind of test case operation method and device

Publications (1)

Publication Number Publication Date
CN109656813A true CN109656813A (en) 2019-04-19

Family

ID=66112311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811390827.2A Pending CN109656813A (en) 2018-11-21 2018-11-21 A kind of test case operation method and device

Country Status (1)

Country Link
CN (1) CN109656813A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110427188A (en) * 2019-08-02 2019-11-08 深圳前海微众银行股份有限公司 It is single to survey configuration method, device, equipment and the storage medium for asserting program
CN110543427A (en) * 2019-09-06 2019-12-06 五八有限公司 Test case storage method and device, electronic equipment and storage medium
CN111124479A (en) * 2019-12-18 2020-05-08 北京像素软件科技股份有限公司 Configuration file analysis method and system and electronic equipment
CN111475410A (en) * 2020-03-31 2020-07-31 北京经纬恒润科技有限公司 Test case generation method and device
CN112084786A (en) * 2020-08-03 2020-12-15 东北大学 DSL-based network configuration file testing method
CN117951035A (en) * 2024-03-26 2024-04-30 成都飞机工业(集团)有限责任公司 Method, system, equipment and medium for constructing integrated logic condition automatic test program statement

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436128A (en) * 2007-11-16 2009-05-20 北京邮电大学 Software test case automatic generating method and system
CN105354035A (en) * 2015-11-17 2016-02-24 天津橙子科技有限公司 Method for compiling test case of web engineering
US20180276109A1 (en) * 2017-03-24 2018-09-27 International Business Machines Corporation Distributed system test device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436128A (en) * 2007-11-16 2009-05-20 北京邮电大学 Software test case automatic generating method and system
CN105354035A (en) * 2015-11-17 2016-02-24 天津橙子科技有限公司 Method for compiling test case of web engineering
US20180276109A1 (en) * 2017-03-24 2018-09-27 International Business Machines Corporation Distributed system test device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张平编: "《探秘C#如何像计算机科学家一样思考》", 30 April 2005 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110427188A (en) * 2019-08-02 2019-11-08 深圳前海微众银行股份有限公司 It is single to survey configuration method, device, equipment and the storage medium for asserting program
CN110543427A (en) * 2019-09-06 2019-12-06 五八有限公司 Test case storage method and device, electronic equipment and storage medium
CN111124479A (en) * 2019-12-18 2020-05-08 北京像素软件科技股份有限公司 Configuration file analysis method and system and electronic equipment
CN111124479B (en) * 2019-12-18 2024-03-22 北京像素软件科技股份有限公司 Method and system for analyzing configuration file and electronic equipment
CN111475410A (en) * 2020-03-31 2020-07-31 北京经纬恒润科技有限公司 Test case generation method and device
CN112084786A (en) * 2020-08-03 2020-12-15 东北大学 DSL-based network configuration file testing method
CN117951035A (en) * 2024-03-26 2024-04-30 成都飞机工业(集团)有限责任公司 Method, system, equipment and medium for constructing integrated logic condition automatic test program statement

Similar Documents

Publication Publication Date Title
CN109656813A (en) A kind of test case operation method and device
CN107273286B (en) Scene automatic test platform and method for task application
US11042369B1 (en) Systems and methods for modernizing and optimizing legacy source code
CN108319456B (en) Development method of programming-free deep learning application
US9146712B2 (en) Extensible code auto-fix framework based on XML query languages
US8392880B2 (en) Rapid application development for database-aware applications
US11392485B2 (en) Auto test generator
CN110221975B (en) Method and device for creating interface case automation test script
US20060075305A1 (en) Method and system for source-code model-based testing
WO2012032890A1 (en) Source code conversion method and source code conversion program
US7496552B2 (en) Method for rule compliance situation checking and related checking system
US20130014093A1 (en) Code inspection executing system for performing a code inspection of abap source codes
CN107783758B (en) A kind of intelligence contract engineering method
US20080282108A1 (en) Program synthesis and debugging using machine learning techniques
US7895575B2 (en) Apparatus and method for generating test driver
US11650799B2 (en) Remote application modernization
CN106095501B (en) A kind of application dispositions method and device
WO2021051006A1 (en) Visually creating and monitoring machine learning models
US11263113B2 (en) Cloud application to automatically detect and solve issues in a set of code base changes using reinforcement learning and rule-based learning
WO2021223215A1 (en) Automated decision platform
US6853963B1 (en) Analyzing an extended finite state machine system model
US20230350643A1 (en) Developing a software product in a no-code development platform to address a problem related to a business domain
Priya et al. Test Case Generation from UML models-A survey
KR102046571B1 (en) Method for generating data processing rule
CN118034661B (en) Intelligent task application system of large language model

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190419

RJ01 Rejection of invention patent application after publication