CN106815100A - Interface test method and device - Google Patents

Interface test method and device Download PDF

Info

Publication number
CN106815100A
CN106815100A CN201510847863.7A CN201510847863A CN106815100A CN 106815100 A CN106815100 A CN 106815100A CN 201510847863 A CN201510847863 A CN 201510847863A CN 106815100 A CN106815100 A CN 106815100A
Authority
CN
China
Prior art keywords
expected results
actual result
cryptographic hash
interface
results table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510847863.7A
Other languages
Chinese (zh)
Inventor
张秋生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201510847863.7A priority Critical patent/CN106815100A/en
Publication of CN106815100A publication Critical patent/CN106815100A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of interface test method and device, it is related to software testing technology field, solves the problems, such as that the accuracy rate and efficiency of existing interface test are low.Main technical schemes of the invention are:The actual result table and expected results table of tested interface are obtained, the actual result table is identical with the number of data lines in the expected results table;The cryptographic Hash of each row of data in the actual result table and the expected results table is calculated respectively;Judge each cryptographic Hash in the actual result table, if there is correspondence identical value in the expected results table;If in the presence of output interface is successfully tested information.Present invention is mainly used for interface testing.

Description

Interface test method and device
Technical field
The present invention relates to software testing technology field, more particularly to interface test method and device.
Background technology
With continually developing for software engineering, method for testing software also gradually increases.Wherein, interface is surveyed Examination is a kind of method of testing of test system components interface, is mainly used in testing external system and system Between and internal subsystems between interaction point.The emphasis of interface testing is the friendship for checking data Change, transmit and control management process, and mutual logic dependencies between system etc..Interface testing Flow is query SQL (the Structured Query predicted the outcome firstly the need of setup test data or generation Language, SQL), then obtain the reality that interface is returned by calling tested interface Border result, and parse actual result and obtain specified format, finally compare actual result and expected results, Judgement is tested whether successfully, and printing test result.
At present, can be carried out directly by the character string of actual result and the character string of expected results that return The mode for comparing is connect, judgement is tested whether successfully, but the position when certain element in two character strings When putting different, test result can therefore suffer from influence and it is inaccurate;Furthermore it is also possible to pass through reality Result resolves to certain type of set, it is contemplated that result is similarly certain type of set, by generation The mode traveled through in code is tested, but because the type of element in set is different, general-purpose version Type as the technology such as parameter and reflection need to just be caused the increase of measuring technology complexity, efficiency drop It is low, therefore the accuracy rate of existing interface test mode and less efficient.
The content of the invention
In view of the above problems, it is proposed that the present invention, above mentioned problem or at least is overcome to provide one kind The interface test method and device for partly solving the above problems.
To reach above-mentioned purpose, present invention generally provides following technical scheme:
On the one hand, a kind of interface test method is the embodiment of the invention provides, the method includes:
Obtain the actual result table and expected results table of tested interface, the actual result table and described Number of data lines in expected results table is identical;
The cryptographic Hash of each row of data in the actual result table and the expected results table is calculated respectively;
Judge each cryptographic Hash in the actual result table, if exist in the expected results table Correspondence identical value;
If in the presence of output interface is successfully tested information.
On the other hand, the embodiment of the present invention also provides a kind of interface test device, and the device includes:
Acquiring unit, actual result table and expected results table for obtaining tested interface, the reality Border result table is identical with the number of data lines in the expected results table;
Computing unit, for calculating the actual result table and the expected results table respectively in per line number According to cryptographic Hash;
Judging unit, for judging each cryptographic Hash in the actual result table, if described pre- There is correspondence identical value in phase result table;
Output unit, for there is correspondence identical value in the expected results table, then output interface is surveyed Examination successful information.
By above-mentioned technical proposal, technical scheme provided in an embodiment of the present invention at least has following advantages:
A kind of interface test method provided in an embodiment of the present invention and device, obtain tested interface first Actual result table and expected results table, the data in the actual result table and the expected results table Line number is identical, and each row of data in the actual result table and the expected results table is then calculated respectively Cryptographic Hash, then judge each cryptographic Hash in the actual result table, if in the expected results table Middle to there is correspondence identical value, if there is correspondence identical value in the expected results table, output connects Mouth is successfully tested information.With the character string and the character of expected results of the actual result for passing through to return at present String carries out the mode for directly comparing to judge to test whether successfully to compare, and the embodiment of the present invention is by judging Each cryptographic Hash in the actual result table, if there is correspondence in the expected results table identical The mode of value determine whether interface testing succeeds, so as to solve in the prior art certain element two The inaccurate problem of test result caused by when position in individual character string is different, and interface testing The challenge of middle comparative result, therefore the difficulty that interface testing compares can be reduced by the present invention, Improve the accuracy rate and efficiency of interface testing.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantage and benefit for Those of ordinary skill in the art will be clear understanding.Accompanying drawing is only used for showing the mesh of preferred embodiment , and it is not considered as limitation of the present invention.And in whole accompanying drawing, with identical with reference to symbol Number represent identical part.In the accompanying drawings:
Fig. 1 is a kind of interface test method flow chart provided in an embodiment of the present invention;
Fig. 2 is another interface test method flow chart provided in an embodiment of the present invention;
Fig. 3 is a kind of composition frame chart of interface test device provided in an embodiment of the present invention;
Fig. 4 is the composition frame chart of another interface test device provided in an embodiment of the present invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing in accompanying drawing The exemplary embodiment of the disclosure is shown, it being understood, however, that may be realized in various forms the disclosure Without that should be limited by embodiments set forth here.Conversely, there is provided these embodiments are able to more Thoroughly understand the disclosure, and can be by the complete technology for conveying to this area of the scope of the present disclosure Personnel.
To make the advantage of technical solution of the present invention clearer, with reference to the accompanying drawings and examples to this hair It is bright to elaborate.
A kind of interface test method is the embodiment of the invention provides, as shown in figure 1, methods described includes:
S101, the actual result table and expected results table that obtain tested interface.
Wherein, the actual result table is identical with the number of data lines in the expected results table.The reality Border result table is the actual running results of tested interface, and the expected results table is to be tested interface just Result when often running, by comparing the data in actual result table and expected results table, it can be determined that Go out whether tested interface is successfully tested.
For the embodiment of the present invention, query statement can be expected by being performed in API source databases, Obtain expected results table.Obtain the API that actual result table can be provided by api interface calling module Various method of calling call tested interface to obtain actual result, such as get, post etc., the present invention Embodiment is not specifically limited.Then the actual result that will be got is formatted into consolidation form, for example: Actual result is formatted as@" ' actTable1':[{'id':0,'name':'Smoth'},{'id':1,'name': ' Lisha'}] ", finally in character string unserializing after formatting to actual result table.
S102, the Hash for calculating each row of data in the actual result table and the expected results table respectively Value.
Wherein, Hash is exactly that the input of random length is passed through hashing algorithm, is transformed into regular length Output.In embodiments of the present invention, by calculating actual result table and expected results table respectively in often go The cryptographic Hash of data, can obtain and the unique corresponding number of row data in actual result table and expected knot table Value.
S103, each cryptographic Hash judged in the actual result table, if in the expected results table It is middle to there is correspondence identical value.
In embodiments of the present invention, by judging each cryptographic Hash in actual result table, if pre- There is correspondence identical value in phase result table, challenge when can simplify comparative result in interface testing, The difficulty of interface testing comparing function module is reduced, so as to improve the ratio of test frame comparing function Compared with efficiency.
For example, the cryptographic Hash of each row is respectively in actual result table:abc111、abc122、abc133 abc144;The cryptographic Hash of each row is respectively in expected results table:abc110、abc122、abc133abc144. By judging that cryptographic Hash abc122, abc133abc144 is converged in expected results table in finding actual result table It is total to there is correspondence identical value, and the cryptographic Hash abc111 in actual result table is in the expected results table In do not exist corresponding value.
If S104, in the presence of output interface is successfully tested information.
For the embodiment of the present invention, if each cryptographic Hash in actual result table is in the expected results table In all there is correspondence identical value, then output interface is successfully tested information;Otherwise output interface test is lost Lose information.In embodiments of the present invention, by judging each cryptographic Hash in the actual result table, Whether exist in the expected results table correspondence identical value mode determine interface testing whether into Work(, so as to solve the position of certain element in the prior art in two character strings it is different when and cause The inaccurate problem of test result, and in interface testing comparative result challenge, it is therefore logical Crossing the present invention can reduce the difficulty that interface testing compares, and improve the accuracy rate and efficiency of interface testing.
Another interface test method is the embodiment of the invention provides, as shown in Fig. 2 methods described bag Include:
S201, the actual result table and expected results table that obtain tested interface.
Wherein, the actual result table is identical with the number of data lines in the expected results table.The reality Border result table is the actual running results of tested interface, and the expected results table is to be tested interface just Result when often running, by comparing the data in actual result table and expected results table, it can be determined that Go out whether tested interface is successfully tested.
For the embodiment of the present invention, step S201 includes:By in application programming interface API Preset query statement is performed in source database, the expected results table is obtained.By the called side of API Formula, calls the tested interface to obtain actual test result;According to preset form by the reality Test result is formatted into unified form;The actual test result unserializing for formatting is arrived In the actual result table.
For example, expected results can be obtained by performing expected query statement in API source databases Table.Obtain the various called sides of the API that actual result table can be provided by api interface calling module Formula calls tested interface to obtain actual result, such as get, post etc., and the embodiment of the present invention is not done to be had Body is limited.Then the actual result that will be got is formatted into consolidation form, for example:By actual result It is formatted as@" ' actTable1':[{'id':0,'name':'Smoth'},{'id':1,'name':' Lisha'}] ", Finally in character string unserializing after formatting to actual result table.
S202, according to preset ordering rule respectively in the actual result table and the expected results table Data be ranked up.
Wherein, the preset ordering rule can be configured according to the actual demand of user, it is also possible to Configured by system default, for example, the preset ordering rule is specifically as follows according to name field in table Ascending order arrangement, the arrangement of age field descending or the arrangement of height field ascending order etc., the embodiment of the present invention is not done It is specific to limit.It should be noted that being simultaneously right by same ordering rule in the embodiment of the present invention Actual result table and expected results table are ranked up, so that actual result table and expected results after sorting Data row in table is corresponding.
In embodiments of the present invention, according to preset ordering rule respectively to the actual result table and described Data in expected results table are ranked up, and can improve the speed compared in further interface test, enter And improve the efficiency of interface testing.
S203, the Hash for calculating each row of data in the actual result table and the expected results table respectively Value.
Wherein, Hash is exactly that the input of random length is passed through hashing algorithm, is transformed into regular length Output.In embodiments of the present invention, by calculating actual result table and expected results table respectively in often go The cryptographic Hash of data, can obtain and the unique corresponding number of row data in actual result table and expected knot table Value.
S204, correspond to line by line judge cryptographic Hash in the actual result table whether with the expected results Cryptographic Hash in table is equal.
In embodiments of the present invention, be first according to preset ordering rule respectively to the actual result table and After data in the expected results table are ranked up, the data in actual result table and expected results table Row is corresponding, i.e., the first row data in the data correspondence expected results table of the first row in actual result table, Second row data in the data correspondence expected results table of the second row in actual result table, by that analogy.So Do not calculate the cryptographic Hash of each row of data in the actual result table and the expected results table afterwards, finally by Row correspondence judge cryptographic Hash in the actual result table whether with the expected results table in cryptographic Hash It is equal.So as to improve the comparing speed and accuracy of interface testing.
For example, the cryptographic Hash of the first row is for abab12, the cryptographic Hash of the second row in actual result table Abab13, the cryptographic Hash of the third line are abab14;The cryptographic Hash of the first row is in expected results table Abab12, the cryptographic Hash of the second row are abab13, the cryptographic Hash of the third line is abab15.Then pass through by Row correspondence judge cryptographic Hash in the actual result table whether with the expected results table in cryptographic Hash After equal, it can be found that the data and expected results table of the first row and the second row in actual result table Middle the first row and the second row are equal, and the third line data are unequal in the third line data and expected results table.
It is nested when existing in the actual result table with the expected results table for the embodiment of the present invention Data when, then for nested data, step S204 includes:According to the nested data genaration Actual result sublist, expected results sublist;The Hash judged in the actual result sublist is corresponded to line by line Whether value is identical with the cryptographic Hash in the expected results sublist.
If in S205a, the actual result table whole cryptographic Hash all with the expected results table in Kazakhstan Uncommon to be worth correspondent equal, then output interface is successfully tested information.
If the cryptographic Hash in S205b, the actual result table and the corresponding Kazakhstan in the expected results table Uncommon value is unequal, then export the corresponding data row of unequal cryptographic Hash in the actual result table.
Wherein, step S205b is the step arranged side by side of step S205a, if certain in actual result table The cryptographic Hash of a line is unequal with the corresponding cryptographic Hash in the expected results table, then export actual knot The corresponding data row of unequal cryptographic Hash in fruit table.
A kind of interface test method provided in an embodiment of the present invention, obtains the reality of tested interface first As a result table and expected results table, the number of data lines phase in the actual result table and the expected results table Together, the cryptographic Hash of each row of data in the actual result table and the expected results table is then calculated respectively, Each cryptographic Hash in the actual result table is judged again, if it is right to exist in the expected results table Identical value is answered, if there is correspondence identical value in the expected results table, output interface is tested into Work(information.Carried out directly with the character string of actual result and the character string of expected results at present by return The mode for comparing is connect to judge to test whether successfully to compare, the embodiment of the present invention is by judging the reality As a result each cryptographic Hash in table, if there is the side of correspondence identical value in the expected results table Formula determines whether interface testing succeeds, so as to solve in the prior art certain element in two character strings In position it is different when caused by the inaccurate problem of test result, and compare knot in interface testing The challenge of fruit, therefore the difficulty that interface testing compares can be reduced by the present invention, improve interface The accuracy rate and efficiency of test.
Further, the embodiment of the present invention provides a kind of interface test device, as shown in figure 3, described Device includes:Acquiring unit 31, computing unit 32, judging unit 33, output unit 34.
Acquiring unit 31, actual result table and expected results table for obtaining tested interface are described Actual result table is identical with the number of data lines in the expected results table.
Computing unit 32, for calculating the actual result table and the expected results table respectively in often go The cryptographic Hash of data.
Judging unit 33, for judging each cryptographic Hash in the actual result table, if described There is correspondence identical value in expected results table.
Output unit 34, corresponds to identical value, then output interface for existing in the expected results table It is successfully tested information.
It should be noted that each function involved by a kind of interface test device provided in an embodiment of the present invention Other corresponding descriptions of unit, may be referred to the correspondence description of method shown in Fig. 1, will not be repeated here, It should be understood that the device in the present embodiment can be corresponded in the whole that realize in preceding method embodiment Hold.
Further, another interface test device provided in an embodiment of the present invention, as shown in figure 4, Described device includes:Acquiring unit 41, computing unit 42, judging unit 43, output unit 44.
Acquiring unit 41, actual result table and expected results table for obtaining tested interface are described Actual result table is identical with the number of data lines in the expected results table.
Computing unit 42, for calculating the actual result table and the expected results table respectively in often go The cryptographic Hash of data.
Judging unit 43, for judging each cryptographic Hash in the actual result table, if described There is correspondence identical value in expected results table.
Output unit 44, corresponds to identical value, then output interface for existing in the expected results table It is successfully tested information.
The acquiring unit 41, specifically for by application programming interface API source databases Preset query statement is performed, the expected results table is obtained.
Further, the acquiring unit 41 includes:
Calling module 411, for the method for calling by API, calls the tested interface to obtain Actual test result.
Formatting module 412, for the actual test result to be formatted into unification according to preset form Form.
Antitone sequence module 413, for the actual test result unserializing that will format to the reality In the result table of border.
Further, described device also includes:Sequencing unit 45.
The sequencing unit 45, for according to preset ordering rule respectively to the actual result table and institute The data stated in expected results table are ranked up.
The judging unit 43, specifically for corresponding to the cryptographic Hash judged in the actual result table line by line It is whether equal with cryptographic Hash in the expected results table.
The output unit 44, if specifically for cryptographic Hash whole in the actual result table all and institute The cryptographic Hash correspondent equal in expected results table is stated, then output interface is successfully tested information.
The output unit 44, if the cryptographic Hash being additionally operable in the actual result table and the expected knot Corresponding cryptographic Hash in fruit table is unequal, then export unequal cryptographic Hash pair in the actual result table The data row answered.
Further, the judging unit 43 includes:
Generation module 431, for nested when existing in the actual result table with the expected results table During data, then for nested data, according to the nested data genaration actual result sublist, in advance Phase result sublist.
Judge module 432, for correspond to line by line judge cryptographic Hash in the actual result sublist whether with Cryptographic Hash in the expected results sublist is identical.
It should be noted that each function involved by a kind of interface test device provided in an embodiment of the present invention Other corresponding descriptions of unit, may be referred to the correspondence description of method shown in Fig. 2, will not be repeated here, It should be understood that the device in the present embodiment can be corresponded in the whole that realize in preceding method embodiment Hold.
A kind of interface test device provided in an embodiment of the present invention, obtains the reality of tested interface first As a result table and expected results table, the number of data lines phase in the actual result table and the expected results table Together, the cryptographic Hash of each row of data in the actual result table and the expected results table is then calculated respectively, Each cryptographic Hash in the actual result table is judged again, if it is right to exist in the expected results table Identical value is answered, if there is correspondence identical value in the expected results table, output interface is tested into Work(information.Carried out directly with the character string of actual result and the character string of expected results at present by return The mode for comparing is connect to judge to test whether successfully to compare, the embodiment of the present invention is by judging the reality As a result each cryptographic Hash in table, if there is the side of correspondence identical value in the expected results table Formula determines whether interface testing succeeds, so as to solve in the prior art certain element in two character strings In position it is different when caused by the inaccurate problem of test result, and compare knot in interface testing The challenge of fruit, therefore the difficulty that interface testing compares can be reduced by the present invention, improve interface The accuracy rate and efficiency of test.
The device embodiment is corresponding with preceding method embodiment, and for ease of reading, present apparatus embodiment is not The detail content in preceding method embodiment is repeated one by one again, it should be understood that the present embodiment In device can correspond to the full content that realize in preceding method embodiment.
The interface test device include processor and memory, above-mentioned acquiring unit, computing unit, Judging unit, output unit and sequencing unit etc. as program unit storage in memory, by Reason device performs storage said procedure unit in memory to realize corresponding function.
Kernel is included in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can To set one or more, the accuracy rate and efficiency of interface testing are improved by adjusting kernel parameter.
Memory potentially includes the volatile memory in computer-readable medium, random access memory The form such as device (RAM) and/or Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM), memory includes at least one storage chip.
Present invention also provides a kind of computer program product, when being performed on data processing equipment, It is adapted for carrying out the program code of initialization there are as below methods step:Obtain the actual result of tested interface Table and expected results table, the actual result table are identical with the number of data lines in the expected results table; The cryptographic Hash of each row of data in the actual result table and the expected results table is calculated respectively;Judge institute State each cryptographic Hash in actual result table, if there is correspondence identical in the expected results table Value;If in the presence of output interface is successfully tested information.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system, Or computer program product.Therefore, the application can be implemented using complete hardware embodiment, complete software The form of the embodiment in terms of example or combination software and hardware.And, the application can be used at one Or multiple wherein includes the computer-usable storage medium of computer usable program code (including but not Be limited to magnetic disk storage, CD-ROM, optical memory etc.) on the computer program product implemented Form.
The application is with reference to the method according to the embodiment of the present application, equipment (system) and computer program The flow chart and/or block diagram of product is described.It should be understood that can be realized flowing by computer program instructions In each flow and/or square frame and flow chart and/or block diagram in journey figure and/or block diagram Flow and/or square frame combination.Can provide these computer program instructions to all-purpose computer, specially With the processor of computer, Embedded Processor or other programmable data processing devices producing one Machine so that produced by the instruction of computer or the computing device of other programmable data processing devices It is raw to be used to realize in one flow of flow chart or multiple flow and/or block diagram one square frame or multiple side The device of the function of being specified in frame.
These computer program instructions may be alternatively stored in can guide computer or other programmable datas to process In the computer-readable memory that equipment works in a specific way so that storage is deposited in the computer-readable Instruction in reservoir is produced and includes the manufacture of command device, and command device realization is in flow chart one The function of being specified in flow or multiple one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions can also be loaded into computer or other programmable data processing devices On so that series of operation steps is performed on computer or other programmable devices to produce computer The treatment of realization, so as to the instruction performed on computer or other programmable devices is provided for realizing Specified in one flow of flow chart or multiple one square frame of flow and/or block diagram or multiple square frames The step of function.
In a typical configuration, computing device include one or more processors (CPU), input/ Output interface, network interface and internal memory.
Memory potentially includes the volatile memory in computer-readable medium, random access memory The form such as device (RAM) and/or Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Memory is the example of computer-readable medium.
Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be with Information Store is realized by any method or technique.Information can be computer-readable instruction, data knot Structure, the module of program or other data.The example of the storage medium of computer includes, but are not limited to phase Become internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electricity can Erasable programmable read-only memory (EPROM) (EEPROM), fast flash memory bank or other memory techniques, read-only light Disk read-only storage (CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic Cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus or any other non-transmission medium, Can be used to store the information that can be accessed by a computing device.Defined according to herein, computer-readable Medium does not include temporary computer readable media (transitory media), such as data-signal and load of modulation Ripple.
Embodiments herein is these are only, the application is not limited to.For this area skill For art personnel, the application can have various modifications and variations.It is all spirit herein and principle it Interior made any modification, equivalent substitution and improvements etc., should be included in claims hereof model Within enclosing.

Claims (10)

1. a kind of interface test method, it is characterised in that including:
Obtain the actual result table and expected results table of tested interface, the actual result table and described Number of data lines in expected results table is identical;
The cryptographic Hash of each row of data in the actual result table and the expected results table is calculated respectively;
Judge each cryptographic Hash in the actual result table, if exist in the expected results table Correspondence identical value;
If in the presence of output interface is successfully tested information.
2. method according to claim 1, it is characterised in that the acquisition interface to be tested Expected results table includes:
By performing preset query statement in application programming interface API source databases, institute is obtained State expected results table.
3. method according to claim 1, it is characterised in that the acquisition interface to be tested Actual result table includes:
By the method for calling of API, the tested interface is called to obtain actual test result;
The actual test result is formatted into unified form according to preset form;
The actual test result unserializing that will be formatted is in the actual result table.
4. according to the method in claim 2 or 3, it is characterised in that described to calculate described respectively In actual result table and the expected results table before the cryptographic Hash of each row of data, methods described also includes:
According to preset ordering rule respectively to the data in the actual result table and the expected results table It is ranked up;
Described each cryptographic Hash judged in the actual result table, if in the expected results table There is corresponding value includes:
Correspond to line by line judge cryptographic Hash in the actual result table whether with the expected results table in Cryptographic Hash is equal.
5. method according to claim 4, it is characterised in that if described in the presence of output interface The information of being successfully tested includes:
If in the actual result table whole cryptographic Hash all with the expected results table in cryptographic Hash pair Should be equal, then output interface is successfully tested information;
Methods described also includes:If in cryptographic Hash in the actual result table and the expected results table Corresponding cryptographic Hash it is unequal, then export the corresponding number of unequal cryptographic Hash in the actual result table According to row.
6. method according to claim 5, it is characterised in that when the actual result table and institute State when there are nested data in expected results table, then for nested data, described corresponding to line by line is sentenced Break the actual result table in cryptographic Hash whether with the expected results table in the equal bag of cryptographic Hash Include:
According to nested data genaration actual result sublist, the expected results sublist;
Correspond to line by line judge cryptographic Hash in the actual result sublist whether with the expected results sublist In cryptographic Hash it is identical.
7. a kind of interface test device, it is characterised in that including:
Acquiring unit, actual result table and expected results table for obtaining tested interface, the reality Border result table is identical with the number of data lines in the expected results table;
Computing unit, for calculating the actual result table and the expected results table respectively in per line number According to cryptographic Hash;
Judging unit, for judging each cryptographic Hash in the actual result table, if described pre- There is correspondence identical value in phase result table;
Output unit, for there is correspondence identical value in the expected results table, then output interface is surveyed Examination successful information.
8. device according to claim 7, it is characterised in that
The acquiring unit, specifically for being held by application programming interface API source databases The preset query statement of row, obtains the expected results table.
9. device according to claim 8, it is characterised in that the acquiring unit includes:
Calling module, for the method for calling by API, calls the tested interface to obtain reality Border test result;
Formatting module is unified for being formatted into the actual test result according to preset form Form;
Antitone sequence module, the actual test result unserializing that will be formatted to the actual result In table.
10. device according to claim 8 or claim 9, it is characterised in that described device also includes: Sequencing unit;
The sequencing unit, for according to preset ordering rule respectively to the actual result table and described Data in expected results table are ranked up;
The judging unit, judges that the cryptographic Hash in the actual result table is specifically for corresponding to line by line Cryptographic Hash in no and described expected results table is equal.
CN201510847863.7A 2015-11-27 2015-11-27 Interface test method and device Pending CN106815100A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510847863.7A CN106815100A (en) 2015-11-27 2015-11-27 Interface test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510847863.7A CN106815100A (en) 2015-11-27 2015-11-27 Interface test method and device

Publications (1)

Publication Number Publication Date
CN106815100A true CN106815100A (en) 2017-06-09

Family

ID=59102856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510847863.7A Pending CN106815100A (en) 2015-11-27 2015-11-27 Interface test method and device

Country Status (1)

Country Link
CN (1) CN106815100A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992389A (en) * 2017-12-22 2018-05-04 无线生活(杭州)信息科技有限公司 A kind of test method and device
CN108959065A (en) * 2018-05-17 2018-12-07 烽火通信科技股份有限公司 The verification method and system of software interface test parameter
CN109408378A (en) * 2018-09-30 2019-03-01 福建星瑞格软件有限公司 A kind of test method and system quickly positioning SQL parsing mistake under big data quantity
CN109634846A (en) * 2018-11-16 2019-04-16 武汉达梦数据库有限公司 A kind of ETL method for testing software and device
CN110209571A (en) * 2019-04-25 2019-09-06 深圳壹账通智能科技有限公司 Test method and device, storage medium, the computer equipment of more new interface
CN110908892A (en) * 2019-09-18 2020-03-24 泰康保险集团股份有限公司 Interface data testing method and device and readable storage medium
CN114020813A (en) * 2021-11-16 2022-02-08 平安银行股份有限公司 Data comparison method, device and equipment based on Hash algorithm and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440197A (en) * 2013-08-25 2013-12-11 浙江大学 Automatic difference test report generating method based on comparison test
CN103678583A (en) * 2013-12-11 2014-03-26 北京华胜天成科技股份有限公司 Method and system for comparing structural data
CN104111885A (en) * 2013-04-22 2014-10-22 腾讯科技(深圳)有限公司 Method and device for verifying interface test results
CN104360920A (en) * 2014-12-02 2015-02-18 微梦创科网络科技(中国)有限公司 Automatic testing method and device for interface
CN104820638A (en) * 2015-04-17 2015-08-05 中国电子科技集团公司第四十一研究所 Embedded whole machine automatic testing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104111885A (en) * 2013-04-22 2014-10-22 腾讯科技(深圳)有限公司 Method and device for verifying interface test results
CN103440197A (en) * 2013-08-25 2013-12-11 浙江大学 Automatic difference test report generating method based on comparison test
CN103678583A (en) * 2013-12-11 2014-03-26 北京华胜天成科技股份有限公司 Method and system for comparing structural data
CN104360920A (en) * 2014-12-02 2015-02-18 微梦创科网络科技(中国)有限公司 Automatic testing method and device for interface
CN104820638A (en) * 2015-04-17 2015-08-05 中国电子科技集团公司第四十一研究所 Embedded whole machine automatic testing method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992389A (en) * 2017-12-22 2018-05-04 无线生活(杭州)信息科技有限公司 A kind of test method and device
CN108959065A (en) * 2018-05-17 2018-12-07 烽火通信科技股份有限公司 The verification method and system of software interface test parameter
CN109408378A (en) * 2018-09-30 2019-03-01 福建星瑞格软件有限公司 A kind of test method and system quickly positioning SQL parsing mistake under big data quantity
CN109408378B (en) * 2018-09-30 2022-05-24 福建星瑞格软件有限公司 Test method and system for rapidly positioning SQL analysis errors under large data volume
CN109634846A (en) * 2018-11-16 2019-04-16 武汉达梦数据库有限公司 A kind of ETL method for testing software and device
CN109634846B (en) * 2018-11-16 2021-10-19 武汉达梦数据库股份有限公司 ETL software testing method and device
CN110209571A (en) * 2019-04-25 2019-09-06 深圳壹账通智能科技有限公司 Test method and device, storage medium, the computer equipment of more new interface
CN110908892A (en) * 2019-09-18 2020-03-24 泰康保险集团股份有限公司 Interface data testing method and device and readable storage medium
CN114020813A (en) * 2021-11-16 2022-02-08 平安银行股份有限公司 Data comparison method, device and equipment based on Hash algorithm and storage medium

Similar Documents

Publication Publication Date Title
CN106815100A (en) Interface test method and device
JP6916403B2 (en) Specifying and applying logical validation rules to data
KR102074026B1 (en) Profiling data with location information
US20170235664A1 (en) Transitive source code violation matching and attribution
CN107239479A (en) A kind of method and device of data storage and inquiry based on block chain
CN105760292B (en) A kind of assertion verification method and apparatus for unit testing
KR20170052672A (en) Conditional validation rules
CN106919370A (en) The acquisition methods and device of a kind of object attribute values
CN105204920B (en) A kind of implementation method and device of the distributed computing operation based on mapping polymerization
WO2017000828A1 (en) Rule-based data object verification method, apparatus, system and electronic device
CN106980619A (en) Data query method and device
CN106227666A (en) A kind of automated testing method based on big data and system
EP2535856A1 (en) Cased-based retrieval of integration cases using similarity measures based on a business domain ontology
CN106649226A (en) Report generation method and device
CN108664644A (en) A kind of question answering system construction method, question and answer processing method and processing device
CN108255479A (en) Creation method, device, storage medium and the terminal of cube files
CN111045670B (en) Method and device for identifying multiplexing relationship between binary code and source code
US9830358B1 (en) Generating identifiers for tuples of recursively defined relations
CN109062918A (en) A kind of method and device of SQL statement conversion
CN105210059B (en) A kind of data processing method and system
CN112148713B (en) Method and device for data migration between heterogeneous databases
US10042884B2 (en) Algebraic data types for database query languages
CN106649319A (en) Search result display method and device
CN108241620A (en) The generation method and device of query script
Alvarez et al. Counting crossing-free structures

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
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20170609

RJ01 Rejection of invention patent application after publication