CN114489629A - Rapid development and test method based on interface document - Google Patents

Rapid development and test method based on interface document Download PDF

Info

Publication number
CN114489629A
CN114489629A CN202210055941.XA CN202210055941A CN114489629A CN 114489629 A CN114489629 A CN 114489629A CN 202210055941 A CN202210055941 A CN 202210055941A CN 114489629 A CN114489629 A CN 114489629A
Authority
CN
China
Prior art keywords
interface
interface document
document
test
rapid development
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
CN202210055941.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.)
Guangzhou Yougu Information Technology Co ltd
Original Assignee
Guangzhou Yougu Information 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 Guangzhou Yougu Information Technology Co ltd filed Critical Guangzhou Yougu Information Technology Co ltd
Priority to CN202210055941.XA priority Critical patent/CN114489629A/en
Publication of CN114489629A publication Critical patent/CN114489629A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • 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/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Library & Information Science (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a rapid development and test method based on an interface document, which effectively improves the efficiency of software system development and test through a template technology and an automatic means. The rapid development and test method based on the interface document comprises the steps of receiving an interface document through setting, analyzing the content of the interface document, and generating a structured data object set which accords with an HTTP (hyper text transport protocol); compiling compatible programming language SDK templates of different clients, and generating a series of SDKs by combining a template engine with the structured data object set output in the last step; developers of different clients integrate SDKs of corresponding clients, compile service codes and output client application programs; the tester uses the template engine of the test case to generate a parameterized test case of each interface; and the tester designs the test data of each interface according to the service logic, executes the test case and outputs the test report.

Description

Rapid development and test method based on interface document
Technical Field
The invention relates to the technical field of photoelectric information, in particular to a rapid development and test method based on an interface document.
Background
The internet is also called as an international network, which refers to a huge network formed by connecting networks in series, the networks are connected by a group of universal protocols to form a logically single huge international network, along with the development of the internet technology, software systems tend to be more and more platformized, the requirements of the platformized software on the flexibility and the universality of data exchange of the systems are higher, a large number of interface docking and interface testing requirements appear, but the existing solution basically stays in the stages of manual development, manual testing and manual docking, for a large number of interface systems, the working mode is too troublesome, in addition, a complete software platform often has a plurality of different clients, and the same data interface needs to repeatedly write a large number of similar codes under different clients for data exchange, so aiming at the problems, the application provides a rapid development and test method based on interface documents.
Disclosure of Invention
Technical problem to be solved
Aiming at the defects of the prior art, the invention provides a rapid development and test method based on an interface document, which solves the problems in the background technology.
(II) technical scheme
In order to achieve the purpose, the invention provides the following technical scheme: the invention provides a rapid development and test method based on an interface document, which effectively improves the development and test efficiency of a software system through a template technology and an automatic means, and specifically comprises the following operations:
the first step is as follows:
receiving an interface document, analyzing the content of the interface document, generating a structured data object set conforming to an HTTP protocol, establishing a Swagger online interface document link interpreter, and generating a structured request object set conforming to the HTTP protocol by utilizing a document analyzer realized by Python;
the second step is that:
compiling compatible programming language SDK templates of different clients, generating a series of SDKs by combining a template engine with the structured data object set output in the last step, and establishing a general template file;
the third step:
developers of different clients integrate SDKs of corresponding clients, compile service codes and output client application programs;
the fourth step:
the tester uses the template engine of the test case to generate the test case parameterized by each interface;
the fifth step:
and the tester designs the test data of each interface according to the service logic, executes the test case and outputs the test report.
Preferably, according to Swagger online interface document link, downloading the document content to be stored in the local computer F1, and then using a Python implemented document parser to generate a structured request object set M1 conforming to the HTTP protocol to be stored in the local computer F2.
Preferably, the Swagger interface document includes a cached online document to the local, so as to improve the post-analysis performance.
Preferably, the Swagger interface document includes reading the cached interface document into the computer memory, recursively extracting the request path of each interface, and recursively extracting the request parameters of the interface, such as the reference object, the data type, the example parameter value, and the like, according to the request path.
Preferably, the Swagger interface document includes parameter values for populating the parameters according to their data types; constructing an operable form object (the data structure can be customized); a structured set of request objects is generated.
Preferably, the series of SDKs in the second step includes Python version SDKs, Javascript version SDKs, and other programming languages SDKs.
Preferably, the universal template file is a universal template file written according with service requirements in a Javascript environment and stored in a local file F3 of the computer, the SDK template engine reads in a file F2 output by the document parser as a data source, reads in a file F3 output by the universal template file as a template source, incrementally fills the template source, and outputs the file Javascript-SDK and stores the file to the local computer.
(III) advantageous effects
The invention provides a rapid development and test method based on an interface document, which has the following beneficial effects:
the rapid development and test method based on the interface document comprises the steps of receiving an interface document through setting, analyzing the content of the interface document, and generating a structured data object set which accords with an HTTP (hyper text transport protocol); compiling compatible programming language SDK templates of different clients, and generating a series of SDKs by combining a template engine with the structured data object set output in the last step; developers of different clients integrate SDKs of corresponding clients, compile service codes and output client application programs; the tester uses the template engine of the test case to generate the test case parameterized by each interface; the tester designs the test data of each interface according to the service logic, executes the test case and outputs the test report, thereby realizing the template technology and the automation means, effectively improving the efficiency of software system development and test and greatly reducing the labor intensity of technical developers.
Drawings
FIG. 1 is a schematic flow diagram of the present invention;
fig. 2 is a flow chart of the Swagger online interface document link interpreter of the present invention.
Detailed Description
All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a technical scheme that: the invention provides a rapid development and test method based on an interface document, which effectively improves the development and test efficiency of a software system through a template technology and an automatic means, and specifically comprises the following operations:
the first step is as follows:
receiving an interface document, analyzing the content of the interface document, generating a structured data object set conforming to an HTTP protocol, establishing a Swagger online interface document link interpreter, and generating a structured request object set conforming to the HTTP protocol by utilizing a Python-implemented document analyzer, specifically, downloading the content of a file to be stored in a local computer file F1 according to the Swagger online interface document link, then generating a structured request object set M1 conforming to the HTTP protocol by utilizing a Python-implemented document analyzer, storing the structured request object set in a local computer F2, wherein the Swagger interface document comprises a cached online document and a local computer memory, and the Swagger interface document comprises a cache online document and a cache, and the later analysis performance is improved Example parameter values, etc.;
the second step is that:
compiling compatible programming language SDK templates of different clients, generating a series of SDKs by combining a template engine with a structured data object set output in the last step, wherein the series of SDKs comprise Python version SDKs, Javascript version SDKs and other programming language SDKs, establishing a universal template file, and the Swagger interface document comprises parameter values for filling parameters according to the data types of the parameters; constructing an operable form object (the data structure can be customized); generating a structured request object set, wherein the universal template file is stored in a local file F3 of the computer by a universal template file written according with service requirements under a Javascript environment, the SDK template engine reads in a file F2 output by the document analyzer as a data source, reads in a file F3 output by the universal template file as a template source, incrementally fills the template source, and outputs the file Javascript-SDK to be stored locally in the computer;
the third step:
developers of different clients integrate SDKs of corresponding clients, compile service codes and output client application programs;
the fourth step:
the tester uses the template engine of the test case to generate the test case parameterized by each interface;
the fifth step:
and the tester designs the test data of each interface according to the service logic, executes the test case and outputs the test report.
In conclusion, the interface document-based rapid development and test method receives an interface document through setting, analyzes the content of the interface document, and generates a structured data object set conforming to the HTTP protocol; compiling compatible programming language SDK templates of different clients, and generating a series of SDKs by combining a template engine with the structured data object set output in the last step; developers of different clients integrate SDKs of corresponding clients, compile service codes and output client application programs; the tester uses the template engine of the test case to generate the test case parameterized by each interface; the tester designs the test data of each interface according to the service logic, executes the test case and outputs the test report, thereby realizing the template technology and the automation means, effectively improving the efficiency of software system development and test and greatly reducing the labor intensity of technical developers.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (7)

1. A rapid development and test method based on interface documents is characterized in that: the rapid development and test method based on the interface document effectively improves the development and test efficiency of a software system by a template technology and an automatic means, and specifically comprises the following operations:
the first step is as follows:
receiving an interface document, analyzing the content of the interface document, generating a structured data object set conforming to an HTTP protocol, establishing a Swagger online interface document link interpreter, and generating a structured request object set conforming to the HTTP protocol by utilizing a document analyzer realized by Python;
the second step is that:
compiling compatible programming language SDK templates of different clients, generating a series of SDKs by combining a template engine with the structured data object set output in the last step, and establishing a general template file;
the third step:
developers of different clients integrate SDKs of corresponding clients, compile service codes and output client application programs;
the fourth step:
the tester uses the template engine of the test case to generate the test case parameterized by each interface;
the fifth step:
and the tester designs the test data of each interface according to the service logic, executes the test case and outputs the test report.
2. The interface document-based rapid development and testing method according to claim 1, wherein: according to the Swagger online interface document link, downloading the file content and storing the file content in a local computer F1, and then using a Python implemented document parser to generate a structured request object set M1 conforming to the HTTP protocol and storing the structured request object set in a local computer F2.
3. The interface document-based rapid development and testing method according to claim 1, wherein: the Swagger interface document caches the online document to the local, and the later-stage analysis performance is improved.
4. The interface document-based rapid development and testing method according to claim 1, wherein: the Swagger interface document comprises reading the cached interface document to a computer memory, recursively extracting a request path of each interface, and recursively extracting request parameters of the interface according to the request path, such as a reference object, a data type, example parameter values, and the like.
5. The interface document-based rapid development and testing method according to claim 4, wherein: the Swagger interface document comprises parameter values filling the parameters according to the data types of the parameters; constructing an operable form object (the data structure can be customized); a structured set of request objects is generated.
6. The interface document-based rapid development and testing method according to claim 1, wherein: the series of SDKs in the second step comprise Python version SDKs, Javascript version SDKs and other programming languages SDKs.
7. The interface document-based rapid development and testing method according to claim 2, wherein: the universal template file is composed of a universal template file written according with service requirements under the Javascript environment and stored in a local file F3 of the computer, the SDK template engine reads in a file F2 output by the document analyzer as a data source, reads in a file F3 output by the universal template file as a template source, the template source is filled in increments, and the output file Javascript-SDK is stored in the local computer.
CN202210055941.XA 2022-01-18 2022-01-18 Rapid development and test method based on interface document Pending CN114489629A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210055941.XA CN114489629A (en) 2022-01-18 2022-01-18 Rapid development and test method based on interface document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210055941.XA CN114489629A (en) 2022-01-18 2022-01-18 Rapid development and test method based on interface document

Publications (1)

Publication Number Publication Date
CN114489629A true CN114489629A (en) 2022-05-13

Family

ID=81511423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210055941.XA Pending CN114489629A (en) 2022-01-18 2022-01-18 Rapid development and test method based on interface document

Country Status (1)

Country Link
CN (1) CN114489629A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115297039A (en) * 2022-10-08 2022-11-04 天津华来科技股份有限公司 HTTP (hyper text transport protocol) parameterized test architecture method, electronic equipment and storage medium
CN116185883A (en) * 2023-04-28 2023-05-30 阿里云计算有限公司 Test case generation method, test system, device, equipment and medium
CN117370242A (en) * 2023-10-09 2024-01-09 汇付天下有限公司 Adapter and method for generating multilingual SDK client by parsing interface document

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115297039A (en) * 2022-10-08 2022-11-04 天津华来科技股份有限公司 HTTP (hyper text transport protocol) parameterized test architecture method, electronic equipment and storage medium
CN116185883A (en) * 2023-04-28 2023-05-30 阿里云计算有限公司 Test case generation method, test system, device, equipment and medium
CN117370242A (en) * 2023-10-09 2024-01-09 汇付天下有限公司 Adapter and method for generating multilingual SDK client by parsing interface document

Similar Documents

Publication Publication Date Title
CN114489629A (en) Rapid development and test method based on interface document
US10705943B2 (en) Automating identification of test cases for library suggestion models
US9122540B2 (en) Transformation of computer programs and eliminating errors
CN112416806B (en) JS engine fuzzy test method based on standard document analysis
CN109857641A (en) The method and device of defects detection is carried out to program source file
CN112306861A (en) Unittest and Jenkins tool-based interface automatic testing system and method
CN114594933A (en) Front-end code generation method and device based on file scanning and storage medium
CN112506488A (en) Method for generating programming language class based on sql creating statement
CN116775599A (en) Data migration method, device, electronic equipment and storage medium
CN113050925B (en) Block chain intelligent contract repairing method and device
CN113050987B (en) Method and device for generating interface document, storage medium and electronic equipment
CN115543832A (en) Software code standard detection method, system, equipment and storage medium
CN112445492B (en) ANTLR 4-based source code translation method
US10997056B1 (en) Generation of explanatory and executable repair examples
CN115373655B (en) Information protocol code automatic generation method based on standardized template
CN113568662B (en) Code change influence range analysis method and system based on calling relation
CN113391815B (en) Source code analysis result testing method and system based on multiple development languages
CN113961192A (en) Code data processing method and device and electronic equipment
CN117891732A (en) Code testing method and device
CN117111933A (en) Front-end code generation method, device and computer readable storage medium
CN117785156A (en) Single file optimization method and device, electronic equipment and storage medium
CN116594687A (en) Cross-platform transplanting system and transplanting method for C language source codes
CN117194265A (en) Automatic industry template testing method and device based on data warehouse hive
CN117908853A (en) Automatic analysis realization method and system based on custom business formula
CN116541037A (en) Code conversion processing method, device and client

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication