CN107992421A - Interface test method and its device and computer installation and its readable storage medium storing program for executing - Google Patents
Interface test method and its device and computer installation and its readable storage medium storing program for executing Download PDFInfo
- Publication number
- CN107992421A CN107992421A CN201711289105.3A CN201711289105A CN107992421A CN 107992421 A CN107992421 A CN 107992421A CN 201711289105 A CN201711289105 A CN 201711289105A CN 107992421 A CN107992421 A CN 107992421A
- Authority
- CN
- China
- Prior art keywords
- interface
- test
- result
- test case
- specified object
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
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 proposes a kind of interface test method, interface test device, computer installation and computer-readable recording medium, wherein, interface test method includes:Load test use-case, specified object is converted to by test case;Object is specified in parsing, is performed according to analysis result and is specified object, and receives the implementing result for specifying object;Whether verification implementing result matches with the desired value of test case, and implementing result and matching result are stored to database for displaying.Interface test method proposed by the present invention, by loading and test case being converted to specified object, performed in interface to be tested, and whether execution result back, verification implementing result match with the desired value of test case, pass through transforming test cases, it can realize and be write using the low language format for writing difficulty, interface definition, parameter and verification need to only be paid close attention to, it is possible to complete writing for interface testing use-case, difficulty is write this reduces test case.
Description
Technical field
The present invention relates to interface testing technical field, in particular to a kind of interface test method, a kind of interface testing
Device, a kind of computer installation and a kind of computer-readable recording medium.
Background technology
At present, interface testing Dependence Problem is write by using high-level language such as java or python, for not programming
The test classmate of experience is difficult to write interface testing use-case, and threshold is high;Even if test case is write but code quality is uneven;
The test case write with high-level language is readable poor, is unfavorable for concern business and data.
Also, the interface testing that few interface testing frameworks can solve this displaying as general interface frame needs
Ask, one of reason is that the ginseng that enters of tested interface needs may be from entering ginseng or other interfaces in the one or more of other interfaces
Return value, and the type of parameter and return value is various, these compatible demands are very for writing interface testing framework
Big challenge.
The content of the invention
It is contemplated that at least solve one of technical problem existing in the prior art.
For this reason, embodiment according to the first aspect of the invention, the present invention proposes a kind of test case, and to write mode simple
Interface test method.
Embodiment according to the second aspect of the invention, the present invention propose a kind of test case and write the simple interface of mode
Test device.
Embodiment according to the third aspect of the invention we, the present invention propose a kind of computer installation.
Embodiment according to the fourth aspect of the invention, the present invention propose a kind of computer-readable recording medium.
In view of this, embodiment, the present invention propose a kind of interface test method according to a first aspect of the present invention, including:
Load test use-case, specified object is converted to by test case;Object is specified in parsing, is performed according to analysis result and is specified object,
And receive the implementing result for specifying object;Whether verification implementing result matches with the desired value of test case, and by implementing result
Stored with matching result to database for displaying.
Interface test method proposed by the present invention, specified object is converted to by loading and by test case, and to specifying
Object is parsed, so that performed according to analysis result in interface to be tested, and execution result back, verify implementing result
Whether matched with the desired value of test case, then by implementing result with both whether matched result storage in the database, into
And after completion test case is performed, result is shown, so that tester can judge that interface is according to display data
No success, and pass through transforming test cases, it is possible to achieve write using the low language format for writing difficulty, correspondingly, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, this reduces test case
Difficulty is write, reduces the threshold of interface testing work.
In addition, the interface test method in above-described embodiment provided by the invention can also have following supplementary technology spy
Sign:
In the above-mentioned technical solutions, it is preferable that object is specified in parsing, is performed according to analysis result and is specified object, and received
The implementing result of object is specified, is specifically included:According to preset rules, specified object is divided into multiple fields;Parse one by one multiple
Field, obtains the execution parameter of each field and enters ginseng value;According to parameter is performed, inputted in corresponding interface into ginseng value;Receive
Interface returns the result.
In the technical scheme, according to preset rules by specified object be divided into multiple fields (such as:Split by blank character
Specify object;Object is specified by originating the segmentations such as language, conclusion), multiple fields are parsed, obtain each field
Perform parameter and enter ginseng value, and then according to the execution parameter of each field, search corresponding interface, the field is inputted in the interface
Enter ginseng value, and receiving interface returns the result, and then realize multiple interfaces while tests, and has the interface test method
Stronger autgmentability.
In any of the above-described technical solution, it is preferable that further include:After one field of every execution, judge whether also not
Perform field;When judging result is to be, continues to execute and be not carried out field.
In the technical scheme, often after interface performs a field, judge whether also remaining to be not carried out word
Section, when judging result when being, to continue to execute and being not carried out field, when judging result is no, terminates this test, and then ensure
Can intactly implementation of test cases, avoid missing fields, avoid legacy interface and do not test.
In any of the above-described technical solution, it is preferable that loading the test case, test case is converted to specified pair
As the step of before, further include:Receive the address information of test case;According to address information, the test for obtaining XML format is used
Example.
In the technical scheme, the address information of test case is received, corresponding XML format is called according to address information
Test case, and to write difficulty low for the test case of XML format, it is simple to write mode, during test case is write, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, reduce test case writes difficulty
Degree.
In any of the above-described technical solution, it is preferable that performing parameter includes:Call address information, the calling of each field
Address information is corresponded with an interface;Protocol information;Operation information.
In the technical scheme, performing parameter includes call address information, the call address information of whole fields not phase
Together, and each call address information corresponds to single interface so that interface and the man-to-man matching of field, alleviate test case
The amount of writing, create a further reduction test case writes difficulty.
Embodiment according to a second aspect of the present invention, the present invention propose a kind of interface test device, including:Loading unit,
Load test use-case;Converting unit, specified object is converted to by test case;First resolution unit, parses and specifies object;First
Execution unit, performs according to analysis result and specifies object;First receiving unit, receives the implementing result for specifying object;Verification is single
Whether member, verification implementing result match with the desired value of test case;Storage element, by implementing result and matching result store to
Database is for displaying.
Interface test device proposed by the present invention, specified object is converted to by loading and by test case, and to specifying
Object is parsed, so that performed according to analysis result in interface to be tested, and execution result back, verify implementing result
Whether matched with the desired value of test case, then by implementing result with both whether matched result storage in the database, into
And after completion test case is performed, result is shown, so that tester can judge that interface is according to display data
No success, and pass through transforming test cases, it is possible to achieve write using the low language format for writing difficulty, correspondingly, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, this reduces test case
Difficulty is write, reduces the threshold of interface testing work.
In the above-mentioned technical solutions, it is preferable that the first resolution unit specifically includes:Cutting unit, will according to preset rules
Specified object is divided into multiple fields;Second resolution unit, parses multiple fields one by one, obtains the execution parameter of each field with entering
Ginseng value;First execution unit, specifically for according to parameter is performed, being inputted in corresponding interface into ginseng value;First receiving unit, tool
Body is used for returning the result for receiving interface.
In the technical scheme, according to preset rules by specified object be divided into multiple fields (such as:Split by blank character
Specify object;Object is specified by segmentations such as conclusion, starting languages), multiple fields are parsed, obtain each field
Perform parameter and enter ginseng value, and then according to the execution parameter of each field, search corresponding interface, the field is inputted in the interface
Enter ginseng value, and receiving interface returns the result, and then realize multiple interfaces while tests, and has the interface test device
Stronger autgmentability.
In any of the above-described technical solution, it is preferable that further include:Judging unit, after one field of every execution, judgement is
It is no to be also not carried out field;Second execution unit, when judging unit judging result for when be to continue to execute and be not carried out field.
In the technical scheme, often after interface performs a field, judge whether also remaining to be not carried out word
Section, when judging result when being, to continue to execute and being not carried out field, when judging result is no, terminates this test, and then ensure
Can intactly implementation of test cases, avoid missing fields, avoid legacy interface and do not test.
In any of the above-described technical solution, it is preferable that further include:Second receiving unit, is surveyed for being loaded in loading unit
Before example on probation, the address information of test case is received;Acquiring unit, according to address information, the test for obtaining XML format is used
Example.
In the technical scheme, the address information of test case is received, corresponding XML format is called according to address information
Test case, and to write difficulty low for the test case of XML format, it is simple to write mode, during test case is write, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, reduce test case writes difficulty
Degree.
In any of the above-described technical solution, it is preferable that performing parameter includes:Call address information, the call address of field
Information is corresponded with interface;Protocol information;Operation information.
In the technical scheme, performing parameter includes call address information, the call address information of whole fields not phase
Together, and each call address information corresponds to single interface so that interface and the man-to-man matching of field, alleviate test case
The amount of writing, create a further reduction test case writes difficulty.
Embodiment according to a third aspect of the present invention, the present invention propose a kind of computer installation, and computer installation includes place
Device is managed, processor realizes the number as any one of above-mentioned technical proposal when being used to perform the computer program stored in memory
The step of according to access method.
Computer installation proposed by the present invention, because including for being realized when performing as any one of above-mentioned technical proposal
The computer program of the step of interface test method, therefore, has the interface testing side as any one of above-mentioned technical proposal
Whole beneficial effects of method, are no longer stated one by one herein.
Embodiment according to a fourth aspect of the present invention, the present invention propose a kind of computer-readable recording medium, store thereon
There is computer program, the interface testing side as any one of above-mentioned technical proposal is realized when computer program is executed by processor
The step of method.
Computer-readable recording medium proposed by the present invention, because being realized for storing to perform as any in above-mentioned technical proposal
The computer program of the step of item interface test method, therefore, has the interface as any one of above-mentioned technical proposal
Whole beneficial effects of test method, are no longer stated one by one herein.
The additional aspect and advantage of the present invention will become obvious in following description section, or the practice by the present invention
Recognize.
Brief description of the drawings
The above-mentioned and/or additional aspect and advantage of the present invention will become in the description from combination accompanying drawings below to embodiment
Substantially and it is readily appreciated that, wherein:
Fig. 1 shows the flow chart for the interface test method that one first aspect embodiment of the present invention provides;
Fig. 2 shows the flow chart for the interface test method that another first aspect embodiment of the invention provides;
Fig. 3 shows the flow chart for the interface test method that another first aspect embodiment of the invention provides;
Fig. 4 shows the flow chart for the interface test method that another first aspect embodiment of the invention provides;
Fig. 5 shows the schematic block diagram for the interface test device that one second aspect embodiment of the present invention provides;
Fig. 6 shows the schematic block diagram for the data access device that another second aspect embodiment of the invention provides;
Fig. 7 shows the schematic block diagram for the interface test device that another second aspect embodiment of the invention provides;
Fig. 8 shows the schematic block diagram for the interface test device that another second aspect embodiment of the invention provides.
Embodiment
It is to better understand the objects, features and advantages of the present invention, below in conjunction with the accompanying drawings and specific real
Mode is applied the present invention is further described in detail.It should be noted that in the case where there is no conflict, the implementation of the application
Feature in example and embodiment can be mutually combined.
Many details are elaborated in the following description to facilitate a thorough understanding of the present invention, still, the present invention may be used also
To be implemented using other different from other modes described here, therefore, protection scope of the present invention and from described below
Specific embodiment limitation.
Fig. 1 shows the flow chart for the interface test method that one first aspect embodiment of the present invention provides.
As shown in Figure 1, the interface test method that one first aspect embodiment of the present invention provides includes:
Step 102, load test use-case, specified object is converted to by test case;
Step 104, parse and specify object, performed according to analysis result and specify object;
Step 106, the implementing result for specifying object is received;
Step 108, implementing result and matching result are stored to database for displaying;
Step 110, whether verification implementing result matches with the desired value of test case.
Interface test method provided by the invention, specified object is converted to by loading and by test case, and to specifying
Object is parsed, so that performed according to analysis result in interface to be tested, and execution result back, verify implementing result
Whether matched with the desired value of test case, then by implementing result with both whether matched result storage in the database, into
And after completion test case is performed, result is shown, so that tester can judge that interface is according to display data
No success, and pass through transforming test cases, it is possible to achieve write using the low language format for writing difficulty, correspondingly, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, this reduces test case
Difficulty is write, reduces the threshold of interface testing work.
Fig. 2 shows the flow chart for the interface test method that another first aspect embodiment of the invention provides.
As shown in Fig. 2, the interface test method that another first aspect embodiment of the invention provides includes:
Step 202, load test use-case, specified object is converted to by test case;
Step 204, according to preset rules, specified object is divided into multiple fields;
Step 206, multiple fields are parsed one by one, are obtained the execution parameter of each field and are entered ginseng value;
Step 208, according to the execution parameter of field, inputted in corresponding interface into ginseng value
Step 210, receiving interface returns the result;
Step 212, it will return the result and stored with matching result to database for displaying;
Step 214, whether verification is returned the result matches with the desired value of test case.
Interface test method provided by the invention, by loading and test case being converted to specified object, according to default
Rule by specified object be divided into multiple fields (such as:Split by blank character and specify object;Pass through conclusion, starting language decile
Cut specified object), multiple fields are parsed, the execution parameter of each field is obtained and enters ginseng value, and then according to each
The execution parameter of field, searches corresponding interface, enters ginseng value, and the return knot of receiving interface what the interface inputted the field
Fruit, so realize multiple interfaces while test, make the interface test method that there is stronger autgmentability, then verify implementing result
Whether matched with the desired value of test case, and by implementing result with both whether matched result storage in the database, into
And after completion test case is performed, result is shown, so that tester can judge that interface is according to display data
No success, and pass through transforming test cases, it is possible to achieve write using the low language format for writing difficulty, correspondingly, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, this reduces test case
Difficulty is write, reduces the threshold of interface testing work.
Wherein, can include in the returning the result of receiving interface:The operating structure of field, enter ginseng value, perform time etc..
Fig. 3 shows the flow chart for the interface test method that another first aspect embodiment of the invention provides.
As shown in figure 3, the interface test method that another first aspect embodiment of the invention provides includes:
Step 302, load test use-case, specified object is converted to by test case;
Step 304, according to preset rules, specified object is divided into multiple fields;
Step 306, multiple fields are parsed one by one, are obtained the execution parameter of each field and are entered ginseng value;
Step 308, according to the execution parameter of field, inputted in corresponding interface into ginseng value;
Step 310, receiving interface returns the result;
Step 312, it will return the result and stored with matching result to database for displaying;
Step 314, whether verification is returned the result matches with the desired value of test case;
Step 316, after one field of every execution, judge whether also to be not carried out field;When judging result is to be, hold
Row step 308, when judging result is no, test terminates.
Interface test method provided by the invention, by loading and test case being converted to specified object, according to default
Rule by specified object be divided into multiple fields (such as:Split by blank character and specify object;Pass through conclusion, starting language decile
Cut specified object), multiple fields are parsed, the execution parameter of each field is obtained and enters ginseng value, and then according to each
The execution parameter of field, searches corresponding interface, enters ginseng value, and the return knot of receiving interface what the interface inputted the field
Fruit, so realize multiple interfaces while test, make the interface test method that there is stronger autgmentability, then verify implementing result
Whether matched with the desired value of test case, and whether matched result stores in the database with both by implementing result, its
In, often after interface performs a field, judge whether it is also remaining be not carried out field, when judging result for when being,
Continue to execute and be not carried out field, when judging result for it is no when, terminate this test, and then ensure that and can intactly perform test
Use-case, avoids missing fields, avoids legacy interface and does not test, and after the completion of the execution of whole fields, result is shown,
So that tester can judge whether interface succeeds according to display data, and pass through transforming test cases, it is possible to achieve use
The low language format for writing difficulty is write, and correspondingly, need to only pay close attention to interface definition, parameter and verification, it is possible to which completion connects
Writing for mouth test case, difficulty is write this reduces test case, reduces the threshold of interface testing work.
Fig. 4 shows the flow chart for the interface test method that another first aspect embodiment of the invention provides.
As shown in figure 4, the interface test method that another first aspect embodiment of the invention provides includes:
Step 402, the address information of test case is received;
Step 404, according to address information, the test case of XML format is obtained;
Step 406, load test use-case, specified object is converted to by test case;
Step 408, according to preset rules, specified object is divided into multiple fields;
Step 410, multiple fields are parsed one by one, obtain call address information, protocol information, the operation information of each field
With entering ginseng value;
Step 412, according to the execution parameter of field, inputted in corresponding interface into ginseng value;
Step 414, receiving interface returns the result;
Step 416, it will return the result and stored with matching result to database for displaying;
Step 418, whether verification is returned the result matches with the desired value of test case;
Step 420, after one field of every execution, judge whether also to be not carried out field.
Interface test method provided by the invention, receives the address information of test case, is called according to address information corresponding
XML format test case, and to write difficulty low for the test case of XML format, loads and is simultaneously converted to test case specified
Object, according to preset rules by specified object be divided into multiple fields (such as:Split by blank character and specify object;Pass through end
Object is specified in the segmentations such as language, starting language), multiple fields are parsed, obtain call address information, the agreement of each field
Information, operation information, according to call address information, protocol information, the operation information of each field, search phase with entering ginseng value
The interface answered, enter ginseng value what the interface inputted the field, and receiving interface returns the result, and then realizes the same of multiple interfaces
When test, make the interface test method that there is stronger autgmentability, then verify implementing result and test case desired value whether
Matching, and whether matched result stores in the database with both by implementing result, wherein, often one is performed in an interface
After field, judge whether it is also remaining be not carried out field, when judging result when being, to continue to execute and being not carried out field, when sentencing
Disconnected result for it is no when, terminate this test, so ensure that can intactly implementation of test cases, avoid missing fields, keep away
Legacy interface is exempted from not test, after the completion of the execution of whole fields, result has been shown, so that tester can be according to exhibition
Registration is it is judged that whether interface succeeds, and passes through transforming test cases, it is possible to achieve using the low language format for writing difficulty into
Row is write, and correspondingly, need to only pay close attention to interface definition, parameter and verification, it is possible to complete writing for interface testing use-case, thus
Reduce test case writes difficulty, reduces the threshold of interface testing work.
Wherein it is preferred to it is JAVA object to specify object.
In a particular embodiment, in addition to first field being performed, each field before execution, from executed
Field and middle extracting parameter value is returned the result, at least part as this field enters ginseng value, retransmits to corresponding with this field
Interface, wherein, the type for entering ginseng value is varied, it is not limited to single kind.
Interface test method provided by the invention, states test case by way of labeling, by interface testing backstage
Program parsing, execution, verification, test case simultaneously record result.
In a particular embodiment, test case is write in xml format, specifically:In the test case file of XML format
In, define the form of outgoing interface, such as http interfaces;Url is set in step nodes;Parameter under Request
Set in node name, value, rule, action, type, sequence, sequence_type_keyword_key,
param_type_key。
In a particular embodiment, entering the extracting method of ginseng value can be, read what is wanted in the return value of multiple interfaces
Value replaces specific value, reaches interface and enters the effect that ginseng dynamic is transmitted, specifically, separates label sequence_type_ first
The value set in keyword_key, then performs following logic in the character string dimension after segmentation respectively:Which statement walk from
In read as a result, the type of the result is type, it is the corresponding values of keyword that keyword is read in this result, to replace
Enter keyword in parameter and be the value of key, and then obtain final entering ginseng value.
Wherein, in a particular embodiment, the desired value of test case is stored in multiple nodes, in the return of matched interfaces
When as a result, whether any a part of desired value with multiple nodes during contrast returns the result one by one matches, and specifically matches
As a result can be to be equal to, non-NULL, include.
Fig. 5 shows the schematic block diagram for the interface test device that one second aspect embodiment of the present invention provides.
As shown in figure 5, the interface test device 500 that one second aspect embodiment of the present invention provides includes:
Loading unit 502, load test use-case;Converting unit 504, specified object is converted to by test case;First solution
Unit 506 is analysed, parses and specifies object;First execution unit 508, performs according to analysis result and specifies object;First receiving unit
510, receive the implementing result for specifying object;Authentication unit 512, verify implementing result and test case desired value whether
Match somebody with somebody;Storage element 514, implementing result and matching result are stored to database for displaying.
Interface test device provided by the invention, specified object is converted to by loading and by test case, and to specifying
Object is parsed, so that performed according to analysis result in interface to be tested, and execution result back, verify implementing result
Whether matched with the desired value of test case, then by implementing result with both whether matched result storage in the database, into
And after completion test case is performed, result is shown, so that tester can judge that interface is according to display data
No success, and pass through transforming test cases, it is possible to achieve write using the low language format for writing difficulty, correspondingly, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, this reduces test case
Difficulty is write, reduces the threshold of interface testing work.
Fig. 6 shows the schematic block diagram for the interface test device that another second aspect embodiment of the invention provides.
As shown in fig. 6, the interface test device 600 that another second aspect embodiment of the invention provides includes:
Loading unit 602, load test use-case;Converting unit 604, specified object is converted to by test case;First solution
Analysis unit 606 includes:Cutting unit 6062, according to preset rules, is divided into multiple fields by specified object;Second resolution unit
6064, multiple fields are parsed one by one, are obtained the execution parameter of each field and are entered ginseng value;First execution unit 608, is specifically used for
According to parameter is performed, inputted in corresponding interface into ginseng value;First receiving unit 610, specifically for the return knot of receiving interface
Fruit;Whether authentication unit 612, verification implementing result match with the desired value of test case;Storage element 614, by implementing result
Stored with matching result to database for displaying.
Interface test device provided by the invention, by loading and test case being converted to specified object, according to default
Rule by specified object be divided into multiple fields (such as:Split by blank character and specify object;Pass through conclusion, starting language decile
Cut specified object), multiple fields are parsed, the execution parameter of each field is obtained and enters ginseng value, and then according to each
The execution parameter of field, searches corresponding interface, enters ginseng value, and the return knot of receiving interface what the interface inputted the field
Fruit, so realize multiple interfaces while test, make the interface test device that there is stronger autgmentability, then verify implementing result
Whether matched with the desired value of test case, and by implementing result with both whether matched result storage in the database, into
And after completion test case is performed, result is shown, so that tester can judge that interface is according to display data
No success, and pass through transforming test cases, it is possible to achieve write using the low language format for writing difficulty, correspondingly, only
Interface definition, parameter and verification need to be paid close attention to, it is possible to complete writing for interface testing use-case, this reduces test case
Difficulty is write, reduces the threshold of interface testing work.
Fig. 7 shows the schematic block diagram for the interface test device that another second aspect embodiment of the invention provides.
As shown in fig. 7, the interface test device 700 that another second aspect embodiment of the invention provides includes:
Loading unit 702, load test use-case;Converting unit 704, specified object is converted to by test case;First solution
Analysis unit 706 includes:Cutting unit 7062, according to preset rules, is divided into multiple fields by specified object;Second resolution unit
7064, multiple fields are parsed one by one, are obtained the execution parameter of each field and are entered ginseng value;First execution unit 708, is specifically used for
According to parameter is performed, inputted in corresponding interface into ginseng value;First receiving unit 710, specifically for the return knot of receiving interface
Fruit;Whether authentication unit 712, verification implementing result match with the desired value of test case;Storage element 714, by implementing result
Stored with matching result to database for displaying;Judging unit 716, after one field of every execution, judges whether also not
Perform field;Second execution unit 718, when judging unit judging result for when be to continue to execute and be not carried out field.
Interface test device provided by the invention, by loading and test case being converted to specified object, according to default
Rule by specified object be divided into multiple fields (such as:Split by blank character and specify object;Pass through conclusion, starting language decile
Cut specified object), multiple fields are parsed, the execution parameter of each field is obtained and enters ginseng value, and then according to each
The execution parameter of field, searches corresponding interface, enters ginseng value, and the return knot of receiving interface what the interface inputted the field
Fruit, so realize multiple interfaces while test, make the interface test device that there is stronger autgmentability, then verify implementing result
Whether matched with the desired value of test case, and whether matched result stores in the database with both by implementing result, its
In, often after interface performs a field, judge whether it is also remaining be not carried out field, when judging result for when being,
Continue to execute and be not carried out field, when judging result for it is no when, terminate this test, and then ensure that and can intactly perform test
Use-case, avoids missing fields, avoids legacy interface and does not test, and after the completion of the execution of whole fields, result is shown,
So that tester can judge whether interface succeeds according to display data, and pass through transforming test cases, it is possible to achieve use
The low language format for writing difficulty is write, and correspondingly, need to only pay close attention to interface definition, parameter and verification, it is possible to which completion connects
Writing for mouth test case, difficulty is write this reduces test case, reduces the threshold of interface testing work.
Fig. 8 shows the schematic block diagram for the interface test device that another second aspect embodiment of the invention provides.
As shown in figure 8, the interface test device 800 that another second aspect embodiment of the invention provides includes:
Second receiving unit 802, the address for before loading unit load test use-case, receiving test case are believed
Breath;Acquiring unit 804, according to address information, obtains the test case of XML format;Loading unit 806, load test use-case;Turn
Unit 808 is changed, test case is converted into specified object;First resolution unit 810 includes:Cutting unit 8102, according to default
Rule, is divided into multiple fields by specified object;Second resolution unit 8104, parses multiple fields one by one, obtains each field
Perform parameter and enter ginseng value;First execution unit 812, specifically for according to parameter is performed, being inputted in corresponding interface into ginseng value;
First receiving unit 814, specifically for returning the result for receiving interface;Authentication unit 816, verifies implementing result and test case
Desired value whether match;Storage element 818, implementing result and matching result are stored to database for displaying;Judge single
Member 820, after one field of every execution, judges whether also to be not carried out field;Second execution unit 822, when judging unit
Judging result for when be to continue to execute and be not carried out field.
Interface test device provided by the invention, receives the address information of test case, is called according to address information corresponding
XML format test case, and to write difficulty low for the test case of XML format, loads and is simultaneously converted to test case specified
Object, according to preset rules by specified object be divided into multiple fields (such as:Split by blank character and specify object;Pass through end
Object is specified in the segmentations such as language, starting language), multiple fields are parsed, obtain call address information, the agreement of each field
Information, operation information, according to call address information, protocol information, the operation information of each field, search phase with entering ginseng value
The interface answered, enter ginseng value what the interface inputted the field, and receiving interface returns the result, and then realizes the same of multiple interfaces
When test, make the interface test device that there is stronger autgmentability, then verify implementing result and test case desired value whether
Matching, and whether matched result stores in the database with both by implementing result, wherein, often one is performed in an interface
After field, judge whether it is also remaining be not carried out field, when judging result when being, to continue to execute and being not carried out field, when sentencing
Disconnected result for it is no when, terminate this test, so ensure that can intactly implementation of test cases, avoid missing fields, keep away
Legacy interface is exempted from not test, after the completion of the execution of whole fields, result has been shown, so that tester can be according to exhibition
Registration is it is judged that whether interface succeeds, and passes through transforming test cases, it is possible to achieve using the low language format for writing difficulty into
Row is write, and correspondingly, need to only pay close attention to interface definition, parameter and verification, it is possible to complete writing for interface testing use-case, thus
Reduce test case writes difficulty, reduces the threshold of interface testing work.
In a particular embodiment, the test case of XML format is converted to JAVA object by converting unit.
Embodiment according to a third aspect of the present invention, the present invention provides a kind of computer installation, computer installation includes place
Device is managed, processor realizes that the data provided such as above-mentioned any embodiment are visited when being used to perform the computer program stored in memory
The step of asking method.
Computer installation provided by the invention, because including for realizing the interface provided such as above-mentioned any embodiment when performing
The computer program of the step of test method, therefore, has the whole of the interface test method provided such as above-mentioned any embodiment
Beneficial effect, no longer state one by one herein.
Embodiment according to a fourth aspect of the present invention, the present invention provides a kind of computer-readable recording medium, stores thereon
There is computer program, the interface test method provided such as above-mentioned any embodiment is provided when computer program is executed by processor
Step.
Computer-readable recording medium provided by the invention, because realizing that above-mentioned any embodiment such as provides for storing to perform
Interface test method the step of computer program, therefore, have as above-mentioned any embodiment provide interface test method
Whole beneficial effects, no longer state one by one herein.
In conclusion interface test method provided by the invention, interface test device, computer installation and computer can
Storage medium is read, specified object is converted to by loading and by test case, and to specifying object to parse, so that according to solution
Analysis result is performed in interface to be tested, and execution result back, and whether the desired value of verification implementing result and test case
Matching, then whether matched result stores in the database, and then after test case is completed in execution with both by implementing result,
Result is shown, so that tester can judge whether interface succeeds according to display data, and is used by conversion testing
Example, it is possible to achieve write using the low language format for writing difficulty, correspondingly, need to only pay close attention to interface definition, parameter and test
Card, it is possible to complete writing for interface testing use-case, write difficulty this reduces test case, reduce interface testing
The threshold of work.
In the present invention, the term such as term " installation ", " connected ", " connection ", " fixation " should all be interpreted broadly, for example,
" connection " can be fixedly connected or be detachably connected, or be integrally connected;" connected " can be directly connected,
It can be indirectly connected by intermediary.For the ordinary skill in the art, on can understanding as the case may be
State the concrete meaning of term in the present invention.
In the description of this specification, the description of term " one embodiment ", " some embodiments ", " specific embodiment " etc.
Mean to combine at least one reality that the particular features, structures, materials, or characteristics that the embodiment or example describe are contained in the present invention
Apply in example or example.In the present specification, schematic expression of the above terms is not necessarily referring to identical embodiment or reality
Example.Moreover, description particular features, structures, materials, or characteristics can in any one or more embodiments or example with
Suitable mode combines.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the invention, for the skill of this area
For art personnel, the invention may be variously modified and varied.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should all be included in the protection scope of the present invention.
Claims (12)
- A kind of 1. interface test method, it is characterised in that including:Load test use-case, specified object is converted to by the test case;The specified object is parsed, the specified object is performed according to analysis result, and receive the execution knot of the specified object Fruit;Verify whether the implementing result matches with the desired value of the test case, and by the implementing result and matching result Storage is to database for displaying.
- 2. interface test method according to claim 1, it is characterised in that the parsing specified object, according to solution Analyse result and perform the specified object, and receive the implementing result of the specified object, specifically include:According to preset rules, the specified object is divided into multiple fields;Multiple fields are parsed one by one, are obtained the execution parameter of each field and are entered ginseng value;According to the execution parameter, entering ginseng value described in the input of corresponding interface;Receive returning the result for the interface.
- 3. interface test method according to claim 2, it is characterised in that further include:After one field of every execution, judge whether also to be not carried out field;When judging result for when be to continue to execute described to be not carried out field.
- 4. interface test method according to any one of claim 1 to 3, it is characterised in that in the loading survey Before the step of trying out example, the test case is converted to specified object, further include:Receive the address information of the test case;According to described address information, the test case of XML format is obtained.
- 5. the interface test method according to Claims 2 or 3, it is characterised in thatThe execution parameter includes:Call address information, the call address information of each field are corresponded with an interface;Protocol information;Operation information.
- A kind of 6. interface test device, it is characterised in that including:Loading unit, load test use-case;Converting unit, specified object is converted to by the test case;First resolution unit, parses the specified object;First execution unit, the specified object is performed according to analysis result;First receiving unit, receives the implementing result of the specified object;Authentication unit, verifies whether the implementing result matches with the desired value of the test case;Storage element, the implementing result and matching result are stored to database for displaying.
- 7. interface test device according to claim 6, it is characterised in thatFirst resolution unit specifically includes:Cutting unit, according to preset rules, is divided into multiple fields by the specified object;Second resolution unit, parses multiple fields one by one, obtains the execution parameter of each field and enters ginseng value;First execution unit, specifically for according to the execution parameter, entering ginseng value described in the input of corresponding interface;First receiving unit, specifically for receiving returning the result for the interface.
- 8. interface test device according to claim 7, it is characterised in that further include:Judging unit, after one field of every execution, judges whether also to be not carried out field;Second execution unit, when the judging unit judging result for when be to continue to execute described to be not carried out field.
- 9. the interface test method according to any one of claim 6 to 8, it is characterised in that further include:Second receiving unit, for before the loading unit loads the test case, receiving the ground of the test case Location information;Acquiring unit, according to described address information, obtains the test case of XML format.
- 10. the interface test method according to claim 7 or 8, it is characterised in thatThe execution parameter includes:Call address information, the call address information and the interface of the field correspond;Protocol information;Operation information.
- 11. a kind of computer installation, it is characterised in that the computer installation includes processor, and the processor is used to perform The interface test method as any one of claim 1 to 5 is realized during the computer program stored in memory.
- 12. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that:The computer program Realized when being executed by processor as any one of claim 1 to 5 the step of interface test method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711289105.3A CN107992421A (en) | 2017-12-07 | 2017-12-07 | Interface test method and its device and computer installation and its readable storage medium storing program for executing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711289105.3A CN107992421A (en) | 2017-12-07 | 2017-12-07 | Interface test method and its device and computer installation and its readable storage medium storing program for executing |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107992421A true CN107992421A (en) | 2018-05-04 |
Family
ID=62036545
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711289105.3A Pending CN107992421A (en) | 2017-12-07 | 2017-12-07 | Interface test method and its device and computer installation and its readable storage medium storing program for executing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107992421A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108664396A (en) * | 2018-05-08 | 2018-10-16 | 平安普惠企业管理有限公司 | Bank's interactive interface verification method, device, computer equipment and storage medium |
CN108733569A (en) * | 2018-05-25 | 2018-11-02 | 北京五八信息技术有限公司 | A kind of automatic interface testing method, device, storage medium and equipment |
CN108845953A (en) * | 2018-08-27 | 2018-11-20 | 北京奇虎科技有限公司 | The method and device of interface testing |
CN109032920A (en) * | 2018-06-05 | 2018-12-18 | 北京奇安信科技有限公司 | A kind of method and device for being tested protocol interface |
CN109189679A (en) * | 2018-08-24 | 2019-01-11 | 北京京东尚科信息技术有限公司 | Interface test method and system, electronic equipment, storage medium |
CN109240909A (en) * | 2018-08-03 | 2019-01-18 | 北京马上慧科技术有限公司 | A kind of data file verification method based on registration center |
CN111258873A (en) * | 2018-11-30 | 2020-06-09 | 阿里巴巴集团控股有限公司 | Test method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1632747A (en) * | 2003-12-22 | 2005-06-29 | 联想(北京)有限公司 | Software interface testing method |
CN105117344A (en) * | 2015-09-19 | 2015-12-02 | 北京暴风科技股份有限公司 | Interface integration test method and system based on PB |
CN105354035A (en) * | 2015-11-17 | 2016-02-24 | 天津橙子科技有限公司 | Method for compiling test case of web engineering |
US20160085666A1 (en) * | 2014-09-22 | 2016-03-24 | International Business Machines Corporation | Auto-deployment and testing of system application test cases in remote server environments |
-
2017
- 2017-12-07 CN CN201711289105.3A patent/CN107992421A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1632747A (en) * | 2003-12-22 | 2005-06-29 | 联想(北京)有限公司 | Software interface testing method |
US20160085666A1 (en) * | 2014-09-22 | 2016-03-24 | International Business Machines Corporation | Auto-deployment and testing of system application test cases in remote server environments |
CN105117344A (en) * | 2015-09-19 | 2015-12-02 | 北京暴风科技股份有限公司 | Interface integration test method and system based on PB |
CN105354035A (en) * | 2015-11-17 | 2016-02-24 | 天津橙子科技有限公司 | Method for compiling test case of web engineering |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108664396A (en) * | 2018-05-08 | 2018-10-16 | 平安普惠企业管理有限公司 | Bank's interactive interface verification method, device, computer equipment and storage medium |
CN108733569A (en) * | 2018-05-25 | 2018-11-02 | 北京五八信息技术有限公司 | A kind of automatic interface testing method, device, storage medium and equipment |
CN108733569B (en) * | 2018-05-25 | 2022-09-02 | 北京五八信息技术有限公司 | Interface automatic testing method and device, storage medium and equipment |
CN109032920A (en) * | 2018-06-05 | 2018-12-18 | 北京奇安信科技有限公司 | A kind of method and device for being tested protocol interface |
CN109240909A (en) * | 2018-08-03 | 2019-01-18 | 北京马上慧科技术有限公司 | A kind of data file verification method based on registration center |
CN109189679A (en) * | 2018-08-24 | 2019-01-11 | 北京京东尚科信息技术有限公司 | Interface test method and system, electronic equipment, storage medium |
CN108845953A (en) * | 2018-08-27 | 2018-11-20 | 北京奇虎科技有限公司 | The method and device of interface testing |
CN108845953B (en) * | 2018-08-27 | 2023-02-17 | 北京奇虎科技有限公司 | Interface testing method and device |
CN111258873A (en) * | 2018-11-30 | 2020-06-09 | 阿里巴巴集团控股有限公司 | Test method and device |
CN111258873B (en) * | 2018-11-30 | 2023-06-27 | 阿里巴巴集团控股有限公司 | Test method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107992421A (en) | Interface test method and its device and computer installation and its readable storage medium storing program for executing | |
Cariou et al. | OCL for the specification of model transformation contracts | |
US20050144529A1 (en) | Method for defined derivation of software tests from use cases | |
CN113032244B (en) | Interface test method, device, computer system and computer readable storage medium | |
CN110276074B (en) | Distributed training method, device, equipment and storage medium for natural language processing | |
CN109783565A (en) | A kind of method and system that excel data quickly introduce | |
CN105871911A (en) | Service calling engine, method and system | |
CN111221949A (en) | Intelligent return visit method, device and equipment based on reinforcement learning and storage medium | |
CN111290951A (en) | Test method, terminal, server, system and storage medium | |
CN107092478A (en) | The integrated system and method for a kind of software component library and component development instrument | |
CN113641591A (en) | Test case generation method and device and test method and device | |
CN113127108A (en) | Service request processing method and device, storage medium and electronic equipment | |
CN112667204B (en) | Data processing method and device for micro-service application and computer equipment | |
CN112487163B (en) | Execution method of automatic flow and method and device for acquiring interface data of execution method | |
CN106484488B (en) | Integrated cloud Compilation Method and system | |
US6516306B1 (en) | Model checking of message flow diagrams | |
Pequeno et al. | FrameIDTV: a framework for developing interactive applications on digital television environments | |
Sawant et al. | Automatic generation of test cases from UML models | |
CN109144479A (en) | Development frame | |
Fonseca i Casas | Transforming classic discrete event system specification models to specification and description language | |
CN109634660A (en) | Program structure method for visualizing, equipment, storage medium and device | |
US7305412B2 (en) | System and method for conversion from graphical business process representations to structural text-based business process representations | |
Sawant et al. | Construction of test cases from UML models | |
Mussbacher et al. | Transformation of aspect-oriented requirements specifications for reactive systems into aspect-oriented design specifications | |
CN113050935A (en) | Method and device for generating mixed object, computing equipment and computer readable 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180504 |