CN112965912B - Interface test case generation method and device and electronic equipment - Google Patents

Interface test case generation method and device and electronic equipment Download PDF

Info

Publication number
CN112965912B
CN112965912B CN202110314215.0A CN202110314215A CN112965912B CN 112965912 B CN112965912 B CN 112965912B CN 202110314215 A CN202110314215 A CN 202110314215A CN 112965912 B CN112965912 B CN 112965912B
Authority
CN
China
Prior art keywords
tested
test case
http interface
interface
test
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.)
Active
Application number
CN202110314215.0A
Other languages
Chinese (zh)
Other versions
CN112965912A (en
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.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin 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 Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202110314215.0A priority Critical patent/CN112965912B/en
Publication of CN112965912A publication Critical patent/CN112965912A/en
Application granted granted Critical
Publication of CN112965912B publication Critical patent/CN112965912B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/3676Test management for coverage analysis
    • 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/3692Test management for test results analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses an interface test case generation method and device and electronic equipment, and belongs to the field of interface test. The interface test case generation method provided by the embodiment of the application obtains the HTTP interface to be tested; reading gateway layer configuration of the HTTP interface to be tested, and acquiring an RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration; acquiring parameter information of the HTTP interface to be tested according to an RPC protocol corresponding to the HTTP interface to be tested; inquiring a test case database according to the parameter information of the HTTP interface to be tested, if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generating the test case of the missing HTTP interface to be tested and storing the test case into the test case database; the first test case and the second test case are respectively used for testing normal conditions and abnormal simulation; the difference between the abnormal simulation and the normal state is fully considered, and the testing efficiency and the testing effect are improved.

Description

Interface test case generation method and device and electronic equipment
Technical Field
The present invention relates to the field of interface testing, and in particular, to a method and an apparatus for generating an interface test case, and an electronic device.
Background
The front-end and back-end separation gradually becomes a standard development mode of the internet project, and the following problem is that the front end and the back end communicate with the Web application program interface, and once the front end does not adjust the interface in time, the access is abnormal. Therefore, in the test process of the server-side project, the interface test is a necessary test subject.
At present, the HTTP interface test mainly has two modes, namely, an existing test tool such as POSTMAN, JMETER is utilized; another is to develop a set of test platform to realize the function of receiving and transmitting HTTP interface for testing. However, both of these approaches are inefficient, require a tester to manually enter protocol requests, and also require a long time for maintenance when certain interfaces change, which has a significant impact on testing and development efficiency.
Therefore, a technical solution for solving the above problems is needed in the industry.
Disclosure of Invention
The application provides an interface test case generation method, an interface test case generation device and electronic equipment, so that the problems existing in the prior art are solved, and the efficiency and the effect of HTTP interface test are improved.
In order to achieve the above object, the present application adopts the following scheme:
in one aspect, an embodiment of the present application provides a method for generating an interface test case, including:
acquiring an HTTP interface to be tested;
reading gateway layer configuration of the HTTP interface to be tested, and acquiring an RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration;
acquiring parameter information of the HTTP interface to be tested according to an RPC protocol corresponding to the HTTP interface to be tested;
inquiring a test case database according to the parameter information of the HTTP interface to be tested, if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generating the test case of the missing HTTP interface to be tested and storing the test case into the test case database; the first test case is used for testing the normal condition of the HTTP interface to be tested, and the second test case is used for testing the abnormal simulation of the HTTP interface to be tested.
Optionally, before the obtaining the HTTP interface to be tested, the method further includes:
accessing a project management system, and acquiring the HTTP interface test progress of a project to be tested in the project management system.
Optionally, the method for generating the interface test case further includes:
and sending the HTTP interface list to be tested, which is not covered by the current test item, to the tester.
Optionally, the obtaining, according to the RPC protocol corresponding to the HTTP interface to be tested, parameter information of the HTTP interface to be tested includes:
and calling an analysis function to acquire the definition file and the position of the RPC protocol corresponding to the HTTP interface to be tested, and acquiring the parameter information of the HTTP interface to be tested by reading the definition file of the RPC protocol corresponding to the HTTP interface to be tested.
Optionally, the parameter information of the HTTP interface to be tested includes at least one of the following:
and the parameter name and the parameter type of the packet head of the request data packet, the parameter name and the parameter type of the packet body of the request data packet, the parameter name and the parameter type of the packet head of the return data packet and the parameter name and the parameter type of the packet body of the return data packet of the HTTP interface to be tested.
Optionally, the second test case includes at least one of the following cases:
transmitting parameter data which do not accord with interface types and/or do not accord with numerical requirements to the HTTP interface to be tested;
transmitting parameter data which do not meet the quantity requirement to the HTTP interface to be tested;
and when the parameter data is transmitted to the HTTP interface to be tested, the necessary parameter data is deleted.
Optionally, the method for generating the interface test case further includes:
and executing the generated test cases and counting test results, and calling the test cases in the test case database after the HTTP interface parameters which do not pass the test are updated, or generating new test cases to execute the test cases again on the HTTP interface which does not pass the test.
On the other hand, the embodiment of the application provides an interface test case generating device, which comprises:
the first acquisition module is used for acquiring an HTTP interface to be tested;
the first processing module is used for reading the gateway layer configuration of the HTTP interface to be tested and acquiring an RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration;
the second acquisition module acquires parameter information of the HTTP interface to be tested according to an RPC protocol corresponding to the HTTP interface to be tested;
the second processing module is used for inquiring a test case database according to the parameter information of the HTTP interface to be tested, and if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generating the test case of the missing HTTP interface to be tested and storing the test case into the test case database; the first test case is used for testing the normal condition of the HTTP interface to be tested, and the second test case is used for testing the abnormal simulation of the HTTP interface to be tested.
In another aspect, an embodiment of the present application further provides an electronic device, including: the system comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the program is executed by the processor to realize the steps of the interface test case generation method as provided in other aspects of the application.
On the other hand, the embodiment of the application also provides a computer readable storage medium, which is characterized in that the computer readable storage medium stores a computer program, and the computer program realizes the steps of the interface test case generation method provided in other aspects of the application when being executed by a processor.
The beneficial effects that technical scheme that this application embodiment provided include at least:
acquiring an HTTP interface to be tested; reading gateway layer configuration of the HTTP interface to be tested, and acquiring an RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration; acquiring parameter information of the HTTP interface to be tested according to an RPC protocol corresponding to the HTTP interface to be tested; inquiring a test case database according to the parameter information of the HTTP interface to be tested, if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generating the test case of the missing HTTP interface to be tested and storing the test case into the test case database; the first test case is used for testing the normal condition of the HTTP interface to be tested, and the second test case is used for testing the abnormal simulation of the HTTP interface to be tested; the difference between the abnormal simulation and the normal state is fully considered, the missing test cases in the case database can be automatically generated, and the test efficiency and effect of the HTTP interface are improved.
Drawings
FIG. 1 is a flowchart of a method for generating an interface test case according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an editing interface of an interface test case generating method according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an interface test case generating device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an interface test case generating device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present application. It will be apparent that the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
In addition, the technical features described below in the different embodiments of the present application may be combined with each other as long as they do not collide with each other.
The method for generating the interface test case provided by the embodiment of the application is described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustration of an interface test case generating method provided by an embodiment of the present application is shown, where the interface test case generating method includes:
and step 101, acquiring an HTTP interface to be tested.
Specifically, according to the interface test case generation method provided by the embodiment of the application, when the HTTP interfaces to be tested are obtained, a plurality of HTTP interfaces to be tested can be automatically obtained.
Step 102, reading the gateway layer configuration of the HTTP interface to be tested, and obtaining the RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration.
Specifically, the current gateway layer developer has maintained configuration files at the gateway layer, and by reading the configuration files of the gateway layer, the mapping of the format definition functions of the HTTP interface and the RPC protocol (for example, one line in the configuration file is just one mapping) can be obtained, that is, the RPC protocol corresponding to the HTTP interface to be tested can be obtained; and all HTTP interfaces provided by the service at present can be automatically acquired through the gateway layer configuration file, so that the comprehensiveness of interface test is ensured, and the aim of testing the RPC protocol through testing the HTTP interfaces can be realized.
And step 103, acquiring parameter information of the HTTP interface to be tested according to the RPC protocol corresponding to the HTTP interface to be tested.
Specifically, by reading the RPC protocol, parameter information of the HTTP interface to be tested can be analyzed, and the parameter information can be used to generate a test case of the HTTP interface to be tested.
Step 104, inquiring a test case database according to the parameter information of the HTTP interface to be tested, if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generating a test case of the missing HTTP interface to be tested and storing the test case into the test case database; the first test case is used for testing the normal condition of the HTTP interface to be tested, and the second test case is used for testing the abnormal simulation of the HTTP interface to be tested.
Specifically, each HTTP interface to be tested is queried in a test case database according to parameter information thereof, the missing test case of the HTTP interface to be tested is generated, if the HTTP interface to be tested is not lack of the first test case or the second test case, the test case of the HTTP interface to be tested is not generated, test case data in the test case database is directly read, the test case is automatically executed, and the test result is sent to relevant testers.
Specifically, the first test case and the second test case can respectively reflect the test results of the HTTP interface to be tested under the normal state and the abnormal simulation, so that the HTTP interface to be tested is debugged according to the HTTP interface to be tested, and the stability of the HTTP interface to be tested is improved.
Optionally, before the obtaining the HTTP interface to be tested, the method further includes:
accessing a project management system, and acquiring the HTTP interface test progress of a project to be tested in the project management system.
For example, if a project management system such as JIRA can be involved, the interface test progress is obtained by reading project test information in the project management system, so that an HTTP interface list to be tested is obtained; the efficiency of obtaining the HTTP interface to be tested can be greatly improved, the integrity of project test is improved, and omission is avoided.
For example, after the test case of the HTTP interface to be tested is tested, a new test result and information may be fed back to the project management system, so that the project management system updates the test progress information of the HTTP interface in time.
Optionally, the method for generating the interface test case further includes:
and sending the HTTP interface list to be tested, which is not covered by the current test item, to the tester.
Specifically, when all HTTP interfaces provided by the analyzed service and HTTP interfaces in which test cases are recorded by testers, which HTTP interfaces in which test cases are not recorded by testers at present can be calculated, the test cases can be automatically generated by the HTTP interfaces, prompt information can be given out, the loss of the interface test cases is fed back, and the test missing points are found.
Specifically, after each time the test case of the HTTP interface to be tested is generated, the list of the test case generated at this time and the information of the HTTP interface list to be tested which is not covered yet are sent to the tester, so that the tester can be reminded of timely supplementing the information of the HTTP interfaces to be tested, timely checking the test result at this time, timely processing the abnormal problem and improving the research and development efficiency of the product.
Optionally, referring to fig. 2, according to a first input performed by a user, the test case of the HTTP interface to be tested is edited.
Specifically, after receiving the HTTP interface test cases to be tested, the tester may open the test and edit the test cases by performing an input operation, such as supplementing content, modifying parameters, associating items, and the like.
Optionally, the obtaining, according to the RPC protocol corresponding to the HTTP interface to be tested, parameter information of the HTTP interface to be tested includes:
and calling an analysis function to acquire the definition file and the position of the RPC protocol corresponding to the HTTP interface to be tested, and acquiring the parameter information of the HTTP interface to be tested by reading the definition file of the RPC protocol corresponding to the HTTP interface to be tested.
Specifically, by reading the configuration file, the mapping between the HTTP interface to be tested and the RPC protocol format definition function can be obtained, and if one line in the configuration file is just one mapping. The RPC protocol format definition function file has certain regularity, and parameter information of the HTTP interface to be tested can be analyzed by writing an analysis program. After the parameter information of the HTTP interface to be tested is analyzed, an API (Application Programming Interface, application program interface) provided by the HTTP interface to be tested can be called, so that the HTTP interface test case can be automatically generated.
Optionally, the parameter information of the HTTP interface to be tested includes at least one of the following:
and the parameter name and the parameter type of the packet head of the request data packet, the parameter name and the parameter type of the packet body of the request data packet, the parameter name and the parameter type of the packet head of the return data packet and the parameter name and the parameter type of the packet body of the return data packet of the HTTP interface to be tested.
Specifically, the request data packet and the return data packet of the HTTP interface to be tested can be searched through the test case database according to the parameter names and the parameter type information of the packet body and the test case of the HTTP interface to be tested.
Optionally, the second test case includes at least one of the following cases:
transmitting parameter data which do not accord with interface types and/or do not accord with numerical requirements to the HTTP interface to be tested;
transmitting parameter data which do not meet the quantity requirement to the HTTP interface to be tested;
and when the parameter data is transmitted to the HTTP interface to be tested, the necessary parameter data is deleted.
Specifically, the second test case is used for testing the running condition of the HTTP interface to be tested under the abnormal condition, and it is required to ensure that the HTTP interface will not crash under the abnormal condition.
For example, parameter data which does not meet the interface type and/or does not meet the numerical requirement is transmitted to the HTTP interface to be tested, for example, the data type of the HTTP interface to be tested is integer, and floating point data is transmitted during testing; parameter data which does not meet the quantity requirements are transmitted to the HTTP interface to be tested, if the quantity of the data of the HTTP interface to be tested is 3, 2 or 5 data are transmitted; for example, data smaller than the minimum value or data larger than the maximum value may be transmitted to the whole digital section, data of a type other than the specified type may be transmitted to the field, the field value may be excessively long, and the like.
Optionally, the method for generating the interface test case further includes:
and executing the generated test cases and counting test results, and calling the test cases in the test case database after the HTTP interface parameters which do not pass the test are updated, or generating new test cases to execute the test cases again on the HTTP interface which does not pass the test.
Specifically, when the parameters of the HTTP interface that has been tested before change, or after the HTTP that has not passed the test is debugged, the HTTP interface will become a new HTTP interface to be tested, and at this time, test case generation needs to be performed according to the new parameters, so as to test the HTTP interface to be tested.
In summary, the method for generating the interface test case provided by the embodiment of the application can obtain the RPC protocol corresponding to the HTTP interface to be tested by reading the gateway layer configuration of the HTTP structure to be tested, and can automatically generate all the HTTP interface test cases to be tested by the RPC protocol and automatically execute the HTTP interface test cases, so that a tester does not need to pay attention to the RPC protocol file, does not need to write the test cases manually, and the whole process from the generation to the execution of the test cases is completely automated, so that the participation of the tester is not required, and the execution efficiency of the interface test is improved. Moreover, the test cases of normal conditions can be generated, and the test cases aiming at abnormal simulation of the HTTP interface can be generated, so that the generated test cases are more comprehensive, and the test effect and the test integrity are improved conveniently.
Referring to fig. 3, an embodiment of the present application provides an interface test case generating device 30, including:
a first obtaining module 31, configured to obtain an HTTP interface to be tested;
the first processing module 32 is configured to read a gateway layer configuration of the HTTP interface to be tested, and obtain an RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration;
the second obtaining module 33 obtains parameter information of the HTTP interface to be tested according to the RPC protocol corresponding to the HTTP interface to be tested;
the second processing module 34 is configured to query a test case database according to the parameter information of the HTTP interface to be tested, and if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generate a test case in which the HTTP interface to be tested is missing, and store the test case in the test case database; the first test case is used for testing the normal condition of the HTTP interface to be tested, and the second test case is used for testing the abnormal simulation of the HTTP interface to be tested.
Optionally, the test case generating device 30 further includes:
and a third obtaining module 35, configured to access to a project management system, and obtain an HTTP interface test progress of a project to be tested in the project management system.
Optionally, the test case generating device 30 further includes:
and the sending module 36 is configured to send the test case generated at this time and the HTTP interface list to be tested that is not covered by the current test item to a tester.
Optionally, the second obtaining module 33 is further configured to:
and calling an analysis function to acquire the definition file and the position of the RPC protocol corresponding to the HTTP interface to be tested, and acquiring the parameter information of the HTTP interface to be tested by reading the definition file of the RPC protocol corresponding to the HTTP interface to be tested.
Optionally, the parameter information of the HTTP interface to be tested includes at least one of the following:
and the parameter name and the parameter type of the packet head of the request data packet, the parameter name and the parameter type of the packet body of the request data packet, the parameter name and the parameter type of the packet head of the return data packet and the parameter name and the parameter type of the packet body of the return data packet of the HTTP interface to be tested.
Optionally, the second test case includes at least one of the following cases:
transmitting parameter data which do not accord with interface types and/or do not accord with numerical requirements to the HTTP interface to be tested;
transmitting parameter data which do not meet the quantity requirement to the HTTP interface to be tested;
and when the parameter data is transmitted to the HTTP interface to be tested, the necessary parameter data is deleted.
Optionally, the test case generating device 30 further includes:
and the execution module 37 is used for executing the generated test cases and counting the test results, and calling the test cases in the test case database after the HTTP interface parameters which do not pass the test are updated, or generating new test cases to execute the test cases again on the HTTP interface which does not pass the test.
Referring to fig. 5, an embodiment of the present invention further provides an electronic device 50, including a processor 51, a memory 52, and a computer program stored in the memory 52 and capable of running on the processor 51, where the computer program when executed by the processor 51 implements each process of the embodiment of the test case generating method, and the same technical effects can be achieved, and for avoiding repetition, a detailed description is omitted herein.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the embodiment of the test case generating method, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. While nevertheless, obvious variations or modifications may be made to the embodiments described herein without departing from the scope of the invention.

Claims (10)

1. The interface test case generation method is characterized by comprising the following steps of:
acquiring an HTTP interface to be tested;
reading gateway layer configuration of the HTTP interface to be tested, and acquiring an RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration;
acquiring parameter information of the HTTP interface to be tested according to an RPC protocol corresponding to the HTTP interface to be tested;
inquiring a test case database according to the parameter information of the HTTP interface to be tested, if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generating the test case of the missing HTTP interface to be tested and storing the test case into the test case database; the first test case is used for testing the normal condition of the HTTP interface to be tested, and the second test case is used for testing the abnormal simulation of the HTTP interface to be tested.
2. The method for generating an interface test case according to claim 1, further comprising, before the obtaining the HTTP interface to be tested:
accessing a project management system, and acquiring the HTTP interface test progress of a project to be tested in the project management system.
3. The interface test case generation method according to claim 2, further comprising:
and sending the HTTP interface list to be tested, which is not covered by the current test item, to the tester.
4. The method for generating the interface test case according to claim 1, wherein the obtaining the parameter information of the HTTP interface to be tested according to the RPC protocol corresponding to the HTTP interface to be tested includes:
and calling an analysis function to acquire the definition file and the position of the RPC protocol corresponding to the HTTP interface to be tested, and acquiring the parameter information of the HTTP interface to be tested by reading the definition file of the RPC protocol corresponding to the HTTP interface to be tested.
5. The method for generating an interface test case according to claim 1, wherein the parameter information of the HTTP interface to be tested includes at least one of:
and the parameter name and the parameter type of the packet head of the request data packet, the parameter name and the parameter type of the packet body of the request data packet, the parameter name and the parameter type of the packet head of the return data packet and the parameter name and the parameter type of the packet body of the return data packet of the HTTP interface to be tested.
6. The method for generating interface test cases according to claim 1, wherein the second test case includes at least one of:
transmitting parameter data which do not accord with interface types and/or do not accord with numerical requirements to the HTTP interface to be tested;
transmitting parameter data which do not meet the quantity requirement to the HTTP interface to be tested;
and when the parameter data is transmitted to the HTTP interface to be tested, the necessary parameter data is deleted.
7. The method for generating an interface test case according to claim 1, further comprising:
and executing the generated test cases and counting test results, and calling the test cases in the test case database after the HTTP interface parameters which do not pass the test are updated, or generating new test cases to execute the test cases again on the HTTP interface which does not pass the test.
8. An interface test case generating device, comprising:
the first acquisition module is used for acquiring an HTTP interface to be tested;
the first processing module is used for reading the gateway layer configuration of the HTTP interface to be tested and acquiring an RPC protocol corresponding to the HTTP interface to be tested according to the gateway layer configuration;
the second acquisition module acquires parameter information of the HTTP interface to be tested according to an RPC protocol corresponding to the HTTP interface to be tested;
the second processing module is used for inquiring a test case database according to the parameter information of the HTTP interface to be tested, and if the first test case and/or the second test case of the HTTP interface to be tested do not exist in the test case database, generating the test case of the missing HTTP interface to be tested and storing the test case into the test case database; the first test case is used for testing the normal condition of the HTTP interface to be tested, and the second test case is used for testing the abnormal simulation of the HTTP interface to be tested.
9. An electronic device, comprising: a processor, a memory and a program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the interface test case generation method of any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the interface test case generation method of any of claims 1 to 7.
CN202110314215.0A 2021-03-24 2021-03-24 Interface test case generation method and device and electronic equipment Active CN112965912B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110314215.0A CN112965912B (en) 2021-03-24 2021-03-24 Interface test case generation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110314215.0A CN112965912B (en) 2021-03-24 2021-03-24 Interface test case generation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112965912A CN112965912A (en) 2021-06-15
CN112965912B true CN112965912B (en) 2024-02-09

Family

ID=76278343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110314215.0A Active CN112965912B (en) 2021-03-24 2021-03-24 Interface test case generation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112965912B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115297039B (en) * 2022-10-08 2023-01-10 天津华来科技股份有限公司 HTTP (hyper text transport protocol) parameterized test architecture method, electronic equipment and storage medium
CN115952100A (en) * 2023-01-10 2023-04-11 北京百度网讯科技有限公司 Interface test method, device, system, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294119A (en) * 2015-06-24 2017-01-04 北京京东尚科信息技术有限公司 Test dispatching system, method and terminal unit
CN107402884A (en) * 2017-07-31 2017-11-28 深圳乐信软件技术有限公司 Generate the method and device of interface testing code
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN110083543A (en) * 2019-05-07 2019-08-02 江苏满运软件科技有限公司 Regression testing method, device, electronic equipment and storage medium
CN111026635A (en) * 2019-09-27 2020-04-17 珠海随变科技有限公司 Software project testing system, method, device and storage medium
CN111488285A (en) * 2020-04-15 2020-08-04 北京字节跳动网络技术有限公司 Interface testing method and device, electronic equipment and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120210306A1 (en) * 2008-12-03 2012-08-16 Zumobi, Inc. System and Method for Application Testing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294119A (en) * 2015-06-24 2017-01-04 北京京东尚科信息技术有限公司 Test dispatching system, method and terminal unit
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN107402884A (en) * 2017-07-31 2017-11-28 深圳乐信软件技术有限公司 Generate the method and device of interface testing code
CN110083543A (en) * 2019-05-07 2019-08-02 江苏满运软件科技有限公司 Regression testing method, device, electronic equipment and storage medium
CN111026635A (en) * 2019-09-27 2020-04-17 珠海随变科技有限公司 Software project testing system, method, device and storage medium
CN111488285A (en) * 2020-04-15 2020-08-04 北京字节跳动网络技术有限公司 Interface testing method and device, electronic equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
aSIT:面向接口的分布式自动化测试***;蔡高扬;马化军;李挥;;广东通信技术(第04期);第38-43页 *

Also Published As

Publication number Publication date
CN112965912A (en) 2021-06-15

Similar Documents

Publication Publication Date Title
CN110321387B (en) Data synchronization method, equipment and terminal equipment
CN110554958B (en) Graph database testing method, system, device and storage medium
CN108959059B (en) Test method and test platform
CN112965912B (en) Interface test case generation method and device and electronic equipment
CN111221743A (en) Automatic testing method and system
CN109885496B (en) Test log management method and system
CN110750433A (en) Interface test method and device
CN111522728A (en) Method for generating automatic test case, electronic device and readable storage medium
CN113010413A (en) Automatic interface testing method and device
CN113688002A (en) Log collection method and related device
CN111124873A (en) Method and device for returning Mock data
CN111930611B (en) Statistical method and device for test data
CN112988589A (en) Interface testing method, device and system
CN110334019B (en) Test method, test device and readable storage medium
CN108828427B (en) Criterion searching method, device, equipment and storage medium for signal integrity test
CN115455059A (en) Method, device and related medium for analyzing user behavior based on underlying data
CN112632132B (en) Processing method, device and equipment for abnormal imported data
CN110134583B (en) Software testing and data processing method and device
CN112597119A (en) Method and device for generating processing log and storage medium
CN111159003B (en) Batch processing test method and device
CN113704114A (en) Automatic testing method, device, equipment and medium for functional interface
CN113238901A (en) Multi-device automatic testing method and device, storage medium and computer device
CN111159988A (en) Model processing method and device, computer equipment and storage medium
CN111522748A (en) Automatic test case generation method and device, server and storage medium
CN113434215B (en) Information loading method and device, storage medium and processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant