CN106528395B - The generation method and device of test case - Google Patents

The generation method and device of test case Download PDF

Info

Publication number
CN106528395B
CN106528395B CN201510570791.6A CN201510570791A CN106528395B CN 106528395 B CN106528395 B CN 106528395B CN 201510570791 A CN201510570791 A CN 201510570791A CN 106528395 B CN106528395 B CN 106528395B
Authority
CN
China
Prior art keywords
test case
parameter
template
test
testing procedure
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.)
Active
Application number
CN201510570791.6A
Other languages
Chinese (zh)
Other versions
CN106528395A (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.)
Alibaba Singapore Holdings Pte Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510570791.6A priority Critical patent/CN106528395B/en
Publication of CN106528395A publication Critical patent/CN106528395A/en
Application granted granted Critical
Publication of CN106528395B publication Critical patent/CN106528395B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application discloses a kind of generation method of test case and devices.Wherein, which includes: each testing procedure obtained in test case template, wherein each testing procedure executes in sequence;If testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and the attribute value of step parameter is added into the initial data of testing procedure, updated step data are obtained;Test case is generated based on updated step data.Present application addresses the technical issues of low efficiency, realize the effect for improving UI testing efficiency when progress UI automatic test.

Description

The generation method and device of test case
Technical field
This application involves internet areas, in particular to the generation method and device of a kind of test case.
Background technique
Software test be it is indispensable in software development process, the purpose is to the defects in software that finds to hide, and subtract The cost of few software development and maintenance, promotes the promotion of software quality.The cost of software test accounts for entire software development process 30%-50%, with the continuous improvement of software function complexity, corresponding automatization testing technique is also evolving and improves
In various types of automatic tests, the test closest to user demand be with user's intercorrelation, be commonly called as The page function behaviour of automation is realized in a manner of the script execution of simulating hand operation for UI (user interface) automatic test Make, reach the test to page function accuracy, generally carries out UI automatic test using various test scripts in this scenario, Such as test data driving, crucial word drive, performance testing driving.
In various test script implementations, the technology used is all based on certain type of data, by data and The combination for testing code, when executing test code, obtains to realize various effective test scripts, but in this scenario Test data is with implementation of test cases and returns to test result, and testing efficiency is low.
When above-mentioned carry out UI automatic test aiming at the problem that low efficiency, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the present application provides the generation method and device of a kind of test case, at least to solve to carry out UI automation The low technical problem of testing time-effectiveness rate.
According to the one aspect of the embodiment of the present application, a kind of generation method of test case is provided, the generation method packet It includes: obtaining each testing procedure in test case template, wherein each testing procedure executes in sequence;If testing procedure It is provided with step parameter, then the attribute value of obtaining step parameter, and the attribute value of step parameter is added into the original of testing procedure In beginning data, updated step data are obtained;Test case is generated based on updated step data.
According to the another aspect of the embodiment of the present application, a kind of generating means of test case are additionally provided, the generating means It include: acquisition module, for obtaining each testing procedure in test case template, wherein each testing procedure is in sequence It executes;Processing module if being provided with step parameter, the attribute value of obtaining step parameter for testing procedure, and step is joined Several attribute values are added into the initial data of testing procedure, obtain updated step data;Generation module, for based on more The number of steps of after new, is according to generation test case.
Optionally, the generating means further include: the first receiving module is being obtained with the test case template postponed Later, the edit instruction that the template for displaying interface for receiving through the test case template inputs, wherein the editor refers to It enables for editing the information with the step parameter in the test case template postponed;Display module, in display step Step parameter to be changed is shown on the parameter display interface of parameter;Second receiving module, for showing boundary by the parameter Face receives the deletion to the step parameter to be changed and instructs or modify instruction;Removing module, if for receiving described delete Except instruction, then the step parameter to be changed deleting instruction instruction and deleting is deleted, updated test case is obtained Template;Display module, if showing the step ginseng to be changed on the screen of terminal for receiving the modification instruction Several parameter setting interfaces receives and stores modification information by the parameter setting interface, obtains the updated test Use-case template.
Optionally, the generating means further include: module is established, for generating based on the updated step data While test case, the incidence relation of the test case Yu the test case template is established;Test module, in base After the updated step data generate test case, test object is surveyed by the test case of generation Examination.
Optionally, the generating means further include: third receiving module, for being based on the updated step data After generating test case, receives the modification for modifying test case step in the test case and request;First judges mould Block, for judging whether the test case step is provided with the step parameter;First modified module, if being used for the test The not set step parameter of use-case step, then the number of steps of directly modifying the test case step evidence, obtain modified The number of steps of test case step evidence and modified test case;Second judgment module, if being used for the test case step It is provided with the step parameter, then judges whether modification and the associated test case template of the test case;Second modification mould Block, if for judge not modify with the associated test case template of the test case, release the test case and institute The number of steps of stating the association of test case template, and modifying test case step evidence obtains modified test case step The number of steps of rapid evidence and modified test case;Third modified module, if for judging that modification is closed with the test case The test case template of connection is then modified the template data for corresponding to the step parameter in the test case template, and is synchronized more The association use-case of the new test case template, wherein the association use-case is to have the pass with the test case template The test case of connection relationship.
Optionally, second judgment module includes: the first judging submodule, for judging whether by modifying the survey The modification interface of example on probation receives modification and the synchronous vacations of the associated test case template of the test case instruct;Second Judging submodule judges modification and the survey if instructing for receiving the synchronous vacations by the modification interface The associated test case template of example on probation;Third judging submodule, if not received for by the modification interface described same Step modification instruction, then judge not modifying and the associated test case template of the test case.
In the embodiment of the present application, after computer gets each testing procedure in test case template, judgement Whether testing procedure is provided with step parameter, if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and The attribute value of the step parameter is added into the initial data of testing procedure, updated step data are obtained, in the program In, before generating test case, to the attribute value of the testing procedure setting steps parameter in test case template, it is being based on adding Added with step parameter attribute value the number of steps of according to generate test case, i.e. the scheme of the present embodiment be creation test case Stage just directly generates the test case of the attribute value with specific step parameter, obtains without the stage in implementation of test cases Test data (attribute value of i.e. above-mentioned step parameter) is taken, solves the problems, such as to carry out low efficiency when UI automatic test, it is real The effect for improving the testing efficiency of UI automatic test is showed.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present application, constitutes part of this application, this Shen Illustrative embodiments and their description please are not constituted an undue limitation on the present application for explaining the application.In the accompanying drawings:
Fig. 1 is a kind of schematic diagram of the generation method of test case according to prior art;
Fig. 2 is the hardware environment schematic diagram according to the terminal of the embodiment of the present application;
Fig. 3 is the flow chart according to a kind of generation method of test case of the embodiment of the present application;
Fig. 4 is the flow chart according to a kind of generation method of optional test case of the embodiment of the present application;
Fig. 5 is the schematic diagram according to a kind of optional parameter setting interface of the embodiment of the present application;
Fig. 6 is the schematic diagram according to a kind of optional the parameter display interface and parameter setting interface of the embodiment of the present application;
Fig. 7 is the signal according to another kind optional the parameter display interface and parameter setting interface of the embodiment of the present application Figure;
Fig. 8 (a) is the stream according to the method for optional the number of steps of the modifying test case evidence of one kind of the embodiment of the present application Cheng Tu;
Fig. 8 (b) is the flow chart according to the generation method of the optional test case of another kind of the embodiment of the present application;
Fig. 9 is the schematic diagram according to a kind of generating means of test case of the embodiment of the present application;And
Figure 10 is the hardware block diagram according to the terminal of the embodiment of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only The embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people Member's every other embodiment obtained without making creative work, all should belong to the model of the application protection It encloses.
It should be noted that the description and claims of this application and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to embodiments herein described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
First by the invention relates to term be explained as follows:
Test case: being one group of test input, execution condition and the expected results worked out for some special objective, with Just it tests some Program path or verifies whether meet some particular demands.
Step parameter: the attribute value by the way that different step parameters is arranged, to generate different test cases.
Step data: referring to the content of actual test case, by designing special algorithm, safeguards actual test case Content (step data) change, by the number of steps of different test cases according to treating with a certain discrimination, i.e., to each different Test case has carried out isolation processing, to solve the problems, such as that traditional mechanism test case independence is weak.
Embodiment 1
According to the embodiment of the present application, a kind of embodiment of the generation method of test case is additionally provided, it should be noted that Step shown in the flowchart of the accompanying drawings can execute in a computer system such as a set of computer executable instructions, and It, in some cases, can be to be different from sequence execution institute herein and although logical order is shown in flow charts The step of showing or describing.
Embodiment of the method provided by the embodiment of the present application can be in mobile terminal, terminal or similar operation It is executed in device.
In the generation method of traditional test case, it is generally based on certain type of data (parameter i.e. shown in FIG. 1 Point), by the combination of data (i.e. parameter point) and test code, to realize (the survey i.e. shown in FIG. 1 of various effective test scripts Example on probation).As shown in Figure 1, two parameter points (parameter point 1 and parameter point 2 i.e. shown in FIG. 1) are set in test code, In corresponding data list, it is configured with the numerical value of three row parameter points, wherein the corresponding test of data line in data list Use-case, as shown in Figure 1, the data of the corresponding parameter point 1 of test case 1 and parameter point 2 are c1 and c2, the corresponding parameter of test case 2 The data of point 1 and parameter point 2 are d1 and d2, and it is e1 and e2, the then survey that test case 3, which corresponds to parameter point 1 and the data of parameter point 2, It tries code when being executed, execution can be recycled three times, wherein data line is taken on corresponding step parameter every time, form three surveys The execution of example (test case 1, test case 2 and test case 3 as shown in figure 1) on probation simultaneously returns the result.
Optionally, the generation method of the test case in the present embodiment can be applied to 101 kimonos of terminal as shown in Figure 2 In the hardware net environment that business device 103 is constituted, as shown in Fig. 2, terminal 101 is attached by network with server 103, on Stating network includes but is not limited to: wide area network, Metropolitan Area Network (MAN) or local area network.
In the embodiment of the present application, above-mentioned terminal can be mobile terminal, PC or server.
Under above-mentioned running environment, this application provides the flow charts of the generation method of test case as shown in Figure 3.
As shown in figure 3, the generation method includes the following steps:
Step S302: each testing procedure in test case template is obtained, wherein each testing procedure is held in sequence Row.
Step S304: if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and by step parameter Attribute value be added into the initial data of testing procedure, obtain updated step data.
Step S306: test case is generated based on updated step data.
Optionally, after generating test case through the above steps, which can also include:
Step S308: test object is tested by the test case of generation.
Test step is judged after computer gets each testing procedure in test case template using the application Suddenly whether it is provided with step parameter, if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and by the step The attribute value of rapid parameter is added into the initial data of testing procedure, updated step data is obtained, in this scenario, in life Before test case, to the attribute value of the testing procedure setting steps parameter in test case template, based on added with step The number of steps of attribute value of rapid parameter is to create the stage of test case just according to test case, the i.e. scheme of the present embodiment is generated The test case for directly generating the attribute value with specific step parameter obtains test without the stage in implementation of test cases Data (attribute value of i.e. above-mentioned step parameter) solve the problems, such as to carry out low efficiency when UI automatic test, realize and mention The effect of the testing efficiency of high UI automatic test.
In the above-described embodiments, not only the data of step grade can be carried out with the setting of step parameter, but also can created The stage for building test case is just added into the attribute value of specific steps parameter in the data of test case, does not need executing The stage of test case adds the attribute value of specific steps parameter in the data of test case;Add the test number of test case According to when be to be added according to step rank, i.e., according to doing more the number of steps of before generation test case to test case to be generated Newly, different test cases can have different step parameter and its attribute value, may be not present because of different test cases Data are unified in the data of a data list and bring need to carry out the defect of extra maintenance management mechanism, simultaneously It avoids because test code is to force to bind by step parameter and the data list content of test, caused maintenance cost is in The problem of exponential multiple rises, through the foregoing embodiment, not only reduces maintenance cost, also improves the flexibility of maintenance.
In addition, through the foregoing embodiment, before generating test case, adding the attribute value of step parameter to update and survey The rapid data of try, so as to generate the test case for having specific steps parameter attribute value, above-described embodiment avoids logical It crosses and writes the mode of code and be arranged brought by parameter point (i.e. the attribute value of the step parameter of testing procedure) and inevitably compile The processes such as multiple circulate operation for writing, debugging execution and issue handling do not need operator yet and have certain to write generation The ability of code, so that raising flexibility is realized, raising efficiency and the effect for reducing Code Edit cost.
Specifically, the detailed process that test case is generated in the embodiment of the present application is described in detail in conjunction with Fig. 4.Such as figure Shown in 4, first testing procedure in each testing procedure in test case template is obtained, and from the test case template First testing procedure start execute following steps, wherein the current testing procedure in test case template is initialized to First testing procedure in the test case template:
Step S401: the current testing procedure in each testing procedure in test case template is obtained.
Specifically, each testing procedure in test case template is parsed, to each test step in test case template It is rapid to carry out parameter point setting (i.e. above-mentioned step parameter).
Step S402: judge whether current testing procedure is provided with step parameter.
That is, judging in the data of current testing procedure whether to include step parameter (such as parameter point).
Wherein, if so, need modify deserve the rapid data of preamble, then follow the steps S403, if it is not, then without pair The data of current testing procedure are modified, namely deserve the data that the rapid data of preamble are the step, execute step S404。
Step S403: the attribute value of the step parameter of current testing procedure is obtained, and the attribute value of the step parameter is added It is added in the initial data of the testing procedure, obtains updated step data.
Specifically, the attribute value for obtaining the step parameter of current testing procedure (such as practical input value, or is read from database The value got), and the rapid attribute value of preamble is deserved in corresponding modification,
Step S404: the number of steps of obtaining current testing procedure evidence.
Specifically, for the current testing procedure of not set step parameter, according to being original the number of steps of current testing procedure Data;For being provided with the current testing procedure of step parameter, according to being updated number of steps the number of steps of current testing procedure According to.
Step S405: judge whether current testing procedure is the last one testing procedure in the test case template.If It is to then follow the steps S406;If it is not, executing step S407.
Step S406: test case is generated based on above-mentioned updated step data.
While generating test case based on above-mentioned updated step data, the test case and test case are established Incidence relation between template.
Step S407: next testing procedure in test case template is worked as into preamble as what is recycled next time Suddenly.
It should be pointed out that above-mentioned steps are only introduced the generating process of a test case, used by test Above method Mass production test case can be passed through when example template generation test case, wherein the generation of each test case Process is all as the generating process of above-mentioned test case is consistent.
Through the foregoing embodiment, it can establish the incidence relation between the test case and test case template, so as to To be associated with the step parameter and test case template of each test case.
Specifically, the correlation technology of the step of test case grade parameter point (the step parameter of i.e. each testing procedure) can lead to It crosses and designs specific Data Structure and Algorithm, by test case step and parameter point fixed correlation.
Test case in above-described embodiment is independent object, can be text, scripted code or data structure Etc. data.The test case can be made of multiple steps (i.e. testing procedure), can be set in each step (i.e. testing procedure) Step parameter is set or is not provided with, if setting steps parameter, step parameter may include one or more parameter points.Multiple parameters point Set can be referred to as a step parameter, which is a virtual object.Wherein, each parameter point may include Parameter name, parameter type and parameter value.
Above-mentioned test case template is actually a kind of template (i.e. template), is the prototype of each test case, Test case template may include testing procedure and step parameter, but not including that parameter value (i.e. the attribute value of step parameter). It can be by the way that different assignment (attribute value that different step parameters is arranged) be arranged to each parameter point, so that it may be backfilling into To generate different test cases in template (i.e. template), here it is the mistakes for passing through test case template Mass production use-case Journey.The test case and template (i.e. template) so generated will establish natural incidence relation, which is used for Indicating the test case is from some template (i.e. template) generation.
Optionally, after computer gets testing procedure 1 and testing procedure 2 in test case template, judge to survey Whether try rapid 1 and testing procedure 2 are provided with step parameter, if testing procedure is provided with step parameter, above-mentioned specific embodiment Parameter point 1, parameter point 2 and parameter point 3 are provided in middle test case template, then obtain " account " attribute value (as " a "), The attribute value (such as " 010 ") of " area code ", and the attribute value (such as " 12345678 ") of " telephone number ", and the above-mentioned step is joined Several attribute values are added into the initial data of testing procedure, obtain updated step data, in this scenario, to test use The step rank of example associates the attribute value of step parameter with test case to safeguard step parameter, is based on the update The number of steps of after the attribute value of step parameter according to generate test case, when testing test object, without writing code Without carrying out function maintenance to it, testing efficiency is improved.
According to the above embodiments of the present application, the attribute value of obtaining step parameter may include: the parameter of obtaining step parameter Mark, wherein parameter identification is used to describe the test case ownership and step ownership of step parameter;It is mentioned from test case template The corresponding parameter information of parameter identification is taken, parameter information includes parameter type and parameter name;Corresponding ginseng is read from database The attribute value of several classes of types and parameter name.
Wherein, which step which test case the step parameter belongs in has been depicted in above-mentioned parameter identification.
In the above-described embodiments, it if each testing procedure that computer is got is provided with step parameter, can first obtain The parameter identification for taking step parameter extracts corresponding parameter type and parameter name according to the parameter identification from test case template The parameter informations such as title;Attribute value corresponding with parameter information is read from database again.To establish step using parameter identification Incidence relation between rapid parameter and the attribute value of step parameter, so as to fast and accurately obtain and join from database The corresponding attribute value of number information, improves the treatment effeciency to the step parameter in use-case template.
Specifically, after computer gets each testing procedure in test case template, judge that testing procedure is It is no to be provided with step parameter, if testing procedure is provided with step parameter, the parameter identification of first obtaining step parameter, according to the ginseng Number mark extracts the parameter informations such as corresponding parameter type and parameter name from test case template;It is read from database again Attribute value corresponding with parameter information, and the attribute value of the step parameter is added into the initial data of testing procedure, it obtains To updated step data, it is then based on updated step data and generates test case, pass through the test case pair of generation Test object is tested.
The realization principle using incidence relation algorithm is discussed in detail by taking step parameter point PP as an example below:
(1) each testing procedure may include step parameter (such as parameter point PP).
(2) each parameter point PP may include the information (such as parameter point content) of one or more parameter points, each parameter The information of point is correspondingly arranged the parameter value (i.e. attribute value) of different parameter points.
(3) parameter point id (i.e. parameter identification) can uniquely indicate parameter point and its test case ownership and step ownership.
Optionally, if step parameter includes a parameter point, the data structure of testing procedure can be in test case template Are as follows:
If step parameter includes multiple parameters point, the data structure of testing procedure can be in test case template are as follows:
It is illustrated in the form of the specific manifestation of test case template and test case below.
Use-case template (i.e. test case model) may include two testing procedures, and specific manifestation form is as follows:
Testing procedure 1: text box inputs [parameter point 1 (type: text, parameter name: account)].
The testing procedure 1 is provided with step parameter, which includes a parameter point (i.e. parameter point 1), the parameter The type of point is text, the entitled account of the parameter point.
Testing procedure 2: text box input [parameter point 2 (type: text, parameter name: area code)+parameter point 3 (type: text This, parameter name: telephone number)].
The testing procedure 2 is provided with step parameter, which includes two parameter points, and first parameter point (is joined Several points 2) type be text, the entitled area code of the parameter point;The type of second parameter point (i.e. parameter point 3) is text, The entitled telephone number of parameter point.
Wherein, " [] " indicates step parameter.
After parsing above-mentioned test case template, judge whether testing procedure 1 and testing procedure 2 are provided with ginseng one by one Several, be discussed in detail by taking the specific processing of testing procedure 1 as an example below: a little 1 corresponding attribute value that gets parms (such as a), uses The attribute value modifies the data of testing procedure 1, and obtain updated data: text box inputs [a] (parameter name of parameter point 1: account Number, parameter value: a), above-mentioned update is also executed to testing procedure 2 and is handled, the data of updated testing procedure: text are obtained Frame inputs [010+12345678] (parameter name of parameter point 2: area code, parameter value: 010;The parameter name of parameter point 3: phone number Code, parameter value: 12345678).
Specifically, testing procedure 1: text box inputs [a] (parameter name of parameter point 1: account, parameter value: a).
Testing procedure 2: text box inputs [010+12345678] (parameter name of parameter point 2: area code, parameter value: 010;Ginseng The parameter name of several points 3: telephone number, parameter value: 12345678).
Test case 2 can also be generated using same processing method after generating test case 1, the form of expression can With are as follows:
Testing procedure 1: text box inputs [b] (parameter name of parameter point 1: account, parameter value: b);
Testing procedure 2: text box inputs [020+0000000] (parameter name of parameter point 2: area code, parameter value: 020;Ginseng The parameter name of several points 3: telephone number, parameter value: 0000000).
After Mass production test case, test object is tested using the test case of generation.
Optionally, after computer gets testing procedure 1 and testing procedure 2 in test case template, judge to survey Whether try rapid 1 and testing procedure 2 are provided with step parameter, if testing procedure is provided with step parameter, above-mentioned specific embodiment Parameter point 1 (type: text, parameter name: account), (type: text, parameter of parameter point 2 are provided in middle test case template Name: area code) and parameter point 3 (type: text, parameter name: telephone number), then the parameter identification based on parameter point 1 obtains " account Number " attribute value " a ", parameter identification based on parameter point 2 obtain the attribute value " 010 " of " area code ", and based on parameter point 3 Parameter identification obtains the attribute value " 12345678 " of " telephone number ", and the attribute value of the above-mentioned step parameter is added into test In the initial data of step, updated step data are obtained, in this scenario, are walked with the step rank of test case to safeguard Rapid parameter, and the attribute value of step parameter is associated with test case, after the attribute value based on the update step parameter Step data generate test case, when testing test object, carry out function maintenance without to it without writing code, Improve testing efficiency.
According to the above embodiments of the present application, from test case template extracting parameter identify corresponding parameter information it Before, which can also include: each testing procedure obtained in initial test case template;By parameter setting circle Face is testing procedure configuration step parameter, is obtained with the test case template postponed, wherein each step parameter may include one A or multiple parameters point, the information of each parameter point include at least parameter name, parameter type, step parameter parameter identification with And attribute value.
In the above-described embodiments, user can be by interface attribute value when configuration step parameter, can also be from data Attribute value is exported in library.
In the above-described embodiments, user can be the testing procedure configuration step ginseng got by parameter setting interface Number obtains improving the convenient degree of user's input step parameter by visual interface with the test case template postponed, Convenience also is provided for the test and maintenance work of the maintenance personnel of test case simultaneously.
The above embodiments of the present application are described in detail below with reference to Fig. 5.
As shown in figure 5, the visualization interface (i.e. parameter setting interface) of test case template can show title (i.e. Fig. 5 In use-case template) and by use-case/parameter point (i.e. test case), log in account number (i.e. step parameter) and parameter XXX (is walked The attribute value of rapid parameter) composition step parameter list, user can be testing procedure configuration step by the visualization interface Parameter such as can input each test case to be tested in use-case/parameter point table column of step parameter table, such as may be used To input use-case 1 (i.e. test case 1), use-case 2 (i.e. test case 2) and use-case 3 (i.e. test case 3) shown in fig. 5;It is stepping on Login account to be tested is inputted in the table column of land account (i.e. step parameter), can such as be inputted: aaa, bbb and ccc.Together When the attribute value of relevant step parameter can be inputted in the table column of parameter (attribute value of step parameter), such as can be defeated Enter: ddd, eee and fff.Wherein, in use-case template as shown in Figure 5, the attribute of test case, step parameter and step parameter Value is one-to-one relationship.I.e. the login account (i.e. step parameter) of use-case 1 (i.e. test case 1) is aaa, corresponding parameter (i.e. the attribute value of step parameter) is ddd.Equally, the login account (i.e. step parameter) of use-case 2 (i.e. test case 2) is bbb, Corresponding parameter (i.e. the attribute value of step parameter) is eee.The login account (i.e. step parameter) of use-case 3 (i.e. test case 3) For ccc, corresponding parameter (i.e. the attribute value of step parameter) is fff.User can pass through visualization interface as shown in Figure 5 Mass production button in (i.e. parameter setting interface) carries out the Mass production to test case, that is, realize while generating use-case 1 (i.e. test case 1), use-case 2 (i.e. test case 2) and use-case 3 (i.e. test case 3) these three test cases.
Through the foregoing embodiment, user or the test and maintenance personnel of test case (can be joined by visualization interface Number set interfaces) each test case of input actual parameter value (can be the attribute value of step parameter), match for testing procedure Set step parameter, and the algorithm on the backstage by the visualization interface (i.e. parameter setting interface), the test of Lai Shixian Mass production The purpose of use-case.
According to the above embodiments of the present application, after obtaining with the test case template postponed, which can be with It include: the edit instruction for receiving and being inputted by the template for displaying interface of test case template, wherein edit instruction is matched for editing The information of step parameter in the test case template postponed;It shows on the parameter display interface of display step parameter wait change Step parameter;The deletion instruction or modification instruction of the step parameter for treating change are received by parameter display interface;If receiving It is instructed to deleting, then deletes the step parameter to be changed that instruction instruction is deleted, obtain updated test case template;If connecing Modification instruction is received, then shows the parameter setting interface of step parameter to be changed on the screen of terminal, passes through parameter setting Interface receives and stores modification information, obtains updated test case template.
It optionally, is testing procedure configuration step by parameter setting interface in user or the maintenance personnel of test case Parameter is obtained with after the test case template postponed, and terminal can be shown to be changed by parameter display interface Step parameter, and the edit instruction that user or maintenance personnel input is received by the parameter display interface of test case template, If the edit instruction received is to delete instruction, the step parameter to be changed that deletion instruction instruction is deleted is deleted, is obtained Updated test case template, if the edit instruction received is modification instruction, display should be wait become on the screen of terminal The parameter setting interface of step parameter more receives and stores modification information by the parameter setting interface, obtains updated Test case template.Through the foregoing embodiment, each test to test case can be realized by the interface of terminal The on-demand configuration parameter point of step, and the edit instruction inputted according to user or maintenance personal, to realize to test case The deletion and modification of step parameter, improve the flexibility of the processing to test case, and improve to step parameter maintenance Effect of visualization.
The above embodiments of the present application are described in detail below with reference to Fig. 6 and Fig. 7.
The template for displaying interface of test case template may include: title (the use-case template in such as Fig. 6), testing procedure (step 1), edit instruction trigger button (the newly-increased parameter point in such as Fig. 6) and other relevant informations (such as Fig. 6 in such as Fig. 6 In [login frame A] input account [XXX]), treat the step parameter of change when terminal is received by parameter display interface and repair Change instruction (trigger signal of the newly-increased parameter point in such as Fig. 6), step parameter to be changed can be shown on the screen of terminal Parameter setting interface, the parameter point set interface may include: title (parameter point setting) in such as Fig. 6, step parameter (such as Parameter name and parameter type in Fig. 6) and input window (login account window and text box input window in such as Fig. 6 Mouthful), it can be connect by the input window (i.e. login account window and text box input window in Fig. 6) in parameter setting interface It receives modification information and (such as passes through the parameter name information of the login account window input in Fig. 6, and defeated by text box input window The parameter type information entered), then receive trigger signal (the triggering letter of save button as shown in FIG. 6 for saving test case Number), the modification information received is saved, and test case is increased based on the modification information, obtains updated test case Template.
The template for displaying interface of test case template also may include: title (the use-case template in such as Fig. 7), testing procedure (step 1), edit instruction trigger button (the editing parameter point in such as Fig. 7) and other relevant informations (such as Fig. 7 in such as Fig. 7 In [login frame A] input account [XXX]), treat the step parameter of change when terminal is received by template for displaying interface and repair Change or delete instruction (trigger signal of the editing parameter point button in such as Fig. 7), can show on the screen of terminal wait change Step parameter parameter setting interface, as shown in fig. 7, the parameter display interface may include: the title (parameter in such as Fig. 7 Point list), parameter point (parameter point 1 [login account], parameter point 2 [XXX] in such as Fig. 7) and Edit button be (in such as Fig. 7 Modify button and delete button), show step parameter to be changed (as joined on the parameter display interface of the display step parameter Several points 1 and parameter point 2), and the deletion that the step parameter for treating change can be received by parameter display interface is instructed or is repaired Change instruction;If receive deletion instruction (trigger signal of the delete button in such as Fig. 7), delete instruction instruction delete wait become Step parameter more, wherein as shown in fig. 7, the corresponding delete button of each parameter point and modification button, if parameter shows boundary Face receives the trigger signal (deleting instruction) to delete button, then the corresponding information for deleting corresponding parameter point, is deleted Except the test case template (i.e. updated test case template) after the parameter point information;If being received by parameter display interface To modification instruction (trigger signal of the modification button in such as Fig. 7), then step parameter to be changed is shown on the screen of terminal Parameter setting interface (the parameter point set interface in such as Fig. 7), which may include: title (in such as Fig. 7 Parameter point setting), parameter point (parameter name and parameter type in such as Fig. 7) and the input window (login account in such as Fig. 7 Window and text box input window), input window (the login account window in such as Fig. 7 in parameter setting interface can be passed through With text box input window), reception modification information (the parameter name information as passed through the login account window input in Fig. 7, and The parameter type information inputted by text box input window), the trigger signal for saving test case is then received (such as Fig. 7 institute The trigger signal for the save button shown), the modification information received is saved, and test case is increased based on the modification information, Obtain updated test case template.
Through the foregoing embodiment, it is on-demand that each testing procedure generated by visualization interface to test case may be implemented Configuration parameter point, can directly on visualization interface defined parameters title and type (i.e. the attribute value of input step parameter).? The parameter point being arranged can be directly deleted or modified on visualization interface by visualization interface.
According to above-described embodiment, the generation method of test case can also include: raw based on updated step data While at test case, the incidence relation of test case and test case template is established;It is being based on updated step data After generating test case, the generation method further include: test object is tested by the test case of generation.
Optionally, while generating test case based on updated step data, terminal can be associated with by mark Test case and test case mould.
According to above-described embodiment, the generation method of test case can also include: the step of being based on each testing procedure After data generate test case, receives the modification for modifying test case step in test case and request;Judgement test is used Whether example step is provided with step parameter;If the not set step parameter of test case step, test case step is directly modified The number of steps of evidence, the number of steps of obtaining modified test case step evidence and modified test case;If test case walks Suddenly it is provided with step parameter, then judges whether modification and the associated test case template of test case;If judge not modify with The associated test case template of test case then releases being associated with for test case and test case template, and modifies test case The number of steps of step evidence, the number of steps of obtaining modified test case step evidence and modified test case;If judging Modification and the associated test case template of test case, then modify the template data that step parameter is corresponded in test case template, And the association use-case of synchronized update test case template, wherein association use-case is to have incidence relation with test case template Test case.
In the above-described embodiments, can by terminal receive modification test case modification request after, according to test The case where use-case step is provided with step parameter, the method for evidence is repaired the number of steps of to take different modification test cases Change, avoids and used in such a way that test code is by the binding of the data list content of step parameter and test case to modify test Example, so as to avoid being to force to bind by step parameter and the data list content of test because of test code, caused by walk The maintenance functions such as the newly-increased of rapid parameter, deletion need the operation of manual synchronous maintenance data list, also avoid surveying one When single skimble-scamble case data in the data list of example on probation is modified, to other data in all data lists Carry out the defect of identical operation, caused by maintenance cost exponentially multiple rise the problem of.Through the foregoing embodiment, may be used The change of the content (step data) of actual test case is safeguarded, by different test cases by design special algorithm The number of steps of according to being treated with a certain discrimination, i.e., isolation processing has been carried out to each different test case, to solve traditional machine The weak problem of test case independence processed.
As shown in Fig. 8 (a), modify test case the number of steps of evidence method may include steps of:
Wherein, it step S801: receives the modification for modifying test case step in test case and requests.
Specifically, terminal can receive user by interface or the modification of maintenance personal's input is requested, this is repaired Changing request may include the request deleted test case or increase test case.
Step S802: judge whether test case step is provided with step parameter.
Specifically, if it is not, even test case step is not provided with step parameter, S803 is thened follow the steps, if so, even Test case step is provided with step parameter, thens follow the steps S804.
Step S803: the number of steps of directly modifying test case step evidence obtains the step of modified test case step Rapid data and modified test case.
Specifically, when test case step is not provided with step parameter, it may not be necessary to consider test case and test mould Incidence relation between plate, directly modification test case step the number of steps of evidence.
Step S804: judge whether modification and the associated test case template of test case.
Specifically, if test case step is not provided with step parameter, to consider between test case and test template Incidence relation, and judge whether modify test case template, if do not have to modification test case template, i.e., if it is not, executing step Rapid S805, if judging modification and the associated test case template of test case, i.e., if so, thening follow the steps S806.
Optionally, judge whether that modifying with the associated test case template of test case may include: to judge whether to pass through The modification interface of modification test case receives modification and the synchronous vacations of the associated test case template of test case instruct;If Synchronous vacations instruction is received by modifying interface, then judges modification and the associated test case template of test case;If not Synchronous vacations instruction is received by modifying interface, then judges not modifying and the associated test case template of test case.
Step S805 releases being associated with for test case and test case template, and the number of steps of modify test case step According to, the number of steps of obtaining modified test case step evidence and modified test case.
Step S806 modifies the template data that step parameter is corresponded in test case template, and synchronized update test case The association use-case of template.
In the above-described embodiments, modification is received by the modification interface of test case and the associated test of test case is used The case where synchronous vacations instruction of example template, to determine whether modification and the associated test case template of test case.By upper Embodiment is stated, may be implemented to meet the actual demand of user or maintenance personnel to synchronous vacations test case template.
In a kind of optinal plan that the above embodiments of the present application provide, as shown in Fig. 8 (b), the test of the embodiment of the present application The generation method of use-case may comprise steps of:
Step a, user setting test case template.
Step b, the generating means of test case obtain each testing procedure in test case template.
Wherein, each testing procedure executes in sequence.
Step c, if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and by step parameter Attribute value is added into the initial data of testing procedure, obtains updated step data.
Step d generates test case based on updated step data.
Step e tests test object by the test case of generation.
Step f shows test result to user.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the application It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much In the case of the former be more preferably embodiment.Based on this understanding, the technical solution of the application is substantially in other words to existing The part that technology contributes can be embodied in the form of software products, which is stored in a storage In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate Machine, server or network equipment etc.) execute method described in each embodiment of the application.
Embodiment 2
According to the embodiment of the present application, additionally provide it is a kind of for implementing the embodiment of the generating means of above-mentioned test case, As shown in figure 9, the generating means of the test case include: to obtain module 20, processing module 40 and generation module 60.
Wherein, module 20 is obtained, for obtaining each testing procedure in test case template, wherein each test step Suddenly it executes in sequence.
Processing module 40 if being provided with step parameter, the attribute value of obtaining step parameter for testing procedure, and will walk The attribute value of rapid parameter is added into the initial data of testing procedure, obtains updated step data.
Generation module 60, for generating test case based on updated step data.
The generating means of test case in above-described embodiment can also include: test module 80.
Wherein, test object is tested for the test case by generating in test module 80.
Test step is judged after computer gets each testing procedure in test case template using the application Suddenly whether it is provided with step parameter, if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and by the step The attribute value of rapid parameter is added into the initial data of testing procedure, updated step data is obtained, in this scenario, in life Before test case, to the attribute value of the testing procedure setting steps parameter in test case template, based on added with step The number of steps of attribute value of rapid parameter is to create the stage of test case just according to test case, the i.e. scheme of the present embodiment is generated The test case for directly generating the attribute value with specific step parameter obtains test without the stage in implementation of test cases Data (attribute value of i.e. above-mentioned step parameter) solve the problems, such as to carry out low efficiency when UI automatic test, realize and mention The effect of the testing efficiency of high UI automatic test.
Optionally, the parameter identification that module is also used to obtaining step parameter is obtained, wherein parameter identification is for describing step The test case ownership and step ownership of parameter;Extracting parameter identifies corresponding parameter information, parameter from test case template Information includes parameter type and parameter name;And the attribute value of type of correspondence parameter and parameter name is read from database.
In the above-described embodiments, it if each testing procedure that computer is got is provided with step parameter, can first obtain The parameter identification for taking step parameter extracts corresponding parameter type and parameter name according to the parameter identification from test case template The parameter informations such as title;Attribute value corresponding with parameter information is read from database again.To establish step using parameter identification Incidence relation between rapid parameter and the attribute value of step parameter, so as to fast and accurately obtain and join from database The corresponding attribute value of number information, improves the treatment effeciency to the step parameter in use-case template.
Optionally, generating means further include: the second acquisition submodule and configuration module.
Wherein, the second acquisition submodule, in the corresponding parameter information of extracting parameter mark from test case template Before, each testing procedure in initial test case template is obtained.
Configuration module is obtained for being testing procedure configuration step parameter by parameter setting interface with the test postponed Use-case template, wherein each step parameter may include one or more parameter points, and the information of each parameter point includes at least ginseng Several titles, parameter type, step parameter parameter identification and attribute value.
In the above-described embodiments, user can be the testing procedure configuration step ginseng got by parameter setting interface Number obtains improving the convenient degree of user's input step parameter by visual interface with the test case template postponed, Convenience also is provided for the test and maintenance work of the maintenance personnel of test case simultaneously.
Optionally, which can also include: the first receiving module, display module, the second receiving module, delete mould Block and display module.
Wherein, the first receiving module passes through test case for receiving after obtaining with the test case template postponed The edit instruction of the template for displaying interface input of template, wherein edit instruction is used to edit in the test case template postponed Step parameter information.
Display module, for showing step parameter to be changed on the parameter display interface of display step parameter.
Second receiving module, for receiving the deletion instruction for the step parameter for treating change by parameter display interface or repairing Change instruction.
Removing module deletes the step to be changed that deletion instruction instruction is deleted if deleting instruction for receiving Parameter obtains updated test case template.
Display module, if showing step parameter to be changed on the screen of terminal for receiving modification instruction Parameter setting interface receives and stores modification information by parameter setting interface, obtains updated test case template.
It in the above-described embodiments, is testing procedure by parameter setting interface in user or the maintenance personnel of test case Configuration step parameter is obtained with after the test case template postponed, and terminal can be shown by parameter display interface Step parameter to be changed, and the volume that user or maintenance personnel input is received by the parameter display interface of test case template Instruction is collected, if the edit instruction received is to delete instruction, deletes the step to be changed ginseng that the deletion instructs instruction to delete Number, obtains updated test case template, if the edit instruction received is modification instruction, shows on the screen of terminal The parameter setting interface of the step parameter to be changed receives and stores modification information by the parameter setting interface, obtains more Test case template after new.Through the foregoing embodiment, it can be realized by the interface of terminal to the every of test case A on-demand configuration parameter point of testing procedure, and the edit instruction inputted according to user or maintenance personal, to realize to test The deletion and modification of the step parameter of use-case, improve the flexibility of the processing to test case, and improve to step parameter The effect of visualization of maintenance.
Optionally, which can also include: to establish module and test module.
Wherein, module is established, is used for while generating test case based on updated step data, establishing test The incidence relation of example and test case template.
Test module, for passing through the survey of generation after generating test case based on updated step data Example on probation tests test object.
Optionally, generating means can also include: third receiving module, first judgment module, the first modified module, second Judgment module, the second modified module and third modified module.
Wherein, third receiving module, for after generating test case based on updated step data, reception to be used for Modify the modification request of test case step in test case.
First judgment module, for judging whether test case step is provided with step parameter.
First modified module directly modifies test case step if being used for the not set step parameter of test case step The number of steps of evidence, the number of steps of obtaining modified test case step evidence and modified test case.
Second judgment module judges whether that modification is used with test if being provided with step parameter for test case step The associated test case template of example.
Second modified module, if for judge not modify with the associated test case template of test case, release survey Example on probation is associated with test case template, and evidence the number of steps of modify test case step, obtains modified test case The number of steps of step evidence and modified test case.
Third modified module, if modifying test for judging modification and the associated test case template of test case The template data of step parameter, and the association use-case of synchronized update test case template are corresponded in use-case template, wherein association is used Example is the test case with test case template with incidence relation.
In the above-described embodiments, can by terminal receive modification test case modification request after, according to test The case where use-case step is provided with step parameter, the method for evidence is repaired the number of steps of to take different modification test cases Change, through the foregoing embodiment, can safeguard the change of the content (step data) of actual test case by designing special algorithm More, according to treating with a certain discrimination, i.e., each different test case will have been carried out at isolation the number of steps of different test cases Reason, to solve the problems, such as that traditional mechanism test case independence is weak.
Optionally, the second judgment module may include: the first judging submodule, second judgment submodule and third judgement Submodule.
Wherein, the first judging submodule receives modification by the modification interface for modifying test case for judging whether It is instructed with the synchronous vacations of the associated test case template of test case.
Second judgment submodule, if judging modification for receiving synchronous vacations instruction by modifying interface and surveying The associated test case template of example on probation.
Third judging submodule, if judging not modify for not receiving synchronous vacations instruction by modifying interface With the associated test case template of test case.
In the above-described embodiments, modification is received by the modification interface of test case and the associated test of test case is used The case where synchronous vacations instruction of example template, to determine whether modification and the associated test case template of test case.By upper Embodiment is stated, may be implemented to meet the actual demand of user or maintenance personnel to synchronous vacations test case template.
Embodiment 3
Embodiments herein can provide a kind of terminal, which can be in terminal group Any one computer terminal.Optionally, in the present embodiment, above-mentioned terminal also could alternatively be mobile whole The terminal devices such as end.
Optionally, the terminal A in embodiment as shown in Figure 10 (i.e. such as the terminal 10 in Figure 10) It may include: one or more (one is only shown in figure) processors 102, memory 104 and transmitting device 106.
Wherein, memory can be used for storing software program and module, such as the life of the test case in the embodiment of the present application At the corresponding program instruction/module of method and device, processor is by running the software program being stored in memory and mould Block realizes above-mentioned vehicle positioning method thereby executing various function application and data processing.Memory may include high speed Random access memory, can also include nonvolatile memory, as one or more magnetic storage device, flash memory or other Non-volatile solid state memory.In some instances, memory can further comprise the storage remotely located relative to processor Device, these remote memories can pass through network connection to terminal A.The example of above-mentioned network includes but is not limited to internet, enterprise Industry intranet, local area network, mobile radio communication and combinations thereof.
Processor can call the information and application program of memory storage by transmitting device, to execute following step: Obtain each testing procedure in test case template, wherein each testing procedure executes in sequence;If testing procedure is arranged There is step parameter, then the attribute value of obtaining step parameter, and the attribute value of step parameter is added into the original number of testing procedure In, updated step data are obtained;Test case is generated based on updated step data.
Test step is judged after computer gets each testing procedure in test case template using the application Suddenly whether it is provided with step parameter, if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and by the step The attribute value of rapid parameter is added into the initial data of testing procedure, updated step data is obtained, in this scenario, in life Before test case, to the attribute value of the testing procedure setting steps parameter in test case template, based on added with step The number of steps of attribute value of rapid parameter is to create the stage of test case just according to test case, the i.e. scheme of the present embodiment is generated The test case for directly generating the attribute value with specific step parameter obtains test without the stage in implementation of test cases Data (attribute value of i.e. above-mentioned step parameter) solve the problems, such as to carry out low efficiency when UI automatic test, realize and mention The effect of the testing efficiency of high UI automatic test.
Optionally, following steps can also be performed in above-mentioned processor: the parameter identification of obtaining step parameter, wherein parameter The test case for describing step parameter is identified to belong to and step ownership;Extracting parameter mark corresponds to from test case template Parameter information, parameter information includes parameter type and parameter name;Type of correspondence parameter and parameter name are read from database The attribute value of title.
Optionally, following steps can also be performed in above-mentioned processor: in the extracting parameter mark pair from test case template Before the parameter information answered, each testing procedure in initial test case template is obtained;It is to survey by parameter setting interface The rapid configuration step parameter of try is obtained with the test case template that postpones, wherein each step parameter may include one or more A parameter point, the information of each parameter point include at least parameter name, parameter type, step parameter parameter identification and attribute Value.
Optionally, following steps can also be performed in above-mentioned processor: after obtaining with the test case template postponed, connecing Receive the edit instruction inputted by the template for displaying interface of test case template, wherein edit instruction is used to edit to match and postpone The information of step parameter in test case template;Step to be changed is shown on the parameter display interface of display step parameter Parameter;The deletion instruction or modification instruction of the step parameter for treating change are received by parameter display interface;If receiving deletion Instruction then deletes the step parameter to be changed that deletion instruction instruction is deleted, obtains updated test case template;If connecing Modification instruction is received, then shows the parameter setting interface of step parameter to be changed on the screen of terminal, passes through parameter setting Interface receives and stores modification information, obtains updated test case template.
Optionally, following steps can also be performed in above-mentioned processor: according to generation the number of steps of being based on each testing procedure While test case, the incidence relation of test case and test case template is established;In the step of being based on each testing procedure After data generate test case, test object is tested by the test case of generation.
Optionally, following steps can also be performed in above-mentioned processor: according to generation the number of steps of being based on each testing procedure After test case, receives the modification for modifying test case step in test case and request;Judging test case step is It is no to be provided with step parameter;If the not set step parameter of test case step, directly modification test case step the number of steps of According to, the number of steps of obtaining modified test case step evidence and modified test case;If test case step is provided with Step parameter then judges whether modification and the associated test case template of test case;If judging not modify and test case Associated test case template then releases being associated with for test case and test case template, and modifies the step of test case step Rapid data, the number of steps of obtaining modified test case step evidence and modified test case;If judging modification and surveying The associated test case template of example on probation is then modified the template data for corresponding to step parameter in test case template, and is synchronized more The association use-case of new test case template, wherein association use-case is the test case for having incidence relation with test case template.
Optionally, following steps can also be performed in above-mentioned processor: judging whether modification circle by modifying test case Face receives modification and the synchronous vacations of the associated test case template of test case instruct;If being received together by modifying interface Step modification instruction, then judge modification and the associated test case template of test case;If not received together by modifying interface Step modification instruction, then judge not modifying and the associated test case template of test case.
Test step is judged after computer gets each testing procedure in test case template using the application Suddenly whether it is provided with step parameter, if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and by the step The attribute value of rapid parameter is added into the initial data of testing procedure, obtains updated step data, in this scenario, according to The facilities of the step parameter of testing procedure, to determine whether needing to add the category of the actual step parameter of the testing procedure Property value into the initial data of the testing procedure, to realize the update of step data, and be based on the updated step data Test case is generated, test object is tested.It avoids by by data (the i.e. attribute of the step parameter of testing procedure Value) and test code in conjunction with mode update step data, caused lacks flexibility, realize that low efficiency and code are compiled Phenomenon at high cost is collected, the effect for improving the testing efficiency of UI automatic test is realized, and then solves and carries out UI automation The low technical problem of testing time-effectiveness rate.
It will appreciated by the skilled person that structure shown in Fig. 10 is only to illustrate, terminal is also possible to Smart phone (such as Android phone, iOS mobile phone), tablet computer, palm PC and mobile internet device (Mobile Internet Devices, MID), the terminal devices such as PAD.Those of ordinary skill in the art will appreciate that above-described embodiment is each All or part of the steps in kind method is that the relevant hardware of terminal device can be instructed to complete by program, which can To be stored in a computer readable storage medium, storage medium may include: flash disk, read-only memory (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc..
Figure 10 is a kind of hardware configuration of the terminal of generation method for test case of the embodiment of the present application Block diagram.As shown in Figure 10, terminal 10 may include one or more (one is only shown in figure) processor 102 (processing Device 102 can include but is not limited to the processing unit of Micro-processor MCV or programmable logic device FPGA etc.), for storing number According to memory 104 and for the transmitting device 106 of communication function.Memory 104 can be used for storing the software of application software Program and module, such as the corresponding program instruction/module of the generation method of the test case in the embodiment of the present application, processor 102 software programs and module being stored in memory 104 by operation, at various function application and data Reason, that is, realize the generation method of above-mentioned test case.Memory 104 may include high speed random access memory, may also include non-easy The property lost memory, such as one or more magnetic storage device, flash memory or other non-volatile solid state memories.Some In example, memory 104 can further comprise the memory remotely located relative to processor 102, these remote memories can To pass through network connection to terminal 10.The example of above-mentioned network includes but is not limited to internet, intranet, local Net, mobile radio communication and combinations thereof.
Transmitting device 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include The wireless network that the communication providers of terminal 10 provide.In an example, transmitting device 106 includes that a network is suitable Orchestration (Network Interface Controller, NIC), can be connected by base station with other network equipments so as to Internet is communicated.In an example, transmitting device 106 can be radio frequency (Radio Frequency, RF) module, For wirelessly being communicated with internet.
Embodiment 4
Embodiments herein additionally provides a kind of storage medium.Optionally, in the present embodiment, above-mentioned storage medium can With program code performed by the generation method for saving test case provided by above-described embodiment one.
Optionally, in the present embodiment, above-mentioned storage medium can be located in computer network in computer terminal group In any one terminal, or in any one mobile terminal in mobile terminal group.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: obtaining Take each testing procedure in test case template, wherein each testing procedure executes in sequence;If testing procedure is provided with Step parameter, then the attribute value of obtaining step parameter, and the attribute value of step parameter is added into the initial data of testing procedure In, obtain updated step data.
Test step is judged after computer gets each testing procedure in test case template using the application Suddenly whether it is provided with step parameter, if testing procedure is provided with step parameter, the attribute value of obtaining step parameter, and by the step The attribute value of rapid parameter is added into the initial data of testing procedure, updated step data is obtained, in this scenario, in life Before test case, to the attribute value of the testing procedure setting steps parameter in test case template, based on added with step The number of steps of attribute value of rapid parameter is to create the stage of test case just according to test case, the i.e. scheme of the present embodiment is generated The test case for directly generating the attribute value with specific step parameter obtains test without the stage in implementation of test cases Data (attribute value of i.e. above-mentioned step parameter) solve the problems, such as to carry out low efficiency when UI automatic test, realize and mention The effect of the testing efficiency of high UI automatic test.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: obtaining Take the parameter identification of step parameter, wherein parameter identification is used to describe the test case ownership and step ownership of step parameter;From Extracting parameter identifies corresponding parameter information in test case template, and parameter information includes parameter type and parameter name;From number According to the attribute value for reading type of correspondence parameter and parameter name in library.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: Before identifying corresponding parameter information from extracting parameter in test case template, obtain each in initial test case template Testing procedure;It is testing procedure configuration step parameter by parameter setting interface, obtains with the test case template postponed, In, each step parameter may include one or more parameter points, and the information of each parameter point includes at least parameter name, parameter The parameter identification and attribute value of type, step parameter.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: It obtains with after the test case template postponed, reception is referred to by the editor that the template for displaying interface of test case template inputs It enables, wherein edit instruction is used to edit the information with the step parameter in the test case template postponed;In display step parameter Parameter display interface on show step parameter to be changed;The step parameter for treating change is received by parameter display interface Delete instruction or modification instruction;If receiving deletion instruction, the step to be changed ginseng that deletion instruction instruction is deleted is deleted Number, obtains updated test case template;If receiving modification instruction, step to be changed is shown on the screen of terminal The parameter setting interface of parameter receives and stores modification information by parameter setting interface, obtains updated test case mould Plate.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: While generating test case based on updated step data, the incidence relation of test case and test case template is established; After generating test case based on updated step data, test object is tested by the test case of generation.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: After generating test case based on updated step data, the modification for modifying test case step in test case is received Request;Judge whether test case step is provided with step parameter;If the not set step parameter of test case step, is directly repaired The number of steps of changing test case step evidence, the number of steps of obtaining modified test case step evidence and modified test use Example;If test case step is provided with step parameter, judge whether modification and the associated test case template of test case;If Judge not modify with the associated test case template of test case, then release being associated with for test case and test case template, And the number of steps of modifying test case step evidence, the number of steps of obtaining modified test case step evidence and modified test Use-case;If judging modification and the associated test case template of test case, modifies and correspond to step ginseng in test case template Several template datas, and the association use-case of synchronized update test case template, wherein association use-case is to have with test case template Relevant test case.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: sentencing Disconnected whether modify with the associated test case template of test case includes: the modification interface judged whether by modifying test case The synchronous vacations for receiving modification and the associated test case template of test case instruct;If receiving synchronization by modifying interface Modification instruction, then judge modification and the associated test case template of test case;If not receiving synchronization by modifying interface Modification instruction, then judge not modifying and the associated test case template of test case.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
In above-described embodiment of the application, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, only A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the application whole or Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code Medium.
The above is only the preferred embodiment of the application, it is noted that for the ordinary skill people of the art For member, under the premise of not departing from the application principle, several improvements and modifications can also be made, these improvements and modifications are also answered It is considered as the protection scope of the application.

Claims (9)

1. a kind of generation method of test case characterized by comprising
Obtain each testing procedure in test case template, wherein each testing procedure executes in sequence;
If the testing procedure is provided with step parameter, the attribute value of the step parameter is obtained, and by the step parameter Attribute value be added into the initial data of the testing procedure, obtain updated step data;
Test case is generated based on the updated step data;
The modification for modifying test case step in the test case is received to request;
Judge whether the test case step is provided with the step parameter;
If the not set step parameter of test case step, the number of steps of directly modifying the test case step According to, the number of steps of obtaining modified test case step evidence and modified test case;
If the test case step is provided with the step parameter, judge whether modification and the associated survey of the test case Example template on probation;
If judge not modify with the associated test case template of the test case, release the test case and the survey The number of steps of trying out the association of example template, and modifying test case step evidence, obtains modified test case step Step data and modified test case;
If judging modification and the associated test case template of the test case, modify corresponding in the test case template The template data of the step parameter, and the association use-case of test case template described in synchronized update, wherein the association use-case To have the test case of the incidence relation with the test case template.
2. generation method according to claim 1, which is characterized in that the attribute value for obtaining the step parameter includes:
Obtain the parameter identification of the step parameter, wherein the test that the parameter identification is used to describe the step parameter is used Example ownership and step ownership;
The corresponding parameter information of the parameter identification is extracted from the test case template, the parameter information includes parameter class Type and parameter name;
The attribute value of the corresponding parameter type and the parameter name is read from database.
3. generation method according to claim 2, which is characterized in that extracting the ginseng from the test case template Before number identifies corresponding parameter information, the generation method further include:
Obtain each testing procedure in initial test case template;
It is that the testing procedure configures the step parameter by parameter setting interface, obtains with the test case mould postponed Plate, wherein each step parameter may include one or more parameter points, and the information of each parameter point includes at least The parameter name, the parameter type, the step parameter parameter identification and the attribute value.
4. generation method according to claim 3, which is characterized in that obtain with the test case template that postpones it Afterwards, the generation method further include:
Receive the edit instruction inputted by the template for displaying interface of the test case template, wherein the edit instruction is used In editor's information with the step parameter in the test case template postponed;
Step parameter to be changed is shown on the parameter display interface of display step parameter;
The deletion to the step parameter to be changed, which is received, by the parameter display interface instructs or modify instruction;
If receiving the deletion instruction, the step parameter to be changed deleting instruction instruction and deleting is deleted, is obtained To updated test case template;
If receiving the modification instruction, parameter setting circle of the step parameter to be changed is shown on the screen of terminal Face receives and stores modification information by the parameter setting interface, obtains the updated test case template.
5. generation method according to claim 1, which is characterized in that
While generating test case based on the updated step data, the generation method further include:
Establish the incidence relation of the test case Yu the test case template;
After generating test case based on the updated step data, the generation method further include: pass through generation The test case tests test object.
6. generation method according to claim 5, which is characterized in that judge whether that modification is associated with the test case Test case template includes:
Judge whether to receive modification and the associated test of the test case by the modification interface for modifying the test case The synchronous vacations of use-case template instruct;
If receiving the synchronous vacations by the modification interface to instruct, judge that modification is associated with the test case Test case template;
If not receiving the synchronous vacations by the modification interface to instruct, judges not modify and be closed with the test case The test case template of connection.
7. a kind of generating means of test case characterized by comprising
Module is obtained, for obtaining each testing procedure in test case template, wherein each testing procedure is according to suitable Sequence executes;
Processing module obtains the attribute value of the step parameter, and will if being provided with step parameter for the testing procedure The attribute value of the step parameter is added into the initial data of the testing procedure, obtains updated step data;
Generation module, for generating test case based on the updated step data;
Third receiving module, it is described for modifying for receiving after generating test case based on updated step data The modification request of test case step in test case;
First judgment module, for judging whether the test case step is provided with the step parameter;
First modified module directly modifies the test if being used for the not set step parameter of the test case step The number of steps of use-case step evidence, the number of steps of obtaining modified test case step evidence and modified test case;
Second judgment module judges whether modification and institute if being provided with the step parameter for the test case step State the associated test case template of test case;
Second modified module, if for judge not modify with the associated test case template of the test case, release institute The number of steps of stating being associated with for test case and the test case template, and modifying test case step evidence, is modified The number of steps of rear test case step evidence and modified test case;
Third modified module, if for judge modification with the associated test case template of the test case, modification described in The template data of the step parameter is corresponded in test case template, and the association of test case template described in synchronized update is used Example, wherein the association use-case is the test case for having the incidence relation with the test case template.
8. generating means according to claim 7, which is characterized in that the acquisition module is also used to obtain the step ginseng Several parameter identification, wherein the parameter identification is used to describe the test case ownership and step ownership of the step parameter;From The corresponding parameter information of the parameter identification is extracted in the test case template, the parameter information includes parameter type and ginseng Several titles;And the attribute value of the corresponding parameter type and the parameter name is read from database.
9. generating means according to claim 8, which is characterized in that the generating means further include:
Second acquisition submodule, for extracted from the test case template the corresponding parameter information of the parameter identification it Before, obtain each testing procedure in initial test case template;
Configuration module is obtained with postponing for being that the testing procedure configures the step parameter by parameter setting interface The test case template, wherein each step parameter may include one or more parameter points, each parameter point Information include at least the parameter name, the parameter type, the step parameter parameter identification and the attribute value.
CN201510570791.6A 2015-09-09 2015-09-09 The generation method and device of test case Active CN106528395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510570791.6A CN106528395B (en) 2015-09-09 2015-09-09 The generation method and device of test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510570791.6A CN106528395B (en) 2015-09-09 2015-09-09 The generation method and device of test case

Publications (2)

Publication Number Publication Date
CN106528395A CN106528395A (en) 2017-03-22
CN106528395B true CN106528395B (en) 2019-08-23

Family

ID=58345414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510570791.6A Active CN106528395B (en) 2015-09-09 2015-09-09 The generation method and device of test case

Country Status (1)

Country Link
CN (1) CN106528395B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107102941B (en) * 2017-03-30 2021-01-08 腾讯科技(深圳)有限公司 Test case generation method and device
CN109213671B (en) * 2017-06-30 2021-08-03 中国航发商用航空发动机有限责任公司 Software testing method and platform thereof
CN108319550A (en) * 2017-12-28 2018-07-24 华为技术有限公司 A kind of test system and test method
CN108228460A (en) * 2018-01-04 2018-06-29 广东睿江云计算股份有限公司 A kind of visual testing scenario generation method and system
CN108490922B (en) * 2018-04-27 2020-03-24 北京新能源汽车股份有限公司 Generation method and device of unified diagnostic service test case
CN109471796A (en) * 2018-10-16 2019-03-15 平安证券股份有限公司 Interface test method, device, computer equipment and storage medium
CN109697167B (en) * 2018-12-27 2022-03-25 江苏满运软件科技有限公司 Method and system for managing test variables, electronic device and storage medium
CN110297762A (en) * 2019-05-24 2019-10-01 平安银行股份有限公司 Plug-in type automatic test approach, device, computer equipment and storage medium
CN110704329A (en) * 2019-10-30 2020-01-17 一汽轿车股份有限公司 System with automatic code conversion function of electrical test case and conversion method
CN110874326B (en) * 2019-11-21 2023-10-27 望海康信(北京)科技股份公司 Test case generation method and device, computer equipment and storage medium
CN110888818A (en) * 2019-12-22 2020-03-17 普信恒业科技发展(北京)有限公司 Test case configuration system and method, automatic test system and method
CN111159028B (en) * 2019-12-23 2023-08-01 望海康信(北京)科技股份公司 Webpage testing method and device
CN111239626B (en) * 2020-01-21 2022-06-14 福建时代星云科技有限公司 Method for automatically generating automobile battery rapid detection scheme
CN111400186B (en) * 2020-03-19 2023-05-05 时时同云科技(成都)有限责任公司 Performance test method and system
CN112256571A (en) * 2020-10-20 2021-01-22 苏州市软件评测中心有限公司 Test case generation method and device and storage medium
CN112667494A (en) * 2020-12-08 2021-04-16 上海纳恩汽车技术股份有限公司 Automobile UDS automatic testing method and system based on configuration table and storage medium
CN114116449A (en) * 2021-10-25 2022-03-01 合众新能源汽车有限公司 Automatic test case parameterization method and device and electronic equipment
CN114328214B (en) * 2021-12-27 2023-05-12 深圳市六度人和科技有限公司 Efficiency improving method and device for interface test case of reporting software and computer equipment
CN115687140B (en) * 2022-11-10 2024-01-30 江苏衫数科技集团有限公司 Test case writing method and system based on automatic test

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777023A (en) * 2010-03-30 2010-07-14 成都市华为赛门铁克科技有限公司 Method and device for generating test cases
CN102831052A (en) * 2011-06-16 2012-12-19 中国银联股份有限公司 Automatic generating device and method for test case
CN102999320A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Automatic test case generation method and system
CN103176896A (en) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 Generating method and generating device of test cases
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
CN103577168A (en) * 2012-07-27 2014-02-12 鸿富锦精密工业(深圳)有限公司 Test case creation system and method
CN104503900A (en) * 2014-11-21 2015-04-08 北京奇虎科技有限公司 Test case generation method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8904354B2 (en) * 2012-12-31 2014-12-02 Ca, Inc. Rule based syntax software test case generator

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777023A (en) * 2010-03-30 2010-07-14 成都市华为赛门铁克科技有限公司 Method and device for generating test cases
CN102831052A (en) * 2011-06-16 2012-12-19 中国银联股份有限公司 Automatic generating device and method for test case
CN102999320A (en) * 2011-09-15 2013-03-27 阿里巴巴集团控股有限公司 Automatic test case generation method and system
CN103176896A (en) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 Generating method and generating device of test cases
CN103186457A (en) * 2011-12-29 2013-07-03 阿里巴巴集团控股有限公司 Method and device for automatically generating test case
CN103577168A (en) * 2012-07-27 2014-02-12 鸿富锦精密工业(深圳)有限公司 Test case creation system and method
CN103235759A (en) * 2013-05-15 2013-08-07 百度在线网络技术(北京)有限公司 Method and device for generating test cases
CN104503900A (en) * 2014-11-21 2015-04-08 北京奇虎科技有限公司 Test case generation method and device

Also Published As

Publication number Publication date
CN106528395A (en) 2017-03-22

Similar Documents

Publication Publication Date Title
CN106528395B (en) The generation method and device of test case
CN111310934B (en) Model generation method and device, electronic equipment and storage medium
CN112562114B (en) Data acquisition method and device
CN107608874A (en) Method of testing and device
CN107908542B (en) Test case creating method and device, computer equipment and storage medium
CN109857668A (en) UI automated function test method, test device, test equipment and storage medium
CN106033393B (en) A kind of applied program testing method and system and mobile terminal
CN105095059B (en) A kind of method and apparatus of automatic test
CN109146081B (en) Method and device for creating model project in machine learning platform
CN106326104A (en) Terminal control test method and apparatus
CN109669688A (en) Based on visual software development methodology, device, terminal device and storage medium
CN105373478B (en) Automated testing method and system
CN107741950A (en) Processing method, device, processor and the service end of data syn-chronization task
CN106446019B (en) A kind of software function treating method and apparatus
CN106933729A (en) A kind of method of testing and system based on cloud platform
CN107463362A (en) The method and system of lasting deployment based on multiple Jenkins
CN105843873A (en) System and method for managing data modeling
CN108600311B (en) Method and device for simulating interface data by client
CN107943707A (en) Test method, device and the storage medium and terminal of behavior tree
CN110833693B (en) Game running method and device, storage medium and electronic device
CN106528429A (en) UI testing method and device
CN109165170A (en) A kind of method and system automating request for test
CN110493812A (en) Processing method, device, system, processor and the main control device of distribution test
CN109947985A (en) Applied to the Processing with Neural Network method and device in on-line system
CN110058756A (en) A kind of mask method and device of image pattern

Legal Events

Date Code Title Description
C06 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240218

Address after: # 01-21, Lai Zan Da Building 1, 51 Belarusian Road, Singapore

Patentee after: Alibaba Singapore Holdings Ltd.

Country or region after: Singapore

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands