CN110134584A - A kind of generation method, device, storage medium and the server of interface testing use-case - Google Patents

A kind of generation method, device, storage medium and the server of interface testing use-case Download PDF

Info

Publication number
CN110134584A
CN110134584A CN201910294085.1A CN201910294085A CN110134584A CN 110134584 A CN110134584 A CN 110134584A CN 201910294085 A CN201910294085 A CN 201910294085A CN 110134584 A CN110134584 A CN 110134584A
Authority
CN
China
Prior art keywords
field
interface
join
case
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910294085.1A
Other languages
Chinese (zh)
Inventor
孙锦程
徐志成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201910294085.1A priority Critical patent/CN110134584A/en
Publication of CN110134584A publication Critical patent/CN110134584A/en
Priority to PCT/CN2019/121678 priority patent/WO2020207034A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to field of computer technology, propose generation method, device, storage medium and the server of a kind of interface testing use-case.This method comprises: obtaining the interface document constructed in advance;The interface document is parsed, obtains therein entering to join field and field attribute;Enter to join field and field attribute according to described, building each enters to join the actual parameter collection and Invalid parameter collection of field respectively;Enter to join the actual parameter of field and concentrate and choose actual parameter respectively and be combined from each, generates the positive test use-case of the interface to be measured;The Invalid parameter for entering to join field from more than one, which is concentrated, chooses Invalid parameter, with from except it is one it is above enter in addition to joining field it is other enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, the negative test use-case of the generation interface to be measured.It is arranged in this way, when interface needs to modify, related personnel only needs to modify the relevant information in interface document, it is not necessary to rewrite interface testing use-case.

Description

A kind of generation method, device, storage medium and the server of interface testing use-case
Technical field
The present invention relates to field of computer technology more particularly to a kind of generation methods of interface testing use-case, device, storage Medium and server.
Background technique
For internet industry, many terminal devices, such as mobile phone, pc are to be carried out by background service with terminal user Interaction, interface testing have very important significance.Due to especially internet financing corporation, Internet company, online product section It plays fastly, version updating iteration is frequent, and it is heavy so as to cause interface testing task, when especially interface needs to modify, need to test Personnel modify or rewrite interface testing use-case, and efficiency is very low.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of generation method of interface testing use-case, device, storage medium and Server can be improved the efficiency of interface testing.
The embodiment of the present invention in a first aspect, providing a kind of generation method of interface testing use-case, comprising:
Obtain the interface document that constructs in advance, the interface document record that interface to be measured has it is each enter join field and The attribute of each field;
The interface document is parsed, obtains therein entering to join field and field attribute;
Enter to join field and field attribute according to described, building each enters to join the actual parameter collection and Invalid parameter of field respectively Collection, the actual parameter integrate the set of the actual parameter within the effective range for falling into field attribute restriction as value, the nothing Effect parameter set is the set for the Invalid parameter that value is fallen into except the effective range of field attribute restriction;
Enter to join the actual parameter of field and concentrate and choose actual parameter respectively and be combined from each, generates the interface to be measured Positive test use-case;
The Invalid parameter for entering to join field from more than one, which is concentrated, chooses Invalid parameter, and from except entering to join word more than one Other outside section enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, and generate the reverse of the interface to be measured Test case.
The second aspect of the embodiment of the present invention provides a kind of generating means of interface testing use-case, comprising:
Interface document obtains module, and for obtaining the interface document constructed in advance, the interface document records interface to be measured What is had each enters to join the attribute of field and each field;
Interface document parsing module obtains therein entering to join field and field attribute for parsing the interface document;
Parameter set constructs module, joins field and field attribute for entering according to, and building each enters to join field respectively Actual parameter collection and Invalid parameter collection, the actual parameter integrate having within the effective range for falling into field attribute restriction as value The set of parameter is imitated, the Invalid parameter integrates the collection of the Invalid parameter except the effective range for falling into field attribute restriction as value It closes;
Positive test use-case generation module, for from it is each enter join field actual parameter concentration choose actual parameter respectively It is combined, generates the positive test use-case of the interface to be measured;
Negative test use-case generation module, the Invalid parameter for entering to join field from more than one, which is concentrated, chooses invalid ginseng Number, with from except it is one it is above enter in addition to joining field other enter to join the actual parameter of field and concentrate the actual parameter progress chosen Combination generates the negative test use-case of the interface to be measured.
The third aspect of the embodiment of the present invention, provides a kind of computer readable storage medium, described computer-readable to deposit Storage media is stored with computer-readable instruction, and such as the embodiment of the present invention is realized when the computer-readable instruction is executed by processor First aspect propose interface testing use-case generation method the step of.
The fourth aspect of the embodiment of the present invention, provides a kind of server, including memory, processor and is stored in institute The computer-readable instruction that can be run in memory and on the processor is stated, the processor executes described computer-readable The step of generation method for the interface testing use-case that the first aspect such as the embodiment of the present invention proposes is realized when instruction.
The generation method of interface testing use-case proposed by the present invention includes: the interface document for obtaining and constructing in advance;Parsing institute Interface document is stated, obtains therein entering to join field and field attribute;Enter to join field and field attribute according to described, building is every respectively It is a to enter to join the actual parameter collection and Invalid parameter collection of field;From it is each enter join field actual parameter concentrate respectively choose effectively ginseng Number is combined, and generates the positive test use-case of the interface to be measured;The Invalid parameter for entering to join field from more than one concentrates choosing Take Invalid parameter, with from enter more than one in addition to joining field it is other enter join field actual parameter concentrate choose it is effective Parameter is combined, and generates the negative test use-case of the interface to be measured.It is arranged in this way, when interface needs to modify, phase Pass personnel only need to modify the relevant information (for example increase or modify into ginseng field, modify field attribute etc.) in interface document i.e. It can, it is not necessary to interface testing use-case is rewritten, to greatly improve the efficiency of interface testing.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of process of one embodiment of the generation method of interface testing use-case provided in an embodiment of the present invention Figure;
Fig. 2 is a kind of process of second embodiment of the generation method of interface testing use-case provided in an embodiment of the present invention Figure;
Fig. 3 is a kind of structure of one embodiment of the generating means of interface testing use-case provided in an embodiment of the present invention Figure;
Fig. 4 is a kind of schematic diagram of server provided in an embodiment of the present invention.
Specific embodiment
The embodiment of the invention provides generation method, device, storage medium and the server of a kind of interface testing use-case, energy Enough improve the efficiency of interface testing.
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field Those of ordinary skill's all other embodiment obtained without making creative work, belongs to protection of the present invention Range.
Referring to Fig. 1, a kind of one embodiment of the generation method of interface testing use-case includes: in the embodiment of the present invention
101, the interface document that constructs in advance is obtained, what the interface document recorded that interface to be measured has each enters to join field And the attribute of each field;
Firstly, obtaining the interface document constructed in advance, which is used to record the interface message of each interface, than Such as interface name, interface url, request address and request method, enter each field of ginseng and the attribute of each field, it is expected that defeated The information such as result out.The interface document can be various types of documents, such as word, excel, txt etc..Interface document is by opening Hair personnel maintenance, when needing changed test demand, developer can modify corresponding interface message, be such as added to ginseng or It modifies into the field of ginseng or attribute etc..Illustratively, the information that interface document includes can be as shown in Tables 1 and 2 below.
Table 1
Interface name Amount verification interface
Interface IP address { access address in 3.1 protocol specifications }/fs/order/handle/XXXX
Request method POST
Interface version 1.1
Explanation Extended meeting is packaged as the offer of the address esg after interface IP address
Table 2
102, the interface document is parsed, obtains therein entering to join field and field attribute;
After obtaining interface document, which is parsed, obtains therein entering to join field and corresponding The information such as field attribute.Specifically, can develop an Automated testing tool using java, which uses apache's Poi.jar goes to parse the interface document, to obtain data therein.
Further, the interface document can be the format of excel table, record total interface in an examining system Information, what each worksheet (sheet) of the excel table recorded distinct interface respectively enters to join field and field attribute, step Rapid 102 may include:
(1) interface identifier of the interface to be measured is obtained;
(2) corresponding target operation table is searched from the interface document according to the interface identifier;
(3) what is recorded in the extraction target operation table enters to join field and field attribute.
Interface identifier is the identification information that interface to be measured distinguishes over the other interfaces of examining system, for example can be compiled for interface Number, each worksheet in the interface document establishes incidence relation with corresponding interface identifier respectively, therefore can be by be measured The interface identifier of interface finds corresponding target operation table from the interface document, then extracts and remembers in target operation table Record enters to join field and field attribute, the as field information of the interface to be measured.
103, enter according to and join field and field attribute, building each enters to join the actual parameter collection of field and invalid respectively Parameter set;
After obtaining ginseng field and corresponding field attribute, it can be constructed respectively according to these data and each enter ginseng The actual parameter collection and Invalid parameter collection of field.The actual parameter integrate as value fall into field attribute restriction effective range it The set of interior actual parameter, the Invalid parameter integrate the invalid ginseng except the effective range for falling into field attribute restriction as value Several set.Field attribute may include field type, whether required field, field length, the Effective Numerical range of field etc. Information, actual parameter refer to the parameter of matching field attribute specification, and Invalid parameter refers to the parameter for not meeting field attribute requirement.Than Such as, the numberical range of certain field attribute requires to be 0-9, then 0-9 is actual parameter, and other numerical value are Invalid parameter.Some word Section attribute specification is date type, then the numerical value for meeting date type is actual parameter, and the numerical value for not meeting date type is nothing Imitate parameter.
Further, step 103 may include:
(1) enter to join the field attribute of field and determine each to enter to join the value effective range of field respectively according to each;
(2) enter to join field for any one target, enter to join in the value effective range of field from the target and select at random The numerical value for taking preset quantity forms the actual parameter collection that the target enters to join field;
(3) numerical value of preset quantity is randomly selected outside the value effective range that the target enters to join field, described in composition Target enters to join the Invalid parameter collection of field.
Specifically, a function can be created, for generating actual parameter collection and Invalid parameter collection.The function is according to interface Enter to join field and field attribute defined in document, removes to construct the effective value range for each entering to join field and invalid value model It encloses, the parameter for falling into effective value range is actual parameter, and the parameter for falling into invalid value range is Invalid parameter.Then, from The multiple numerical value compositions of (for example traversing or randomly select certain amount) selection have according to certain rules in effective value range Parameter set is imitated, multiple numerical value are chosen from invalid value range and constitute Invalid parameter collection.
104, from it is each enter join field actual parameter concentrate respectively choose actual parameter be combined, generate it is described to be measured The positive test use-case of interface;
Then, enter to join the actual parameter of field and concentrate and choose actual parameter respectively and be combined from each, generate it is described to Survey the positive test use-case of interface, it is all enter to join the value of field be the test case that is constituted of actual parameter is positive survey Example on probation.Each enter to join field and concentrate one actual parameter of selection from the actual parameter of oneself respectively, then these actual parameter structures At a positive test use-case of the interface to be measured, this process is repeatedly executed, multiple positive tests can be obtained and use Example.
105, it is concentrated from more than one Invalid parameter for entering to join field and chooses Invalid parameter, and from except entering more than one Other outside ginseng field enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, and generate the interface to be measured Negative test use-case.
The Invalid parameter for entering to join field from more than one, which is concentrated, chooses Invalid parameter, and from except entering to join word more than one Other outside section enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, and generate the reverse of the interface to be measured Test case, the test case that at least one value for entering to join field is made of Invalid parameter is negative test use-case. Field will be entered to join and be divided into two parts, a part concentrates Selecting All Parameters, invalid ginseng of a part from itself from the actual parameter of itself Selecting All Parameters in manifold, then these parameters constitute a negative test use-case of the interface to be measured, repeatedly execute this Multiple negative test use-cases can be obtained in process.
It, can will be effective by way of recursion cycle in addition, generating positive test use-case and when negative test use-case Parameter and actual parameter combination, generate positive test use-case, by actual parameter and invalid parameter combination, generate negative test and use Example.The data format for entering ginseng and generally using json of interface, this data format be it is nested layer by layer, that is, there is hierarchical structure. The corresponding actual parameter of the first level and Invalid parameter can be extracted, arrangement group is passed through according to the hierarchical structure for entering parameter evidence Symphysis at multiple first levels positive test use-case and negative test use-case, and by the generation test case of the first level and the The parameter of two levels is combined, and is generated the test case of the second level, is sequentially overlapped the parameter of each level, until test case Data level reach preset condition.
Specifically, extracting all actual parameters and Invalid parameter of the first level, life is traversed by way of permutation and combination At the test case of multiple first layer levels, that is, each possibility value with/without effect parameter is traversed, each valued combinations are constituted One test case.Then, all actual parameters and Invalid parameter (parameter without the first level) for extracting the second level, are pressed Test case that a certain number of first levels are chosen according to predetermined manner (such as random), for the first level of each selection Test case, traverses all possible valued combinations of the second level parameter by way of permutation and combination, each possible to take Value combination is superimposed the test case of first level, that is, constitutes the test case of second level.For example the first step generates 100 The test case of a first level then can therefrom randomly select 5, it is assumed that be A-E, then A is superimposed the second level parameter Each possibility value, the test case of each possibility value one the second level of+A=, then successively executes B-E, generates all The second level test case.After the test case for obtaining the second level, acquisition third level in a like fashion is adopted Test case, until until reaching highest level or some preset level.
The generation method for the interface testing use-case that the embodiment of the present invention proposes includes: the interface document for obtaining and constructing in advance; The interface document is parsed, obtains therein entering to join field and field attribute;Enter to join field and field attribute according to described, respectively Building each enters to join the actual parameter collection and Invalid parameter collection of field;From it is each enter join field actual parameter concentration choose respectively Actual parameter is combined, and generates the positive test use-case of the interface to be measured;Enter to join the Invalid parameter of field from more than one Concentrate and choose Invalid parameter, with from except it is one it is above enter in addition to joining field other enter to join the actual parameter of field and concentrate selection Actual parameter be combined, generate the negative test use-case of the interface to be measured.It is arranged in this way, when interface needs to modify When, related personnel only needs to modify the relevant information in interface document and (for example increases or modify into ginseng field, modify field attribute Deng), it is not necessary to interface testing use-case is rewritten, to greatly improve the efficiency of interface testing.
Referring to Fig. 2, a kind of second embodiment of the generation method of interface testing use-case includes: in the embodiment of the present invention
201, the interface document that constructs in advance is obtained, what the interface document recorded that interface to be measured has each enters to join field And the attribute of each field;
In embodiments of the present invention, the expected result of the interface document also record interface test.
202, the interface document is parsed, obtains therein entering to join field and field attribute;
203, enter according to and join field and field attribute, building each enters to join the actual parameter collection of field and invalid respectively Parameter set;
The actual parameter integrates the set of the actual parameter within the effective range for falling into field attribute restriction as value, institute State the set for the Invalid parameter that Invalid parameter integrates except the effective range for falling into field attribute restriction as value.
204, from it is each enter join field actual parameter concentrate respectively choose actual parameter be combined, generate it is described to be measured The positive test use-case of interface;
205, it is concentrated from more than one Invalid parameter for entering to join field and chooses Invalid parameter, and from except entering more than one Other outside ginseng field enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, and generate the interface to be measured Negative test use-case;
Step 201-205 is identical as step 101-105, specifically can refer to the related description of step 101-105.
206, the positive test use-case and negative test use-case are executed, interface testing result is obtained;
After obtaining positive test use-case and negative test use-case, these test cases are executed, it is to be measured then to obtain this The interface testing result of interface.
207, the interface testing result and the expected result are compared, determine the test knot of the interface to be measured Whether fruit is normal.
After obtaining interface testing result, by the expected result recorded in the interface testing result and interface document into Row compares, and determines whether the test result of the interface to be measured is normal.That is, if the interface testing result and expected result phase Together, then show that interface testing result is normal;If the interface testing result and expected result difference, show interface testing knot Fruit is abnormal.
Further, step 207 may include:
(1) if the interface testing result is consistent with the expected result, it is determined that the test result of the interface to be measured Normally, and in the predeterminable area of the interface document the first marker character is added;
(2) if the interface testing result is not consistent with the expected result, it is determined that the test knot of the interface to be measured Fruit is abnormal, and adds the second marker character in the predeterminable area.
It is specified in the interface document if interface testing result is consistent with the desired output result in interface document The first marker character that region addition passes through for indicating test;If the desired output result in test output result and interface document It is not inconsistent, then the second marker character for indicating test crash is added in the specified region in the interface document.It sets in this way It sets, developer can intuitively know whether the result of interface testing is normal from the interface document very much, so as to timely It was found that and handling abnormal results.
The generation method of interface testing use-case proposed by the present invention includes: the interface document for obtaining and constructing in advance;Parsing institute Interface document is stated, obtains therein entering to join field and field attribute;Enter to join field and field attribute according to described, building is every respectively It is a to enter to join the actual parameter collection and Invalid parameter collection of field;From it is each enter join field actual parameter concentrate respectively choose effectively ginseng Number is combined, and generates the positive test use-case of the interface to be measured;The Invalid parameter for entering to join field from more than one concentrates choosing Take Invalid parameter, with from enter more than one in addition to joining field it is other enter join field actual parameter concentrate choose it is effective Parameter is combined, and generates the negative test use-case of the interface to be measured;It executes the positive test use-case and negative test is used Example, obtains interface testing result;The interface testing result and the expected result are compared, determine the interface to be measured Test result it is whether normal.It is arranged in this way, when interface needs to modify, related personnel only needs to modify in interface document Relevant information (for example increase or modify into ginseng field, modify field attribute etc.), it is not necessary to rewrite interface testing use Example, to greatly improve the efficiency of interface testing.Moreover, can also execute these surveys automatically after obtaining test case Example on probation, and the expected result recorded in obtained interface testing result and interface document is compared, with determine it is described to Whether the test result for surveying interface is normal.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
A kind of generation method of interface testing use-case is essentially described above, below by the life to a kind of interface testing use-case It is described in detail at device.
Referring to Fig. 3, a kind of one embodiment of the generating means of interface testing use-case includes: in the embodiment of the present invention
Interface document obtains module 301, and for obtaining the interface document constructed in advance, the interface document records to be measured connect What mouth had each enters to join the attribute of field and each field;
Interface document parsing module 302 obtains therein entering to join field and field category for parsing the interface document Property;
Parameter set constructs module 303, joins field and field attribute for entering according to, and building each enters to join field respectively Actual parameter collection and Invalid parameter collection, the actual parameter integrate as value falls into field attribute restriction effective range within The set of actual parameter, the Invalid parameter integrate the Invalid parameter except the effective range for falling into field attribute restriction as value Set;
Positive test use-case generation module 304, for from it is each enter join field actual parameter concentrate choose respectively it is effective Parameter is combined, and generates the positive test use-case of the interface to be measured;
Negative test use-case generation module 305, the Invalid parameter for entering to join field from more than one, which is concentrated, to be chosen in vain Parameter, with from enter more than one in addition to joining field it is other enter join field actual parameter concentrate the actual parameter chosen into Row combination, generates the negative test use-case of the interface to be measured.
Further, the interface document is the format of excel table, and the interface document parsing module may include:
Interface identifier acquiring unit, for obtaining the interface identifier of the interface to be measured;
Worksheet searching unit, for searching corresponding target operation from the interface document according to the interface identifier Table;
Field extraction unit, for extract recorded in the target operation table enter to join field and field attribute.
Further, the parameter set building module may include:
Value effective range determination unit, for entering to join the field attribute of field and determine each to enter to join word respectively according to each The value effective range of section;
Actual parameter collection construction unit enters to join field for entering to join field for any one target from the target The numerical value that preset quantity is randomly selected in value effective range forms the actual parameter collection that the target enters to join field;
Invalid parameter collection construction unit randomly selects outside the value effective range for entering to join field from the target default The numerical value of quantity forms the Invalid parameter collection that the target enters to join field.
Further, the expected result of the interface document also record interface test, the generation of the interface testing use-case Device can also include:
Test case execution module obtains interface testing for executing the positive test use-case and negative test use-case As a result;
Test result comparison module determines institute for the interface testing result and the expected result to be compared Whether the test result for stating interface to be measured is normal.
Further, the test result comparison module may include:
First test result determination unit, if being consistent for the interface testing result with the expected result, it is determined that The test result of the interface to be measured is normal, and adds the first marker character in the predeterminable area of the interface document;
Second test result determination unit, if not being consistent for the interface testing result with the expected result, really The test result of the fixed interface to be measured is abnormal, and adds the second marker character in the predeterminable area.
The embodiment of the present invention also provides a kind of computer readable storage medium, and the computer-readable recording medium storage has Computer-readable instruction realizes that any one indicated such as Fig. 1 or Fig. 2 connects when the computer-readable instruction is executed by processor The step of generation method of mouth test case.
The embodiment of the present invention also provides a kind of server, including memory, processor and storage are in the memory And the computer-readable instruction that can be run on the processor, the processor are realized when executing the computer-readable instruction As Fig. 1 or Fig. 2 any one interface testing use-case indicated generation method the step of.
Fig. 4 is the schematic diagram for the server that one embodiment of the invention provides.As shown in figure 4, the server 4 of the embodiment wraps It includes: processor 40, memory 41 and being stored in the computer that can be run in the memory 41 and on the processor 40 Readable instruction 42.The processor 40 realizes the life of above-mentioned each interface testing use-case when executing the computer-readable instruction 42 At the step in embodiment of the method, such as step 101 shown in FIG. 1 is to 105.Alternatively, the processor 40 executes the calculating The function of each module/unit in above-mentioned each Installation practice, such as module 301 to 305 shown in Fig. 3 are realized when machine readable instruction 42 Function.
Illustratively, the computer-readable instruction 42 can be divided into one or more module/units, one Or multiple module/units are stored in the memory 41, and are executed by the processor 40, to complete the present invention.Institute Stating one or more module/units can be the series of computation machine readable instruction section that can complete specific function, the instruction segment For describing implementation procedure of the computer-readable instruction 42 in the server 4.
The server 4 can be desktop PC, notebook, palm PC and cloud server etc. and calculate equipment. The server 4 may include, but be not limited only to, processor 40, memory 41.It will be understood by those skilled in the art that Fig. 4 is only It is the example of server 4, does not constitute the restriction to server 4, may include than illustrating more or fewer components or group Close certain components or different components, for example, the server 4 can also include input-output equipment, network access equipment, Bus etc..
The processor 40 can be central processing unit (CentraL Processing Unit, CPU), can also be Other general processors, digital signal processor (DigitaL SignaL Processor, DSP), specific integrated circuit (AppLication Specific Integrated Circuit, ASIC), ready-made programmable gate array (FieLd- ProgrammabLe Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 41 can be the internal storage unit of the server 4, such as the hard disk or memory of server 4. The memory 41 is also possible to the External memory equipment of the server 4, such as the plug-in type being equipped on the server 4 is hard Disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure DigitaL, SD) card, flash card (FLash Card) etc..Further, the memory 41 can also both include the internal storage unit of the server 4 or wrap Include External memory equipment.The memory 41 is for storing needed for the computer-readable instruction and the server other Program and data.The memory 41 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into 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, technical solution of the present invention 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 be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-OnLy Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.

Claims (10)

1. a kind of generation method of interface testing use-case characterized by comprising
Obtain the interface document that constructs in advance, what the interface document recorded that interface to be measured has each enters to join field and each The attribute of field;
The interface document is parsed, obtains therein entering to join field and field attribute;
Entering to join field and field attribute according to described, building each enters to join the actual parameter collection and Invalid parameter collection of field respectively, The actual parameter integrates the set of the actual parameter within the effective range for falling into field attribute restriction as value, the invalid ginseng Manifold is the set for the Invalid parameter that value is fallen into except the effective range of field attribute restriction;
Enter to join the actual parameter of field and concentrate and choose actual parameter respectively and be combined from each, is generating the interface to be measured just To test case;
The Invalid parameter for entering to join field from more than one, which is concentrated, chooses Invalid parameter, and from addition to entering to join field more than one It is other enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, generate the negative test of the interface to be measured Use-case.
2. the generation method of interface testing use-case according to claim 1, which is characterized in that the interface document is The format of excel table, each worksheet of the interface document records distinct interface respectively to enter to join field and field attribute, The parsing interface document obtains therein entering to join field and field attribute includes:
Obtain the interface identifier of the interface to be measured;
Corresponding target operation table is searched from the interface document according to the interface identifier;
Extract recorded in the target operation table enter to join field and field attribute.
3. the generation method of interface testing use-case according to claim 1, which is characterized in that described to enter to join word according to Section and field attribute, building each enters the actual parameter collection for joining field respectively and Invalid parameter collection includes:
Enter to join the field attribute of field and determine each to enter to join the value effective range of field respectively according to each;
Enter to join field for any one target, randomly selects present count out of the target enters to join field value effective range The numerical value of amount forms the actual parameter collection that the target enters to join field;
The numerical value that preset quantity is randomly selected outside the value effective range that the target enters to join field forms the target and enters ginseng The Invalid parameter collection of field.
4. the generation method of interface testing use-case according to any one of claim 1 to 3, which is characterized in that described to connect The expected result of mouth document also record interface test, in the positive test use-case and negative test use-case for generating the interface to be measured Later, further includes:
The positive test use-case and negative test use-case are executed, interface testing result is obtained;
The interface testing result and the expected result are compared, whether just to determine the test result of the interface to be measured Often.
5. the generation method of interface testing use-case according to claim 4, which is characterized in that described by the interface testing As a result be compared with the expected result, determine the interface to be measured test result whether normally include:
If the interface testing result is consistent with the expected result, it is determined that the test result of the interface to be measured is normal, and The first marker character is added in the predeterminable area of the interface document;
If the interface testing result is not consistent with the expected result, it is determined that the test result of the interface to be measured is abnormal, And the second marker character is added in the predeterminable area.
6. a kind of generating means of interface testing use-case characterized by comprising
Interface document obtains module, and for obtaining the interface document constructed in advance, the interface document, which records interface to be measured, to be had Each enter to join the attribute of field and each field;
Interface document parsing module obtains therein entering to join field and field attribute for parsing the interface document;
Parameter set constructs module, joins field and field attribute for entering according to, and building each enters to join the effective of field respectively Parameter set and Invalid parameter collection, the actual parameter integrate effective ginseng within the effective range for falling into field attribute restriction as value Several set, the Invalid parameter integrate the set of the Invalid parameter except the effective range for falling into field attribute restriction as value;
Positive test use-case generation module, for entering to join the actual parameter concentration selection actual parameter progress respectively of field from each Combination generates the positive test use-case of the interface to be measured;
Negative test use-case generation module, the Invalid parameter for entering to join field from more than one, which is concentrated, chooses Invalid parameter, with From enter more than one in addition to joining field it is other enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, Generate the negative test use-case of the interface to be measured.
7. a kind of computer readable storage medium, the computer-readable recording medium storage has computer-readable instruction, special Sign is, realizes that the interface as described in any one of claims 1 to 5 is surveyed when the computer-readable instruction is executed by processor The step of generation method of example on probation.
8. a kind of server, including memory, processor and storage can transport in the memory and on the processor Capable computer-readable instruction, which is characterized in that the processor realizes following steps when executing the computer-readable instruction:
Obtain the interface document that constructs in advance, what the interface document recorded that interface to be measured has each enters to join field and each The attribute of field;
The interface document is parsed, obtains therein entering to join field and field attribute;
Entering to join field and field attribute according to described, building each enters to join the actual parameter collection and Invalid parameter collection of field respectively, The actual parameter integrates the set of the actual parameter within the effective range for falling into field attribute restriction as value, the invalid ginseng Manifold is the set for the Invalid parameter that value is fallen into except the effective range of field attribute restriction;
Enter to join the actual parameter of field and concentrate and choose actual parameter respectively and be combined from each, is generating the interface to be measured just To test case;
The Invalid parameter for entering to join field from more than one, which is concentrated, chooses Invalid parameter, and from addition to entering to join field more than one It is other enter to join the actual parameter of field the actual parameter chosen is concentrated to be combined, generate the negative test of the interface to be measured Use-case.
9. server according to claim 8, which is characterized in that the interface document is the format of excel table, described What each worksheet of interface document recorded distinct interface respectively enters to join field and field attribute, the parsing interface text Shelves obtain therein entering to join field and field attribute includes:
Obtain the interface identifier of the interface to be measured;
Corresponding target operation table is searched from the interface document according to the interface identifier;
Extract recorded in the target operation table enter to join field and field attribute.
10. server according to claim 8 or claim 9, which is characterized in that the phase of the interface document also record interface test It hopes as a result, after the positive test use-case and negative test use-case for generating the interface to be measured, further includes:
The positive test use-case and negative test use-case are executed, interface testing result is obtained;
The interface testing result and the expected result are compared, whether just to determine the test result of the interface to be measured Often.
CN201910294085.1A 2019-04-12 2019-04-12 A kind of generation method, device, storage medium and the server of interface testing use-case Pending CN110134584A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910294085.1A CN110134584A (en) 2019-04-12 2019-04-12 A kind of generation method, device, storage medium and the server of interface testing use-case
PCT/CN2019/121678 WO2020207034A1 (en) 2019-04-12 2019-11-28 Method and device for generating interface test case, and storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910294085.1A CN110134584A (en) 2019-04-12 2019-04-12 A kind of generation method, device, storage medium and the server of interface testing use-case

Publications (1)

Publication Number Publication Date
CN110134584A true CN110134584A (en) 2019-08-16

Family

ID=67569924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910294085.1A Pending CN110134584A (en) 2019-04-12 2019-04-12 A kind of generation method, device, storage medium and the server of interface testing use-case

Country Status (2)

Country Link
CN (1) CN110134584A (en)
WO (1) WO2020207034A1 (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110633217A (en) * 2019-09-19 2019-12-31 中国银行股份有限公司 Interface checking method and device
CN110704310A (en) * 2019-09-17 2020-01-17 贝壳技术有限公司 Software program testing method and device, electronic equipment and storage medium
CN110727597A (en) * 2019-10-15 2020-01-24 杭州安恒信息技术股份有限公司 Method for completing use case based on log troubleshooting invalid codes
CN110825638A (en) * 2019-11-08 2020-02-21 中国农业银行股份有限公司 Test case generation method and device, server and storage medium
CN110888797A (en) * 2019-10-11 2020-03-17 平安信托有限责任公司 Test data generation method and device, computer equipment and storage medium
CN110990276A (en) * 2019-11-29 2020-04-10 泰康保险集团股份有限公司 Automatic testing method and device for interface field and storage medium
CN111143221A (en) * 2019-12-28 2020-05-12 中国银行股份有限公司 Test method and device
CN111221742A (en) * 2020-01-19 2020-06-02 中国平安人寿保险股份有限公司 Test case updating method and device, storage medium and server
CN111240970A (en) * 2020-01-06 2020-06-05 网联清算有限公司 Test case generation method and device
CN111506498A (en) * 2020-03-16 2020-08-07 平安科技(深圳)有限公司 Automatic generation method and device of test case, computer equipment and storage medium
WO2020207034A1 (en) * 2019-04-12 2020-10-15 深圳壹账通智能科技有限公司 Method and device for generating interface test case, and storage medium and server
CN111949520A (en) * 2020-07-31 2020-11-17 上海中通吉网络技术有限公司 Automatic interface test method and equipment
CN112346989A (en) * 2020-11-26 2021-02-09 网易(杭州)网络有限公司 Interface testing method, device, medium and computing equipment
CN112506769A (en) * 2020-12-04 2021-03-16 数字广东网络建设有限公司 Interface document-based request body generation method and device and computer equipment
CN112597018A (en) * 2020-12-22 2021-04-02 未来电视有限公司 Interface test case generation method, device, equipment and storage medium
CN113064828A (en) * 2021-04-13 2021-07-02 广州骏伯网络科技有限公司 Automatic testing method and device, computer equipment and storage medium
CN113157584A (en) * 2021-04-28 2021-07-23 杭州孝道科技有限公司 Fuzzy test method based on HttpClient
CN113342647A (en) * 2021-05-31 2021-09-03 中国工商银行股份有限公司 Test data generation method and device
CN113407444A (en) * 2021-06-03 2021-09-17 中科曙光国际信息产业有限公司 Interface test case generation method, device, equipment and storage medium
CN113495831A (en) * 2020-04-03 2021-10-12 卫宁健康科技集团股份有限公司 Method, system, device and medium for generating test case based on keyword
CN113515439A (en) * 2020-04-10 2021-10-19 中国电信股份有限公司 Background interface data access security test method and device
CN113535565A (en) * 2021-07-19 2021-10-22 工银科技有限公司 Interface use case generation method, device, equipment, medium and program product
CN113992549A (en) * 2020-07-08 2022-01-28 大唐移动通信设备有限公司 Test method, test device, electronic equipment and storage medium
CN117033234A (en) * 2023-08-24 2023-11-10 广东保伦电子股份有限公司 Interface testing method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018014580A1 (en) * 2016-07-20 2018-01-25 平安科技(深圳)有限公司 Data interface test method and apparatus, and server and storage medium
CN108415832A (en) * 2018-02-07 2018-08-17 平安科技(深圳)有限公司 Automatic interface testing method, device, equipment and storage medium
CN109308263A (en) * 2018-09-29 2019-02-05 北京云测信息技术有限公司 A kind of small routine test method, device and equipment
CN109388561A (en) * 2018-09-18 2019-02-26 深圳壹账通智能科技有限公司 Interface testing case generation method, device, computer equipment and storage medium
CN109446072A (en) * 2018-09-27 2019-03-08 深圳壹账通智能科技有限公司 The generation method and device of test script

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9424167B2 (en) * 2014-05-21 2016-08-23 Cgi Technologies And Solutions Inc. Automated testing of an application system
CN109254920A (en) * 2018-09-06 2019-01-22 上海精数信息科技有限公司 Interface testing case generation method, device, electronic equipment, storage medium
CN110134584A (en) * 2019-04-12 2019-08-16 深圳壹账通智能科技有限公司 A kind of generation method, device, storage medium and the server of interface testing use-case

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018014580A1 (en) * 2016-07-20 2018-01-25 平安科技(深圳)有限公司 Data interface test method and apparatus, and server and storage medium
CN108415832A (en) * 2018-02-07 2018-08-17 平安科技(深圳)有限公司 Automatic interface testing method, device, equipment and storage medium
CN109388561A (en) * 2018-09-18 2019-02-26 深圳壹账通智能科技有限公司 Interface testing case generation method, device, computer equipment and storage medium
CN109446072A (en) * 2018-09-27 2019-03-08 深圳壹账通智能科技有限公司 The generation method and device of test script
CN109308263A (en) * 2018-09-29 2019-02-05 北京云测信息技术有限公司 A kind of small routine test method, device and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李大玲: "《学术机构知识库构建模式研究》", 31 May 2009, 上海交通大学出版社 *

Cited By (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020207034A1 (en) * 2019-04-12 2020-10-15 深圳壹账通智能科技有限公司 Method and device for generating interface test case, and storage medium and server
CN110704310A (en) * 2019-09-17 2020-01-17 贝壳技术有限公司 Software program testing method and device, electronic equipment and storage medium
CN110633217A (en) * 2019-09-19 2019-12-31 中国银行股份有限公司 Interface checking method and device
CN110888797A (en) * 2019-10-11 2020-03-17 平安信托有限责任公司 Test data generation method and device, computer equipment and storage medium
CN110727597B (en) * 2019-10-15 2023-03-10 杭州安恒信息技术股份有限公司 Method for checking invalid code completion case based on log
CN110727597A (en) * 2019-10-15 2020-01-24 杭州安恒信息技术股份有限公司 Method for completing use case based on log troubleshooting invalid codes
CN110825638A (en) * 2019-11-08 2020-02-21 中国农业银行股份有限公司 Test case generation method and device, server and storage medium
CN110825638B (en) * 2019-11-08 2023-06-09 中国农业银行股份有限公司 Test case generation method, device, server and storage medium
CN110990276A (en) * 2019-11-29 2020-04-10 泰康保险集团股份有限公司 Automatic testing method and device for interface field and storage medium
CN111143221A (en) * 2019-12-28 2020-05-12 中国银行股份有限公司 Test method and device
CN111143221B (en) * 2019-12-28 2024-01-30 中国银行股份有限公司 Test method and device
CN111240970A (en) * 2020-01-06 2020-06-05 网联清算有限公司 Test case generation method and device
CN111240970B (en) * 2020-01-06 2024-06-11 网联清算有限公司 Test case generation method and device
CN111221742B (en) * 2020-01-19 2024-06-07 中国平安人寿保险股份有限公司 Test case updating method and device, storage medium and server
CN111221742A (en) * 2020-01-19 2020-06-02 中国平安人寿保险股份有限公司 Test case updating method and device, storage medium and server
CN111506498A (en) * 2020-03-16 2020-08-07 平安科技(深圳)有限公司 Automatic generation method and device of test case, computer equipment and storage medium
CN111506498B (en) * 2020-03-16 2022-06-21 平安科技(深圳)有限公司 Automatic generation method and device of test case, computer equipment and storage medium
CN113495831A (en) * 2020-04-03 2021-10-12 卫宁健康科技集团股份有限公司 Method, system, device and medium for generating test case based on keyword
CN113495831B (en) * 2020-04-03 2024-05-31 卫宁健康科技集团股份有限公司 Method, system, equipment and medium for generating test case based on keywords
CN113515439A (en) * 2020-04-10 2021-10-19 中国电信股份有限公司 Background interface data access security test method and device
CN113515439B (en) * 2020-04-10 2023-09-29 中国电信股份有限公司 Method and device for testing security of background interface data access
CN113992549A (en) * 2020-07-08 2022-01-28 大唐移动通信设备有限公司 Test method, test device, electronic equipment and storage medium
CN111949520A (en) * 2020-07-31 2020-11-17 上海中通吉网络技术有限公司 Automatic interface test method and equipment
CN112346989A (en) * 2020-11-26 2021-02-09 网易(杭州)网络有限公司 Interface testing method, device, medium and computing equipment
CN112346989B (en) * 2020-11-26 2023-06-20 网易(杭州)网络有限公司 Interface testing method, device, medium and computing equipment
CN112506769B (en) * 2020-12-04 2024-06-14 数字广东网络建设有限公司 Request body generation method and device based on interface document and computer equipment
CN112506769A (en) * 2020-12-04 2021-03-16 数字广东网络建设有限公司 Interface document-based request body generation method and device and computer equipment
CN112597018A (en) * 2020-12-22 2021-04-02 未来电视有限公司 Interface test case generation method, device, equipment and storage medium
CN113064828A (en) * 2021-04-13 2021-07-02 广州骏伯网络科技有限公司 Automatic testing method and device, computer equipment and storage medium
CN113157584A (en) * 2021-04-28 2021-07-23 杭州孝道科技有限公司 Fuzzy test method based on HttpClient
CN113342647A (en) * 2021-05-31 2021-09-03 中国工商银行股份有限公司 Test data generation method and device
CN113407444A (en) * 2021-06-03 2021-09-17 中科曙光国际信息产业有限公司 Interface test case generation method, device, equipment and storage medium
CN113535565B (en) * 2021-07-19 2022-10-04 工银科技有限公司 Interface use case generation method, device, equipment and medium
CN113535565A (en) * 2021-07-19 2021-10-22 工银科技有限公司 Interface use case generation method, device, equipment, medium and program product
CN117033234A (en) * 2023-08-24 2023-11-10 广东保伦电子股份有限公司 Interface testing method, device, equipment and medium

Also Published As

Publication number Publication date
WO2020207034A1 (en) 2020-10-15

Similar Documents

Publication Publication Date Title
CN110134584A (en) A kind of generation method, device, storage medium and the server of interface testing use-case
CN102930023B (en) Knowledge based engineering data quality solution
CN102682090B (en) A kind of sensitive word matching treatment system and method based on polymerization word tree
Fan et al. Performance guarantees for distributed reachability queries
CN103118111B (en) Information push method based on data from a plurality of data interaction centers
CN102662966B (en) Method and system for obtaining subject-oriented dynamic page content
CN105243159A (en) Visual script editor-based distributed web crawler system
US20170109667A1 (en) Automaton-Based Identification of Executions of a Business Process
CN109242553A (en) A kind of user behavior data recommended method, server and computer-readable medium
US11570214B2 (en) Crowdsourced innovation laboratory and process implementation system
CN107430611A (en) Filter data lineage figure
CN110134845A (en) Project public sentiment monitoring method, device, computer equipment and storage medium
CN109670081A (en) The method and device of service request processing
CN106708965A (en) Data processing method and apparatus
CN107153702A (en) A kind of data processing method and device
CN113254630B (en) Domain knowledge map recommendation method for global comprehensive observation results
US10397326B2 (en) IRC-Infoid data standardization for use in a plurality of mobile applications
CN103440199A (en) Method and device for guiding test
Ali et al. A hybrid DevOps process supporting software reuse: A pilot project
CN115905630A (en) Graph database query method, device, equipment and storage medium
CN105426392A (en) Collaborative filtering recommendation method and system
US20170109640A1 (en) Generation of Candidate Sequences Using Crowd-Based Seeds of Commonly-Performed Steps of a Business Process
CN110245281A (en) Internet assets information collection method and terminal device
CN108694213A (en) Generation method, search method and the device of journal file
Hernandez-Resendiz et al. Semi-Automated approach for building event logs for process mining from relational database

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190816