CN109933535A - Generation method, device and the server of test case - Google Patents
Generation method, device and the server of test case Download PDFInfo
- Publication number
- CN109933535A CN109933535A CN201910235245.5A CN201910235245A CN109933535A CN 109933535 A CN109933535 A CN 109933535A CN 201910235245 A CN201910235245 A CN 201910235245A CN 109933535 A CN109933535 A CN 109933535A
- Authority
- CN
- China
- Prior art keywords
- test
- parameter
- test case
- case
- service
- 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
Links
Abstract
The present invention provides a kind of generation method of test case, device and servers;Wherein, this method comprises: obtaining the testing requirement of business object to be tested;According to testing requirement, multiple test parameters are set;Wherein, each test parameter includes many kinds of parameters value;According to the corresponding many kinds of parameters value of each test parameter, a plurality of test case and the corresponding expected results of every test case are generated;It wherein, include at least one parameter value of each test parameter in every test case.In the present invention, while generating test case, corresponding expected results are generated, meet the testing requirement that white-box testing etc. needs test case expected results, to extend the test function of test case.
Description
Technical field
The present invention relates to the field of test technology, more particularly, to a kind of generation method of test case, device and server.
Background technique
Interface testing is usually applied in the development process to software systems, and main software system provides outside
The interactive interface of interface or internal system, to verify the correctness and stability of interface.Interface testing can be specifically divided into
A variety of test-types, for example, functional test, pressure test, performance test etc..Existing interface testing relies primarily on existing survey
Trial work tool is realized, such as pressure test tool Jmeter, load testing tool loadrunner of system action and performance etc..
It in interface test process, needs to use a large amount of test case, is carried out with the interface to software systems more complete
Face test;Test case usually generates machine by case and generates, such as AllPairs;Usually only have however, existing case generates machine
There is Test cases technology function, but can not know the corresponding expected results of each test case, causes test function limited.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of generation method of test case, device and server, to expand
Open up the test function of test case.
In a first aspect, the embodiment of the invention provides a kind of generation method of test case, this method comprises: obtaining to be measured
The testing requirement of the business object of examination;According to testing requirement, multiple test parameters are set;Wherein, each test parameter includes a variety of
Parameter value;According to the corresponding many kinds of parameters value of each test parameter, generates a plurality of test case and every test case is corresponding
Expected results;It wherein, include at least one parameter value of each test parameter in every test case.
In preferred embodiments of the present invention, above-mentioned testing requirement includes type of service and type of service to be tested
Corresponding test item and test granularity;The step of multiple test parameters are set according to testing requirement, comprising: according to test item
The test parameter of type of service is arranged in mesh;According to test granularity, the parameter value of each test parameter is set.
It is above-mentioned according to the corresponding many kinds of parameters value of each test parameter in preferred embodiments of the present invention, it generates a plurality of
The step of test case, comprising: permutation and combination processing is carried out to the corresponding many kinds of parameters value of each test parameter, obtains a plurality of survey
Example on probation.
It is above-mentioned according to the corresponding many kinds of parameters value of each test parameter in preferred embodiments of the present invention, generate every
The step of test case corresponding expected results, comprising: search the corresponding type of service of every test case and type of service
Business game;According in test case, the parameter value of each test parameter and the matching relationship of business game obtain test and use
The corresponding expected results of example.
In preferred embodiments of the present invention, the above method further include: test case is input to the correspondence of business object
It is tested in interface, obtains the test result of business object return;Test result and expected results are compared, surveyed
The check results of test result.
Second aspect, the embodiment of the invention provides a kind of generating means of test case, which includes: that demand obtains
Module, for obtaining the testing requirement of business object to be tested;Parameter setting module, it is multiple for being arranged according to testing requirement
Test parameter;Wherein, each test parameter includes many kinds of parameters value;Use-case generation module, for according to each test parameter pair
The many kinds of parameters value answered generates a plurality of test case and the corresponding expected results of every test case;Wherein, every test
It include at least one parameter value of each test parameter in use-case.
In preferred embodiments of the present invention, above-mentioned testing requirement includes type of service and type of service to be tested
Corresponding test item and test granularity;Parameter setting module is also used to: according to test item, the test of type of service is arranged
Parameter;According to test granularity, the parameter value of each test parameter is set.
In preferred embodiments of the present invention, above-mentioned use-case generation module is also used to: corresponding to each test parameter more
Kind parameter value carries out permutation and combination processing, obtains a plurality of test case.
In preferred embodiments of the present invention, above-mentioned use-case generation module is also used to: it is corresponding to search every test case
The business game of type of service and type of service;According in test case, the parameter value and business game of each test parameter
Matching relationship, obtain the corresponding expected results of test case.
In preferred embodiments of the present invention, above-mentioned apparatus further include: test module, for test case to be input to industry
It is engaged in being tested in the corresponding interface of object, obtains the test result of business object return;Contrast module is used for test result
It is compared with expected results, obtains the check results of test result.
The third aspect, the embodiment of the invention provides a kind of server, server includes memory and processor, storage
Device is used to store the program for supporting processor to execute above-mentioned first aspect the method, and processor is configurable for executing storage
The program stored in device.
Fourth aspect, the embodiment of the invention provides a kind of computer storage mediums, for being stored as above-mentioned second aspect
Computer software instructions used in described device.
The embodiment of the present invention bring it is following the utility model has the advantages that
Generation method, device and the server of test case provided in an embodiment of the present invention, obtain business pair to be tested
After the testing requirement of elephant, multiple test parameters are arranged according to the testing requirement;Further according to the corresponding a variety of ginsengs of each test parameter
Numerical value generates a plurality of test case and corresponding expected results;In which, while generating test case, generation pair
The expected results answered meet white-box testing etc. and need the testing requirement of test case expected results, to extend survey
The test function of example on probation.
Other features and advantages of the present invention will illustrate in the following description, alternatively, Partial Feature and advantage can be with
Deduce from specification or unambiguously determine, or by implementing above-mentioned technology of the invention it can be learnt that.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, better embodiment is cited below particularly, and match
Appended attached drawing is closed, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor
It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow chart of the generation method of test case provided in an embodiment of the present invention;
Fig. 2 is the flow chart of the generation method of another test case provided in an embodiment of the present invention;
Fig. 3 is the flow chart of the generation method of another test case provided in an embodiment of the present invention;
Fig. 4 is that the test case that the generation method provided in an embodiment of the present invention by above-mentioned test case generates is surveyed
The method flow diagram of examination;
Fig. 5 is a kind of structural schematic diagram of the generating means of test case provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of the generating means of another test case provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram of server 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 attached drawing to the present invention
Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
In interface test process, test case usually generates machine by case and generates, and case generates machine and is referred to as surveying
Example Auto-Generation Tool on probation;Case generates chance and generates test case according to the testing requirement of software systems, and a test is used
A kind of situation of example one interface of simulation, to obtain feedback data of the interface under the testing case;When software system
The test interface of system is more, or need to each test interface carry out in detail, comprehensively test when, case generate machine may need
Export the corresponding tens of thousands of test cases of the software systems.Case generates machine and passes through to the corresponding many kinds of parameters of each test parameter
Value carries out permutation and combination, obtains test case, but can not know the expected results of the corresponding interface of every test case, i.e.,
Expected feedback data;The expected feedback data is it is to be understood that after the test case is input to corresponding interface, if should
The working condition or performance of the interface of testing case are normal, then the above-mentioned expected feedback data of interface output.
It, may if before test, can not know the expected feedback data of the corresponding interface of every test case
It is difficult to meet the testing requirement of certain tests, such as white-box testing causes the test function of the test case generated limited.
Based on the above issues, the embodiment of the invention provides a kind of generation method of test case, device and servers;It should
Technology can be applied in the test process of storage system, application system or other software system, software program, carry out below
It specifically describes.
The embodiment of the present invention provides firstly a kind of generation method of test case, as shown in Figure 1, this method includes as follows
Step:
Step S102 obtains the testing requirement of business object to be tested;
The business object to be tested is usually software systems, software program etc.;The testing requirement of business object is usually wrapped
Including needs interface to be tested and each interface to need various situations to be tested.The testing requirement is usually by research and development business object
Engineer be arranged and submit;In actual implementation, interface can be submitted to obtain the testing requirement submitted by testing requirement;Tool
For body, which submits the file for receiving and can receive specified format, and the test of business object is recorded in this document
Demand;The testing requirement, which is submitted to receive, can be previously provided with table, text box of specified format etc., for inputting for engineer
The content of input after input, is saved as above-mentioned testing requirement by testing requirement.
Multiple test parameters are arranged according to testing requirement in step S104;Wherein, each test parameter includes many kinds of parameters
Value;
Above-mentioned test parameter is usually the various performance parameters of interface, and the function of interface is different, and specific test parameter is logical
It is often also different;By taking data memory interface as an example, the test parameter of data memory interface can be (general for uploading speed, upload mode
It is logical upload, piecemeal uploads, the breaking point uploading after suspension reconnection), data volume etc.;Many kinds of parameters can be set in each test parameter
Value can carry out value according to actual speed requirement with certain interval of values for example, for uploading speed, can also be with
Machine value takes a parameter value every 1M, obtains the parameter value of 200 uploading speeds such as since 1M;For uploading mode,
3 parameter values can be then taken, in such a way that above-mentioned three kinds of correspondence upload;For data volume, due to the data volume difference of different files
It is larger, then corresponding parameter value can be taken to a wide range, for example, carrying out value since 500M by interval of values of 1G, obtaining
To the parameter value of 100 data volumes.
Step S106 generates a plurality of test case and every survey according to the corresponding many kinds of parameters value of each test parameter
The corresponding expected results of example on probation;It wherein, include at least one parameter value of each test parameter in every test case.
During generating test case, change the parameter value of any one test parameter, that is, produce one it is new
Test case.One test case can only test an interface, and the test parameter in the test case can connect at this time for this
The various performance parameters of mouth.For example, test case is specifically as follows for above-mentioned data memory interface: uploading speed 20M,
Upload mode is piecemeal upload, data volume 20G;After the test case is input to data memory interface, which can be returned
The test result under the test case is returned, as can the data that can uploading speed realize, upload correctly save, data encryption
Safety etc..One test case can also relate to multiple interfaces, at this point, the parameter value of each test parameter of each interface is joined
With the generating process of test case.It can be seen from the above, after the corresponding expected results of test case are input to interface for test case,
The expected feedback data of the interface illustrates the interface when the feedback data of interface output is the expected feedback data
Performance is normal.
It, can audit by the testing case interface to data are uploaded for example, for above-mentioned data memory interface
Function;In actual implementation, in the business game of the interface include three permissions, respectively permission A, permission B and permission C, and
When one of permission judges that current data cannot upload, such as permission B, then the interface rejects the data;Use test
When use-case is tested, a plurality of test case can be used and simulate different types of data, and the business game according to the interface,
Obtain the corresponding expected feedback data of every test case, the expected feedback data can for " agreeing to receive the data " or
" rejection receives the data ".
The generation method of test case provided in an embodiment of the present invention obtains the testing requirement of business object to be tested
Afterwards, multiple test parameters are arranged according to the testing requirement;Further according to the corresponding many kinds of parameters value of each test parameter, generate a plurality of
Test case and corresponding expected results;In which, while generating test case, corresponding expected results are generated,
It meets white-box testing etc. and needs the testing requirement of test case expected results, to extend the test function of test case
Energy.
The embodiment of the invention also provides the generation method of another test case, this method method shown in above-mentioned Fig. 1
On the basis of realize.Above described embodiment describes the testing requirement of business object generally include to need interface to be tested and
Each interface needs various situations to be tested;In the present embodiment, the content of testing requirement is further refined, testing requirement tool
Body includes the corresponding test item of type of service and type of service and test granularity to be tested.
The type of business that above-mentioned type of service can be understood as the function of current interface to be tested or needs are completed, example
Such as, receive data, encryption data, save data etc.;In general, an interface may have multiple business type, multiple interfaces
It can have same type of service.The corresponding test item of above-mentioned type of service is usually associated with type of service, for example, business
Type is the interface for receiving data, and test item may include data transmission efficiency, data transmission correctness etc.;Type of service
For the interface of encryption data, test item generally comprises encryption efficiency, cryptographic security etc..Above-mentioned test granularity is understood that
For the fine degree of each test item test, usually test granularity is smaller, more comprehensive to the test of the test item accurate, when
Test case used in so is also more;It is bigger to test granularity, used test more coarse to the test of the test item
Use-case is fewer.
Based on above-mentioned testing requirement, the generation method of the test case in the present embodiment specifically comprises the following steps, such as Fig. 2
It is shown:
Step S202 obtains the testing requirement of business object to be tested;The testing requirement includes service class to be tested
Type and the corresponding test item of the type of service and test granularity;
The test parameter of type of service is arranged according to the test item in testing requirement in step S204;
The test parameter is it is to be understood that test item in order to realize interface, test case need the data class for including
Type;For example, type of service is the interface for receiving data, for " data transmission efficiency " this test item, which can
Think data format, data volume etc..
The parameter value of each test parameter is arranged according to the test granularity in testing requirement in step S206.
For example, the parameter value of the test parameter can be specific format, such as text lattice when test parameter is data format
Formula, picture format, video format or code etc.;When test parameter is data volume, the parameter value of the test parameter can be specific
Data volume size, such as 5,000,000,1,000,000,000,50G.
In actual implementation, the test item pass corresponding with test parameter in above-mentioned testing requirement can be pre-established
The corresponding relationship of system and the test granularity in testing requirement, test parameter and parameter value;Above-mentioned corresponding relationship can specifically lead to
The form for crossing table is realized, can also be realized by way of calculation formula, calculation code;After getting above-mentioned testing requirement,
The parameter value of test parameter and each test parameter can be searched or is calculated from above-mentioned corresponding relationship.
Step S208 generates a plurality of test case and every survey according to the corresponding many kinds of parameters value of each test parameter
The corresponding expected results of example on probation;It wherein, include at least one parameter value of each test parameter in every test case.
The generation method of above-mentioned test case, after the testing requirement for obtaining business object to be tested, according to testing requirement
In test item setting test parameter further according to the test granularity in testing requirement, the parameter value of each test parameter is set,
And then generate a plurality of test case and corresponding expected results;In which, test parameter is obtained by testing requirement first
With corresponding parameter value, necessary data are provided to generate test case and are supported, be conducive to be subsequently generated and meet testing requirement
Test case and corresponding expected results, meet the test that white-box testing etc. needs test case expected results
Demand, to extend the test function of test case.
The embodiment of the invention also provides the generation method of another test case, this method method shown in above-mentioned Fig. 2
On the basis of realize.In the present embodiment, the generation of test case and the corresponding expected results of test case is further described
Process, as shown in figure 3, this method comprises the following steps:
Step S302 obtains the testing requirement of business object to be tested;The testing requirement includes service class to be tested
Type and the corresponding test item of the type of service and test granularity;
The test parameter of type of service is arranged according to test item in step S304;According to test granularity, each survey is set
Try the parameter value of parameter.
Step S306 carries out permutation and combination processing to the corresponding many kinds of parameters value of each test parameter, obtains a plurality of test
Use-case.
It, can be right according to the constraint condition of the interface after many kinds of parameters value for each test parameter for obtaining interface
The parameter value of each test parameter carries out permutation and combination, and the result of each permutation and combination can be used as a test case.It is above-mentioned
Constraint condition would generally exclude the permutation and combination of a part as a result, for example, be the interface for receiving data for type of service, it is several
According to upload mode can for it is common upload, the breaking point uploading after piecemeal uploads and suspension reconnection;And it is therein a certain specific
Upload mode, may be only for the data volume of specified size;Under the limitation of not constraint condition, the result of above-mentioned permutation and combination
The usually product of the parameter value of above-mentioned each test parameter, such as parameter values of above-mentioned 200 uploading speeds, 3 kinds of upload modes,
In the case where the parameter value of 100 data volumes, the quantity of the result of permutation and combination is 60000, it can obtains 60000 tests
Use-case.Certainly, above-mentioned test case can also relate to multiple interfaces, at this point it is possible to make the ginseng of each test parameter of each interface
Numerical value both participates in permutation and combination.
Step S308 searches the corresponding type of service of every test case and the business game of the type of service;
By above-mentioned steps it is found that test case is obtained by the parameter value permutation and combination of each test parameter, and test is set
Test item based on parameter is corresponding with type of service, and therefore, the corresponding type of service of test case can pass through parameter value
The corresponding test item of corresponding test parameter, test parameter searches to obtain.The business game of type of service can be understood as reality
Now specific means required for the type of service.For example, type of service is the interface of Information Security audit, the business of the interface
Multiple audit conditions specifically can be set in strategy, and when interface is to data, which is done with each audit condition one by one
It compares, comparison result usually " matches " and " mismatch ";It usually also include judgment condition in the business game, to determine the number
According to whether meeting above-mentioned business game;For example, multiple comparison results are generated after above-mentioned data and each audit condition compare, it should
Judgment condition can be set to, and when all comparison results are " matching ", determine the industry of the data fit present type of service
Business strategy, which may be arranged as, and comparison result be that the quantity of " matching " greater than comparison result is " mismatch "
Quantity determines the business game of the data fit present type of service.
Step S310, according in test case, the parameter value of each test parameter and the matching relationship of business game are obtained
The corresponding expected results of test case.
The process that every test case can simulate a kind of data and the data and interface interacts;It therefore, can be with
The corresponding business game of type of service of each interface is obtained in advance;Test case is matched with corresponding business game, it will
Matching result is as the corresponding expected results of test case.
The generation method of above-mentioned test case obtains the testing requirement and setting test ginseng of business object to be tested
After number, parameter value, by carrying out permutation and combination to the corresponding many kinds of parameters value of test parameter, a plurality of test case can be obtained;It is logical
It crosses in test case, the parameter value of each test parameter and the matching relationship of business game, available each test case is corresponding
Expected results, so that meeting white-box testing etc. needs the testing requirement of test case expected results, to extend survey
The test function of example on probation.
During carrying out white-box testing to business object by above-mentioned test case, tester needs to use by test
Example knows the operating status of each interface of business object and each interface;Pass through the pre- of above-mentioned test case and test case
Phase is as a result, can check whether the operating status of the interface of business object and expecting state are consistent, to reach white-box testing
Purpose;As shown in figure 4, being specifically comprised the following steps: by the process that above-mentioned test case is tested
Step S402, test case is input in the corresponding interface of business object and is tested, and is obtained business object and is returned
The test result returned;
In actual implementation, test case can be input to business by the test case receiving interface that business object is arranged
In object, test case automatic running in business object, the test result of return can be shown that the test case is relevant and connect
The operating status of mouth.
Step S404, test result and expected results are compared, and obtain the check results of test result.
Wherein, test result may indicate that the true operating status of interface relevant to test case, and expected results generation
The table feedback result of interface relevant to test case under normal operating conditions;The check results of above-mentioned test result can be with
Show the difference between test result and expected results;If test result and the difference of expected results are within a preset range, say
Bright relevant interface is in normal operating condition;And if the difference between test result and expected results has exceeded default model
It encloses, then illustrates that relevant interface is in abnormal operating condition, engineer is needed to repair these interfaces.
In aforesaid way, the relevant interface of business object can be tested by a plurality of test case;It is used by test
The corresponding expected results of example, can verify test result, obtain corresponding check results, which meets such as white
Box test etc. needs the testing requirement of test case expected results, to extend the test function of test case.
It should be noted that the embodiments are all described in a progressive manner for above-mentioned each method, each embodiment is stressed
Be the difference from other embodiments, the same or similar parts between the embodiments can be referred to each other.
Corresponding to above method embodiment, a kind of structural schematic diagram of the generating means of test case shown in Figure 5,
The device includes:
Demand obtains module 50, for obtaining the testing requirement of business object to be tested;
Parameter setting module 51, for multiple test parameters to be arranged according to testing requirement;Wherein, each test parameter includes
Many kinds of parameters value;
Use-case generation module 52, for generating a plurality of test case according to the corresponding many kinds of parameters value of each test parameter,
And the corresponding expected results of every test case;It wherein, include at least one of each test parameter in every test case
Parameter value.
The generating means of above-mentioned test case, after the testing requirement for obtaining business object to be tested, according to the test need
Seek the multiple test parameters of setting;Further according to the corresponding many kinds of parameters value of each test parameter, a plurality of test case and right is generated
The expected results answered;In which, while generating test case, corresponding expected results are generated, meet such as whitepack
Test etc. needs the testing requirement of test case expected results, to extend the test function of test case.
Further, above-mentioned testing requirement includes the corresponding test item of type of service and type of service to be tested
With test granularity;Above-mentioned parameter setup module is also used to: according to test item, the test parameter of type of service is arranged;According to survey
Granularity is tried, the parameter value of each test parameter is set.
Further, above-mentioned use-case generation module is also used to: being arranged the corresponding many kinds of parameters value of each test parameter
Column combined treatment obtains a plurality of test case.
Further, above-mentioned use-case generation module is also used to: searching the corresponding type of service of every test case, Yi Jiye
The business game of service type;According in test case, the parameter value of each test parameter and the matching relationship of business game are obtained
The corresponding expected results of test case.
The structural schematic diagram of the generating means of another test case shown in Figure 6, the device is shown in above-mentioned Fig. 5
It is realized on device basic, the device further include:
Test module 60, is tested for test case to be input in the corresponding interface of business object, obtains business
The test result that object returns;
Contrast module 61 obtains the check results of test result for comparing test result and expected results.
The technical effect of the generating means of test case provided by the embodiment of the present invention, realization principle and generation is with before
It is identical to state embodiment of the method, to briefly describe, Installation practice part does not refer to place, can refer to phase in preceding method embodiment
Answer content.
Present embodiments provide a kind of server corresponding to the above method embodiment.Fig. 7 is the structure of the server
Schematic diagram, as shown in fig. 7, the server includes processor 701 and memory 702;Wherein, memory 702 is for storing one
Or a plurality of computer instruction, one or more computer instruction are executed by processor, to realize the generation side of above-mentioned test case
Method.
Server shown in Fig. 7 further includes bus 703 and forwarding chip 704, processor 701, forwarding chip 704 and storage
Device 702 is connected by bus 703.The server can be network edge device.
Wherein, memory 702 may include high-speed random access memory (RAM, Random Access Memory),
It may further include non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.Bus
703 can be isa bus, pci bus or eisa bus etc..The bus can be divided into address bus, data/address bus, control always
Line etc..Only to be indicated with a four-headed arrow in Fig. 7, it is not intended that an only bus or a type of convenient for indicating
Bus.
Forwarding chip 704 is used to connect by network interface at least one user terminal and other network units, will seal
The IPv4 message or IPv6 message installed is sent to the user terminal by network interface.
Processor 701 may be a kind of IC chip, the processing capacity with signal.It is above-mentioned during realization
Each step of method can be completed by the integrated logic circuit of the hardware in processor 701 or the instruction of software form.On
The processor 701 stated can be general processor, including central processing unit (Central Processing Unit, abbreviation
CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital
Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific Integrated
Circuit, abbreviation ASIC), ready-made programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or
Person other programmable logic device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute sheet
Disclosed each method, step and logic diagram in inventive embodiments.General processor can be microprocessor or the processing
Device is also possible to any conventional processor etc..The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in
Hardware decoding processor executes completion, or in decoding processor hardware and software module combination execute completion.Software mould
Block can be located at random access memory, flash memory, read-only memory, programmable read only memory or electrically erasable programmable storage
In the storage medium of this fields such as device, register maturation.The storage medium is located at memory 702, and processor 701 reads memory
Information in 702, in conjunction with its hardware complete previous embodiment method the step of.
The embodiment of the invention also provides a kind of machine readable storage medium, which is stored with machine
Executable instruction, for the machine-executable instruction when being called and being executed by processor, machine-executable instruction promotes processor real
The generation method of existing above-mentioned test case, specific implementation can be found in embodiment of the method, and details are not described herein.
The technical effect and preceding method embodiment of server provided by the embodiment of the present invention, realization principle and generation
Identical, to briefly describe, Installation practice part does not refer to place, can refer to corresponding contents in preceding method embodiment.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through
Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing
Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product,
Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code
Part, a part of the module, section or code, which includes that one or more is for implementing the specified logical function, to be held
Row instruction.It should also be noted that function marked in the box can also be to be different from some implementations as replacement
The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes
It can execute in the opposite order, this depends on the function involved.It is also noted that every in block diagram and or flow chart
The combination of box in a box and block diagram and or flow chart can use the dedicated base for executing defined function or movement
It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
Finally, it should be noted that embodiment described above, only specific embodiments of the present invention, of the invention to illustrate
Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to the present invention
It is described in detail, those skilled in the art should understand that: anyone skilled in the art exists
The invention discloses technical scope in, can still modify to technical solution documented by previous embodiment or can be easily
Expect changing or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make phase
It answers the essence of technical solution to be detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection model of the invention
Within enclosing.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (12)
1. a kind of generation method of test case, which is characterized in that the described method includes:
Obtain the testing requirement of business object to be tested;
According to the testing requirement, multiple test parameters are set;Wherein, each test parameter includes many kinds of parameters value;
According to the corresponding a variety of parameter values of each test parameter, a plurality of test case and every survey are generated
The corresponding expected results of example on probation;Wherein, at least one ginseng in every test case comprising each test parameter
Numerical value.
2. the method according to claim 1, wherein the testing requirement include type of service to be tested, with
And the corresponding test item of the type of service and test granularity;
Described the step of multiple test parameters are arranged according to the testing requirement, comprising:
According to the test item, the test parameter of the type of service is set;
According to the test granularity, the parameter value of each test parameter is set.
3. the method according to claim 1, wherein described according to the corresponding a variety of institutes of each test parameter
The step of stating parameter value, generating a plurality of test case, comprising: to the corresponding a variety of parameter values of each test parameter into
The processing of row permutation and combination, obtains a plurality of test case.
4. according to the method described in claim 2, it is characterized in that, described according to the corresponding a variety of institutes of each test parameter
The step of stating parameter value, generating every test case corresponding expected results, comprising:
Search the business game of every corresponding type of service of test case and the type of service;
According in the test case, the matching relationship of the parameter value of each test parameter and the business game is obtained described
The corresponding expected results of test case.
5. the method according to claim 1, wherein the method also includes:
The test case is input in the corresponding interface of the business object and is tested, obtained the business object and return
Test result;
The test result and the expected results are compared, the check results of the test result are obtained.
6. a kind of generating means of test case, which is characterized in that described device includes:
Demand obtains module, for obtaining the testing requirement of business object to be tested;
Parameter setting module, for multiple test parameters to be arranged according to the testing requirement;Wherein, each test parameter packet
Include many kinds of parameters value;
Use-case generation module, for generating a plurality of test use according to the corresponding a variety of parameter values of each test parameter
Example and the corresponding expected results of every test case;It wherein, include each test in every test case
At least one parameter value of parameter.
7. device according to claim 6, which is characterized in that the testing requirement include type of service to be tested, with
And the corresponding test item of the type of service and test granularity;
The parameter setting module, is also used to: according to the test item, the test parameter of the type of service is arranged;According to
The parameter value of each test parameter is arranged in the test granularity.
8. device according to claim 6, which is characterized in that the use-case generation module is also used to: to each survey
It tries the corresponding a variety of parameter values of parameter and carries out permutation and combination processing, obtain a plurality of test case.
9. device according to claim 7, which is characterized in that the use-case generation module is also used to:
Search the business game of every corresponding type of service of test case and the type of service;
According in the test case, the matching relationship of the parameter value of each test parameter and the business game is obtained described
The corresponding expected results of test case.
10. device according to claim 6, which is characterized in that described device further include:
Test module is tested for the test case to be input in the corresponding interface of the business object, obtains institute
State the test result of business object return;
Contrast module obtains the verification of the test result for comparing the test result and the expected results
As a result.
11. a kind of server, which is characterized in that the server includes memory and processor, and the memory is for depositing
Storage supports processor perform claim to require the program of any one of 1 to 5 the method, the processor is configured to for executing institute
State the program stored in memory.
12. a kind of computer storage medium, which is characterized in that for being stored as any one of claim 6 to 10 described device institute
Computer software instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910235245.5A CN109933535B (en) | 2019-03-26 | 2019-03-26 | Test case generation method and device and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910235245.5A CN109933535B (en) | 2019-03-26 | 2019-03-26 | Test case generation method and device and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109933535A true CN109933535A (en) | 2019-06-25 |
CN109933535B CN109933535B (en) | 2022-09-13 |
Family
ID=66988418
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910235245.5A Active CN109933535B (en) | 2019-03-26 | 2019-03-26 | Test case generation method and device and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109933535B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110633217A (en) * | 2019-09-19 | 2019-12-31 | 中国银行股份有限公司 | Interface checking method and device |
CN110708211A (en) * | 2019-08-30 | 2020-01-17 | 上海唯链信息科技有限公司 | Network flow testing method and system |
CN111324540A (en) * | 2020-03-02 | 2020-06-23 | 北京同邦卓益科技有限公司 | Interface testing method and device |
CN111352782A (en) * | 2020-02-28 | 2020-06-30 | 北京字节跳动网络技术有限公司 | Interface testing method and device, computer equipment and storage medium |
CN112104526A (en) * | 2020-09-21 | 2020-12-18 | 中国人民解放军陆军装备部驻北京地区军事代表局驻石家庄地区第一军事代表室 | Test system and test method |
CN112148621A (en) * | 2020-10-14 | 2020-12-29 | 中国农业银行股份有限公司 | Test method and device and electronic equipment |
CN112202639A (en) * | 2020-09-30 | 2021-01-08 | 重庆长安汽车股份有限公司 | Performance test method for realizing Internet of vehicles remote control service through LoadRunner tool |
WO2022142939A1 (en) * | 2020-12-29 | 2022-07-07 | 深圳前海微众银行股份有限公司 | Test case generation method and apparatus, device, and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130311976A1 (en) * | 2012-05-17 | 2013-11-21 | Cognizant Technology Solutions India Pvt. Ltd. | Method and system for generating and processing black box test cases |
CN107391379A (en) * | 2017-07-28 | 2017-11-24 | 武汉斗鱼网络科技有限公司 | Interface automatic test approach and device |
CN109388561A (en) * | 2018-09-18 | 2019-02-26 | 深圳壹账通智能科技有限公司 | Interface testing case generation method, device, computer equipment and storage medium |
CN109446076A (en) * | 2018-10-15 | 2019-03-08 | 广东省科技基础条件平台中心 | Software project testing method, system, storage medium and terminal device |
-
2019
- 2019-03-26 CN CN201910235245.5A patent/CN109933535B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130311976A1 (en) * | 2012-05-17 | 2013-11-21 | Cognizant Technology Solutions India Pvt. Ltd. | Method and system for generating and processing black box test cases |
CN107391379A (en) * | 2017-07-28 | 2017-11-24 | 武汉斗鱼网络科技有限公司 | Interface automatic test approach and device |
CN109388561A (en) * | 2018-09-18 | 2019-02-26 | 深圳壹账通智能科技有限公司 | Interface testing case generation method, device, computer equipment and storage medium |
CN109446076A (en) * | 2018-10-15 | 2019-03-08 | 广东省科技基础条件平台中心 | Software project testing method, system, storage medium and terminal device |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110708211A (en) * | 2019-08-30 | 2020-01-17 | 上海唯链信息科技有限公司 | Network flow testing method and system |
CN110708211B (en) * | 2019-08-30 | 2021-09-17 | 上海唯链信息科技有限公司 | Network flow testing method and system |
CN110633217A (en) * | 2019-09-19 | 2019-12-31 | 中国银行股份有限公司 | Interface checking method and device |
CN111352782A (en) * | 2020-02-28 | 2020-06-30 | 北京字节跳动网络技术有限公司 | Interface testing method and device, computer equipment and storage medium |
CN111324540A (en) * | 2020-03-02 | 2020-06-23 | 北京同邦卓益科技有限公司 | Interface testing method and device |
CN111324540B (en) * | 2020-03-02 | 2023-08-04 | 北京同邦卓益科技有限公司 | Interface testing method and device |
CN112104526A (en) * | 2020-09-21 | 2020-12-18 | 中国人民解放军陆军装备部驻北京地区军事代表局驻石家庄地区第一军事代表室 | Test system and test method |
CN112202639A (en) * | 2020-09-30 | 2021-01-08 | 重庆长安汽车股份有限公司 | Performance test method for realizing Internet of vehicles remote control service through LoadRunner tool |
CN112202639B (en) * | 2020-09-30 | 2022-08-09 | 重庆长安汽车股份有限公司 | Performance test method for realizing Internet of vehicles remote control service through LoadRunner tool |
CN112148621A (en) * | 2020-10-14 | 2020-12-29 | 中国农业银行股份有限公司 | Test method and device and electronic equipment |
WO2022142939A1 (en) * | 2020-12-29 | 2022-07-07 | 深圳前海微众银行股份有限公司 | Test case generation method and apparatus, device, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109933535B (en) | 2022-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109933535A (en) | Generation method, device and the server of test case | |
CN108427632B (en) | Automatic test method and device | |
CN106133537B (en) | A kind of FPGA function module emulation verification method and its system | |
CN102169846B (en) | Method for writing multi-dimensional variable password in parallel in process of testing integrated circuit wafer | |
CN105068929A (en) | Test script generation method, test script generation device, testing method, testing device and testing system | |
CN109460223A (en) | A kind of API gateway management system and its method | |
CN104346365A (en) | Device and method for determining specific service associated logs | |
CN110321292A (en) | Chip detecting method, device, electronic equipment and computer readable storage medium | |
CN112260885B (en) | Industrial control protocol automatic test method, system, device and readable storage medium | |
CN110209584A (en) | A kind of automatic generation of test data and relevant apparatus | |
CN110096445A (en) | A kind of model is in ring test method and device | |
CN108460068A (en) | Method, apparatus, storage medium and the terminal that report imports and exports | |
CN107730096A (en) | A kind of method for evaluating quality and device in information data source | |
CN107679423A (en) | Partition integrity inspection method and device | |
CN107293330A (en) | The method and simulation checking system of simulating, verifying are carried out to random access memory ram | |
CN110209587A (en) | The test method and device of safety chip operation flow | |
CN106600461A (en) | data verification method, device and equipment | |
CN116956801A (en) | Chip verification method, device, computer equipment and storage medium | |
CN108089987B (en) | Function verification method and device | |
CN110597728A (en) | Method, device and system for constructing test data | |
CN103165405A (en) | Mutli-dimensional variable code real-time generation method through general purpose interface bus (GPIB) interface | |
CN115987821A (en) | Gateway routing test method and device | |
CN105703964A (en) | Online application system test method and equipment | |
CN109558315A (en) | The determination method, device and equipment of test scope | |
CN108710658A (en) | A kind of storage method and device of data record |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |