CN103631720A - Method and device for generating test case - Google Patents

Method and device for generating test case Download PDF

Info

Publication number
CN103631720A
CN103631720A CN201310713450.0A CN201310713450A CN103631720A CN 103631720 A CN103631720 A CN 103631720A CN 201310713450 A CN201310713450 A CN 201310713450A CN 103631720 A CN103631720 A CN 103631720A
Authority
CN
China
Prior art keywords
function
test
tested
module
parameter
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
CN201310713450.0A
Other languages
Chinese (zh)
Other versions
CN103631720B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201310713450.0A priority Critical patent/CN103631720B/en
Publication of CN103631720A publication Critical patent/CN103631720A/en
Application granted granted Critical
Publication of CN103631720B publication Critical patent/CN103631720B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention proposes a method and a device for generating a test case. The method comprises the following steps: obtaining an input instrument and a configuration film, wherein the input instruction comprises a test type parameter; the configuration film comprises a module, class information, function information of the tested function and a test parameter; determining the test type according to the test type parameter, and structuring test data according to the test type and the test parameter; rendering the preset template according to the template, the class information, the function information of the tested function and the test data, so as to generate the test case. By adopting the method disclosed by the embodiment of the invention, on one hand, automatic generation of the function test case is achieved without artificially compiling the test case of the tested function, so as to improve the test accuracy, and on the other hand, the test type is determined according to the test type parameter, and support of a plurality of different test modes is achieved, so that the supported test modes are diversified.

Description

The generation method and apparatus of test case
Technical field
The present invention relates to software testing technology field, relate in particular to a kind of generation method and apparatus of test case.
Background technology
Software test is the important means that improves software product reliability, guarantees software product quality.Software test activity was dissolved in each stage of software product Life cycle, all kinds of technical methods and testing tool that software test adopts reach its maturity, relevant method of testing, test case and testing tool are also perfect constantly, so software test is towards standardization development.
At present, different test cases is used in software test in different test phases, and for example, the unit testing stage is used unit testing use-case etc., by test case, the various use scenes of software and situation is tested the correct and safe operation of safeguards system.Test case can also have some robotizations to generate software by writing manually now, can help to reduce hand labor, improves testing efficiency.
But, in realizing process of the present invention, inventor finds that prior art at least exists following problem: (1) at present for mono-kind of YII(based on assembly, for developing the high-performance PHP(hypertext pre-service language of large Web application) framework) the unit testing use-case automatic technology of framework is ripe not enough, for example, the PHP test frame of a PHPUNIT(lightweight) although can realize unit testing, but the support granularity to unit testing is excessive, cannot realize the automatic generation of function test case, still need manual compiling test case; (2) when the testing tool that uses YII framework to carry, still need manually to construct test data, cause code upgrade after test case maintenance cost very large; (3) unit testing covering logic is comprehensive not; (4) test mode of supporting is single.
Summary of the invention
The present invention is intended at least one of solve the problems of the technologies described above.
For this reason, first object of the present invention is to propose a kind of generation method of test case.The method is without the test case of the tested function of manual compiling, realize the automatic generation of function test case, thereby improved testing efficiency, and determined test-types according to test-types parameter, realize the test mode of supporting number of different types, made the test mode variation of supporting.
Second object of the present invention is to propose a kind of generating apparatus of test case.
To achieve these goals, the generation method of the test case of first aspect present invention embodiment comprises the following steps: obtain input instruction and configuration file, wherein, described input instruction comprises test-types parameter, and described configuration file comprises function information and the test parameter of module and category information, tested function; According to described test-types parameter, determine test-types, and according to described test-types and described test parameter structure test data; And according to the function information of described module and category information, tested function and described test data, default template is played up with generating test use case.
The generation method of the test case of the embodiment of the present invention, can determine test-types according to test-types parameter, and according to test-types and test parameter structure test data, and default template being played up according to the function information of template and category information, tested function and test data, thereby generating test use case.The embodiment of the present invention at least has the following advantages: (1), without the test case of the tested function of manual compiling, has been realized the automatic generation of function test case, thereby improved testing efficiency; (2) without manual structure test data, reduce the maintenance cost of test case, and combined test data freely, ensured the randomness of test data; (3) according to test-types parameter, determine test-types, realized the test mode of supporting number of different types, make the test mode variation of supporting.
To achieve these goals, the generating apparatus of the test case of second aspect present invention embodiment, comprise: acquisition module, be used for obtaining input instruction and configuration file, wherein, described input instruction comprises test-types parameter, and described configuration file comprises function information and the test parameter of module and category information, tested function; Test data constructing module, for determining test-types according to described test-types parameter, and according to described test-types and described test parameter structure test data; And generation module, for default template being played up with generating test use case according to the function information of described module and category information, tested function and described test data.
The generating apparatus of the test case of the embodiment of the present invention, by test data constructing module, according to test-types parameter, determine test-types, and according to test-types and test parameter structure test data, generation module is played up default template according to the function information of template and category information, tested function and test data, thus generating test use case.The embodiment of the present invention at least has the following advantages: (1), without the test case of the tested function of manual compiling, has been realized the automatic generation of function test case, thereby improved testing efficiency; (2) without manual structure test data, reduce the maintenance cost of test case, and combined test data freely, ensured the randomness of test data; (3) according to test-types parameter, determine test-types, realized the test mode of supporting number of different types, make the test mode variation of supporting.
The aspect that the present invention is additional and advantage in the following description part provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Accompanying drawing explanation
Above-mentioned and/or the additional aspect of the present invention and advantage will become from the following description of the accompanying drawings of embodiments and obviously and easily understand, wherein,
Fig. 1 is the process flow diagram of the generation method of test case according to an embodiment of the invention;
Fig. 2 is the process flow diagram of generation method of the test case of a specific embodiment according to the present invention;
Fig. 3 is the process flow diagram of generation method of the test case of another specific embodiment according to the present invention;
Fig. 4 is the structural representation of the generating apparatus of test case according to an embodiment of the invention;
Fig. 5 is the structural representation of the generating apparatus of the test case of a specific embodiment according to the present invention;
Fig. 6 is the structural representation of the generating apparatus of the test case of another specific embodiment according to the present invention;
Fig. 7 is the structural representation of the generating apparatus of the test case of another specific embodiment according to the present invention;
Fig. 8 is the structural representation of the generating apparatus of the test case of another specific embodiment again according to the present invention;
Fig. 9 is the structural representation of the generating apparatus of the test case of another specific embodiment according to the present invention.
Embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has the element of identical or similar functions from start to finish.Below by the embodiment being described with reference to the drawings, be exemplary, only for explaining the present invention, and can not be interpreted as limitation of the present invention.On the contrary, embodiments of the invention comprise spirit and all changes within the scope of intension, modification and the equivalent that falls into additional claims.
In description of the invention, it will be appreciated that, term " first ", " second " etc. are only for describing object, and can not be interpreted as indication or hint relative importance.In description of the invention, it should be noted that, unless otherwise clearly defined and limited, term " is connected ", " connection " should be interpreted broadly, and for example, can be to be fixedly connected with, and can be also to removably connect, or connects integratedly; Can be mechanical connection, can be to be also electrically connected to; Can be to be directly connected, also can indirectly be connected by intermediary.For the ordinary skill in the art, can concrete condition understand above-mentioned term concrete meaning in the present invention.In addition,, in description of the invention, except as otherwise noted, the implication of " a plurality of " is two or more.
In process flow diagram or any process of otherwise describing at this or method describe and can be understood to, represent to comprise that one or more is for realizing module, fragment or the part of code of executable instruction of the step of specific logical function or process, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can be not according to order shown or that discuss, comprise according to related function by the mode of basic while or by contrary order, carry out function, this should be understood by embodiments of the invention person of ordinary skill in the field.
In order to solve the automatic generation that cannot realize function test case, still need manual compiling test case and function is tested to test mode or the more single problem of type of supporting, the present invention proposes a kind of generation method and apparatus of test case.Below with reference to accompanying drawing, describe according to the generation method and apparatus of the test case of the embodiment of the present invention.
The embodiment of the present invention has proposed a kind of generation method of test case, comprise the following steps: obtain input instruction and configuration file, wherein, input instruction comprises test-types parameter, and configuration file comprises function information and the test parameter of module and category information, tested function; According to test-types parameter, determine test-types, and according to test-types and test parameter structure test data; And according to the function information of module and category information, tested function and test data, default template is played up with generating test use case.
Fig. 1 is the process flow diagram of the generation method of test case according to an embodiment of the invention.
As shown in Figure 1, the generation method of test case comprises the following steps:
S101, obtains input instruction and configuration file, and wherein, input instruction comprises test-types parameter, and configuration file comprises function information and the test parameter of module and category information, tested function.
For example, when user or tester are before use test framework or testing tool generating test use case, can first require the instructions such as user or tester's input test type parameter, wherein, test-types parameter can be understood as user and specifies the test case that need to generate which kind of type, for example, after test frame or the testing tool test-types parameter in getting input instruction, judge this test-types parameter, different test-types parameter representatives generate dissimilar test case, enter different logic branches, as, test-types parameter is " v ", representative generates regression test case, test-types parameter is " m ", represent generation unit test case etc.
In addition, also can require user or tester to fill in configuration file, configuration file can be a file, can fill in module and category information (as module name by user or tester, class name), the function information of tested function is (as function name, function parameter, the number of function parameter), test parameter (function parameter value as corresponding in function parameter) etc., wherein, different function parameters can divide and represent with different name region, if the number of function parameter is 2, available parm1, parm2 represents, the different values of same function parameter can CSV, test frame or testing tool are after getting configuration file, can from configuration file, read in function parameter, the function parameter value that function parameter is corresponding, and by function parameter, the function parameter value that function parameter is corresponding saves as array and is used for follow up scan and play up test case.
S102, determines test-types according to test-types parameter, and according to test-types and test parameter structure test data.
Particularly, after getting input instruction, can the test-types parameter in input instruction be judged, can determine corresponding test-types according to different test-types parameters, for example, test-types parameter is " v ", can determine that test-types is regression test, test-types parameter is " m ", can determine that test-types is unit testing, and according to corresponding test-types and test parameter structure test data.For example, obtain the function parameter number of the tested function in configuration file, many groups value of each function parameter, many groups value of all function parameters and function parameter is done to independent assortment, get at random first predetermined group (as 4 groups) non-idle pattern, as predetermined group of (as 4 groups) test data, as, tested function has 2 function parameter: parm1, parm2, 2 groups of values of each function parameter are parm1:1, 2, parm2:a, b, after independent assortment, be: (1, a), (1, b), (2, a), (2, b), can be using these non-idle patterns as 4 groups of test datas.Thus, can ensure the randomness of test data, with the robustness of dissimilar test data test procedure.
S103, plays up with generating test use case default template according to the function information of module and category information, tested function and test data.
Wherein, default template can be the template file in PHP programming, default template can define in advance, for example, define in advance the pattern of template, the variable name of each position etc., in addition, default template can comprise fixing information (as module path, class name etc.) and/or the variable that need to obtain (function parameter value as corresponding in the parameter of the number of parameters of tested function name, tested function place class name, tested function and parameter name, tested function, tested function place file path etc.).
Particularly, can by template, process class according to the function information of module and category information, tested function and test data default template is played up, template parameter, template file are set, present template and by result writing in files with generating test use case.For example, in default template file, there is individual field " $ CLASS ", first tested function " MyTest " can be assigned to " $ CLASS ", then by the template processing class PHPUnit_Util_Template calling in PHP UNIT, play up, afterwards " $ CLASS " replaced with to " MyTest ", because some fixed part in default template defines in advance, so only the part of needs conversion need be defined as to variable, all variate-value directly can be filled into and can generate the test case corresponding with tested function " MyTest " when playing up so at every turn.
The generation method of the test case of the embodiment of the present invention, can determine test-types according to test-types parameter, and according to test-types and test parameter structure test data, and default template being played up according to the function information of template and category information, tested function and test data, thereby generating test use case.The embodiment of the present invention at least has the following advantages: (1), without the test case of the tested function of manual compiling, has been realized the automatic generation of function test case, thereby improved testing efficiency; (2) without manual structure test data, reduce the maintenance cost of test case, and combined test data freely, ensured the randomness of test data; (3) according to test-types parameter, determine test-types, realized the test mode of supporting number of different types, make the test mode variation of supporting.
For fear of the error that other functions cause tested function in test process, in one embodiment of the invention, in the process generating in test case, also need to excavate the function that the function calling relationship of tested function is called to obtain tested function, simulate these invoked functions, give fixing rreturn value to these invoked functions, particularly, the generation method of test case also comprises: according to module and category information, corresponding module and class are scanned to obtain the function body of tested function; According to the function body of tested function, excavate the function that the function calling relationship of tested function is called to obtain tested function; And the function that tested function is called intercepts, so that when tested function operation, the function calling by tested function returns to preset value to tested function.
Particularly, can under corresponding module path, scan whole class according to the module in configuration file and category information (as module name, class name), the function name of the tested function obtaining from configuration file according to matching regular expressions, to find the function body of this tested function, and the function body of this tested function is decomposed to obtain the function calling relationship of tested function.In an embodiment of the present invention, function calling relationship can comprise the every other function calling in tested function, and this call relation is called during for tested function operation with the form storage of array.Afterwards, the function in function calling relationship can be intercepted, so that when tested function operation, the function calling by tested function returns to preset value to tested function.Wherein, preset value can be the rreturn value of called function.Thus, by simulating invoked function, give fixing rreturn value to these invoked functions, avoided the error that other functions cause tested function in test process.
In one embodiment of the invention, according to module and category information, corresponding module and class are scanned to obtain the function body of tested function, further comprise: according to module and category information, obtain the absolute path of class place file under tested function, and file is carried out to entire scan to obtain the function body of tested function.Particularly, first acquisition module and category information (as module name, class name) from configuration file, be combined into the absolute path of such place file according to module and category information (as module name, class name).Afterwards, again such place file is carried out to entire scan, if find that there is the function name of tested function in configuration file, obtain all the elements of this tested function, for example, the function names that the function body of this tested function, function parameter, function parameter number, this tested function call etc., so that obtain the function calling relationship of tested function according to all the elements of this tested function.Thus, the embodiment of the present invention improved tested function function body obtain accuracy.
In one embodiment of the invention, according to the function body of tested function, excavate the function that the function calling relationship of tested function is called to obtain tested function, further comprise: the function body of tested function is decomposed with generating solution parser code name, and by reflex mechanism class Reflection, obtain the call relation between class and tested function, the function being called to obtain tested function according to resolver code name.Particularly, can obtain the function body of whole tested function as code snippet, by resolver code name function (as function Token_get_all (); ) resolve into resolver code name, by reflex mechanism class Reflection, successively obtain the call relation between class and tested function, thereby obtain the function that tested function calls.Wherein, resolver code name function can become character or character string one by one by code analysis, and for example, " { " can be resolved the begin symbol that device code name function resolves to a function, and the part below notifying program is all in this function body.Thus, the embodiment of the present invention has improved the accuracy of obtaining of function that tested function calls.
In one embodiment of the invention, the function that tested function is called intercepts, further comprise: the function that tested function is called carries out rename, and the title of the function calling according to tested function is set up new function, wherein, new function returns to preset value when tested function call.Particularly, in the process of function calling relationship of excavating tested function, can obtain class and the tested function of all users or programming personnel's definition, function and the class that can to tested function, call by Runkit storehouse are carried out rename.By original function name/method name, re-establish new function/method more afterwards, again function body corresponding to original function added in new function, like this when PHP script starts to carry out, can call this " hook ", by the method for all classes or function all " hook " one time, can forge function intermediate data and process like this, for the generation of test case provides advantage, avoid other functions to cause error to tested function.Wherein, the definition of any class and function can be supported to revise dynamically in Runkit storehouse.
For example, in tested function test, function f unca and funcb have been called, because the processing logic of these two functions is unknown for tested function, and input and output are also not predictable, so need these two functions of simulation, do not allow these two functions play a role, what guarantee like this to test in test process is the logic of tested function, ensures the accuracy of test.
Fig. 2 is the process flow diagram of generation method of the test case of a specific embodiment according to the present invention.
In an embodiment of the present invention, after generating test use case, also can load test case so that tested function is tested, and according to test result, test case be managed.Particularly, as shown in Figure 2, the generation method of test case comprises the following steps:
S201, obtains input instruction and configuration file, and wherein, input instruction comprises test-types parameter, and configuration file comprises function information and the test parameter of module and category information, tested function.
For example, when user or tester are before use test framework or testing tool generating test use case, can first require the instructions such as user or tester's input test type parameter, wherein, test-types parameter can be understood as user and specifies the test case that need to generate which kind of type, for example, after test frame or the testing tool test-types parameter in getting input instruction, judge this test-types parameter, different test-types parameter representatives generate dissimilar test case, enter different logic branches, as, test-types parameter is " v ", representative generates regression test case, test-types parameter is " m ", represent generation unit test case etc.
In addition, also can require user or tester to fill in configuration file, configuration file can be a file, can fill in module and category information (as module name by user or tester, class name), the function information of tested function is (as function name, function parameter, the number of function parameter), test parameter (function parameter value as corresponding in function parameter) etc., wherein, different function parameters can divide and represent with different name region, if the number of function parameter is 2, available parm1, parm2 represents, the different values of same function parameter can CSV, test frame or testing tool are after getting configuration file, can from configuration file, read in function parameter, the function parameter value that function parameter is corresponding, and by function parameter, the function parameter value that function parameter is corresponding saves as array and is used for follow up scan and play up test case.
S202, determines test-types according to test-types parameter, and according to test-types and test parameter structure test data.
Particularly, after getting input instruction, can the test-types parameter in input instruction be judged, can determine corresponding test-types according to different test-types parameters, for example, test-types parameter is " v ", can determine that test-types is regression test, test-types parameter is " m ", can determine that test-types is unit testing, and according to corresponding test-types and test parameter structure test data.For example, obtain the function parameter number of the tested function in configuration file, many groups value of each function parameter, many groups value of all function parameters and function parameter is done to independent assortment, get at random first predetermined group (as 4 groups) non-idle pattern, as predetermined group of (as 4 groups) test data, as, tested function has 2 function parameter: parm1, parm2, 2 groups of values of each function parameter are parm1:1, 2, parm2:a, b, after independent assortment, be: (1, a), (1, b), (2, a), (2, b), can be using these non-idle patterns as 4 groups of test datas.Thus, can ensure the randomness of test data, with the robustness of dissimilar test data test procedure.
S203, plays up with generating test use case default template according to the function information of module and category information, tested function and test data.
Wherein, default template can be the template file in PHP programming, default template can define in advance, for example, define in advance the pattern of template, the variable name of each position etc., in addition, default template can comprise fixing information (as module path, class name etc.) and/or the variable that need to obtain (function parameter value as corresponding in the parameter of the number of parameters of tested function name, tested function place class name, tested function and parameter name, tested function, tested function place file path etc.).
Particularly, can by template, process class according to the function information of module and category information, tested function and test data default template is played up, template parameter, template file are set, present template and by result writing in files with generating test use case.For example, in default template file, there is individual field " $ CLASS ", first tested function " MyTest " can be assigned to " $ CLASS ", then by the template processing class PHPUnit_Util_Template calling in PHP UNIT, play up, afterwards " $ CLASS " replaced with to " MyTest ", because some fixed part in default template defines in advance, so only the part of needs conversion need be defined as to variable, all variate-value directly can be filled into and can generate the test case corresponding with tested function " MyTest " when playing up so at every turn.
S204, loads test case so that tested function is tested, and according to test result, test case is managed.
Particularly, after playing up with generating test use case according to the function information of module and category information, tested function and test data to default template, can load test case so that tested function is tested.For example, when determining that according to test-types parameter test-types is unit testing type, can generation unit test case, load this unit testing use-case so that tested function is carried out to unit testing, when determining that according to test-types parameter test-types is regression test type, can generate regression test case, load this regression test case so that tested function is carried out to regression test.Afterwards, then according to test result, test case is managed, as, when test is passed through, test case can be collected to reuse, obstructed out-of-date when test, can debug test case.
The generation method of the test case of the embodiment of the present invention, can load test case so that tested function is tested, and according to test result, test case is managed, when test is passed through, test case can be collected to reuse, obstructed out-of-date when test, can debug test case, by the automatic management function of test case, reduced artificial concern cost.
Fig. 3 is the process flow diagram of generation method of the test case of another specific embodiment according to the present invention.
In an embodiment of the present invention, can whether meet preset requirement by verification test result, so that test case is managed.Particularly, as shown in Figure 3, the generation method of test case comprises the following steps:
S301, obtains input instruction and configuration file, and wherein, input instruction comprises test-types parameter, and configuration file comprises function information and the test parameter of module and category information, tested function.
For example, when user or tester are before use test framework or testing tool generating test use case, can first require the instructions such as user or tester's input test type parameter, wherein, test-types parameter can be understood as user and specifies the test case that need to generate which kind of type, for example, after test frame or the testing tool test-types parameter in getting input instruction, judge this test-types parameter, different test-types parameter representatives generate dissimilar test case, enter different logic branches, as, test-types parameter is " v ", representative generates regression test case, test-types parameter is " m ", represent generation unit test case etc.
In addition, also can require user or tester to fill in configuration file, configuration file can be a file, can fill in module and category information (as module name by user or tester, class name), the function information of tested function is (as function name, function parameter, the number of function parameter), test parameter (function parameter value as corresponding in function parameter) etc., wherein, different function parameters can divide and represent with different name region, if the number of function parameter is 2, available parm1, parm2 represents, the different values of same function parameter can CSV, test frame or testing tool are after getting configuration file, can from configuration file, read in function parameter, the function parameter value that function parameter is corresponding, and by function parameter, the function parameter value that function parameter is corresponding saves as array and is used for follow up scan and play up test case.
S302, determines test-types according to test-types parameter, and according to test-types and test parameter structure test data.
Particularly, after getting input instruction, can the test-types parameter in input instruction be judged, can determine corresponding test-types according to different test-types parameters, for example, test-types parameter is " v ", can determine that test-types is regression test, test-types parameter is " m ", can determine that test-types is unit testing, and according to corresponding test-types and test parameter structure test data.For example, obtain the function parameter number of the tested function in configuration file, many groups value of each function parameter, many groups value of all function parameters and function parameter is done to independent assortment, get at random first predetermined group (as 4 groups) non-idle pattern, as predetermined group of (as 4 groups) test data, as, tested function has 2 function parameter: parm1, parm2, 2 groups of values of each function parameter are parm1:1, 2, parm2:a, b, after independent assortment, be: (1, a), (1, b), (2, a), (2, b), can be using these non-idle patterns as 4 groups of test datas.Thus, can ensure the randomness of test data, with the robustness of dissimilar test data test procedure.
S303, plays up with generating test use case default template according to the function information of module and category information, tested function and test data.
Wherein, default template can be the template file in PHP programming, default template can define in advance, for example, define in advance the pattern of template, the variable name of each position etc., in addition, default template can comprise fixing information (as module path, class name etc.) and/or the variable that need to obtain (function parameter value as corresponding in the parameter of the number of parameters of tested function name, tested function place class name, tested function and parameter name, tested function, tested function place file path etc.).
Particularly, can by template, process class according to the function information of module and category information, tested function and test data default template is played up, template parameter, template file are set, present template and by result writing in files with generating test use case.For example, in default template file, there is individual field " $ CLASS ", first tested function " MyTest " can be assigned to " $ CLASS ", then by the template processing class PHPUnit_Util_Template calling in PHP UNIT, play up, afterwards " $ CLASS " replaced with to " MyTest ", because some fixed part in default template defines in advance, so only the part of needs conversion need be defined as to variable, all variate-value directly can be filled into and can generate the test case corresponding with tested function " MyTest " when playing up so at every turn.
S304, load test case so that tested function is tested, and whether verification test result meets preset requirement.
Wherein, the rreturn value that preset requirement can be regarded as in test result is identical with the expectation rreturn value in verification function.
For example, when the test case generating is unit testing use-case, when loading unit test case is carried out unit testing to tested function, first can import respectively predetermined group of (as 4 groups) test data into tested function, call tested function, obtain respectively predetermined group of corresponding (4 groups) rreturn value, afterwards, expectation rreturn value in this rreturn value and verification function can be contrasted, with check test result, whether meet preset requirement.Wherein, the expectation rreturn value in verification function can be a group of filling in advance and expects the rreturn value of tested function.
And for example, when the test case generating is regression test case, when loading regression test case carries out regression test to tested function, first revise local data base configuration, can change the database connecting in tested function into be connected to baseline machine database, to keep the consistance of data.Afterwards, in this locality, call tested function, can import respectively predetermined group of (as 4 groups) test data into tested function, to obtain respectively predetermined group of corresponding (4 groups) rreturn value, at baseline machine, call the tested function in baseline machine simultaneously, and will be scheduled to group as 4 groups) test data imports respectively this tested function into, and the rreturn value of this tested function is back in verification function, using as expecting rreturn value.Finally, then by verification function, this locality called to the rreturn value of tested function and expected that rreturn value contrasts, with check test result, whether meeting preset requirement.Wherein, baseline machine can be a set of environments, and the database of this environment and code are normal, and acquiescence is correct.
If S305 meets, test case is added to the set of steady testing use-case.
For example, when the rreturn value of the tested function of verification function verification is identical with the expectation rreturn value in verification function, when check test result meets preset requirement, can think that this test case is normal use, test case can be added to the set of steady testing use-case, to reuse.
S306, if do not met, adds test case test case set to be debugged.
For example, when the rreturn value of the tested function of verification function verification not identical with the expectation rreturn value in verification function, and check test result is not while meeting preset requirement, can think that this test case can not normally be used, also need it to debug, and this test case is added to test case set to be debugged.
The generation method of the test case of the embodiment of the present invention, can whether meet preset requirement by check test result, so that test case is managed, when meeting preset requirement, test case can be added to the set of steady testing use-case, when not meeting preset requirement, test case can be added to test case set to be debugged, reusable for stable test case, while using without next time, still need first it to be generated, improved work efficiency.
In order to realize above-described embodiment, the present invention also proposes a kind of generating apparatus of test case.
A generating apparatus for test case, comprising: acquisition module, and for obtaining input instruction and configuration file, wherein, input instruction comprises test-types parameter, configuration file comprises function information and the test parameter of module and category information, tested function; Test data constructing module, for determining test-types according to test-types parameter, and according to test-types and test parameter structure test data; And generation module, for default template being played up with generating test use case according to the function information of module and category information, tested function and test data.
Fig. 4 is the structural representation of the generating apparatus of test case according to an embodiment of the invention.
As shown in Figure 4, the generating apparatus of test case comprises: acquisition module 100, test data constructing module 200 and generation module 300.
Particularly, acquisition module 100 is for obtaining input instruction and configuration file, and wherein, input instruction comprises test-types parameter, and configuration file comprises function information and the test parameter of module and category information, tested function.For example, when user or tester are before use test framework or testing tool generating test use case, acquisition module 100 can first require the instructions such as user or tester's input test type parameter, wherein, test-types parameter can be understood as user and specifies the test case that need to generate which kind of type, for example, after the test-types parameter of acquisition module 100 in getting input instruction, judge this test-types parameter, different test-types parameter representatives generate dissimilar test case, enter different logic branches, as, test-types parameter is " v ", representative generates regression test case, test-types parameter is " m ", represent generation unit test case etc.
In addition, acquisition module 100 also can require user or tester to fill in configuration file, configuration file can be a file, can fill in module and category information (as module name by user or tester, class name), the function information of tested function is (as function name, function parameter, the number of function parameter), test parameter (function parameter value as corresponding in function parameter) etc., wherein, different function parameters can divide and represent with different name region, if the number of function parameter is 2, available parm1, parm2 represents, the different values of same function parameter can CSV, acquisition module 100 is after getting configuration file, can from configuration file, read in function parameter, the function parameter value that function parameter is corresponding, and by function parameter, the function parameter value that function parameter is corresponding saves as array and is used for follow up scan and play up test case.
Test data constructing module 200 is for determining test-types according to test-types parameter, and according to test-types and test parameter structure test data.More specifically, after getting input instruction, test data constructing module 200 can judge the test-types parameter in input instruction, can determine corresponding test-types according to different test-types parameters, for example, test-types parameter is " v ", can determine that test-types is regression test, test-types parameter is " m ", can determine that test-types is unit testing, and according to corresponding test-types and test parameter structure test data.For example, obtain the function parameter number of the tested function in configuration file, many groups value of each function parameter, many groups value of all function parameters and function parameter is done to independent assortment, get at random first predetermined group (as 4 groups) non-idle pattern, as predetermined group of (as 4 groups) test data, as, tested function has 2 function parameter: parm1, parm2, 2 groups of values of each function parameter are parm1:1, 2, parm2:a, b, after independent assortment, be: (1, a), (1, b), (2, a), (2, b), can be using these non-idle patterns as 4 groups of test datas.Thus, can ensure the randomness of test data, with the robustness of dissimilar test data test procedure.
Generation module 300 is for playing up with generating test use case default template according to the function information of module and category information, tested function and test data.Wherein, default template can be the template file in PHP programming, default template can define in advance, for example, define in advance the pattern of template, the variable name of each position etc., in addition, default template can comprise fixing information (as module path, class name etc.) and/or the variable that need to obtain (function parameter value as corresponding in the parameter of the number of parameters of tested function name, tested function place class name, tested function and parameter name, tested function, tested function place file path etc.).More specifically, generation module 300 can be processed class by template according to the function information of module and category information, tested function and test data default template is played up, template parameter, template file are set, present template and by result writing in files with generating test use case.For example, in default template file, there is individual field " $ CLASS ", first generation module 300 can be assigned to tested function " MyTest " " $ CLASS ", then by the template processing class PHPUnit_Util_Template calling in PHP UNIT, play up, afterwards " $ CLASS " replaced with to " MyTest ", because some fixed part in default template defines in advance, so only the part of needs conversion need be defined as to variable, when playing up at every turn, all variate-value directly can be filled into and can generate the test case corresponding with tested function " MyTest " like this.
The generating apparatus of the test case of the embodiment of the present invention, by test data constructing module, according to test-types parameter, determine test-types, and according to test-types and test parameter structure test data, generation module is played up default template according to the function information of template and category information, tested function and test data, thus generating test use case.The embodiment of the present invention at least has the following advantages: (1), without the test case of the tested function of manual compiling, has been realized the automatic generation of function test case, thereby improved testing efficiency; (2) without manual structure test data, reduce the maintenance cost of test case, and combined test data freely, ensured the randomness of test data; (3) according to test-types parameter, determine test-types, realized the test mode of supporting number of different types, make the test mode variation of supporting.
Fig. 5 is the structural representation of the generating apparatus of the test case of a specific embodiment according to the present invention.
As shown in Figure 5, the generating apparatus of test case comprises: acquisition module 100, test data constructing module 200, generation module 300, function body acquisition module 400, call relation excavate module 500 and interception module 600.
Particularly, function body acquisition module 400 is for scanning to obtain the function body of tested function according to module and category information to corresponding module and class.More specifically, function body acquisition module 400 can scan whole class according to the module in configuration file and category information (as module name, class name) under corresponding module path, the function name of the tested function obtaining from configuration file according to matching regular expressions, to find the function body of this tested function.
Call relation excavates the function that module 500 is called to obtain tested function for excavate the function calling relationship of tested function according to the function body of tested function.More specifically, call relation excavation module 500 can decompose to obtain to the function body of tested function the function calling relationship of tested function.In an embodiment of the present invention, function calling relationship can comprise the every other function calling in tested function, and this call relation is called during for tested function operation with the form storage of array.
Interception module 600 intercepts for the function that tested function is called, so that when tested function operation, the function calling by tested function returns to preset value to tested function.Wherein, preset value can be the rreturn value of called function.
In one embodiment of the invention, interception module 600 specifically for: the function that tested function is called carries out rename, and the title of the function calling according to tested function sets up new function, wherein, new function returns to preset value when tested function call.More specifically, at call relation, excavating module 500 excavates in the process of function calling relationship of tested function, interception module 600 can obtain class and the tested function of all users or programming personnel's definition, and function and the class that can to tested function, call by Runkit storehouse are carried out rename.By original function name/method name, re-establish new function/method more afterwards, again function body corresponding to original function added in new function, like this when PHP script starts to carry out, can call this " hook ", by the method for all classes or function all " hook " one time, can forge function intermediate data and process like this, for the generation of test case provides advantage, avoid other functions to cause error to tested function.Wherein, the definition of any class and function can be supported to revise dynamically in Runkit storehouse.
For example, in tested function test, function f unca and funcb have been called, because the processing logic of these two functions is unknown for tested function, and input and output are also not predictable, so need these two functions of simulation, do not allow these two functions play a role, what guarantee like this to test in test process is the logic of tested function, ensures the accuracy of test.
The generating apparatus of the test case of the embodiment of the present invention, by call relation, excavate module and excavate the function that the function calling relationship of tested function is called to obtain tested function, the function that interception module calls tested function intercepts, so that when tested function operation, the function calling by tested function returns to preset value to tested function, by simulating these invoked functions, give fixing rreturn value to these invoked functions, avoided the error that other functions cause tested function in test process.
Fig. 6 is the structural representation of the generating apparatus of the test case of another specific embodiment according to the present invention.
As shown in Figure 6, the generating apparatus of test case comprises: acquisition module 100, test data constructing module 200, generation module 300, function body acquisition module 400, call relation excavation module 500, interception module 600, absolute path are obtained submodule 410 and scanning submodule 420.Wherein, function body acquisition module 400 comprises: absolute path is obtained submodule 410 and scanning submodule 420.
Particularly, absolute path is obtained submodule 410 for obtain the absolute path of class place file under tested function according to module and category information.More specifically, absolute path obtain submodule 410 can be from configuration file acquisition module and category information (as module name, class name), and according to module and category information (as module name, class name), be combined into the absolute path of such place file.
Scanning submodule 420 carries out entire scan to obtain the function body of tested function for the file that absolute path is obtained to submodule 410 and got.More specifically, scanning submodule 420 can obtain the absolute path that submodule 410 obtains according to absolute path class place file is carried out to entire scan, if find that there is the function name of tested function in configuration file, obtain all the elements of this tested function, for example, the function names that the function body of this tested function, function parameter, function parameter number, this tested function call etc., so that obtain the function calling relationship of tested function according to all the elements of this tested function.
The generating apparatus of the test case of the embodiment of the present invention, obtains to absolute path the file that submodule gets by scanning submodule and carries out entire scan to obtain the function body of tested function, improved tested function function body obtain accuracy.
Fig. 7 is the structural representation of the generating apparatus of the test case of another specific embodiment according to the present invention.
As shown in Figure 7, the generating apparatus of test case comprises: acquisition module 100, test data constructing module 200, generation module 300, function body acquisition module 400, call relation excavation module 500, interception module 600, absolute path are obtained submodule 410, scanning submodule 420, decomposition submodule 510 and call relation and obtained submodule 520.Wherein, function body acquisition module 400 comprises: absolute path is obtained submodule 410 and scanning submodule 420, and call relation excavates module 500 and comprises: decompose submodule 510 and call relation and obtain submodule 520.
Particularly, decompose submodule 510 for the function body of tested function is decomposed with generating solution parser code name.More specifically, decompose function body that submodule 510 can obtain whole tested function as code snippet, by resolver code name function (as function Token_get_all (); ) resolve into resolver code name.Wherein, resolver code name function can become character or character string one by one by code analysis, and for example, " { " can be resolved the begin symbol that device code name function resolves to a function, and the part below notifying program is all in this function body.
Call relation obtains submodule 520 for obtaining the call relation between class and tested function, the function being called to obtain tested function according to resolver code name by reflex mechanism class Reflection.More specifically, call relation obtains submodule 520 can successively obtain the call relation between class and tested function by reflex mechanism class Reflection according to resolver code name, thereby obtains the function that tested function calls.
The generating apparatus of the test case of the embodiment of the present invention, by call relation, obtain submodule and by reflex mechanism class Reflection, obtain the call relation between class and tested function according to resolver code name, the function being called to obtain tested function, has improved the accuracy of obtaining of function that tested function calls.
Fig. 8 is the structural representation of the generating apparatus of the test case of another specific embodiment again according to the present invention.
As shown in Figure 8, the generating apparatus of test case comprises: acquisition module 100, test data constructing module 200, generation module 300, function body acquisition module 400, call relation excavation module 500, interception module 600, administration module 700, absolute path are obtained submodule 410, scanning submodule 420, decomposition submodule 510 and call relation and obtained submodule 520.Wherein, function body acquisition module 400 comprises: absolute path is obtained submodule 410 and scanning submodule 420, and call relation excavates module 500 and comprises: decompose submodule 510 and call relation and obtain submodule 520.
Particularly, administration module 700 is for loading test case so that tested function is tested, and according to test result, test case managed.More specifically, after generation module 300 is played up with generating test use case according to the function information of module and category information, tested function and test data to default template, administration module 700 can load test case so that tested function is tested.For example, when determining that according to test-types parameter test-types is unit testing type, can generation unit test case, load this unit testing use-case so that tested function is carried out to unit testing, when determining that according to test-types parameter test-types is regression test type, can generate regression test case, load this regression test case so that tested function is carried out to regression test.Afterwards, then according to test result, test case is managed, as, when test is passed through, test case can be collected to reuse, obstructed out-of-date when test, can debug test case.
The generating apparatus of the test case of the embodiment of the present invention, by administration module, load test case so that tested function is tested, and according to test result, test case is managed, when test is passed through, test case can be collected to reuse, obstructed out-of-date when test, can debug test case, by the automatic management function of test case, reduced artificial concern cost.
Fig. 9 is the structural representation of the generating apparatus of the test case of another specific embodiment according to the present invention.
As shown in Figure 9, the generating apparatus of test case comprises: acquisition module 100, test data constructing module 200, generation module 300, function body acquisition module 400, call relation excavate that module 500, interception module 600, administration module 700, absolute path are obtained submodule 410, scanning submodule 420, decomposed submodule 510, call relation obtains submodule 520, check submodule 710 and adds submodule 720.Wherein, function body acquisition module 400 comprises: absolute path is obtained submodule 410 and scanning submodule 420, call relation excavates module 500 and comprises: decompose submodule 510 and call relation and obtain submodule 520, administration module 700 comprises: check submodule 710 and add submodule 720.
Particularly, whether check submodule 710 meets preset requirement for verification test result.Wherein, the rreturn value that preset requirement can be regarded as in test result is identical with the expectation rreturn value in verification function.
For example, when the test case generating is unit testing use-case, when loading unit test case is carried out unit testing to tested function, first check submodule 710 can import respectively predetermined group of (as 4 groups) test data into tested function, call tested function, obtain respectively predetermined group of corresponding (4 groups) rreturn value, afterwards, expectation rreturn value in this rreturn value and verification function can be contrasted, with check test result, whether meet preset requirement.Wherein, the expectation rreturn value in verification function can be a group of filling in advance and expects the rreturn value of tested function.
And for example, when the test case generating is regression test case, when loading regression test case carries out regression test to tested function, first check submodule 710 revises local data base configuration, can change the database connecting in tested function into be connected to baseline machine database, to keep the consistance of data.Afterwards, in this locality, call tested function, can import respectively predetermined group of (as 4 groups) test data into tested function, to obtain respectively predetermined group of corresponding (4 groups) rreturn value, at baseline machine, call the tested function in baseline machine simultaneously, and will be scheduled to group as 4 groups) test data imports respectively this tested function into, and the rreturn value of this tested function is back in verification function, using as expecting rreturn value.Finally, then by verification function, this locality called to the rreturn value of tested function and expected that rreturn value contrasts, with check test result, whether meeting preset requirement.Wherein, baseline machine can be a set of environments, and the database of this environment and code are normal, and acquiescence is correct.
Add submodule 720 for when check submodule 710 verification test result meet preset requirement, test case is added to the set of steady testing use-case.For example, when detection sub-module 710 verification test result meet preset requirement, can think that this test case is normal use, adds submodule 720 test case can be added to the set of steady testing use-case, to reuse.
In one embodiment of the invention, add submodule 720 also for when check submodule 710 verification test result do not meet preset requirement, test case is added to test case set to be debugged.For example, when check submodule 710 verification test result do not meet preset requirement, can think that this test case can not normally be used, also need it to debug, add submodule 720 that this test case is added to test case set to be debugged.Thus, tester knows which test case can not be used very easily, also needs it to debug, and increases work efficiency.
The generating apparatus of the test case of the embodiment of the present invention, by check submodule verification test result, whether meet preset requirement, so that test case is managed, when meeting preset requirement, add submodule test case can be added to the set of steady testing use-case, when not meeting preset requirement, add submodule test case can be added to test case set to be debugged, reusable for stable test case, while using without next time, still need first it to be generated, improved work efficiency.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, a plurality of steps or method can realize with being stored in storer and by software or the firmware of suitable instruction execution system execution.For example, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: have for data-signal being realized to the discrete logic of the logic gates of logic function, the special IC with suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, the schematic statement of above-mentioned term is not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or feature can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, those having ordinary skill in the art will appreciate that: in the situation that not departing from principle of the present invention and aim, can carry out multiple variation, modification, replacement and modification to these embodiment, scope of the present invention is limited by claim and equivalent thereof.

Claims (14)

1. a generation method for test case, is characterized in that, comprises the following steps:
Obtain input instruction and configuration file, wherein, described input instruction comprises test-types parameter, and described configuration file comprises function information and the test parameter of module and category information, tested function;
According to described test-types parameter, determine test-types, and according to described test-types and described test parameter structure test data; And
According to the function information of described module and category information, tested function and described test data, default template is played up with generating test use case.
2. method according to claim 1, is characterized in that, also comprises:
According to described module and category information, corresponding module and class are scanned to obtain the function body of described tested function;
The function being called to obtain described tested function according to the function calling relationship of the described tested function of function body excavation of described tested function; And
The function that described tested function is called intercepts, so that when described tested function operation, the function calling by described tested function returns to preset value to described tested function.
3. method according to claim 2, is characterized in that, the described function that tested function is called intercepts further and comprises:
The function that described tested function is called carries out rename, and the title of the function calling according to described tested function sets up new function, and wherein, described new function returns to described preset value when described tested function call.
4. method according to claim 2, is characterized in that, the described function body that corresponding module and class is scanned to obtain described tested function according to module and category information further comprises:
According to described module and category information, obtain the absolute path of class place file under described tested function, and described file is carried out to entire scan to obtain the function body of described tested function.
5. method according to claim 2, is characterized in that, the function calling relationship that the described function body according to tested function excavates described tested function further comprises with the function that obtains described tested function and called:
The function body of described tested function is decomposed with generating solution parser code name, and by reflex mechanism class Reflection, obtain the call relation between described class and tested function, the function being called to obtain described tested function according to described resolver code name.
6. method according to claim 1, is characterized in that, described according to the function information of module and category information, tested function and described test data, to default template, play up with generating test use case after, also comprise:
Load described test case so that tested function is tested, and according to test result, described test case is managed.
7. method according to claim 6, is characterized in that, describedly according to test result, described test case is managed specifically and is comprised:
Check described test result whether to meet preset requirement;
If meet, described test case added to the set of steady testing use-case;
If do not meet, described test case added to test case set to be debugged.
8. a generating apparatus for test case, is characterized in that, comprising:
Acquisition module, for obtaining input instruction and configuration file, wherein, described input instruction comprises test-types parameter, described configuration file comprises function information and the test parameter of module and category information, tested function;
Test data constructing module, for determining test-types according to described test-types parameter, and according to described test-types and described test parameter structure test data; And
Generation module, for playing up with generating test use case default template according to the function information of described module and category information, tested function and described test data.
9. device according to claim 8, is characterized in that, also comprises:
Function body acquisition module, for scanning to obtain the function body of described tested function according to described module and category information to corresponding module and class;
Call relation excavates module, the function being called to obtain described tested function for excavate the function calling relationship of described tested function according to the function body of described tested function; And
Interception module, intercepts for the function that described tested function is called, so that when described tested function operation, the function calling by described tested function returns to preset value to described tested function.
10. device according to claim 9, it is characterized in that, described interception module specifically for: the function that described tested function is called carries out rename, and the title of the function calling according to described tested function is set up new function, wherein, described new function returns to described preset value when described tested function call.
11. devices according to claim 9, is characterized in that, described function body acquisition module comprises:
Absolute path is obtained submodule, for obtain the absolute path of class place file under described tested function according to described module and category information; And
Scanning submodule, carries out entire scan to obtain the function body of described tested function for described absolute path being obtained to the described file that submodule gets.
12. devices according to claim 9, is characterized in that, described call relation excavates module and comprises:
Decompose submodule, for the function body of described tested function being decomposed with generating solution parser code name; And
Call relation obtains submodule, for obtaining the call relation between described class and tested function, the function being called to obtain described tested function according to described resolver code name by reflex mechanism class Reflection.
13. devices according to claim 8, is characterized in that, also comprise:
Administration module, for loading described test case so that tested function is tested, and manages described test case according to test result.
14. devices according to claim 13, is characterized in that, described administration module comprises:
Check submodule, for checking described test result whether to meet preset requirement;
Add submodule, for when described check submodule checks described test result to meet preset requirement, described test case is added to the set of steady testing use-case; Wherein,
The described submodule that adds, also for when described check submodule checks described test result not meet preset requirement, adds test case set to be debugged by described test case.
CN201310713450.0A 2013-12-20 2013-12-20 The generation method and apparatus of test case Active CN103631720B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310713450.0A CN103631720B (en) 2013-12-20 2013-12-20 The generation method and apparatus of test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310713450.0A CN103631720B (en) 2013-12-20 2013-12-20 The generation method and apparatus of test case

Publications (2)

Publication Number Publication Date
CN103631720A true CN103631720A (en) 2014-03-12
CN103631720B CN103631720B (en) 2016-08-17

Family

ID=50212804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310713450.0A Active CN103631720B (en) 2013-12-20 2013-12-20 The generation method and apparatus of test case

Country Status (1)

Country Link
CN (1) CN103631720B (en)

Cited By (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104035872A (en) * 2014-06-27 2014-09-10 浪潮(北京)电子信息产业有限公司 Method and device for testing clustering software
CN104268078A (en) * 2014-09-23 2015-01-07 北京控制工程研究所 Automatic chip validation method based on parameterized IP test case set
CN104407973A (en) * 2014-11-25 2015-03-11 珠海格力电器股份有限公司 Automatic unit test realizing method and device
CN104915221A (en) * 2014-03-14 2015-09-16 深圳市鑫龙上通讯科技有限公司 Driving method for driving mobile phone
CN105468514A (en) * 2015-01-29 2016-04-06 深圳Tcl数字技术有限公司 Data combination based test method and apparatus
CN105608009A (en) * 2015-12-30 2016-05-25 合肥东芯通信股份有限公司 GUI tool and method for generating random test cases based on MATLAB
CN106126411A (en) * 2016-06-13 2016-11-16 广州酷狗计算机科技有限公司 A kind of method and apparatus that tested program code is tested
CN106294138A (en) * 2016-07-29 2017-01-04 东软集团股份有限公司 Method for generating test case and device
CN106354634A (en) * 2016-08-25 2017-01-25 青岛海信传媒网络技术有限公司 Interface testing method and device
CN106407105A (en) * 2016-08-26 2017-02-15 上海合福信息科技有限公司 Test design book generation method
CN107153615A (en) * 2017-05-19 2017-09-12 千寻位置网络有限公司 The method and system of software test, service terminal
CN107341102A (en) * 2017-06-12 2017-11-10 北京奇安信科技有限公司 A kind of test case file generation method and device
CN107480055A (en) * 2017-07-26 2017-12-15 网易(杭州)网络有限公司 Method of testing, device, calculate readable storage medium storing program for executing and computing device
CN108228965A (en) * 2017-12-06 2018-06-29 北京物芯科技有限责任公司 A kind of emulation verification method of storage unit, device and equipment
CN108241607A (en) * 2018-01-22 2018-07-03 中国平安人寿保险股份有限公司 Automatically imported method, server and the storage medium of test of heuristics case
CN108334443A (en) * 2017-12-22 2018-07-27 海尔优家智能科技(北京)有限公司 Generate method, apparatus, equipment and the computer readable storage medium of test case
CN108572911A (en) * 2017-03-14 2018-09-25 北京京东尚科信息技术有限公司 Automate safety detecting method, device, electronic equipment and readable storage medium storing program for executing
CN108874678A (en) * 2018-06-28 2018-11-23 北京顺丰同城科技有限公司 A kind of automatic test approach and device of intelligent program
CN109783287A (en) * 2018-12-28 2019-05-21 北京五维星宇科技有限公司 Test instruction generation method, system, terminal and medium based on configuration file
CN109800119A (en) * 2018-12-25 2019-05-24 深圳市元征科技股份有限公司 A kind of product function test method and device
CN109857671A (en) * 2019-02-15 2019-06-07 广州视源电子科技股份有限公司 Generation method, device, server and the storage medium of test case
CN109901059A (en) * 2019-01-29 2019-06-18 航天科工防御技术研究试验中心 A kind of Complex Programmable Logic Devices repeats configuration test method and electronic equipment
CN110046086A (en) * 2018-12-20 2019-07-23 阿里巴巴集团控股有限公司 Expected data generation method and device and electronic equipment for test
CN110109842A (en) * 2019-06-18 2019-08-09 网易(杭州)网络有限公司 The method and device of test number system
CN110162463A (en) * 2019-04-19 2019-08-23 平安普惠企业管理有限公司 Method for testing software, device and electronic equipment based on automated test tool
CN110221956A (en) * 2018-03-02 2019-09-10 富士通株式会社 Method and apparatus for generating the test case of block chain intelligence contract
CN110348127A (en) * 2019-07-12 2019-10-18 北京物芯科技有限责任公司 A kind of generation method of test case, device, equipment and storage medium
CN110471830A (en) * 2018-05-10 2019-11-19 武汉斗鱼网络科技有限公司 A kind of program testing method, device and electronic equipment
CN110750442A (en) * 2019-09-06 2020-02-04 平安医疗健康管理股份有限公司 Test case generation method, device, equipment and storage medium
CN110781090A (en) * 2019-10-31 2020-02-11 北京东软望海科技有限公司 Control method and device for data processing test, computer equipment and storage medium
CN111930617A (en) * 2020-07-31 2020-11-13 中国工商银行股份有限公司 Automatic testing method and device based on data objectification
CN112256595A (en) * 2020-12-22 2021-01-22 成都新希望金融信息有限公司 Heterogeneous system testing method and device and electronic equipment
CN112328226A (en) * 2020-09-17 2021-02-05 北京中数科技术有限公司 Embedded system automatic test code generation method and device
CN113190439A (en) * 2021-04-22 2021-07-30 北京百度网讯科技有限公司 Test case execution method and device and electronic equipment
CN113535265A (en) * 2021-07-15 2021-10-22 中国第一汽车股份有限公司 Service data generation method and device, electronic equipment and storage medium
CN113836038A (en) * 2021-10-21 2021-12-24 中国平安人寿保险股份有限公司 Test data construction method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622294A (en) * 2011-01-28 2012-08-01 国际商业机器公司 Method and method for generating test cases for different test types
CN103186457A (en) * 2011-12-29 2013-07-03 阿里巴巴集团控股有限公司 Method and device for automatically generating test case
CN103235759A (en) * 2013-05-15 2013-08-07 百度在线网络技术(北京)有限公司 Method and device for generating test cases
CN103268285A (en) * 2013-05-31 2013-08-28 百度在线网络技术(北京)有限公司 Method and device for automatic generation of robustness test case of API interface
US20130263089A1 (en) * 2012-03-30 2013-10-03 NIIT Technologies Ltd Generating test cases for functional testing of a software application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622294A (en) * 2011-01-28 2012-08-01 国际商业机器公司 Method and method for generating test cases for different test types
CN103186457A (en) * 2011-12-29 2013-07-03 阿里巴巴集团控股有限公司 Method and device for automatically generating test case
US20130263089A1 (en) * 2012-03-30 2013-10-03 NIIT Technologies Ltd Generating test cases for functional testing of a software application
CN103235759A (en) * 2013-05-15 2013-08-07 百度在线网络技术(北京)有限公司 Method and device for generating test cases
CN103268285A (en) * 2013-05-31 2013-08-28 百度在线网络技术(北京)有限公司 Method and device for automatic generation of robustness test case of API interface

Cited By (54)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915221A (en) * 2014-03-14 2015-09-16 深圳市鑫龙上通讯科技有限公司 Driving method for driving mobile phone
CN104035872B (en) * 2014-06-27 2017-01-11 浪潮(北京)电子信息产业有限公司 Method and device for testing clustering software
CN104035872A (en) * 2014-06-27 2014-09-10 浪潮(北京)电子信息产业有限公司 Method and device for testing clustering software
CN104268078A (en) * 2014-09-23 2015-01-07 北京控制工程研究所 Automatic chip validation method based on parameterized IP test case set
CN104268078B (en) * 2014-09-23 2017-03-15 北京控制工程研究所 A kind of chip automatic verification method based on parametrization IP test case set
CN104407973A (en) * 2014-11-25 2015-03-11 珠海格力电器股份有限公司 Automatic unit test realizing method and device
CN104407973B (en) * 2014-11-25 2018-04-06 珠海格力电器股份有限公司 A kind of implementation method and device of automation cell test
CN105468514B (en) * 2015-01-29 2019-04-16 深圳Tcl数字技术有限公司 Test method and device based on data combination
CN105468514A (en) * 2015-01-29 2016-04-06 深圳Tcl数字技术有限公司 Data combination based test method and apparatus
CN105608009B (en) * 2015-12-30 2018-06-26 合肥东芯通信股份有限公司 The gui tool and method of random test use-case are generated based on MATLAB
CN105608009A (en) * 2015-12-30 2016-05-25 合肥东芯通信股份有限公司 GUI tool and method for generating random test cases based on MATLAB
CN106126411B (en) * 2016-06-13 2019-01-01 广州酷狗计算机科技有限公司 The method and apparatus that a kind of pair of tested program code is tested
CN106126411A (en) * 2016-06-13 2016-11-16 广州酷狗计算机科技有限公司 A kind of method and apparatus that tested program code is tested
CN106294138A (en) * 2016-07-29 2017-01-04 东软集团股份有限公司 Method for generating test case and device
CN106354634A (en) * 2016-08-25 2017-01-25 青岛海信传媒网络技术有限公司 Interface testing method and device
CN106407105A (en) * 2016-08-26 2017-02-15 上海合福信息科技有限公司 Test design book generation method
CN106407105B (en) * 2016-08-26 2019-02-01 上海合福信息科技有限公司 A kind of test design sheets generation method
CN108572911A (en) * 2017-03-14 2018-09-25 北京京东尚科信息技术有限公司 Automate safety detecting method, device, electronic equipment and readable storage medium storing program for executing
CN107153615A (en) * 2017-05-19 2017-09-12 千寻位置网络有限公司 The method and system of software test, service terminal
CN107341102A (en) * 2017-06-12 2017-11-10 北京奇安信科技有限公司 A kind of test case file generation method and device
CN107341102B (en) * 2017-06-12 2020-07-14 奇安信科技集团股份有限公司 Test case file generation method and device
CN107480055A (en) * 2017-07-26 2017-12-15 网易(杭州)网络有限公司 Method of testing, device, calculate readable storage medium storing program for executing and computing device
CN108228965B (en) * 2017-12-06 2022-01-11 北京物芯科技有限责任公司 Simulation verification method, device and equipment for memory cell
CN108228965A (en) * 2017-12-06 2018-06-29 北京物芯科技有限责任公司 A kind of emulation verification method of storage unit, device and equipment
CN108334443A (en) * 2017-12-22 2018-07-27 海尔优家智能科技(北京)有限公司 Generate method, apparatus, equipment and the computer readable storage medium of test case
CN108241607A (en) * 2018-01-22 2018-07-03 中国平安人寿保险股份有限公司 Automatically imported method, server and the storage medium of test of heuristics case
CN110221956A (en) * 2018-03-02 2019-09-10 富士通株式会社 Method and apparatus for generating the test case of block chain intelligence contract
CN110471830A (en) * 2018-05-10 2019-11-19 武汉斗鱼网络科技有限公司 A kind of program testing method, device and electronic equipment
CN110471830B (en) * 2018-05-10 2022-06-21 武汉斗鱼网络科技有限公司 Program testing method and device and electronic equipment
CN108874678A (en) * 2018-06-28 2018-11-23 北京顺丰同城科技有限公司 A kind of automatic test approach and device of intelligent program
CN108874678B (en) * 2018-06-28 2021-12-07 北京顺丰同城科技有限公司 Automatic testing method and device for intelligent program
CN110046086A (en) * 2018-12-20 2019-07-23 阿里巴巴集团控股有限公司 Expected data generation method and device and electronic equipment for test
CN109800119A (en) * 2018-12-25 2019-05-24 深圳市元征科技股份有限公司 A kind of product function test method and device
CN109783287A (en) * 2018-12-28 2019-05-21 北京五维星宇科技有限公司 Test instruction generation method, system, terminal and medium based on configuration file
CN109783287B (en) * 2018-12-28 2022-09-13 北京五维星宇科技有限公司 Test instruction generation method, system, terminal and medium based on configuration file
CN109901059A (en) * 2019-01-29 2019-06-18 航天科工防御技术研究试验中心 A kind of Complex Programmable Logic Devices repeats configuration test method and electronic equipment
CN109857671A (en) * 2019-02-15 2019-06-07 广州视源电子科技股份有限公司 Generation method, device, server and the storage medium of test case
CN110162463A (en) * 2019-04-19 2019-08-23 平安普惠企业管理有限公司 Method for testing software, device and electronic equipment based on automated test tool
CN110109842A (en) * 2019-06-18 2019-08-09 网易(杭州)网络有限公司 The method and device of test number system
CN110348127B (en) * 2019-07-12 2023-05-09 北京物芯科技有限责任公司 Method, device, equipment and storage medium for generating test cases
CN110348127A (en) * 2019-07-12 2019-10-18 北京物芯科技有限责任公司 A kind of generation method of test case, device, equipment and storage medium
CN110750442A (en) * 2019-09-06 2020-02-04 平安医疗健康管理股份有限公司 Test case generation method, device, equipment and storage medium
CN110781090B (en) * 2019-10-31 2023-09-12 望海康信(北京)科技股份公司 Control method and device for data processing test, computer equipment and storage medium
CN110781090A (en) * 2019-10-31 2020-02-11 北京东软望海科技有限公司 Control method and device for data processing test, computer equipment and storage medium
CN111930617B (en) * 2020-07-31 2023-08-25 中国工商银行股份有限公司 Automatic test method and device based on data objectification
CN111930617A (en) * 2020-07-31 2020-11-13 中国工商银行股份有限公司 Automatic testing method and device based on data objectification
CN112328226A (en) * 2020-09-17 2021-02-05 北京中数科技术有限公司 Embedded system automatic test code generation method and device
CN112328226B (en) * 2020-09-17 2022-03-04 北京中数科技术有限公司 Embedded system automatic test code generation method and device
CN112256595B (en) * 2020-12-22 2021-03-12 成都新希望金融信息有限公司 Heterogeneous system testing method and device and electronic equipment
CN112256595A (en) * 2020-12-22 2021-01-22 成都新希望金融信息有限公司 Heterogeneous system testing method and device and electronic equipment
CN113190439A (en) * 2021-04-22 2021-07-30 北京百度网讯科技有限公司 Test case execution method and device and electronic equipment
CN113190439B (en) * 2021-04-22 2024-03-22 北京百度网讯科技有限公司 Execution method and device of test case and electronic equipment
CN113535265A (en) * 2021-07-15 2021-10-22 中国第一汽车股份有限公司 Service data generation method and device, electronic equipment and storage medium
CN113836038A (en) * 2021-10-21 2021-12-24 中国平安人寿保险股份有限公司 Test data construction method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN103631720B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN103631720A (en) Method and device for generating test case
US11099820B2 (en) Reconfiguring application software into microservice architecture
CN107273286B (en) Scene automatic test platform and method for task application
CN103150249B (en) A kind of method and system of automatic test
CN103365770B (en) Mobile terminal software test macro and method for testing software
US7895575B2 (en) Apparatus and method for generating test driver
US10445225B2 (en) Command coverage analyzer
Humble et al. The deployment production line
CN106354638A (en) Automatic testing method and device based on lexical analysis
Wahler et al. CAST: Automating software tests for embedded systems
Rosiak et al. Custom-tailored clone detection for IEC 61131-3 programming languages
Sayagh et al. What should your run-time configuration framework do to help developers?
KR100994070B1 (en) A Reserved Component Container Based Software Development Method and Apparatus
Kua Unit Testing
Kerraoui et al. MATT: multi agents testing tool based nets within nets
CN110968342B (en) Version comparison method, device and system
Amo et al. A software modeling approach for the design and analysis of cooperative optimization systems
Oubelli et al. Test Cases Evolution of Mobile Applications
Sattar et al. Automated DD-path Testing and its Significance in SDLC Phases
Delcambre et al. Using task system templates to support process description and evolution
CN118113545A (en) Test monitoring method, device, computer equipment and computer readable storage medium
Gaur et al. How automated testing tools are showing its impact in the field of software testing
Lopata et al. Knowledge Subsystem’s Integration into MDA Based Forward and Reverse IS Engineering
Chen et al. An automatic coverage analysis for SystemC using UML and aspect-oriented technology
CN113868140A (en) Automatic testing method and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant