CN110362495A - A kind of interface enters to join function test method, device, equipment and storage medium - Google Patents
A kind of interface enters to join function test method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN110362495A CN110362495A CN201910655002.7A CN201910655002A CN110362495A CN 110362495 A CN110362495 A CN 110362495A CN 201910655002 A CN201910655002 A CN 201910655002A CN 110362495 A CN110362495 A CN 110362495A
- Authority
- CN
- China
- Prior art keywords
- parameter
- enter
- parameter value
- standard
- enters
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000010998 test method Methods 0.000 title claims abstract description 14
- 238000012360 testing method Methods 0.000 claims abstract description 112
- 241000208340 Araliaceae Species 0.000 claims abstract description 71
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims abstract description 71
- 235000003140 Panax quinquefolius Nutrition 0.000 claims abstract description 71
- 235000008434 ginseng Nutrition 0.000 claims abstract description 71
- 230000006870 function Effects 0.000 claims abstract description 28
- 238000000034 method Methods 0.000 claims abstract description 26
- 238000004590 computer program Methods 0.000 claims description 11
- 238000011990 functional testing Methods 0.000 claims description 7
- 235000013399 edible fruits Nutrition 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 8
- 230000000694 effects Effects 0.000 abstract description 3
- 239000000243 solution Substances 0.000 description 4
- 241001269238 Data Species 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3676—Test management for coverage analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of interfaces to enter to join function test method, method includes the following steps: the standard for obtaining interface to be measured enters ginseng;According to the parameter value create-rule of setting, the standard of automatically generating enters in ginseng and each enters the corresponding alternative parameter value of parameter;For it is each enter parameter, successively enter the corresponding each alternative parameter value of parameter using this and replace this to enter the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtains this and enters to join the corresponding final data of parameter;Interface requests are carried out using each final data respectively, obtain test result.Using technical solution provided by the embodiment of the present invention, operation is more simple, simplifies test process, improves testing efficiency, can ensure Test coverage face, can preferably adapt to quickly upgrading demand for software.The invention also discloses a kind of interfaces to enter to join device for testing functions, equipment and storage medium, has relevant art effect.
Description
Technical field
The present invention relates to the field of test technology, more particularly to a kind of interface enter to join function test method, device, equipment and
Storage medium.
Background technique
With the fast development of computer technology, the software with various functions is continuously developed out, to the life of people
It lives with work belt and much facilitates.Before software publication, needs to enter interface more and join function and test, i.e., will enter parameter
Certain parameter value is assigned, interface requests are carried out, obtains test result.
Currently, enter to join in functional test to interface, be mostly be manually entered by tester it is each enter parameter parameter
Value.Operate it is relatively complicated, and need to rely on the experience of tester to it is each enter parameter carry out the typing of parameter value, test
Covering surface can not ensure that testing efficiency is lower, can not adapt to quickly upgrading demand for software.
Summary of the invention
The object of the present invention is to provide a kind of interfaces to enter to join function test method, device, equipment and storage medium, with simplification
Test process improves testing efficiency, ensures Test coverage face.
In order to solve the above technical problems, the invention provides the following technical scheme:
A kind of interface enters to join function test method, comprising:
The standard for obtaining interface to be measured enters ginseng;
According to the parameter value create-rule of setting, automatically generates the standard and enter in ginseng each to enter the corresponding replacement of parameter
Parameter value;
For it is each enter parameter, successively enter the corresponding each alternative parameter value of parameter using this and replace this to enter to join parameter
Standard parameter value, and the standard parameter value for keeping other to enter parameter is constant, obtains this and enters the corresponding final data of parameter;
Interface requests are carried out using each final data respectively, obtain test result.
In a kind of specific embodiment of the invention, the parameter value create-rule according to setting automatically generates institute
The standard of stating enters in ginseng and each enters the corresponding alternative parameter value of parameter, comprising:
Determine that the standard enters the Format Type for each entering parameter in ginseng;
For it is each enter parameter, from the parameter value create-rule of setting, selection enters the Format Type of parameter with this
Corresponding rule automatically generates this and enters the corresponding alternative parameter value of parameter.
In a kind of specific embodiment of the invention, further includes:
According to the test result of acquisition, test log is generated;
The test log is pushed to setting personnel.
In a kind of specific embodiment of the invention, further includes:
For it is each enter parameter, if this enters at least one corresponding test result of parameter and normal implementing result not
Together, then this is entered into parameter and is determined as a kind of parameter;If this enter the corresponding all test results of parameter with it is described normal
Implementing result is identical, then this is entered parameter and be determined as two class parameters;The normal implementing result are as follows: enter ginseng using the standard
Carry out interface requests, the test result of acquisition;
When testing again, for it is each belong to a kind of parameter enter parameter, according to the parameter value create-rule, from
This enters the corresponding alternative parameter value of parameter for dynamic generation, successively enters the corresponding each alternative parameter value replacement of parameter using this and is somebody's turn to do
Enter the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtaining this, to enter parameter corresponding
Final data;
Successively replace the standard parameter value for belonging to each of two class parameters and entering parameter simultaneously using each preset parameter value,
And keep other belong to each of a kind of parameter enter parameter standard parameter value it is constant, obtain the corresponding final number of two class parameters
According to;
Repeat described the step of carrying out interface requests using each final data respectively, obtaining test result.
In a kind of specific embodiment of the invention, the preset parameter value is the parameter value being made of null character, and/
Or the parameter value being made of random digit, random lowercase, random capitalization, random Chinese character, spcial character, null character.
A kind of interface enters to join device for testing functions, comprising:
Standard enters ginseng and obtains module, and the standard for obtaining interface to be measured enters ginseng;
Alternative parameter value generation module automatically generates the standard and enters ginseng for the parameter value create-rule according to setting
In each enter the corresponding alternative parameter value of parameter;
Final data obtains module, and for successively being entered using this for parameter is each entered, parameter is corresponding each to be replaced
It changes parameter value and replaces this and enter the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, is somebody's turn to do
Enter the corresponding final data of parameter;
Test result obtains module, for carrying out interface requests using each final data respectively, obtains test result.
In a kind of specific embodiment of the invention, the alternative parameter value generation module is specifically used for:
Determine that the standard enters the Format Type for each entering parameter in ginseng;
For it is each enter parameter, from the parameter value create-rule of setting, selection enters the Format Type of parameter with this
Corresponding rule automatically generates this and enters the corresponding alternative parameter value of parameter.
In a kind of specific embodiment of the invention, further includes:
Parametric classification module, for for parameter is each entered, at least one corresponding test to be tied if this enters parameter
Fruit is different from normal implementing result, then this is entered parameter and be determined as a kind of parameter;If this enters the corresponding all surveys of parameter
Test result is identical as the normal implementing result, then this is entered parameter and be determined as two class parameters;The normal implementing result
Are as follows: enter ginseng using the standard and carries out interface requests, the test result of acquisition;
Testing execution module again belongs to a kind of parameter and enters to join parameter for when testing again for each, according to
The parameter value create-rule automatically generates this and enters the corresponding alternative parameter value of parameter, successively enters parameter using this and corresponds to
Each alternative parameter value replace this and enter the standard parameter value of parameter, and other is kept to enter the standard parameter value of parameter not
Become, obtains this and enter the corresponding final data of parameter;
Successively replace the standard parameter value for belonging to each of two class parameters and entering parameter simultaneously using each preset parameter value,
And keep other belong to each of a kind of parameter enter parameter standard parameter value it is constant, obtain the corresponding final number of two class parameters
According to;
It triggers the test result and obtains module.
A kind of interface enters to join functional test equipment, comprising:
Memory, for storing computer program;
Processor realizes that interface described in any of the above-described enters to join function test method when for executing the computer program
The step of.
A kind of computer readable storage medium is stored with computer program on the computer readable storage medium, described
Realize that interface described in any of the above-described enters the step of joining function test method when computer program is executed by processor.
Mark is automatically generated by the parameter value create-rule of setting using technical solution provided by the embodiment of the present invention
Each enter the corresponding alternative parameter value of parameter in access ginseng, and carries out standard parameter value for parameter is each entered automatically
Replacement obtains and each enters the corresponding final data of parameter, carries out interface requests using each final data respectively, is tested
As a result, operation is more simple compared to the setting for manually carrying out the parameter value into ginseng parameter, test process is simplified, is improved
Testing efficiency can ensure Test coverage face, can preferably adapt to quickly upgrading demand for software.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 enters to join the implementation flow chart of function test method for interface a kind of in the embodiment of the present invention;
Fig. 2 enters to join the structural schematic diagram of device for testing functions for interface a kind of in the embodiment of the present invention;
Fig. 3 enters to join the structural schematic diagram of functional test equipment for interface a kind of in the embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, with reference to the accompanying drawings and detailed description
The present invention is described in further detail.Obviously, described embodiments are only a part of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
It is shown in Figure 1, enter to join the implementing procedure of function test method for a kind of interface provided by the embodiment of the present invention
Figure, this method may comprise steps of:
S110: the standard for obtaining interface to be measured enters ginseng.
Interface to be measured can be any one interface of software under testing, and the parameter that enters of distinct interface may be different.First
It determines current interface to be measured, ginseng is then entered by the standard that the modes such as user's typing can obtain interface to be measured.Standard enters ginseng
In each enter parameter with standard parameter value.
User specifically can be tester, technical staff etc..
S120: according to the parameter value create-rule of setting, the standard of automatically generating enters in ginseng and each enters that parameter is corresponding to be replaced
Change parameter value.
In embodiments of the present invention, a parameter value create-rule can be preset.
Specifically, one option list of user can be supplied to, by user, selection parameter value generates rule from option list
The option being then based on:
1.1 length: entering to join length, is defaulted as 0, the i.e. length of selection standard parameter value;
Whether 1.2 numeric types: including number when generating into ginseng;Default is.
Whether 1.3 lowercases: including lowercase when generating into ginseng;Default is.
Whether 1.4 capitalizations: including capitalization when generating into ginseng;Default is.
Whether 1.5 Chinese characters (gbk): including Chinese character when generating into ginseng;Default be (chinese character think the length is
1)。
1.6 spcial characters (!" # $ %& ' () *+, -/:;≤ >? @[] ^_` { | }~): when generating into ginseng whether include
Spcial character;Default is.
1.7 null character (t n x0b x0c r): whether include null character when generating into ginseng;Default is.
1.8 it is customized enter ginseng: support user's typing enter ginseng definition, such as sql injection.
1.9 character priority grades:
At 1.1 (length) >=6, firstly generate each random character (length 6) in 1.2-1.7, it is remaining from
It is obtained at random in 1.2-1.7, supplies 1.1 (length).
If length is unsatisfactory for, priority are as follows: Chinese character > null character > spcial character > capitalization=lowercase=number
Word.
It, can be with setup parameter value create-rule according to the option that user selects.For example, if above-mentioned whole option is equal
It is selected, then parameter value create-rule is as follows:
2.1: null character;
2.2: including 1 random digit, 1 random lowercase, 1 random capitalization, 1 random Chinese character, whole
Spcial character, whole null character;
2.3: " standard parameter value for entering parameter " meets cell-phone number format: generating a cell-phone number at random;
2.4: " standard parameter value for entering parameter " meets cell-phone number format: generating a cell-phone number at random and removes last
One;
2.5: " standard parameter value for entering parameter " meets cell-phone number format: generating a cell-phone number at random and increases by one
Random number word bit;
2.6: " standard parameter value for entering parameter " meets date format: generating a date-time at random;
2.7: " standard parameter value for entering parameter " meets date format: generating one " standard parameter value for entering parameter "
The preceding 1 year time;
2.8: " standard parameter value for entering parameter " meets date format: generating one " standard parameter value for entering parameter "
The 1 year time afterwards;
2.9: " standard parameter value for entering parameter " meets real number format: generating a random decimal;
2.10: " standard parameter value for entering parameter " meets real number format: -1;
2.11: " standard parameter value for entering parameter " meets real number format: 0;
2.12: " standard parameter value for entering parameter " meets real number format: generate a units be equal to 1.1 (length) with
Machine number;
2.13: " standard parameter value for entering parameter " meets real number format: generating a units and is equal to 1.1 (length) 1.2
The random number of (rounding up) again;
2.14: " standard parameter value for entering parameter " meets mailbox format: generating a random mailbox;
2.15: " standard parameter value for entering parameter " meets mailbox format: generate a length be equal to 1.1 (length) with
Machine character string;
2.16: " standard parameter value for entering parameter " meets string format, and: 1.2-1.7 is in the case where being, according to
1.9 priority obtains;It is then a random Chinese character when such as 1.1 (length), be 1 and 1.5 (Chinese characters) be "Yes", if 1.1 (grow
Degree) it is then a random null character when to be 1 and 1.5 (Chinese characters) be "No";It is "Yes" if 1.1 (length) are 2 and 1.5 (Chinese characters)
When, then it is random Chinese character+one random null character;And so on.Generate the random string for being equal to 1.1 (length);
2.17: " standard parameter value for entering parameter " meets string format: with 2.16, generating 1.1 (length) 1.2 double-lengths
Spend the random string of (rounding up);
2.18: the non-empty of typing frame typing is customized to enter to join.
It should be noted that above-mentioned parameter value create-rule is merely illustrative, it in practical applications, can be according to practical feelings
Condition is set.
According to the parameter value create-rule of setting, standard can be automatically generated and enter in ginseng each to enter the corresponding replacement of parameter
Parameter value.
In a kind of specific embodiment of the invention, it can first determine that standard enters the format class for each entering parameter in ginseng
Type, then for parameter is each entered, from the parameter value create-rule of setting, selection enters the Format Type pair of parameter with this
The rule answered automatically generates this and enters the corresponding alternative parameter value of parameter.
As the standard of acquisition enters the json format of ginseng are as follows:
{"key1":"value1","key2":["list_1","list_2"]}。
By taking above-mentioned parameter value create-rule as an example, if the standard parameter value of " value1 " is phone number, i.e., this enters ginseng
The Format Type of parameter is cell-phone number Format Type, and can choose corresponding rule is 2.1-2.5, and this of generation enters parameter pair
The alternative parameter value answered be respectively [", ' 0aA!" # $ %& ' () *+, -/:;≤ >? @[] ^_` { | }~t n r x0b
X0c grants ', ' 15577778892', ' 1557777888', ' 155777788880', ' customized enter ginseng '];
If the standard parameter value of " value1 " is the date, i.e., the Format Type for entering parameter is date format type, can
To select corresponding rule for 2.1,2.2,2.6-2.8, based on these rules, automatically generates this and enter the corresponding replacement ginseng of parameter
Numerical value;
If the standard parameter value of " value1 " is real number, i.e., the Format Type for entering parameter is real number Format Type, can
To select corresponding rule for 2.1,2.2,2.9-2.13, based on these rules, automatically generates this and enter the corresponding replacement of parameter
Parameter value;
If the standard parameter value of " value1 " is mailbox, i.e., the Format Type for entering parameter is mailbox Format Type, can
To select corresponding rule for 2.1,2.2,2.14,2.15, based on these rules, automatically generates this and enter the corresponding replacement of parameter
Parameter value;
If the standard parameter value of " value1 " is character string, i.e., the Format Type for entering parameter is string format class
Type, can choose corresponding rule as 2.1,2.2,2.16,2.17, and based on these rules, automatically generating this, to enter parameter corresponding
Alternative parameter value.
It is to be carried out to the generation for the alternative parameter value for entering parameter " value1 " for example, joining for entering ginseng above
The generation of the alternative parameter value of number " list_1 ", " list_2 " similarly, is not repeated to illustrate.
The standard of automatically generating enter ginseng in each enter the corresponding alternative parameter value of parameter after, step S130 can be continued to execute
Operation.
S130: for it is each enter parameter, successively enter the corresponding each alternative parameter value of parameter using this and replace this
Join the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, and obtaining this, to enter parameter corresponding most
Whole data.
In step S120 according to the parameter value create-rule of setting, the standard of automatically generating enters each to enter parameter in ginseng corresponding
Alternative parameter value after, each enter parameter and corresponded to one or more alternative parameter values.
For it is each enter parameter, successively enter the corresponding each alternative parameter value of parameter using this and replace this to enter to join parameter
Standard parameter value, and it is constant to keep other to enter the corresponding each standard parameter value of parameter, and obtaining this, to enter parameter corresponding
Final data.One enters parameter and corresponds to several alternative parameter values, this enters parameter and corresponds to several final datas.
Continuation is illustrated by taking above example as an example.
The corresponding alternative parameter value of parameter " value1 " that enters generated is respectively as follows:
[",'0aA!" # $ %& ' () *+, -/:;≤ >? @[] ^_` { | }~t n r x0b x0c grant ', '
15577778892', ' 1557777888', ' 155777788880', ' customized enter ginseng '].
Successively { " key1 ": " value1 ", " key2 ": [" list_ is replaced using each alternative parameter value in the list
1 ", " list_2 "] } in enter the standard of parameter " value1 " and enter ginseng value, and other is kept to enter the standard parameter value of parameter not
Become, obtains and be respectively as follows: into the corresponding final data of ginseng parameter " value1 "
{"key1":"","key2":["list_1","list_2"]};
{"key1":"0aA!" # $ %& ' () *+, -/:;≤ >? @[] ^_` { | }~t n r x0b x0c grant ", "
key2":["list_1","list_2"]};
{"key1":"'15577778892'","key2":["list_1","list_2"]};
{"key1":"'1557777888'","key2":["list_1","list_2"]};
{"key1":"'155777788880'","key2":["list_1","list_2"]};
{ " key1 ": " customized to enter to join ", " key2 ": [" list_1 ", " list_2 "] }.
Enter parameter " value1 " corresponding 6 alternative parameter values, this finally obtained enters the corresponding final data of parameter
There are 6.
Similarly, it can obtain respectively into ginseng parameter " list_1 ", " list_2 " corresponding final data.
S140: carrying out interface requests using each final data respectively, obtains test result.
It obtains after each entering the corresponding final data of parameter, carries out interface requests using each final data respectively, obtain
Obtain test result.For each final data, corresponding test result can be interface whether the normal response final data, be
It is no to return to normal implementing result, if to return to abnormal implementing result, whether system malfunctions.
In one embodiment of the invention, test log can be generated, by test log according to the test result of acquisition
It is pushed to setting personnel.Setting personnel such as are pushed to by mail, phone number, client terminals, so that setting personnel's root
Determine whether that the interface is entered to join function to optimize according to test log.
Using method provided by the embodiment of the present invention, by the parameter value create-rule of setting, the standard of automatically generating enters
Each enter the corresponding alternative parameter value of parameter in ginseng, and carry out the replacement of standard parameter value for parameter is each entered automatically,
It obtains and each enters the corresponding final data of parameter, carry out interface requests using each final data respectively, obtain test result,
Compared to the setting for manually carrying out the parameter value into ginseng parameter, operation is more simple, simplifies test process, improves test effect
Rate can ensure Test coverage face, can preferably adapt to quickly upgrading demand for software.
In one embodiment of the invention, this method may also comprise the following steps::
Step 1: for it is each enter parameter, if this enters at least one corresponding test result of parameter and normally holds
Row result is different, then this is entered parameter and be determined as a kind of parameter;If this enter the corresponding all test results of parameter with
Normal implementing result is identical, then this is entered parameter and be determined as two class parameters;Normal implementing result are as follows: enter ginseng using standard and carry out
Interface requests, the test result of acquisition.
In embodiments of the present invention, obtain interface to be measured standard enter ginseng after, the standard can be used enter ginseng and connect
Mouth request, the test result of acquisition is normal implementing result.
Interface requests are carried out using each final data respectively, obtain the corresponding test result of each final data.Standard
Enter each to enter in ginseng parameter and correspond to one or more final datas, while can also correspond to one or more test results.
For it is each enter parameter, this can be entered to the corresponding each test result of parameter and normal implementing result and carried out
Compare, it is determined whether identical, if this enters parameter, at least one corresponding test result is different from normal implementing result, can
Be determined as a kind of parameter so that this is entered parameter, show this enter influence of the different parameters value of parameter for test result compared with
Greatly, if this enters parameter, corresponding all test results are identical as normal implementing result, this can be entered to join parameter true
It is set to two class parameters, it is smaller shows that this enters influence of the different parameters value of parameter for test result.
Step 2: when testing again, for it is each belong to a kind of parameter enter parameter, generate and advise according to parameter value
Then, it automatically generates this and enters the corresponding alternative parameter value of parameter, successively enter the corresponding each alternative parameter value of parameter using this
It replaces this and enters the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtain this and enter to join parameter
Corresponding final data.
In practical applications, the test of interface to be measured can be carried out according to the setting period, or had in software program
It is carried out when update.The behaviour of step S110 to step S140 can be executed in the first test for entering to join function to interface to be measured
Make, obtains test result, can also need to be performed both by step S110 extremely to entering in the test for joining function for interface to be measured every time
The operation of step S140 obtains test result.
In embodiments of the present invention, it after the operation for executing step S110 to step S140, is carried out for entering parameter
The division of a kind of parameter and two class parameters.When needing to test interface to be measured again, one kind can be belonged to for each
Parameter enters parameter, according to parameter value create-rule, automatically generates this and enters the corresponding alternative parameter value of parameter, successively use
This, which enters the corresponding each alternative parameter value of parameter, replaces this and enters the standard parameter value of parameter, and other is kept to enter parameter
Standard parameter value is constant, obtains this and enters the corresponding final data of parameter.The process is referred to step S120 to step S130
Operating process, details are not described herein.
Step 3: the standard for belonging to each of two class parameters and entering parameter is successively replaced simultaneously using each preset parameter value
Parameter value, and keep other belong to each of a kind of parameter enter parameter standard parameter value it is constant, it is corresponding to obtain two class parameters
Final data.
In embodiments of the present invention, preset parameter value can be set, preset parameter value is specifically as follows to be made of null character
Parameter value, and/or by random digit, random lowercase, random capitalization, random Chinese character, spcial character, null character structure
At parameter value.
Successively replace the standard parameter value for belonging to each of two class parameters and entering parameter simultaneously using each preset parameter value,
And keep other belong to each of a kind of parameter enter parameter standard parameter value it is constant, obtain the corresponding final number of two class parameters
According to.
For example, if entering the interface that the corresponding final data of parameter " value1 " obtains returns the result i.e. test result
There is variation, then will enter parameter " value1 " and be labeled as a kind of parameter, when testing again, still generates replacement ginseng according to 2.1-2.5
Numerical value, which obtains, finally enters ginseng;
It is not changed if entering the interface that the corresponding final data of parameter " value1 " obtains and returning the result i.e. test result,
Parameter " value1 " will then be entered labeled as two class parameters, when testing again, only obtained with 2.2 and 2.3 generation alternative parameter values
Final data;
If entering parameter " value1 " for a kind of parameter, " list_1 ", " list_2 " etc. it is multiple enter parameter be two classes
Parameter then executes batch in alternative parameter and replaces, keeps the standard parameter value into ginseng parameter " value1 " constant, two obtained
The corresponding final data of class parameter are as follows:
{"key1":"value1","key2":["",""]};
{"key1":"value1","key2":["0aA!" # $ %& ' () *+, -/:;≤ >? @[] ^_` { | }~t
N r x0b x0c grant ", " 0aA!" # $ %& ' () *+, -/:;≤ >? @[] ^_` { | }~t n r x0b x0c grant "].
I.e. all two classes parameters execute interface requests twice altogether.
Step 4: it repeats step S140 and carries out interface requests using each final data respectively, obtain test result
Operation.
In embodiments of the present invention, for it is each belong to a kind of parameter enter parameter, obtaining this, to enter parameter corresponding
Final data obtains the corresponding final data of two class parameters for two class parameters.Interface is carried out using each final data respectively
Request, can obtain test result.
Provided method through the embodiment of the present invention, when execution interface enters to join functional test, it is only necessary to user's typing
One standard enters ginseng, and can automatically generate needs interface to be tested to enter parameter evidence, initiates request and returns the result.Greatly subtract
Few manual operation process improves the coverage rate into ginseng test.After the completion of test, by judging into ginseng parameter to test result
Whether have an impact and carry out flag parameters type, improves the execution efficiency of test next time.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of interfaces to enter to join device for testing functions,
A kind of interface described below enter to join device for testing functions enter to join function test method with a kind of above-described interface can be mutual
To should refer to.
Shown in Figure 2, which includes:
Standard enters ginseng and obtains module 210, and the standard for obtaining interface to be measured enters ginseng;
Alternative parameter value generation module 220, for the parameter value create-rule according to setting, the standard of automatically generating enters in ginseng
Each enter the corresponding alternative parameter value of parameter;
Final data obtains module 230, and for for parameter is each entered, successively using this, to enter parameter corresponding each
Alternative parameter value replaces this and enters the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtains
This enters the corresponding final data of parameter;
Test result obtains module 240, for carrying out interface requests using each final data respectively, obtains test knot
Fruit.
Using device provided by the embodiment of the present invention, by the parameter value create-rule of setting, the standard of automatically generating enters
Each enter the corresponding alternative parameter value of parameter in ginseng, and carry out the replacement of standard parameter value for parameter is each entered automatically,
It obtains and each enters the corresponding final data of parameter, carry out interface requests using each final data respectively, obtain test result,
Compared to the setting for manually carrying out the parameter value into ginseng parameter, operation is more simple, simplifies test process, improves test effect
Rate can ensure Test coverage face, can preferably adapt to quickly upgrading demand for software.
In a kind of specific embodiment of the invention, alternative parameter value generation module 220 is specifically used for:
The standard of determination enters the Format Type for each entering parameter in ginseng;
For it is each enter parameter, from the parameter value create-rule of setting, selection enters the Format Type of parameter with this
Corresponding rule automatically generates this and enters the corresponding alternative parameter value of parameter.
In a kind of specific embodiment of the invention, further includes test log pushing module, is used for:
According to the test result of acquisition, test log is generated;
Test log is pushed to setting personnel.
In a kind of specific embodiment of the invention, further includes:
Parametric classification module, for for parameter is each entered, at least one corresponding test to be tied if this enters parameter
Fruit is different from normal implementing result, then this is entered parameter and be determined as a kind of parameter;If this enters the corresponding all surveys of parameter
Test result is identical as normal implementing result, then this is entered parameter and be determined as two class parameters;Normal implementing result are as follows: use mark
Access ginseng carries out interface requests, the test result of acquisition;
Testing execution module again belongs to a kind of parameter and enters to join parameter for when testing again for each, according to
Parameter value create-rule automatically generates this and enters the corresponding alternative parameter value of parameter, and successively using this, to enter parameter corresponding every
A alternative parameter value replaces this and enters the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtains
It obtains this and enters the corresponding final data of parameter;
Successively replace the standard parameter value for belonging to each of two class parameters and entering parameter simultaneously using each preset parameter value,
And keep other belong to each of a kind of parameter enter parameter standard parameter value it is constant, obtain the corresponding final number of two class parameters
According to;
It triggers test result and obtains module 240.
In a kind of specific embodiment of the invention, preset parameter value is the parameter value being made of null character, and/or by
The parameter value that random digit, random lowercase, random capitalization, random Chinese character, spcial character, null character are constituted.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of interfaces to enter to join functional test equipment,
As shown in figure 3, the equipment includes:
Memory 310, for storing computer program;
Processor 320 realizes that any of the above-described interface enters to join the step of function test method when for executing computer program
Suddenly.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of computer readable storage medium, meters
It is stored with computer program on calculation machine readable storage medium storing program for executing, any of the above-described interface is realized when computer program is executed by processor
Enter the step of joining function test method.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with it is other
The difference of embodiment, same or similar part may refer to each other between each embodiment.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
Used herein a specific example illustrates the principle and implementation of the invention, and above embodiments are said
It is bright to be merely used to help understand technical solution of the present invention and its core concept.It should be pointed out that for the common of the art
, without departing from the principle of the present invention, can be with several improvements and modifications are made to the present invention for technical staff, these
Improvement and modification are also fallen within the protection scope of the claims of the present invention.
Claims (10)
1. a kind of interface enters to join function test method characterized by comprising
The standard for obtaining interface to be measured enters ginseng;
According to the parameter value create-rule of setting, automatically generates the standard and enter in ginseng each to enter the corresponding alternative parameter of parameter
Value;
For it is each enter parameter, successively enter the corresponding each alternative parameter value of parameter using this and replace the mark for entering parameter
Quasi- parameter value, and the standard parameter value for keeping other to enter parameter is constant, obtains this and enters the corresponding final data of parameter;
Interface requests are carried out using each final data respectively, obtain test result.
2. the method according to claim 1, wherein the parameter value create-rule according to setting, automatic raw
Enter in ginseng at the standard and each enter the corresponding alternative parameter value of parameter, comprising:
Determine that the standard enters the Format Type for each entering parameter in ginseng;
For it is each enter parameter, from the parameter value create-rule of setting, select it is corresponding with the Format Type for entering parameter
Rule, automatically generate this and enter the corresponding alternative parameter value of parameter.
3. the method according to claim 1, wherein further include:
According to the test result of acquisition, test log is generated;
The test log is pushed to setting personnel.
4. according to claim 1 to described in any item methods among 3, which is characterized in that further include:
For it is each enter parameter, if this enters parameter, at least one corresponding test result is different from normal implementing result,
This is then entered into parameter and is determined as a kind of parameter;If this enter the corresponding all test results of parameter with the normal execution
As a result identical, then this is entered into parameter and is determined as two class parameters;The normal implementing result are as follows: enter ginseng using the standard and carry out
Interface requests, the test result of acquisition;
When testing again, for it is each belong to a kind of parameter enter parameter, it is automatic raw according to the parameter value create-rule
Enter the corresponding alternative parameter value of parameter at this, successively using this enter the corresponding each alternative parameter value of parameter replace this enter ginseng
The standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtaining this, to enter parameter corresponding final
Data;
Successively belong to each of two class parameters using the replacement simultaneously of each preset parameter value and enter the standard parameter value of parameter, and protects
Hold other belong to each of a kind of parameter enter parameter standard parameter value it is constant, obtain the corresponding final data of two class parameters;
Repeat described the step of carrying out interface requests using each final data respectively, obtaining test result.
5. according to the method described in claim 4, it is characterized in that, the preset parameter value is the parameter being made of null character
Value, and/or the ginseng being made of random digit, random lowercase, random capitalization, random Chinese character, spcial character, null character
Numerical value.
6. a kind of interface enters to join device for testing functions characterized by comprising
Standard enters ginseng and obtains module, and the standard for obtaining interface to be measured enters ginseng;
Alternative parameter value generation module automatically generates the standard and enters in ginseng often for the parameter value create-rule according to setting
It is a enter the corresponding alternative parameter value of parameter;
Final data obtains module, for successively entering the corresponding each replacement of parameter using this and joining for parameter is each entered
Numerical value replaces this and enters the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtains this and enters ginseng
The corresponding final data of parameter;
Test result obtains module, for carrying out interface requests using each final data respectively, obtains test result.
7. device according to claim 6, which is characterized in that the alternative parameter value generation module is specifically used for:
Determine that the standard enters the Format Type for each entering parameter in ginseng;
For it is each enter parameter, from the parameter value create-rule of setting, select it is corresponding with the Format Type for entering parameter
Rule, automatically generate this and enter the corresponding alternative parameter value of parameter.
8. device according to claim 6 or 7, which is characterized in that further include:
Parametric classification module, for for each enter parameter, if this enter at least one corresponding test result of parameter with
Normal implementing result is different, then this is entered parameter and be determined as a kind of parameter;If this enters the corresponding all test knots of parameter
Fruit is identical as the normal implementing result, then this is entered parameter and be determined as two class parameters;The normal implementing result are as follows: make
Enter ginseng with the standard and carries out interface requests, the test result of acquisition;
Testing execution module again, for when testing again, for it is each belong to a kind of parameter enter parameter, according to described
Parameter value create-rule automatically generates this and enters the corresponding alternative parameter value of parameter, and successively using this, to enter parameter corresponding every
A alternative parameter value replaces this and enters the standard parameter value of parameter, and the standard parameter value for keeping other to enter parameter is constant, obtains
It obtains this and enters the corresponding final data of parameter;
Successively belong to each of two class parameters using the replacement simultaneously of each preset parameter value and enter the standard parameter value of parameter, and protects
Hold other belong to each of a kind of parameter enter parameter standard parameter value it is constant, obtain the corresponding final data of two class parameters;
It triggers the test result and obtains module.
9. a kind of interface enters to join functional test equipment characterized by comprising
Memory, for storing computer program;
Processor realizes that the interface as described in any one of claim 1 to 5 enters to join function survey when for executing the computer program
The step of method for testing.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program realizes that the interface as described in any one of claim 1 to 5 enters to join functional test when the computer program is executed by processor
The step of method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910655002.7A CN110362495B (en) | 2019-07-19 | 2019-07-19 | Interface parameter entering function test method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910655002.7A CN110362495B (en) | 2019-07-19 | 2019-07-19 | Interface parameter entering function test method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110362495A true CN110362495A (en) | 2019-10-22 |
CN110362495B CN110362495B (en) | 2023-12-19 |
Family
ID=68220422
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910655002.7A Active CN110362495B (en) | 2019-07-19 | 2019-07-19 | Interface parameter entering function test method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110362495B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112286812A (en) * | 2020-10-30 | 2021-01-29 | 上海莉莉丝科技股份有限公司 | JSON data processing method, system, device and medium |
CN113111005A (en) * | 2021-05-06 | 2021-07-13 | 腾讯科技(深圳)有限公司 | Application program testing method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140109228A1 (en) * | 2012-10-16 | 2014-04-17 | International Business Machines Corporation | Transforming unit tests for security testing |
CN108804327A (en) * | 2018-06-12 | 2018-11-13 | 北京京东金融科技控股有限公司 | A kind of method and apparatus of automatic Data Generation Test |
CN109101415A (en) * | 2018-06-25 | 2018-12-28 | 平安科技(深圳)有限公司 | Interface test method, system, equipment and the storage medium compared based on database |
-
2019
- 2019-07-19 CN CN201910655002.7A patent/CN110362495B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140109228A1 (en) * | 2012-10-16 | 2014-04-17 | International Business Machines Corporation | Transforming unit tests for security testing |
CN108804327A (en) * | 2018-06-12 | 2018-11-13 | 北京京东金融科技控股有限公司 | A kind of method and apparatus of automatic Data Generation Test |
CN109101415A (en) * | 2018-06-25 | 2018-12-28 | 平安科技(深圳)有限公司 | Interface test method, system, equipment and the storage medium compared based on database |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112286812A (en) * | 2020-10-30 | 2021-01-29 | 上海莉莉丝科技股份有限公司 | JSON data processing method, system, device and medium |
CN113111005A (en) * | 2021-05-06 | 2021-07-13 | 腾讯科技(深圳)有限公司 | Application program testing method and device |
CN113111005B (en) * | 2021-05-06 | 2024-11-01 | 腾讯科技(深圳)有限公司 | Application program testing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110362495B (en) | 2023-12-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9639453B2 (en) | Method and system for determining functional tests to execute based on code coverage | |
CN105511873B (en) | User interface control display method and device | |
CN111401722B (en) | Intelligent decision method and intelligent decision system | |
CN108388515A (en) | Test data generating method, device, equipment and computer readable storage medium | |
CN110633078B (en) | Method and device for automatically generating feature calculation codes | |
CN108255707A (en) | Development roles creation method, device, equipment and the storage medium of test case | |
CN113342692B (en) | Automatic test case generation method and device, electronic equipment and storage medium | |
CN106502642A (en) | A kind of evaluation method of eda tool and system | |
CN110362495A (en) | A kind of interface enters to join function test method, device, equipment and storage medium | |
CN109902251A (en) | Scheme Choice method, apparatus, terminal and readable storage medium storing program for executing based on decision tree | |
CN111737609A (en) | WEB system menu bar display method, terminal and storage medium | |
CN106776165A (en) | Server performance method of testing and system | |
CN109086090A (en) | A kind of method, apparatus, equipment and the storage medium of server B MC configuration | |
US8606762B2 (en) | Data quality administration framework | |
CN112346962B (en) | Control data testing method and device applied to control testing system | |
JP2012190063A (en) | Data generation device and data generation program | |
CN111124854A (en) | Method, system, terminal and storage medium for distributing smoking test cases | |
CN112732242B (en) | Method and device for generating wide-table processing script | |
CN112181419B (en) | Interface generation method and device and storage medium | |
CN113641567A (en) | Database inspection method and device, electronic equipment and storage medium | |
CN107291767A (en) | The optimized treatment method and device of task execution time | |
CN112306850B (en) | Test case generation method, device and storage medium | |
CN113064640B (en) | BIOS option verification method, system and medium | |
CN113535038A (en) | Front-end menu tree generation method and device, computer equipment and storage medium | |
CN113448872B (en) | Test execution method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |