CN110609785A - Software interface testing method and device - Google Patents

Software interface testing method and device Download PDF

Info

Publication number
CN110609785A
CN110609785A CN201810620434.XA CN201810620434A CN110609785A CN 110609785 A CN110609785 A CN 110609785A CN 201810620434 A CN201810620434 A CN 201810620434A CN 110609785 A CN110609785 A CN 110609785A
Authority
CN
China
Prior art keywords
interface
data
test
tested
attribute
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
CN201810620434.XA
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.)
Zhongchang (hangzhou) Information Technology Co Ltd
China Mobile Communications Group Co Ltd
Original Assignee
Zhongchang (hangzhou) Information Technology Co Ltd
China Mobile Communications Group 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 Zhongchang (hangzhou) Information Technology Co Ltd, China Mobile Communications Group Co Ltd filed Critical Zhongchang (hangzhou) Information Technology Co Ltd
Priority to CN201810620434.XA priority Critical patent/CN110609785A/en
Publication of CN110609785A publication Critical patent/CN110609785A/en
Pending legal-status Critical Current

Links

Classifications

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

Abstract

The embodiment of the application discloses a method and a device for testing a software interface. The technical scheme is that test data required by a to-be-tested interface is analyzed by adopting a preset language processing algorithm to obtain at least one data attribute library, wherein each data attribute library comprises an attribute value aiming at the same set data attribute; acquiring at least one full data use case for testing the interface to be tested based on the attribute values in at least one data attribute library; and calling the full data use cases based on the interface request type of the interface to be tested to obtain a test result corresponding to at least one full data use case. According to the method, a plurality of full data cases obtained by decomposing and recombining the data to be tested can cover various scenes, and the whole testing process is automatically completed, so that the testing efficiency is improved.

Description

Software interface testing method and device
Technical Field
The present application relates to the field of computer software testing technologies, and in particular, to a method and an apparatus for testing a software interface.
Background
With the wide use of computer software in the whole industry, the software quality is gradually valued by users, and the software test becomes more important as a front-end entrance for software quality assurance. The test of the software interface is an important branch in software test, and is mainly used for detecting interaction points between external systems and systems of a software program and between subsystems in the software program, the key point of the test is to check data exchange, transfer and control management processes, mutual logic dependency relationship between systems and the like, a test object is data of the software interface and interface interaction, and the main activity is the correctness check of interface interaction data. The stability of the whole software program can be guaranteed only by guaranteeing the stability of the software interface.
At present, the testing process of the existing software interface is a manual testing process, and testers need to write testing programs by themselves to test.
However, due to the complexity of writing test cases (or called data cases) and test codes, the time spent by testers is long and the test efficiency is low when testing software interfaces, and the situation that part of case scenes are not covered due to insufficient design of test case files exists.
Disclosure of Invention
The embodiment of the application provides a method and a device for testing a software interface, which are used for improving the testing efficiency and perfecting the coverage of various use case scenes.
In a first aspect, a method for testing a software interface is provided, and the method may include:
analyzing test data required by the interface to be tested by adopting a preset language processing algorithm to obtain at least one data attribute library, wherein each data attribute library comprises each attribute value aiming at the same set data attribute;
extracting data attribute values in each data attribute library;
recombining the extracted data attribute values in different data attribute libraries to obtain at least one full data case for testing the interface to be tested, wherein the full data case comprises the attribute value of each data attribute library in at least one data attribute library;
executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested, wherein the preset test request calls the full data case;
and obtaining a test result corresponding to at least one full data case.
Therefore, a plurality of full data cases can be obtained by decomposing and recombining the data to be tested, the coverage of various scenes is perfected, the processes of obtaining the full data cases and executing the test are all automatically completed, and compared with the prior art, the test efficiency is improved.
In an optional implementation, before analyzing test data required by the interface to be tested by using a preset language processing algorithm, the method further includes:
and receiving test data required by the interface to be tested and sent by the client, wherein the test data is acquired by a tester according to the interface information of the interface to be tested in a preset interface document.
The scheme is a mode for the server to obtain at least one data to be tested.
In an optional implementation, the method further comprises: and sending the test result to the client so that the client performs data verification on the test result and the actual result to generate a test report, wherein the actual result is a result returned by a real calling interface stored in the client.
In an alternative implementation, the predetermined language processing algorithm is a neuro-linguistic programming NLP algorithm.
In a second aspect, there is provided a test apparatus, which may include:
the analysis unit is used for analyzing the test data required by the interface to be tested by adopting a preset language processing algorithm to obtain at least one data attribute library, and each data attribute library comprises each attribute value aiming at the same set data attribute;
the extracting unit is used for extracting the data attribute value in each data attribute library;
the acquisition unit is used for recombining the extracted data attribute values in the different data attribute libraries to acquire at least one full data case for testing the interface to be tested, wherein the full data case comprises the attribute value of each data attribute library in at least one data attribute library;
the execution unit is used for executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested, and the preset test request calls a full data case;
and the acquisition unit is used for acquiring the test result corresponding to at least one full data case.
In an alternative implementation, the apparatus further comprises a receiving unit;
the receiving unit is used for receiving test data required by the interface to be tested and sent by the client, and the test data is acquired by a tester according to interface information of the interface to be tested in the preset interface document.
In an alternative implementation, the apparatus further comprises a transmitting unit;
and the sending unit is used for sending the test result to the client so that the client performs data verification on the test result and the actual result to generate a test report, wherein the actual result is a result returned by a real calling interface stored in the client.
In an alternative implementation, the predetermined language processing algorithm is a neuro-linguistic programming NLP algorithm.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, performs the method steps of any of the above first aspects.
According to the technical scheme, a preset language processing algorithm is adopted to analyze test data required by the interface to be tested to obtain at least one data attribute library, and each data attribute library comprises attribute values aiming at the same set data attribute; acquiring at least one full data use case for testing the interface to be tested based on the attribute values in at least one data attribute library, wherein the full data use case comprises the attribute value of each data attribute library in at least one data attribute library; and executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested to call the full data use case so as to obtain a test result corresponding to at least one full data use case. Therefore, a plurality of full data cases can be obtained by decomposing and recombining the data to be tested, the coverage of various scenes is perfected, the processes of obtaining the full data cases and executing the test are all automatically completed, and compared with the prior art, the test efficiency is improved.
Drawings
Fig. 1 is a schematic diagram of a system architecture applied in a method for testing a software interface according to an embodiment of the present invention;
fig. 2 is a schematic flowchart illustrating a method for testing a software interface according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a testing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the present application.
The currently common engineering project development mode is front-end and back-end (or called client and server) separated development. The front end provides a Hyper Text Markup Language (HTML) page, and the back end provides an interface of a corresponding software program. When the developer triggers the corresponding option on the front-end interactive interface, the front end can call the interface of the back end, the back-end server makes the corresponding response, and the response result is returned to the front end. In this development mode, the interface becomes an important "tie" for front-end and back-end connections. To ensure the stability of the interface, it becomes very important to test the validity of the interface. Before the project is developed, the front-end and back-end developers need to define an interface together and compile an interface document, so that the front-end and back-end developers develop according to the interface document in the development process, and the interface document can also realize the test and maintenance of the interface.
The interface can be generally divided into a Web Service interface and an HTTP API interface. The Web Service interface is a message transmitted through a HyperText Transfer Protocol (HTTP) based on a Simple Object Access Protocol (SOAP) Protocol, the request message and the return message are in an Extensible Markup Language (XML) format, and the interface test can be called and tested only through a test tool. Web services are a platform-independent, low-coupling, self-contained, programmable Web-based application that can be described, published, discovered, coordinated, and configured using the open XML (a subset of the standard universal markup language) standard. The test tools may include a meter, loadrunner, postman, soap ui, and the like.
The HTTP API interface is used for carrying out interface calling through a path based on an HTTP protocol, request messages are all in a key-value form, return messages are all json strings generally, methods such as get and post are available, and the get and the post are the two most common request modes. Wherein json is a common data type. The essence of json is a string that can be converted to data types in other languages, such as key-value in Python, native object in Java Script, class object in Java, etc. The following description will take the tested interface as the HTTP API interface as an example.
The software interface testing method provided by the embodiment of the invention can be applied to the system architecture shown in fig. 1, and the system comprises the terminal equipment and the server which are in communication connection through a network. The terminal equipment may include wireless terminal equipment, which may be hand-held devices with wireless connection capability or other processing equipment connected to a wireless modem, as well as wired terminal equipment, which may be mobile terminal equipment such as mobile telephones (or "cellular" telephones) and computers with mobile terminal equipment, e.g., portable, pocket, hand-held, computer-included, or vehicle-mounted mobile devices, that exchange language and/or data with a radio access network. The cable terminal device may be a cable television, a cable computer, or the like. The server may be a Personal Computer (PC) server. The communication between the terminal device and the server supports a general Streaming media Protocol, such as Real-Time transport Protocol (RTP), Real-Time Streaming Protocol (RTSP), hypertext transfer Protocol (HTTP), Dynamic Adaptive Streaming Protocol (DASH), HTTP Live Streaming Protocol (HTTP Live Streaming, HLS), and the like.
The software interface testing method provided by the embodiment of the invention can be applied to a server in a server, a client server in terminal equipment provides data to be tested, and the server can respond to a service request of the client.
The technical scheme provided by the embodiment of the invention utilizes a language training model developed by a Recurrent Neural Network (RNN) to train the input data to be tested, and automatically generates massive interface test data (or interface test results) so as to improve the test efficiency and improve the coverage of various scenes. The method specifically comprises the following steps:
the client acquires the data to be tested imported by the tester, wherein the data to be tested is acquired by the tester according to the interface information of the interface to be tested in the interface document, namely the data to be tested is the data required by the test of the interface to be tested. After receiving the data to be tested sent by the client, the server decomposes the data to be tested by adopting a preset language processing algorithm, such as OpenNLP, classifies and stores the decomposed data according to data attributes to obtain at least one data attribute library, wherein each data attribute library comprises attribute values aiming at the same data attributes. I.e., data of the same kind of data attribute. The server side recombines each attribute value in at least one data attribute library to generate at least one full data case of the interface to be tested so as to perfect the coverage of various case scenes, and then the server side carries out comprehensive test on the interface to be tested through unified scheduling execution and interface operation and management of the client side, obtains a test report corresponding to a test result of at least one full data case, guarantees the service logic of the server side interface service, improves the test efficiency, and shortens the development and online periods. The OpenNLP is based on a Java machine learning toolkit and is used for processing natural language texts. Supporting most commonly used Neuro-Linguistic Programming (NLP) tasks. Such as, for example, tagging, sentence segmentation, part-of-speech tagging, name extraction, chunking, parsing, and the like.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are merely for illustrating and explaining the present invention and are not intended to limit the present invention, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Fig. 2 is a schematic flowchart of a method for testing a software interface according to an embodiment of the present invention. As shown in fig. 2, the method may include:
step 210, the server analyzes the test data required by the interface to be tested by adopting a preset language processing algorithm to obtain at least one data attribute library.
Before executing the step, a tester leads test data required by the interface to be tested into the client through a network page corresponding to the interface to be tested, or leads a preset document comprising at least one piece of data to be tested into the client, so that the client obtains the test data required by the interface to be tested.
The test data is data of at least one data attribute required by testing the interface to be tested recorded in the preset interface document, and the data can comprise information such as fields, descriptions, types, remarks and the like. A field is an attribute of a type; the description is a Chinese paraphrase for a field; the type is an attribute type, and only four types of String, Number, Object and Array are available; remarks are explanations or examples may be written, such as in the case of the json structure, which is best written to allow the front-end to better understand. It is understood that, in order to cover various scenarios, the test data may be normal data or abnormal data, the normal data may obtain expected test results, and the abnormal data may obtain various unexpected abnormal test results.
For example, the Taobao login interface is tested, and the test data can comprise data of a Taobao login website, at least one user name, at least one password, an interface request type and a protocol.
Returning to step 210, the client sends the test data required by the interface to be tested to the server, so that the server obtains the test data.
The server side adopts a preset language processing algorithm of NLP, decomposes the data to be tested after analyzing the test data, classifies the decomposed data according to data attributes and stores the classified data in corresponding databases, and therefore at least one data attribute library is obtained, wherein each data attribute library comprises attribute values aiming at the same data attributes, namely data of the same type of data attributes. For example, a data attribute library of a protocol, which is used for storing a protocol applied by an interface to be tested, such as HTTP/HTTPs, TCP/UDP, SOPA protocol, and the like, a data attribute library of web page data, which is used for storing each relevant URL, a data attribute library of user data, which is used for storing an account number, a password, and the like.
Wherein, each attribute value in the data attribute library has a parameter key-value pair key-value.
Step 220, the server obtains at least one full data use case for testing the interface to be tested based on the attribute values in the at least one data attribute library.
The full data case is a test case of the interface to be tested, and comprises an attribute value of each data attribute library in at least one data attribute library. The full data cases include normal test cases and abnormal test cases.
The server side extracts attribute values from each data attribute library; and recombining the extracted attribute values in the different data attribute libraries to obtain at least one full data use case for testing the interface to be tested.
For example, there are 3 data attribute libraries, the server extracts the protocol 1 and the protocol 2 from the data attribute library 1, extracts the account 2, the account 3, and the password 2 from the data attribute library 2, extracts the URL1 from the data attribute library 3, and recombines the data to obtain: protocol 1, account 2, password 2, URL 1; protocol 1, account 3, password 2, URL 1; protocol 2, account 2, password 2, URL 1; protocol 2, account 3, password 2, URL 1.
Therefore, by decomposing and recombining the test data required by at least one interface to be tested, at least one full data case for testing the interface to be tested can be obtained, so that the coverage of the interface test on various case scenes is perfected.
And step 230, the server executes a preset test request of the interface to be tested based on the interface request type of the interface to be tested, wherein the preset test request is used for calling a full data case.
The interface request type may include a get type and a post type. And after the server identifies the interface request type of the interface to be tested, calling a full data case to execute a preset test request.
After the full data case is prepared, the server can trigger the intelligent scheduler, automatically generate test requests of preset protocols aiming at various protocols, package the full data case, and test the interface to be tested in real time or at regular time.
And 240, the server side obtains a test result corresponding to the execution of at least one full data case.
The server side has corresponding return values after each full data use case is executed, and the return values of each full data use case are used as corresponding test results. If the test is correct, returning a normal return value, and if the test is abnormal, returning an abnormal return value. For example, if the full data use case including the protocol 1, the account 2, the password 2, and the URL1 is a normal full data use case, the test result obtained by executing the full data use case is an actual result.
After the step is executed, the server side sends the obtained test result to the client side, and the client side verifies the test result, namely, the test result is compared with an actual result to generate a test report. And the actual result is a result returned by the real calling interface stored by the client. The test report comprises execution information of each full data case, including case ID, case description, expected result, actual result, request message, response message and the like, and the execution information provides convenient information for checking and problem analysis of the execution process.
Optionally, the client and the server may preset an encryption Algorithm, such as a Message Digest Algorithm fifth edition (MD 5) Algorithm named as chinese, and as long as the client and the server use a consistent encryption Algorithm, the interface may be called for interface testing, thereby ensuring the calling security of the interface to be tested.
In the prior art, the full data use cases of the interface are usually designed manually, and then test results are generated according to the full data use cases.
The test method adopts a preset language processing algorithm to analyze test data required by the interface to be tested to obtain at least one data attribute library, wherein each data attribute library comprises an attribute value aiming at the same data attribute; acquiring at least one full data use case for testing the interface to be tested based on the attribute values in at least one data attribute library, wherein the full data use case comprises the attribute value of each data attribute library in at least one data attribute library; and executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested to call the full data use case so as to obtain a test result corresponding to at least one full data use case. Therefore, a plurality of full data cases can be obtained by decomposing and recombining the data to be tested, the coverage of various scenes is perfected, the processes of obtaining the full data cases and executing the test are all automatically completed, and compared with the prior art, the test efficiency is improved.
Corresponding to the foregoing method, an embodiment of the present invention further provides a testing apparatus, as shown in fig. 3, where the terminal includes:
the analysis unit 310 is configured to analyze test data required by the interface to be tested by using a preset language processing algorithm to obtain at least one data attribute library, where each data attribute library includes attribute values for the same set data attribute;
an extracting unit 320, configured to extract attribute values in each data attribute library;
the obtaining unit 330 is configured to recombine the extracted attribute values in the different data attribute libraries, and obtain at least one full data use case for testing the interface to be tested, where the full data use case includes an attribute value of each data attribute library in the at least one data attribute library;
the execution unit 340 is configured to execute a preset test request of the interface to be tested based on the interface request type of the interface to be tested, where the preset test request is used to invoke a full data case;
the obtaining unit 330 is configured to obtain a test result corresponding to at least one full data use case.
Optionally, the apparatus further comprises a receiving unit 350;
the receiving unit 350 is configured to receive at least one to-be-tested data sent by the client, where the to-be-tested data is obtained by a tester according to interface information of an to-be-tested interface in a preset interface document.
Optionally, the apparatus further comprises a sending unit 360;
and the sending unit 360 is configured to send the test result to the client, so that the client performs data verification on the test result and the actual result to generate a test report, where the actual result is a result returned by the actual interface stored in the memory.
Optionally, the preset language processing algorithm is a neuro-linguistic programming NLP algorithm.
The testing device analyzes the testing data required by the interface to be tested by adopting a preset language processing algorithm to obtain at least one data attribute library, wherein each data attribute library comprises an attribute value aiming at the same data attribute; acquiring at least one full data use case of the interface to be tested based on the attribute values in at least one data attribute library, wherein the full data use case comprises the attribute value of each data attribute library in at least one data attribute library; and executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested to call the full data use case so as to obtain a test result corresponding to at least one full data use case. Therefore, a plurality of full data cases can be obtained by decomposing and recombining the data to be tested, the coverage of various scenes is perfected, the processes of obtaining the full data cases and executing the test are all automatically completed, and compared with the prior art, the test efficiency is improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 410, a communication interface 420, a memory 430, and a communication bus 440, where the processor 410, the communication interface 420, and the memory 430 complete mutual communication through the communication bus 440.
A memory 430 for storing computer programs;
the processor 410, when executing the program stored in the memory 430, implements the following steps:
analyzing test data required by the interface to be tested by adopting a preset language processing algorithm to obtain at least one data attribute library, wherein each data attribute library comprises each attribute value aiming at the same set data attribute;
extracting attribute values in each data attribute library;
recombining the extracted attribute values in the different data attribute libraries to obtain at least one full data case for testing the interface to be tested, wherein the full data case comprises the attribute value of each data attribute library in the at least one data attribute library;
executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested, wherein the preset test request calls the full data case;
and obtaining a test result corresponding to at least one full data case.
In an optional implementation, before parsing at least one data to be tested by using a preset language processing algorithm, the method further includes:
and receiving at least one to-be-tested data sent by the client, wherein the to-be-tested data is obtained by a tester according to the interface information of the to-be-tested interface in the preset interface document.
In an optional implementation, the method further comprises:
and sending the test result to the client so that the client performs data verification on the test result and the actual result to generate a test report, wherein the actual result is a result returned by the actual interface stored in the memory.
In an alternative implementation, the predetermined language processing algorithm is a neuro-linguistic programming NLP algorithm.
The aforementioned communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Since the implementation manner and the beneficial effects of the problem solving of each device of the electronic device in the foregoing embodiment can be implemented by referring to each step in the embodiment shown in fig. 2, detailed working processes and beneficial effects of the electronic device provided by the embodiment of the present invention are not described herein again.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, which when run on a computer, cause the computer to perform the testing method described in any of the above embodiments.
In a further embodiment provided by the present invention, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the testing method of any of the above embodiments.
As will be appreciated by one of skill in the art, the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present application.
It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the embodiments of the present application and their equivalents, the embodiments of the present application are also intended to include such modifications and variations.

Claims (10)

1. A method for testing a software interface, the method comprising:
analyzing test data required by the interface to be tested by adopting a preset language processing algorithm to obtain at least one data attribute library, wherein each data attribute library comprises each attribute value aiming at the same set data attribute;
extracting attribute values in each data attribute library;
recombining the extracted attribute values in different data attribute libraries to obtain at least one full data use case for testing the interface to be tested, wherein the full data use case comprises the attribute value of each data attribute library in the at least one data attribute library;
executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested, wherein the preset test request is used for calling the full data case;
and obtaining a test result corresponding to the at least one full data case.
2. The method of claim 1, wherein before analyzing the test data required by the interface under test using the predetermined language processing algorithm, the method further comprises:
receiving test data required by an interface to be tested and sent by a client, wherein the test data is acquired by a tester according to interface information of the interface to be tested in a preset interface document.
3. The method of claim 1, wherein the method further comprises:
and sending the test result to a client so that the client performs data verification on the test result and an actual result to generate a test report, wherein the actual result is a result returned by a real calling interface stored in the client.
4. The method of claim 1, wherein the pre-set language processing algorithm is a neuro-linguistic programming (NLP) algorithm.
5. A test device, the device comprising:
the analysis unit is used for analyzing the test data required by the interface to be tested by adopting a preset language processing algorithm to obtain at least one data attribute library, wherein each data attribute library comprises each attribute value aiming at the same set data attribute;
the extracting unit is used for extracting the data attribute value in each data attribute library;
the acquisition unit is used for recombining the extracted attribute values in the different data attribute libraries to acquire at least one full data use case for testing the interface to be tested, wherein the full data use case comprises the attribute value of each data attribute library in the at least one data attribute library;
the execution unit is used for executing a preset test request of the interface to be tested based on the interface request type of the interface to be tested, wherein the preset test request is used for calling the full data case;
the obtaining unit is configured to obtain a test result corresponding to the at least one full data case.
6. The apparatus of claim 5, wherein the apparatus further comprises a receiving unit;
the receiving unit is used for receiving test data required by the interface to be tested and sent by the client, wherein the test data is acquired by a tester according to the interface information of the interface to be tested in a preset interface document.
7. The apparatus of claim 5, wherein the apparatus further comprises a transmitting unit;
and the sending unit is used for sending the test result to the client so that the client performs data verification on the test result and an actual result to generate a test report, wherein the actual result is a result returned by a real calling interface stored in the client.
8. The apparatus of claim 5, wherein the pre-set language processing algorithm is a neuro-linguistic programming (NLP) algorithm.
9. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-4 when executing a program stored on a memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN201810620434.XA 2018-06-15 2018-06-15 Software interface testing method and device Pending CN110609785A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810620434.XA CN110609785A (en) 2018-06-15 2018-06-15 Software interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810620434.XA CN110609785A (en) 2018-06-15 2018-06-15 Software interface testing method and device

Publications (1)

Publication Number Publication Date
CN110609785A true CN110609785A (en) 2019-12-24

Family

ID=68888162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810620434.XA Pending CN110609785A (en) 2018-06-15 2018-06-15 Software interface testing method and device

Country Status (1)

Country Link
CN (1) CN110609785A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338943A (en) * 2020-02-21 2020-06-26 北京字节跳动网络技术有限公司 Test method, test device, electronic equipment and readable storage medium
CN112015657A (en) * 2020-09-02 2020-12-01 中国工商银行股份有限公司 Automatic test data management method and system
CN113065150A (en) * 2021-05-06 2021-07-02 中国工商银行股份有限公司 Method and device for testing encryption algorithm module
CN115237755A (en) * 2022-06-27 2022-10-25 北京关键科技股份有限公司 Protocol-based check algorithm library calling method and calling equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503900A (en) * 2014-11-21 2015-04-08 北京奇虎科技有限公司 Test case generation method and device
CN106354634A (en) * 2016-08-25 2017-01-25 青岛海信传媒网络技术有限公司 Interface testing method and device
CN107729243A (en) * 2017-10-12 2018-02-23 上海携程金融信息服务有限公司 API automated testing method, system, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503900A (en) * 2014-11-21 2015-04-08 北京奇虎科技有限公司 Test case generation method and device
CN106354634A (en) * 2016-08-25 2017-01-25 青岛海信传媒网络技术有限公司 Interface testing method and device
CN107729243A (en) * 2017-10-12 2018-02-23 上海携程金融信息服务有限公司 API automated testing method, system, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338943A (en) * 2020-02-21 2020-06-26 北京字节跳动网络技术有限公司 Test method, test device, electronic equipment and readable storage medium
CN112015657A (en) * 2020-09-02 2020-12-01 中国工商银行股份有限公司 Automatic test data management method and system
CN113065150A (en) * 2021-05-06 2021-07-02 中国工商银行股份有限公司 Method and device for testing encryption algorithm module
CN113065150B (en) * 2021-05-06 2024-03-01 中国工商银行股份有限公司 Encryption algorithm module testing method and device
CN115237755A (en) * 2022-06-27 2022-10-25 北京关键科技股份有限公司 Protocol-based check algorithm library calling method and calling equipment

Similar Documents

Publication Publication Date Title
CN109828903B (en) Automatic testing method and device, computer device and storage medium
CN105099811B (en) Interface testing method and device
CN107122258B (en) Method and equipment for checking state code of test interface
CN107122297B (en) Method and equipment for generating request message of test interface
CN110609785A (en) Software interface testing method and device
US8745641B1 (en) Automatic verification and anomaly detection in a representational state transfer (REST) application programming interface
US8769502B2 (en) Template based asynchrony debugging configuration
US20180011780A1 (en) Web application test script generation to test software functionality
US20130117855A1 (en) Apparatus for automatically inspecting security of applications and method thereof
US9652366B2 (en) Code change analysis to optimize testing lifecycle
CN107391359B (en) Service testing method and device
CN107436844B (en) Method and device for generating interface use case aggregate
CN103729294B (en) Method and device for testing performance script of application software
Nguyen et al. Detection of embedded code smells in dynamic web applications
US10855717B1 (en) Systems and methods of intelligent and directed dynamic application security testing
CN104821954A (en) Cross-platform remote procedure call method
CN110955600A (en) Interface test method and device
CN106713011B (en) Method and system for obtaining test data
CN112395184A (en) Information acquisition method, equipment and computer storage medium
CN107168844B (en) Performance monitoring method and device
CN111427771A (en) Code coverage rate analysis method, equipment, server and readable storage medium
US10310962B2 (en) Infrastructure rule generation
CN111124937B (en) Method and system for assisting in improving test case generation efficiency based on instrumentation function
CN110768860B (en) Test method, test device and electronic equipment
CN112286815A (en) Interface test script generation method and related equipment thereof

Legal Events

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

Application publication date: 20191224