CN109783367A - Interface test method, device, computer installation and storage medium - Google Patents
Interface test method, device, computer installation and storage medium Download PDFInfo
- Publication number
- CN109783367A CN109783367A CN201811537751.1A CN201811537751A CN109783367A CN 109783367 A CN109783367 A CN 109783367A CN 201811537751 A CN201811537751 A CN 201811537751A CN 109783367 A CN109783367 A CN 109783367A
- Authority
- CN
- China
- Prior art keywords
- interface
- party
- tested
- parameters
- transmitted
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000009434 installation Methods 0.000 title claims abstract description 38
- 238000010998 test method Methods 0.000 title claims abstract description 24
- 238000012360 testing method Methods 0.000 claims abstract description 86
- 238000000034 method Methods 0.000 claims abstract description 27
- 238000001914 filtration Methods 0.000 claims abstract description 18
- 238000004590 computer program Methods 0.000 claims description 20
- 238000004321 preservation Methods 0.000 claims description 2
- 238000012795 verification Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 26
- 241000208340 Araliaceae Species 0.000 description 11
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 11
- 235000003140 Panax quinquefolius Nutrition 0.000 description 11
- 235000008434 ginseng Nutrition 0.000 description 11
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 230000007774 longterm Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 210000003127 knee Anatomy 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
- Telephonic Communication Services (AREA)
Abstract
The present invention provides a kind of interface test method, comprising: real-time acquisition system log information, the interface parameters for being transmitted to third party's back office interface by filtering out interface to be tested in the system log message;The interface parameters for being transmitted to third party's back office interface by the interface to be tested filtered out in system log message is compared with preset baseline parameter value, whether the interface parameters that third party's back office interface is transmitted to described in judgement is consistent with the baseline parameter value;If the interface parameters that the interface to be tested is transmitted to third party's back office interface is consistent with the baseline parameter value, it is determined that test passes through;If inconsistent, it is determined that test does not pass through.The present invention also provides a kind of interface test device, computer installation and computer readable storage mediums.The quality of interface testing can be improved in the present invention, and third party's interface is avoided due to transmitting wrong parameter to third party's interface to cause system to go wrong in follow-up process without verification.
Description
Technical field
The present invention relates to the field of test technology, and in particular to a kind of interface test method and device, electronic equipment and calculating
Machine readable storage medium storing program for executing.
Background technique
With the continuous development of internet, all inevitably need to access third party in more and more internet products
Service.Usual third party's service can all provide some interfaces, these interfaces be called by internet product, to inform third party's service
Execute corresponding operation.The test method of third party's interface is called for internet product, it is main to pass through verifying internet product
Entering ginseng and going out to join whether to meet for back office interface is expected to realize, but there is also the ginsengs of internet product back office interface error of transmission
Number gives third party backstage, and the parameter that third party backstage does not verify this mistake just directly falls library or is applied to usage scenario,
Accordingly even when third party backstage mistake does not occur to the result that the internet product returns, can also go out in subsequent process
Existing mistake.So due to that can not verify the database on third party backstage in interface testing, which guarantees exist
Risk.
Summary of the invention
In view of the foregoing, it is necessary to propose a kind of interface test method and device, electronic equipment and computer-readable deposit
Storage media calls third party's back office interface test quality to improve back office interface.
The first aspect of the application provides a kind of interface test method, is applied in computer installation, which comprises
Real-time acquisition system log information is transmitted to third party by filtering out interface to be tested in the system log message
The interface parameters of back office interface;
The interface for being transmitted to third party's back office interface by the interface to be tested filtered out in system log message is joined
Number be compared with preset baseline parameter value, be transmitted to described in judgement third party's back office interface interface parameters whether with it is described
Baseline parameter value is consistent;
If the interface parameters that the interface to be tested is transmitted to third party's back office interface is consistent with the baseline parameter value,
Determine that test passes through;And
If the interface to be tested be transmitted to third party's back office interface interface parameters and the reference parameter value it is inconsistent,
Then determine that test does not pass through.
Preferably, in " real-time acquisition system log information, by filtering out interface biography to be tested in the system log message
Transport to the interface parameters of third party's back office interface " before, the method also includes steps:
Obtain the multiple return parameters and the corresponding expectation ginseng of the interface to be tested that the interface to be tested is returned
Number;
The multiple return parameters expectation parameter corresponding with interface to be tested is compared one by one, judges the return
Whether parameter is consistent with corresponding expectation parameter;
When the return parameters of the interface to be tested and consistent corresponding expectation parameter, interface testing success is determined,
Then real-time acquisition system log information, by filtered out in the system log message interface to be tested be transmitted to third party backstage connect
The interface parameters of mouth;
When the return parameters of the interface to be tested and inconsistent corresponding expectation parameter, determine that interface testing fails,
The system log message is not obtained.
Preferably, the real-time acquisition system log information, by filtering out interface to be tested in the system log message
The interface parameters for being transmitted to third party's back office interface includes:
Execute the default script for being used for grasping system log information, grasping system log information;
Third party is transmitted to by searching and locating the interface to be tested in the system log message according to preset keyword
The interface parameters of back office interface;
The interface to be tested found described in preservation is transmitted to the interface parameters of third party's back office interface.
Preferably, the baseline parameter value includes at least one of following several numerical value: being got in test process
The preceding parameter preset that the interface parameters of third party's back office interface is once transmitted to by the interface to be tested, is arranged in test case
The parameter transmitted when value, test for the first time to third party's interface is as the baseline parameter value.
Preferably, the baseline parameter value is stored in preset memory locations with the format of Json character string.
Preferably, the interface parameters value exists in key/value pairs of form, determines that its is corresponding unique by Key
Value, wherein Key is the title of interface parameters, and corresponding value is the corresponding parameter value of the interface parameters title.
Preferably, the interface to be tested once transmits multiple interface parameters values to third party's back office interface, the multiple
Interface parameters value includes fixed value and variable value, described " to pass the interface to be tested by filtering out in system log message
The interface parameters for transporting to third party's back office interface is compared with preset baseline parameter value " include:
Obtain the variable value into the interface parameters that the interface to be tested inputs;
Variable value in the baseline parameter value, which is replaced with described get to what the interface to be tested inputted, can be changed
Value;
The interface to be tested by filtering out in system log message is transmitted to connecing for third party's back office interface
Mouth parameter value is exactly matched with the replaced baseline parameter value.
The second aspect of the application provides a kind of interface test device, and described device includes:
Log information obtains module, real-time acquisition system log information is used for, by filtering out in the system log message
Interface to be tested is transmitted to the interface parameters of third party's back office interface;
Comparison module, for being transmitted to third party backstage by the interface to be tested filtered out in system log message for described
The interface parameters of interface is compared with preset baseline parameter value, and the interface ginseng of third party's back office interface is transmitted to described in judgement
Whether number is consistent with the baseline parameter value;
Judgment module, for be transmitted in the interface to be tested third party's back office interface interface parameters and the baseline
When parameter value is consistent, determine that test passes through;Interface parameters and the institute of third party's back office interface are transmitted in the interface to be tested
State reference parameter value it is inconsistent when, determine test does not pass through.
The third aspect of the application provides a kind of computer installation, and the computer installation includes processor, the processing
Device is for realizing interface test method as previously described when executing the computer program stored in memory.
The fourth aspect of the application provides a kind of computer readable storage medium, is stored thereon with computer program, described
Interface test method as previously described is realized when computer program is executed by processor.
The present invention is compared by will be transmitted to the interface parameters of third party's back office interface with preset parameter value, with confirmation
Every time pass to third party's back office interface interface parameters be all it is consistent and correct, ability exact p-value passes through, in this way can be effective
The quality for improving interface testing, avoid due to transmit wrong parameter to third party's interface third party's interface without verify cause be
System goes wrong in follow-up process.
Detailed description of the invention
Fig. 1 is the application environment configuration diagram for the interface test method that the embodiment of the present invention one provides.
Fig. 2 is interface test method flow chart provided by Embodiment 2 of the present invention.
Fig. 3 is the structural schematic diagram for the interface test device that the embodiment of the present invention three provides.
Fig. 4 is the computer installation schematic diagram that the embodiment of the present invention four provides.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real
Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, embodiments herein and embodiment
In feature can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, described embodiment is only
It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill
Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention
The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool
The purpose of the embodiment of body, it is not intended that in the limitation present invention.
Embodiment one
As shown in fig.1, the application environment configuration diagram of the interface test method provided for the embodiment of the present invention one.
Interface test method of the invention applies the ring at one including computer installation 1 and at least one terminal installation 2
In border, the computer installation 1 and at least one terminal installation 2 are established by network and are communicated to connect.In the present embodiment, the meter
Calculation machine device 1 can be server or PC, wherein the server can be single server, server cluster
Or Cloud Server etc..
The terminal installation 2 is, but is not limited to, server, smart phone, tablet computer, convenient computer on knee, platform
The electronic equipments such as formula computer.
In one embodiment, the computer installation 1 and at least one described terminal installation 2 can pass through wired (example
Such as USB (Universal Serial Bus, universal serial bus) wirelessly establishes communication connection.The wireless mode
It can be any type of conventional wireless communication, such as radio, Wireless Fidelity (Wireless Fidelity, WIFI), bee
Nest, satellite, broadcast etc..Wireless communication technique may include, but be not limited to, global system for mobile communications (Global System
For Mobile Communications, GSM), General Packet Radio Service (General Packet Radio Service,
GPRS), CDMA (Code Division Multiple Access, CDMA), wideband code division multiple access (W-CDMA),
CDMA2000, IMT single carrier (IMT Single Carrier), enhanced data rates for gsm evolution (Enhanced Data
Rates for GSM Evolution, EDGE), it is Long Term Evolution (Long-Term Evolution, LTE), advanced long-term
Evolution technology, time-division Long Term Evolution (Time-Division LTE, TD-LTE), high performance radio local area network (High
Performance Radio Local Area Network, HiperLAN), high performance radio wide area network (High
Performance Radio Wide Area Network, HiperWAN), local multiple spot distribute business (Local
Multipoint Distribution Service, LMDS), full micro-wave access global inter communication (Worldwide
Interoperability for Microwave Access, WiMAX), ZigBee protocol (ZigBee), bluetooth, orthogonal frequency division multiplexing
It is empty with technology (Flash Orthogonal Frequency-Division Multiplexing, Flash-OFDM), large capacity
Division multiple access (High Capacity Spatial Division Multiple Access, HC-SDMA), General Mobile electricity
Letter system (Universal Mobile Telecommunications System, UMTS), Universal Mobile Telecommunications System time-division
Duplexing (UMTS Time-Division Duplexing, UMTS-TDD), evolved high-speed packet access (Evolved High
Speed Packet Access, HSPA+), TD SDMA (Time Division Synchronous Code
Division Multiple Access, TD-SCDMA), evolution data optimization (Evolution-Data Optimized,
EV-DO), Digital Enhanced Cordless Communications (Digital Enhanced Cordless Telecommunications, DECT) and
Other.
The computer installation 1 for needing to carry out interface testing can collect cost hair directly on computer installation 1
Interface testing function provided by bright method, or installation is for realizing the client of method of the invention.For another example, of the invention
Provided method can also be operated in the form of Software Development Kit (Software Development Kit, SDK)
In the equipment such as server, the interface of interface testing function, computer installation 1 or other equipment are provided in the form of SDK by mentioning
The processing to abnormal application program can be realized in the interface of confession.
Embodiment two
It please refers to shown in Fig. 2, is the flow chart of interface test method provided by Embodiment 2 of the present invention.According to different need
It asks, the sequence of step can change in the flow chart, and certain steps can be omitted.
Step S1, real-time acquisition system log information is transmitted by filtering out interface to be tested in the system log message
To the interface parameters of third party's back office interface.
During project testing, it is frequently encountered the scene that project to be tested calls third party's function, for example, when to be measured
When examination project is finance product store, user needs to be implemented the function of paying finance product expense after clicking purchase finance product,
At this moment it just needs to call the interface of Third-party payment platform, realizes payment function.It is executed in test process treating test item,
System log message can be generated, data transmission during the project implementation to be tested, fortune are had recorded in the system log message
The various data informations such as row state.
In an embodiment of the present invention, before step S1, the method also includes:
1) multiple return parameters that the interface to be tested of the project to be tested is returned are obtained and described to be measured are tried
The corresponding expectation parameter of mouth;
2) the multiple return parameters expectation parameter corresponding with interface to be tested is compared one by one, is returned described in judgement
Whether consistent with corresponding expectation parameter return parameter;
3) when the return parameters of the interface to be tested are consistent with corresponding expectation parameter, specification interface is successfully tested,
Then execute the step S1.
4) when the return parameters of the interface to be tested and inconsistent corresponding expectation parameter, specification interface test is lost
It loses, does not execute the step S1.When interface testing failure, needs tester and research staff to search error reason and solve
This mistake.
In an embodiment of the present invention, the step S1 is specifically included:
1) the default script for being used for grasping system log information, grasping system log information are executed;
2) according to the preset keyword of user setting by searching and locating the interface to be tested in the system log message
It is transmitted to the interface parameters of third party's back office interface;
3) interface to be tested found described in saving is transmitted to the interface parameters of third party's back office interface.
In one embodiment, when an application software needs inter-department cooperation in same company, the third
Square back office interface can be the back office interface of sundry item group or department in same company.For example, if the application software
It is the application software that certain insurance company is used for marketing insurance, the application software provides a user the entrance of a purchase insurance,
After user inputs personal information and the information of purchase insurance in the application software, the processes such as the core of insurance is protected just need institute
The core insurance system of the underwriting department door of insurance company is stated to complete, in this case, in the application software after purchase insurance
Platform interface calls the back office interface of the core insurance system to execute core and protect function, then the interface of the core insurance system is third
Square back office interface.
In another embodiment, third party's interface is also possible to the back office interface of other companies, for example, working as user
After buying insurance or finance product in application software, when needing to pay the bill using wechat, then the back office interface of the application software
Just need to call the back office interface of wechat to complete payment function, then the back office interface of the wechat is that third party backstage connects
Mouthful.
Step S2, the interface to be tested by filtering out in system log message is transmitted to third party's back office interface
Interface parameters is compared with preset baseline parameter value, be transmitted to described in judgement third party's back office interface interface parameters whether
It is consistent with the baseline parameter value.
In one embodiment, the baseline parameter value refers to that get in test process preceding once to be measured is tried by described
The interface parameters of third party's back office interface is transported in oral instructions, that is, in the step S2 by by filtered out in system log message to
This interface parameters for being transmitted to third party's interface of test interface and the interface last time to be tested got are transmitted to the
The interface parameters of tripartite's back office interface is compared.When the interface to be tested is to test for the first time, this can be obtained
To the interface parameters for being transferred to third party's interface be compared with the interface parameters value that tester is arranged in test case.
In another embodiment, the baseline parameter value can be the preset parameter value being arranged in test case, described
The baseline being arranged in the interface parameters for being transmitted to third party's interface got every time and the test case is joined in step S2
Numerical value is compared.
In yet another embodiment, it when interface to be tested does first time interface testing, is transferred to by the interface to be tested
The interface parameters of third party's interface is to be configured by tester, and tester can dock when executing test for the first time
Mouth parameter carries out artificial nucleus couple, therefore the ginseng that the interface to be tested is transmitted to third party's interface when first time test
Number is used as the baseline parameter value.When subsequent each test by the interface parameters for being transmitted to third party backstage filtered out with
It is compared when the first time tests to the parameter that third party's interface transmits.
Wherein, the baseline parameter value is with Json (JavaScript Object Notation, JS object numbered musical notation) character
The format of string is stored in preset memory locations.
In one embodiment, the interface parameters value exists in the form of key-value pair (key/value to), passes through key
(key) it can determine its corresponding unique value (Value), wherein Key is the title of interface parameters, corresponding value in key-value pair
For the corresponding parameter value of the interface parameters title.
In interface testing, the back office interface of application program once may transmit multiple interface ginsengs to third party's back office interface
Numerical value includes variable value and fixed value in the multiple interface parameters value.Wherein, variable value refers to that key is corresponding in interface parameters
Value value be not it is fixed, value value may change in test every time, for example, key is to use in the interface parameters value
When the userspersonal informations such as name, age, identification card number, the phone number at family, because the personal information of each user is different,
Therefore the corresponding value of these key is different, therefore, sets variable value for these interface parameters values changed.And fixed value is
Refer to that the corresponding value value of key is fixed and invariable in interface parameters, for example, when the interface ginseng transmitted to third party's back office interface
When number is the parameters such as test label, element, these labels, element are fixed and invariable, then, these changeless interface ginsengs
Number is set as fixed value.
Correspondingly, in step s 2, the method also includes:
1) variable value in the interface parameters inputted in this test to the interface to be tested is obtained, for example, obtaining this
Address name, age, identification card number, cell-phone number inputted in secondary test to the interface to be tested etc. is due to user identity difference
Different variable element values;
2) variable value in the baseline parameter value is replaced in described this test got to described to be tested
The variable value of interface input;
3) interface to be tested by filtering out in system log message is transmitted to third party's back office interface
Interface parameters value (key/value) is exactly matched with the replaced baseline parameter value (key/value).
If step S3, the described interface to be tested is transmitted to the interface parameters and the baseline parameter value of third party's back office interface
Unanimously, it is determined that the interface parameters that the interface to be tested is transmitted to third party backstage is correct, and determines that test passes through.
If S4, the interface to be tested be transmitted to third party's back office interface interface parameters and the reference parameter value it is different
It causes, it is determined that mistake occurs in the interface parameters that the interface to be tested passes to third party's back office interface, and determines that test is obstructed
It crosses.
Embodiment three
Referring to Fig. 3, being the structure chart of interface test device preferred embodiment of the present invention.
In some embodiments, the interface test device 10 is run in computer installation.The interface test device
10 may include multiple functional modules as composed by program code segments.Each program segment in the interface test device 10
Program code can store in the memory of computer installation, and as performed by least one described processor, be connect with realizing
Mouth test function.
In the present embodiment, function of the interface test device 10 according to performed by it can be divided into multiple functions
Module.As shown in fig.3, the functional module may include: that log information obtains module 101, comparison module 102, judges mould
Block 103.The so-called module of the present invention refers to that one kind performed by least one processor and can complete fixed function
Series of computation machine program segment, storage in memory.It in the present embodiment, will be subsequent about the function of each module
It is described in detail in embodiment.
The log information obtains module 101 and is used for real-time acquisition system log information, by the system log message
Filter out the interface parameters that interface to be tested is transmitted to third party's back office interface.
During project testing, it is frequently encountered the scene that project to be tested calls third party's function, for example, when to be measured
When examination project is finance product store, user needs to be implemented the function of paying finance product expense after clicking purchase finance product,
At this moment it just needs to call the interface of Third-party payment platform, realizes payment function.It is executed in test process treating test item,
System log message can be generated, data transmission during the project implementation to be tested, fortune are had recorded in the system log message
The various data informations such as row state.
In an embodiment of the present invention, the log information obtains module in acquisition system log message and by the system
Interface to be tested is filtered out in system log information to be transmitted to before the interface parameters of third party's back office interface, is also used to execute following
Operation:
1) multiple return parameters that the interface to be tested of the project to be tested is returned are obtained and described to be measured are tried
The corresponding expectation parameter of mouth;
2) the multiple return parameters expectation parameter corresponding with interface to be tested is compared one by one, is returned described in judgement
Whether consistent with corresponding expectation parameter return parameter;
3) when the return parameters of the interface to be tested are consistent with corresponding expectation parameter, specification interface is successfully tested,
Then the log information obtains module 101 and obtains system log message and by filtering out to be measured try in the system log message
The interface parameters of third party's back office interface is transported in oral instructions.
4) when the return parameters of the interface to be tested and inconsistent corresponding expectation parameter, specification interface test is lost
It loses, then the log information obtains module 101 and do not obtain system log message.When interface testing failure, test crash is generated
Warning information prompts that tester and research staff is needed to search error reason and solves this mistake.
In an embodiment of the present invention, the log information obtains module 101 and obtains system log message and by described
Interface to be tested filtered out in system log message be transmitted to the interface parameters of third party's back office interface specifically include:
1) the default script for being used for grasping system log information, grasping system log information are executed;
2) according to the preset keyword of user setting by searching and locating the interface to be tested in the system log message
It is transmitted to the interface parameters of third party's back office interface;
3) interface to be tested found described in saving is transmitted to the interface parameters of third party's back office interface.
In one embodiment, when an application software needs inter-department cooperation in same company, the third
Square back office interface can be the back office interface of sundry item group or department in same company.For example, if the application software
It is the application software that certain insurance company is used for marketing insurance, the application software provides a user the entrance of a purchase insurance,
After user inputs personal information and the information of purchase insurance in the application software, the processes such as the core of insurance is protected just need institute
The core insurance system of the underwriting department door of insurance company is stated to complete, in this case, in the application software after purchase insurance
Platform interface calls the back office interface of the core insurance system to execute core and protect function, then the interface of the core insurance system is third
Square back office interface.
In another embodiment, third party's interface is also possible to the back office interface of other companies, for example, working as user
After buying insurance or finance product in application software, when needing to pay the bill using wechat, then the backstage of the application software connects
Mouth just needs to call the back office interface of wechat to complete payment function, then the back office interface of the wechat is that third party backstage connects
Mouthful.
The comparison module 102 is used to the interface to be tested by filtering out in system log message being transmitted to third
The interface parameters of square back office interface is compared with preset baseline parameter value, and third party's back office interface is transmitted to described in judgement
Whether interface parameters is consistent with the baseline parameter value.
In one embodiment, the baseline parameter value refer to got in test process it is preceding once by described to be tested
Interface is transmitted to the interface parameters of third party's back office interface, that is, will be by filtering out in system log message in the step S2
This interface parameters for being transmitted to third party's interface of interface to be tested is transmitted to the interface last time to be tested got
The interface parameters of third party's back office interface is compared.When the interface to be tested is to test for the first time, this can be obtained
The interface parameters value that the interface parameters for being transferred to third party's interface got and tester are arranged in test case compares
It is right.
In another embodiment, the baseline parameter value can be the preset parameter value being arranged in test case, described
The baseline being arranged in the interface parameters for being transmitted to third party's interface got every time and the test case is joined in step S2
Numerical value is compared.
In yet another embodiment, it when interface to be tested does first time interface testing, is transferred to by the interface to be tested
The interface parameters of third party's interface is to be configured by tester, and tester can dock when executing test for the first time
Mouth parameter carries out artificial nucleus couple, therefore the parameter transmitted when first time test to third party's interface is as the baseline
Parameter value.The interface parameters for being transmitted to third party backstage filtered out and the first time are tested when subsequent each test
When to third party's interface transmit parameter be compared.
Wherein, the baseline parameter value is with Json (JavaScript Object Notation, JS object numbered musical notation) character
The format of string is stored in preset memory locations.
In one embodiment, the interface parameters value exists in the form of key-value pair (key/value to), passes through key
(key) it can determine its corresponding unique value (Value), wherein Key is the title of interface parameters, corresponding value in key-value pair
For the corresponding parameter value of the interface parameters title.
In interface testing, the back office interface of application program once may transmit multiple interface ginsengs to third party's back office interface
Numerical value includes variable value and fixed value in the multiple interface parameters value.Wherein, variable value refers to that key is corresponding in interface parameters
Value value be not it is fixed, value value may change in test every time, for example, key is to use in the interface parameters value
When the userspersonal informations such as name, age, identification card number, the phone number at family, because the personal information of each user is different,
Therefore the corresponding value of these key is different, therefore, sets variable value for these interface parameters values changed.And fixed value is
Refer to that the corresponding value value of key is fixed and invariable in interface parameters, for example, when the interface ginseng transmitted to third party's back office interface
When number is the parameters such as test label, element, these labels, element are fixed and invariable, then, these changeless interface ginsengs
Number is set as fixed value.
Correspondingly, in step s 2, the method also includes:
1) variable value in the interface parameters inputted in this test to the interface to be tested is obtained, for example, obtaining this
Address name, age, identification card number, cell-phone number inputted in secondary test to the interface to be tested etc. is due to user identity difference
Different variable element values;
2) variable value in the baseline parameter value is replaced in described this test got to described to be tested
The variable value of interface input;
3) interface to be tested by filtering out in system log message is transmitted to third party's back office interface
Interface parameters value (key/value) is exactly matched with the replaced baseline parameter value (key/value).
The judgment module 103 the interface to be tested be transmitted to third party's back office interface interface parameters and the base
When line parameter value is consistent, determine that the interface parameters that the interface to be tested is transmitted to third party backstage is correctly, to determine that test is logical
It crosses;When the interface to be tested is transmitted to the interface parameters of third party's back office interface and the reference parameter value is inconsistent, then
It determines that mistake occurs in the interface parameters that the interface to be tested passes to third party's back office interface, determines that test does not pass through.
Example IV
Fig. 4 is the schematic diagram of computer installation preferred embodiment of the present invention.
The computer installation 1 includes memory 20, processor 30 and is stored in the memory 20 and can be in institute
State the computer program 40 run on processor 30, such as interface testing program.The processor 30 executes the computer journey
The step in above-mentioned interface test method embodiment, such as step S1~S4 shown in Fig. 2 are realized when sequence 40.Alternatively, the place
Reason device 30 realizes the function of each module/unit in above-mentioned interface test device embodiment, example when executing the computer program 40
Such as the module 101-103 in Fig. 3.
Illustratively, the computer program 40 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 20, and are executed by the processor 30, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, and described instruction section is used
In implementation procedure of the description computer program 40 in the computer installation 1.For example, the computer program 40 can be with
The log information being divided into Fig. 3 obtains module 101, comparison module 102, judgment module 103.Each module concrete function referring to
Embodiment three.
The computer installation 1 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.It will be understood by those skilled in the art that the schematic diagram is only the example of computer installation 1, do not constitute to computer
The restriction of device 1 may include perhaps combining certain components or different components, example than illustrating more or fewer components
Such as described computer installation 1 can also include input-output equipment, network access equipment, bus.
Alleged processor 30 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 30 is also possible to any conventional processing
Device etc., the processor 30 are the control centres of the computer installation 1, utilize various interfaces and the entire computer of connection
The various pieces of device 1.
The memory 20 can be used for storing the computer program 40 and/or module/unit, and the processor 30 passes through
Operation executes the computer program and/or module/unit being stored in the memory 20, and calls and be stored in memory
Data in 20 realize the various functions of the computer installation 1.The memory 20 can mainly include storing program area and deposit
Store up data field, wherein storing program area can application program needed for storage program area, at least one function (for example sound is broadcast
Playing function, image player function etc.) etc.;Storage data area, which can be stored, uses created data (ratio according to computer installation 1
Such as audio data, phone directory) etc..In addition, memory 20 may include high-speed random access memory, it can also include non-easy
The property lost memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other
Volatile solid-state part.
If the integrated module/unit of the computer installation 1 is realized in the form of SFU software functional unit and as independence
Product when selling or using, can store in a computer readable storage medium.Based on this understanding, of the invention
It realizes all or part of the process in above-described embodiment method, can also instruct relevant hardware come complete by computer program
At the computer program can be stored in a computer readable storage medium, and the computer program is held by processor
When row, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, institute
Stating computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..It is described
Computer-readable medium may include: any entity or device, recording medium, U that can carry the computer program code
Disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), arbitrary access
Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs
It is bright, the content that the computer-readable medium includes can according in jurisdiction make laws and patent practice requirement into
Row increase and decrease appropriate, such as do not include electric load according to legislation and patent practice, computer-readable medium in certain jurisdictions
Wave signal and telecommunication signal.
In several embodiments provided by the present invention, it should be understood that arriving, disclosed computer installation and method can
To realize by another way.For example, computer installation embodiment described above is only schematical, for example, institute
The division of unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in same treatment unit
It is that each unit physically exists alone, can also be integrated in same 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 hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie
In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power
Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims
Variation is included in the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This
Outside, it is clear that one word of " comprising " does not exclude other units or steps, and odd number is not excluded for plural number.It is stated in computer installation claim
Multiple units or computer installation can also be implemented through software or hardware by the same unit or computer installation.The
One, the second equal words are used to indicate names, and are not indicated any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference
Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention
Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.
Claims (10)
1. a kind of interface test method is applied in computer installation, which is characterized in that the described method includes:
Real-time acquisition system log information is transmitted to third party backstage by filtering out interface to be tested in the system log message
The interface parameters of interface;
By it is described by the interface to be tested filtered out in system log message be transmitted to the interface parameters of third party's back office interface with
Preset baseline parameter value is compared, be transmitted to described in judgement third party's back office interface interface parameters whether with the baseline
Parameter value is consistent;
If the interface parameters that the interface to be tested is transmitted to third party's back office interface is consistent with the baseline parameter value, it is determined that
Test passes through;And
If the interface to be tested be transmitted to third party's back office interface interface parameters and the reference parameter value it is inconsistent, really
Fixed test does not pass through.
2. interface test method as described in claim 1, which is characterized in that in the real-time acquisition system log information, by
It filters out interface to be tested in the system log message to be transmitted to before the interface parameters of third party's back office interface, the method
It further comprises the steps of:
Obtain the multiple return parameters and the corresponding expectation parameter of the interface to be tested that the interface to be tested is returned;
The multiple return parameters expectation parameter corresponding with interface to be tested is compared one by one, judges the return parameters
It is whether consistent with corresponding expectation parameter;
When the return parameters of the interface to be tested and consistent corresponding expectation parameter, determine interface testing success, then it is real
When obtain system log message, be transmitted to third party's back office interface by filtering out interface to be tested in the system log message
Interface parameters;
When the return parameters of the interface to be tested and inconsistent corresponding expectation parameter, determines that interface testing fails, do not obtain
Take the system log message.
3. interface test method as described in claim 1, which is characterized in that the real-time acquisition system log information, by institute
It states to filter out interface to be tested in system log message and be transmitted to the interface parameters of third party's back office interface and includes:
Execute the default script for being used for grasping system log information, grasping system log information;
Third party backstage is transmitted to by searching and locating the interface to be tested in the system log message according to preset keyword
The interface parameters of interface;
The interface to be tested found described in preservation is transmitted to the interface parameters of third party's back office interface.
4. interface test method as described in claim 1, which is characterized in that the baseline parameter value includes following several numerical value
At least one of: what is got in test process preceding is once transmitted to connecing for third party's back office interface by the interface to be tested
The preset parameter value that is arranged in mouthful parameter, test case, the parameter conduct transmitted to third party's interface when testing for the first time
The baseline parameter value.
5. interface test method as described in claim 1, which is characterized in that the baseline parameter value is with the lattice of Json character string
Formula is stored in preset memory locations.
6. interface test method as described in claim 1, which is characterized in that the interface parameters value is with key/value pairs
Form exists, and determines its corresponding unique Value by Key, wherein Key is the title of interface parameters, and corresponding value is
The corresponding parameter value of the interface parameters title.
7. interface test method as claimed in claim 6, which is characterized in that the interface to be tested is once to third party backstage
Interface transmits multiple interface parameters values, and the multiple interface parameters value includes fixed value and variable value, and the general is described by system
The interface to be tested filtered out in log information is transmitted to the interface parameters and preset baseline parameter value of third party's back office interface
It is compared and includes:
Obtain the variable value into the interface parameters that the interface to be tested inputs;
Variable value in the baseline parameter value is replaced with into the variable value for getting and inputting to the interface to be tested;
The interface for being transmitted to third party's back office interface by the interface to be tested filtered out in system log message is joined
Numerical value is exactly matched with the replaced baseline parameter value.
8. a kind of interface test device, which is characterized in that described device includes:
Log information obtains module, is used for real-time acquisition system log information, to be measured by filtering out in the system log message
The interface parameters of third party's back office interface is transported in oral instructions of trying;
Comparison module, for the interface to be tested by filtering out in system log message to be transmitted to third party's back office interface
Interface parameters be compared with preset baseline parameter value, the interface parameters that third party's back office interface is transmitted to described in judgement is
It is no consistent with the baseline parameter value;
Judgment module, for be transmitted in the interface to be tested third party's back office interface interface parameters and the baseline parameter
When being worth consistent, determine that test passes through;The interface to be tested be transmitted to third party's back office interface interface parameters and the base
When quasi- parameter value is inconsistent, determine that test does not pass through.
9. a kind of computer installation, it is characterised in that: the computer installation includes processor, and the processor is deposited for executing
Such as interface test method of any of claims 1-7 is realized when the computer program stored in reservoir.
10. a kind of computer readable storage medium, is stored thereon with computer program, it is characterised in that: the computer program
Such as interface test method of any of claims 1-7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811537751.1A CN109783367B (en) | 2018-12-15 | 2018-12-15 | Interface testing method, device, computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811537751.1A CN109783367B (en) | 2018-12-15 | 2018-12-15 | Interface testing method, device, computer device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109783367A true CN109783367A (en) | 2019-05-21 |
CN109783367B CN109783367B (en) | 2023-10-27 |
Family
ID=66497012
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811537751.1A Active CN109783367B (en) | 2018-12-15 | 2018-12-15 | Interface testing method, device, computer device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783367B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110162979A (en) * | 2019-05-27 | 2019-08-23 | 北京百度网讯科技有限公司 | A kind of safety detecting method, device, electronic equipment and the storage medium of Web API |
CN111782546A (en) * | 2020-07-23 | 2020-10-16 | 北京斗米优聘科技发展有限公司 | Automatic interface testing method and device based on machine learning |
CN114371866A (en) * | 2020-10-14 | 2022-04-19 | 腾讯科技(深圳)有限公司 | Version reconstruction testing method, device and equipment of business system |
CN114666258A (en) * | 2022-03-22 | 2022-06-24 | 阿波罗智联(北京)科技有限公司 | Interface test method, device, electronic equipment and medium |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090307763A1 (en) * | 2008-06-05 | 2009-12-10 | Fiberlink Communications Corporation | Automated Test Management System and Method |
US20130046504A1 (en) * | 2011-08-18 | 2013-02-21 | Hon Hai Precision Industry Co., Ltd. | Computing device, storage medium, and method for testing integrity of signals transmitted from hard disk interfaces |
CN105490881A (en) * | 2015-12-09 | 2016-04-13 | 北京交控科技股份有限公司 | Configurable data interface test method and system |
CN105975394A (en) * | 2016-05-06 | 2016-09-28 | 华为技术有限公司 | Program testing method and device |
CN106461709A (en) * | 2014-03-11 | 2017-02-22 | 文纳伯公司 | Digital frequency response analysis system and method useful for power supplies |
CN107122290A (en) * | 2016-02-25 | 2017-09-01 | 阿里巴巴集团控股有限公司 | The recording method of log information and device |
CN108021805A (en) * | 2017-12-18 | 2018-05-11 | 上海众人网络安全技术有限公司 | Detect method, apparatus, equipment and the storage medium of Android application program running environment |
CN108388514A (en) * | 2018-02-24 | 2018-08-10 | 平安科技(深圳)有限公司 | Automatic interface testing method, device, equipment and computer readable storage medium |
CN108388507A (en) * | 2018-01-24 | 2018-08-10 | 深圳市买买提信息科技有限公司 | Batch script testing method and device |
CN108446225A (en) * | 2018-03-06 | 2018-08-24 | 平安科技(深圳)有限公司 | Creating device, method and the computer readable storage medium of analog interface |
CN108762955A (en) * | 2018-05-30 | 2018-11-06 | 平安普惠企业管理有限公司 | Interface call method, device, computer equipment and storage medium |
-
2018
- 2018-12-15 CN CN201811537751.1A patent/CN109783367B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090307763A1 (en) * | 2008-06-05 | 2009-12-10 | Fiberlink Communications Corporation | Automated Test Management System and Method |
US20130046504A1 (en) * | 2011-08-18 | 2013-02-21 | Hon Hai Precision Industry Co., Ltd. | Computing device, storage medium, and method for testing integrity of signals transmitted from hard disk interfaces |
CN106461709A (en) * | 2014-03-11 | 2017-02-22 | 文纳伯公司 | Digital frequency response analysis system and method useful for power supplies |
CN105490881A (en) * | 2015-12-09 | 2016-04-13 | 北京交控科技股份有限公司 | Configurable data interface test method and system |
CN107122290A (en) * | 2016-02-25 | 2017-09-01 | 阿里巴巴集团控股有限公司 | The recording method of log information and device |
CN105975394A (en) * | 2016-05-06 | 2016-09-28 | 华为技术有限公司 | Program testing method and device |
CN108021805A (en) * | 2017-12-18 | 2018-05-11 | 上海众人网络安全技术有限公司 | Detect method, apparatus, equipment and the storage medium of Android application program running environment |
CN108388507A (en) * | 2018-01-24 | 2018-08-10 | 深圳市买买提信息科技有限公司 | Batch script testing method and device |
CN108388514A (en) * | 2018-02-24 | 2018-08-10 | 平安科技(深圳)有限公司 | Automatic interface testing method, device, equipment and computer readable storage medium |
CN108446225A (en) * | 2018-03-06 | 2018-08-24 | 平安科技(深圳)有限公司 | Creating device, method and the computer readable storage medium of analog interface |
CN108762955A (en) * | 2018-05-30 | 2018-11-06 | 平安普惠企业管理有限公司 | Interface call method, device, computer equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
李昊;: "互联网第三方支付模拟平台的设计与实现", 信息技术 * |
薛振文: "云监测系统Web Service接口及多平台调用的设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110162979A (en) * | 2019-05-27 | 2019-08-23 | 北京百度网讯科技有限公司 | A kind of safety detecting method, device, electronic equipment and the storage medium of Web API |
CN111782546A (en) * | 2020-07-23 | 2020-10-16 | 北京斗米优聘科技发展有限公司 | Automatic interface testing method and device based on machine learning |
CN114371866A (en) * | 2020-10-14 | 2022-04-19 | 腾讯科技(深圳)有限公司 | Version reconstruction testing method, device and equipment of business system |
CN114666258A (en) * | 2022-03-22 | 2022-06-24 | 阿波罗智联(北京)科技有限公司 | Interface test method, device, electronic equipment and medium |
CN114666258B (en) * | 2022-03-22 | 2023-11-07 | 阿波罗智联(北京)科技有限公司 | Interface testing method, device, electronic equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN109783367B (en) | 2023-10-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109783367A (en) | Interface test method, device, computer installation and storage medium | |
CN109710655B (en) | Database query method, device, terminal equipment and storage medium | |
CN110247811A (en) | A kind of alarm method and relevant apparatus of internet of things equipment | |
CN108255847B (en) | Page generation method and device | |
CN110309058A (en) | Business end test method, device, computer installation and computer storage medium | |
CN109345200A (en) | Automatic auditing method and device, computer readable storage medium based on high-volume report | |
CN110365536A (en) | A kind of the fault cues method and relevant apparatus of internet of things equipment | |
CN111142746B (en) | System quota calculation method and device | |
CN107844324A (en) | Customer terminal webpage redirects treating method and apparatus | |
CN109828905A (en) | Automated testing method, device, computer installation and storage medium | |
CN105868311A (en) | Data analyzing method and device | |
CN110941674A (en) | Block chain-based compliance audit method, device, system and storage medium | |
CN107329991A (en) | A kind of list access to web page and methods of exhibiting and its system | |
CN109582452A (en) | A kind of container dispatching method, dispatching device and electronic equipment | |
CN112308590B (en) | Parameter processing method and device, computing equipment and storage medium | |
CN107153646A (en) | A kind of data processing method and equipment | |
CN110580556B (en) | Data processing method and system and processor | |
CN107294811A (en) | Network detecting method, network detection means and intelligent terminal | |
CN112463780A (en) | Data quality inspection method and device | |
CN109582533A (en) | Data analysing method, device, electronic equipment and storage medium | |
CN112801616B (en) | Abnormal account book processing method and device | |
CN108460002A (en) | Affiliate's automatic butt method, apparatus, equipment and storage medium | |
CN109389306A (en) | A kind of synchronous method and device of user's order | |
CN108536773A (en) | A kind of auto alarm information integrating method, device, equipment and medium | |
CN107528724A (en) | A kind of optimized treatment method and device of node cluster |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |