CN116414707A - Test data execution method, device, equipment, medium and product based on API (application program interface) document - Google Patents

Test data execution method, device, equipment, medium and product based on API (application program interface) document Download PDF

Info

Publication number
CN116414707A
CN116414707A CN202310356854.2A CN202310356854A CN116414707A CN 116414707 A CN116414707 A CN 116414707A CN 202310356854 A CN202310356854 A CN 202310356854A CN 116414707 A CN116414707 A CN 116414707A
Authority
CN
China
Prior art keywords
interface
data
document
api
parameters
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
CN202310356854.2A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310356854.2A priority Critical patent/CN116414707A/en
Publication of CN116414707A publication Critical patent/CN116414707A/en
Pending legal-status Critical Current

Links

Images

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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • 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

Abstract

The disclosure provides a test data execution method based on an API (application program interface) document, which can be applied to the technical field of big data. The test data execution method based on the API document comprises the following steps: generating an API interface document according to the interface document parameters and preset interface design rules; generating field test data based on interface data parameters of the API interface document and a data service model matched with the API interface document; and executing the field test data by a baffle test server deployed based on the API interface document. The present disclosure also provides a test data execution apparatus, device, storage medium and program product based on the API interface document.

Description

Test data execution method, device, equipment, medium and product based on API (application program interface) document
Technical Field
The present disclosure relates to the field of big data technologies, and more particularly, to a method, an apparatus, a device, a medium, and a product for executing test data based on an API interface document.
Background
With the rapid development of economy and society, the development demands of content such as application programs and web applications are increasing. In the existing project development summarization process, the front end and the back end are generally developed separately (such as web project development). The development of the application program needs to define an interface at the front end and the back end together, write an interface document, and then continue to execute the development according to the interface document until the project development is finished, and maintenance of the interface document is needed to be maintained. However, the front end and the rear end of the existing interface document are respectively written, so that the joint debugging of the front end and the rear end cannot be maintained, various development problems exist, and the function development of the front end and the rear end needs to be maintained through baffle testing.
Disclosure of Invention
In view of at least one of the above problems, the present disclosure provides an API interface document-based test data execution method, apparatus, device, medium, and program product that improve application development test efficiency.
One aspect of the present disclosure provides a test data execution method based on an API interface document, including: generating an API interface document according to the interface document parameters and preset interface design rules; generating field test data based on interface data parameters of the API interface document and a data service model matched with the API interface document; and executing the field test data by a baffle test server deployed based on the API interface document.
According to an embodiment of the disclosure, the generating an API interface document according to the interface document parameters and the preset interface design rules includes: screening preset document definition parameters; calling historical document parameters according to the document definition parameters to generate the interface document parameters; and based on the interface document parameters stored by the preset interface design rules, the API interface document is derived.
According to an embodiment of the disclosure, before the generating field test data based on the interface data parameters of the API interface document and the data service model matched with the API interface document, the method further includes: identifying interface content parameters of the API interface document, and extracting interface keywords; and logically matching the data service model corresponding to the API interface document by combining the interface keywords and a preset service model.
According to an embodiment of the present disclosure, the generating field test data based on the interface data parameters of the API interface document and the data service model matched with the API interface document includes: analyzing the interface data parameters to generate corresponding parameter definition data; invoking a field association relation matched with the data service model through the parameter definition data; wherein the interface data parameters include the interface content parameters.
According to an embodiment of the present disclosure, in the generating field test data based on the interface data parameters of the API interface document and the data service model matched with the API interface document, further includes: randomizing to generate random data of the API interface document; and generating field test data of the random data based on the field association relation.
According to an embodiment of the present disclosure, before the executing the field test data by the barrier test server deployed based on the API interface document, the method further includes: analyzing interface attribute parameters of the interface data parameters; and deploying the baffle test server based on the interface attribute parameters.
According to an embodiment of the present disclosure, in the deploying the baffle test server based on the interface attribute parameter, the method includes: mapping the interface attribute parameters to generate interface routing information; converting class definition codes of the interface attribute parameters into interface codes through an interface definition grammar tree; and compiling and packaging the interface codes, and deploying the baffle test server based on the interface routing information.
According to an embodiment of the present disclosure, in the executing the field test data by a barrier test server deployed based on the API interface document, it includes: generating a data change rule according to the data service model and the field association relation; and dynamically adjusting the field test data according to the data change rule and returning the field test data to the interface of the baffle test server corresponding to the API interface document.
Another aspect of the present disclosure provides a test data execution apparatus based on an API interface document, including a document generating module, a data generating module, and a test execution module. The document generation module is used for generating an API interface document according to the interface document parameters and the preset interface design rules; the data generation module is used for generating field test data based on the interface data parameters of the API interface document and a data service model matched with the API interface document; and the test execution module is used for executing the field test data through a baffle test server deployed based on the API interface document.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the test data execution method based on the API interface document.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described test data execution method based on an API interface document.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described test data execution method based on an API interface document.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1A schematically illustrates a functional implementation diagram between an existing e-commerce core system and a third party service;
fig. 1B schematically illustrates a functional scenario diagram of implementing multi-system joint debugging between an e-commerce core system and a third party service through a baffle system according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates an application scenario diagram of a method, apparatus, device, medium and program product for executing test data based on an API interface document according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a test data execution method based on an API interface document, in accordance with an embodiment of the present disclosure;
FIG. 4A schematically illustrates a scenario flowchart of a test data execution method based on an API interface document, according to an embodiment of the present disclosure;
FIG. 4B schematically illustrates a specific scenario flowchart of a test data execution method based on an API interface document according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a test environment build system composition diagram applied to implement a test data execution method based on an API interface document in accordance with an embodiment of the present disclosure;
FIG. 6 schematically illustrates a block diagram of a test data execution device based on an API interface document, in accordance with an embodiment of the present disclosure; and
fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement a test data execution method based on an API interface document, according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the existing application development process, as shown in fig. 1A, the e-commerce core system comprises a series of functional modules such as a member center, a marketing center, a payment center and the like, and in the scenes of calling a third party to pay for order payment, recharging and the like, the front end and the rear end generally respectively carry out interface writing, and before the application development is not completed, the problems of difficult environment stabilization, difficult data preparation, difficult parallel development and the like among multiple systems exist due to the fact that the front end and the rear end cannot be simultaneously regulated, so that a large amount of communication cost and investigation cost are required for the multi-system simultaneous regulation test.
In order to solve the problem of difficulty in multi-system joint debugging test, in the embodiment of the present disclosure, a stable joint debugging test is implemented by using mock developed by simulating peripheral systems, services and interfaces mainly. As shown in fig. 1B, the e-commerce core system includes a series of functional modules such as a member center, a marketing center, a payment center, and the like, and in the scenarios of calling a third party to pay for an order, recharging, and the like, the two parties keep following an interface protocol, and meanwhile, the functions of the front end and the rear end can be respectively realized according to a payment channel, a real-name channel, a short-message channel, and the like of a third party service simulated by a payment mock, a real-name mock, a short-message mock, and the like of a baffle system, regardless of development joint debugging, functional testing, and performance testing.
Front-end testing of local interfaces may typically be performed using mockjs, while back-end testing is accomplished using manual testing or automated testing. The manual test is a process of manually executing test cases by means of a browser or a part of test tools (such as postman, jemter, etc.), and the automatic test of the interface requires manually writing the test cases.
It should be noted that the nature of the baffle test is analog feedback of interface call, mainly related to data transmission interaction, and data related to dynamic data and static data. The static data is the preset fixed data content, the dynamic data is based on the interface condition, the dynamic data is returned according to the data of the database through simple logic, and the related test data needs to be manually set or randomly generated in any mode, so that the following problems are easy to generate in the baffle test process: (1) Manually setting data, wherein the data can be fixedly locked on one hand, the scientificity and the authenticity of the data are lower on the other hand, and a certain workload is required for constructing the data; the data is completely randomly generated, so that the data authenticity is low, and the data can be different each time, which is not beneficial to program debugging and problem reproduction; (2) The existing baffle test server is completely built manually, the content changes such as interface design and the like are frequent in the development process, the baffles are required to be repeatedly modified and set, and the operation is repeated and has strong subjectivity; (3) The existing data for baffle test has single purpose, and can only develop test projects aiming at the current application, so that each development project needs to reconstruct a baffle server and corresponding test data, and the reusability is low. The above problems cause an increase in test costs directly in the application development process, and a decrease in development efficiency.
In view of at least one of the above problems, the present disclosure provides an API interface document-based test data execution method, apparatus, device, medium, and program product that improve application development test efficiency.
It should be noted that, the method and the device for executing test data based on an API interface document according to the embodiments of the present disclosure may be applied to the technical field of big data and the technical field of information security, and may also be applied to any field other than the technical field of big data and the technical field of information security, such as the financial service field, and the application field of the method and the device for executing test data based on an API interface document according to the embodiments of the present disclosure is not limited specifically.
In addition, in the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing, applying and the like of the personal information of the user all conform to the regulations of related laws and regulations, necessary security measures are adopted, and the public welfare is not violated. In the technical scheme of the disclosure, the authorization or consent of the user is obtained before the personal information of the user is obtained or acquired.
The embodiment of the disclosure provides a test data execution method based on an API (application program interface) document, which comprises the following steps: generating an API interface document according to the interface document parameters and preset interface design rules; generating field test data based on interface data parameters of the API interface document and a data service model matched with the API interface document; and executing the field test data by a baffle test server deployed based on the API interface document.
FIG. 2 schematically illustrates an application scenario diagram of a method, apparatus, device, medium and program product for executing test data based on an API interface document according to an embodiment of the present disclosure.
As shown in fig. 2, the application scenario 200 according to this embodiment may include terminal devices 201, 202, 203, a network 204, and a server 205. The network 204 is the medium used to provide communication links between the terminal devices 201, 202, 203 and the server 205. The network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 205 via the network 204 using the terminal devices 201, 202, 203 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 201, 202, 203.
The terminal devices 201, 202, 203 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 205 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by users using the terminal devices 201, 202, 203. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, the test data execution method based on the API interface document provided in the embodiment of the present disclosure may be generally executed by the server 205. Accordingly, the test data executor provided by the embodiments of the present disclosure and based on the API interface document may be generally provided in the server 205. The test data execution method based on the API interface document provided by the embodiments of the present disclosure may also be executed by a server or a server cluster that is different from the server 205 and is capable of communicating with the terminal devices 201, 202, 203 and/or the server 205. Accordingly, the test data execution apparatus based on the API interface document provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 205 and is capable of communicating with the terminal devices 201, 202, 203 and/or the server 205.
It should be understood that the number of terminal devices, networks and servers in fig. 2 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The test data execution method based on the API interface document of the disclosed embodiment will be described in detail below with reference to the scenario described in fig. 2 through fig. 3 to 5.
FIG. 3 schematically illustrates a flowchart of a test data execution method based on an API interface document, according to an embodiment of the present disclosure.
As shown in fig. 3, the test data execution method based on the API interface document of this embodiment includes operations S301 to S303.
In operation S301, an API interface document is generated according to the interface document parameters and the preset interface design rules;
generating field test data based on the interface data parameters of the API interface document and a data service model matched with the API interface document in operation S302; and
in operation S303, the field test data is executed by a barrier test server deployed based on the API interface document.
The interface document parameters are predefined parameters for generating the API interface document according to the embodiments of the present disclosure, may be defined by development requirements or development scenarios of specific application programs or application services, may relate to attribute parameters and content parameters of the corresponding API interface document, and the specific attribute parameters may include URL address, input parameters, output parameters, document format, document type, and the like of the API interface document, and the specific parameters relate to data related to the attribute of the API interface document, and the content parameters relate to data related to the content of the API interface document, such as interface name, interface description, interface use, and parameter description of the API interface document.
The preset interface design rule is a rule for storing the document generation data defined by the interface document parameters, and can be used for storing the interface document parameters corresponding to the API interface document and exporting the interface document parameters to generate the defined API interface document.
The API interface document is a document which is provided by the application programming interface and is convenient for realizing application interaction access, and records specific application codes of the API interface to represent specific parameters of the API interface, and can be specifically the interface data parameters.
The data service model is a service-related model matched with the current test environment, such as a credit service model, a fund service model, an order service model and the like, each service model can define specific data related to different services, and the data service model matched with the API interface document can reflect the service data of the API interface document.
The field test data is the data corresponding to each attribute field in the corresponding data table of the existing test data (which can be used historical test data or unused setting test data, etc.) in the actual database of the system, and can define the field content and the field interrelation of the test data of the API interface document, so that the field test data can be used as the test environment matched with the API interface document or the test data required by application development, and meanwhile, the field test data is matched with the service content corresponding to the data service model. Therefore, the high multiplexing effect on the historical data and the preset data can be ensured, so that the multiplexing rate and the data utilization efficiency of the data can be greatly improved, and meanwhile, the generation efficiency and the accuracy of the test data are also greatly improved.
The construction and deployment of the baffle test server can be realized through the API interface document, and the test execution process can be carried out on the field test data by using the baffle test server. The baffle test server can realize the simulation mock of the API interface to realize the stable joint debugging test in a baffle test mode, so that the data test execution in the embodiment of the disclosure is ensured to be almost completely in an automatic execution process.
Therefore, according to the test data execution method based on the API document, the automatic test environment construction based on the API document can be realized, firstly, the interface definition and the rule in the API document can be automatically analyzed through intelligent identification of the API document, then, the related interface test service can be automatically constructed based on the analysis result, the deployment of batch automatic baffle service can be realized, the test efficiency is greatly improved, meanwhile, the test data conforming to the real business logic can be intelligently generated according to the related definition of the interface, so that the test is more in accordance with the real scene, meanwhile, the test data sharing platform forms the sharing of the test data, the data multiplexing is improved, the test data construction complexity is simplified, and the development test efficiency is improved. Therefore, the test data execution method based on the API document in the embodiment of the disclosure provides a test environment construction scheme based on the API document, which has higher test efficiency and higher reusability.
FIG. 4A schematically illustrates a scenario flowchart of a test data execution method based on an API interface document, according to an embodiment of the present disclosure; FIG. 4B schematically illustrates a specific scenario flowchart of a test data execution method based on an API interface document according to an embodiment of the present disclosure; FIG. 5 schematically illustrates a test environment build system composition diagram applied to implement a test data execution method based on an API interface document in accordance with an embodiment of the present disclosure.
In order to further more clearly describe the above test data execution method based on the API interface document according to the embodiment of the present disclosure, the operations S401-S411 in the specific scenario flow defined in fig. 4B and the test environment construction system 500 defined in fig. 5 are described in more detail below. The test environment construction system 500 may include an API unified interface platform 510, a test task management platform 520, a test container management platform 530, and a test data management platform 540, for implementing the above methods.
The operation sequence of operations S421-S424 and operations S401-S411 of the specific scene flow defined in fig. 4A and fig. 4B is only a specific implementation case, and is not a specific limitation of the execution sequence of the test data execution method based on the API interface document according to the embodiment of the present disclosure, as shown in fig. 4A, the construction of the barrier test server (i.e. operation S423) and the generation of the specific field test data (i.e. operation S422) may be actually implemented in parallel, which is not described herein.
As shown in fig. 3 to 5, in operation S301, according to the interface document parameters and the preset interface design rules, the API interface document is generated, including:
screening preset document definition parameters;
calling historical document parameters according to the document definition parameters to generate the interface document parameters;
and based on the interface document parameters stored by the preset interface design rules, the API interface document is derived.
As shown in fig. 4A, in operation S421, the API interface document is constructed to complete the definition of the API interface and the construction of the related parameters for the subsequent call using the API interface document.
The interface can be mainly divided into four parts, namely a request method, url, a request parameter and a return parameter, and besides, an interface example, an interface document version number, version modification content, version modification time, a modifier, an error code and the like can be further added to the interface document in the construction of the API interface document. Specifically, interface document examples: https: the// apis.daibu.com/store/detail/f318c7e9-ac04-4f0d-94b7-df9fd6d8239d.
Specifically, as shown in fig. 4B, in operation S401, definition of an API interface needs to be implemented through a system internal unified API platform. Specific parameters of each API interface can be screened through the API unified interface platform, and document definition parameters of each interface are ensured to have normalized names, wherein the document definition parameters are predefined parameters of corresponding API interfaces, and are test execution scenes or test requirement related parameters of an API interface document which is specifically matched with the API interface. In addition, the unified interface platform of the API can also perform operations such as adding, inquiring, deleting, modifying and the like of the document definition parameters through the API. In the process, the API unified interface platform can also quickly call relevant document definition parameters, definition rules and other historical test data or preset test data and other relevant stored data (namely historical document parameters) in other API interfaces, high multiplexing of the stored data is realized, such as identity card information is transmitted, parameter naming, data types, check rules, error processing and the like can be used for content data of other previous API documents, multiplexing of the data is further realized, the data recycling rate is improved, meanwhile, the data generation efficiency is improved, and finally generated test data of the API interface document can be more suitable for test execution.
In operation S402, for completing the interface design of the API, after approval by the API unified interface platform, the setting or modification of the corresponding interface may be confirmed. It should be noted that, as those skilled in the art should understand, the API interface document in the embodiment of the present disclosure may be a set of a plurality of different API interface documents, and not merely refer to a single API interface document.
Therefore, the design and definition of the API interface document can be completed through the API unified interface platform, so that the record of the changed version of the API design is reserved, the API interface document can be processed and completed by the front end and the rear end together, and the API design of the target system is finally formed through approval and approval, so that the API interface document meets the data calling requirements of the front end and the rear end as simultaneously as possible.
In operation S403, specific parameter design data of the related API interface document may be saved to the database by the API unified interface platform based on a preset interface design rule, where the preset interface design rule is a rule for saving document generation data defined by the interface document parameters, and the preset interface design rule may be used for saving the interface document parameters corresponding to the API interface document, or may be used for exporting the interface document parameters to generate the defined API interface document. Based on the preset interface design rule, the corresponding API interface document can be directly exported to a document with a specified file format type, such as a json format document, so that the construction of the API interface document is completed.
As shown in fig. 5, the test environment construction system 500 may include an API unified interface platform 510 mainly for performing definition management on an API interface of the entire system, and the platform may include an API management module 511, an API auditing module 512, a project management module 513, a project association setting module 514, a document generation module 515, an import conversion module 516, and a database module 517 in addition to user management, rights management, authentication management, and the like modules necessary for a conventional system.
The API management module 511 may include an API editing module, which may be used for management operations of an API interface, including adding, querying, editing, deleting, debugging, etc. the interface; the API editing module can also comprise a verification module and a matching module, wherein the verification module is mainly used for verifying the set interface definition according to a verification rule, such as judging whether the interface return accords with the development standard of an enterprise, judging whether the data verification rule of the interface is consistent with the type of the interface or not, and the like; the matching module is mainly used for calling similar interfaces from the existing interfaces of the platform according to the information (such as interface names, interface definitions, interface parameters and the like) input by the developer when the interfaces are added or edited, so that the user can visually select the similar interfaces by clicking the visualizations, and the needed parts (such as parameter descriptions, check rules and the like) in the similar interfaces can be conveniently inserted into the interface definitions which are required to be edited or newly added at present, and further quick interface setting is realized.
The API auditing module 512 is mainly used for auditing the addition, deletion or change editing of the API; the recording module can be used for recording the addition, deletion, change editing, inquiry debugging and the like of the API.
The project management module 513 is mainly configured to provide management for the projects related to the API, including adding, querying management, deleting, modifying and adjusting the projects.
The project association setting module 514 is mainly used for providing association and setting of the API and the project, and can set an interface version and a regulation parameter of a corresponding project to realize targeted setting of different projects, wherein the regulation parameter is an additional setting of the API for the project, for example, a certain verification rule can specify that the application is not performed in a certain project to realize customized application of the interface in different projects.
The document generation module 515 may obtain the API definitions of the related items according to the initiated document generation request, and generate the API document of the corresponding item. The document generation module 515 includes an API acquisition module, a parameter setting module, a template loading module, a document engine module, an association refresh module, and the like. The parameter setting module can be used for setting parameters generated by the API document, such as contained content fields, selected templates and the like; the API acquisition module can acquire related API definitions; the template loading module can be used for loading the corresponding template according to the setting of the parameter setting module, and forming and archiving an API document in the template filled with the API definition through the document engine module; the refreshing module can be used for refreshing the API document after the set association condition is triggered, and the association condition can be manually requested, can be triggered to request when modified such as project, API definition and the like, and can be triggered to request according to time period.
The import conversion module 516 is mainly used for inputting the existing API design document, generating relevant interface definition through the API management module after voice analysis of the document, and associating relevant projects, the function is used for fast importing the API design document with the old development mode into the platform, and the module can specifically preset a plurality of analysis templates to analyze and identify the existing API design document according to the analysis templates.
The database module 517 is mainly used for interfacing with a database and storing all relevant data of the API unified interface platform, such as interface definition, project setting, interface association, etc.
Therefore, according to the test data execution method based on the API document, the automatic test environment construction based on the API document can be realized, firstly, the interface definition and the rule in the API document can be automatically analyzed through intelligent identification of the API document, meanwhile, the test data conforming to the real business logic can be intelligently generated according to the interface related definition, so that the test is more in accordance with the real scene, meanwhile, the test data sharing platform forms the sharing of the test data, the data multiplexing is improved, the test data construction complexity is simplified, and the development test efficiency is improved.
As shown in fig. 3-5, before the step S302 generates field test data based on the interface data parameters of the API interface document and the data service model matched with the API interface document according to an embodiment of the present disclosure, it further includes:
identifying interface content parameters of the API interface document, and extracting interface keywords;
and logically matching the data service model corresponding to the API interface document by combining the interface keywords and a preset service model.
As shown in fig. 4A, in operation S422, the construction of test data is constructed, and the generation of test data is made intelligent.
Specifically, as shown in fig. 4B, in operation S407, the NLP semantic recognition processing is performed on the interface content parameters such as the interface name, the interface description, the interface use, the parameter description, etc. in the interface document, so as to extract the interface keywords corresponding to the API interface document;
in operation S408, the data service model, such as credit service model, fund service model, order service model, etc., corresponding to the current system is determined by matching through preset service model logic in combination with the extracted interface keywords and interface parameters. The preset business model logic is a preset association relation between the interface keywords and the data business model, and query matching of the data business model can be achieved through the preset business model logic based on the interface keywords.
In particular, as shown in fig. 5, the test data management platform 540 may include an NLP semantic parsing module 541 and a business logic matching module 542.
The NLP semantic parsing module 541 may perform NLP semantic recognition processing on interface content parameters such as an interface name, an interface description, an interface use, and a parameter description in the API interface document, and extract an interface keyword. The keyword extraction of the NLP semantic parsing module 541 can be implemented in various ways, such as Bi-lstm+ CRF, textRank, TF-IDF. In the embodiment of the present disclosure, the NLP semantic analysis module 541 mainly adopts a word2vec clustering-based manner to implement keyword extraction based on NLP semantic recognition, and sorts the words closer to the center of the class by clustering candidate keywords, so as to obtain keywords, which specifically includes the following steps: 1) Training a Word2Vec model of the corpus to obtain a Word vector file; 2) Preprocessing the text to obtain N candidate keywords; 3) Traversing the candidate keywords, and extracting word vector representations of the candidate keywords from the word vector file; 4) Clustering the candidate keywords to obtain clustering centers of all the categories; 5) Calculating the distance between the words in the group and the clustering center under each category, and sorting in descending order according to the size of the clusters; 6) And calculating the result of the candidate keywords to obtain Top-K words which are ranked as text keywords.
The business logic matching module 542 is mainly configured to match the interface keywords and interface content parameters analyzed by the NLP semantic analysis module 541 with the preset business model logic currently existing, and determine a business model corresponding to the current system, such as a credit business model, a fund business model, an order business model, and the like. The service logic matching module 542 may perform similarity matching on the keywords and each service model logic in a similarity manner, match the interface parameter data definition with the keywords related to the existing service logic, perform weighted evaluation comprehensively to obtain a specific similarity, and select a service model with the highest similarity as a matching result, that is, a data service model corresponding to the API interface document.
Therefore, the matching of the actual service model and the API document can be automatically realized without manually setting the data, and compared with the traditional mode of manually and automatically constructing test data or completely random data generation, the method can be more fit with the actual service scene, so that the scientificity and the authenticity of the data are higher, the test execution is more fit with the actual situation, and more accurate test simulation is carried out.
As shown in fig. 3-5, in the generating field test data based on the interface data parameters of the API interface document and the data traffic model matched with the API interface document in operation S302, according to an embodiment of the present disclosure, it includes:
analyzing the interface data parameters to generate corresponding parameter definition data;
invoking a field association relation matched with the data service model through the parameter definition data;
wherein the interface data parameters include the interface content parameters.
As shown in fig. 4B, in operation S409, each data parameter of the interface is analyzed, and parameter definition data adapted to the content parameter of the interface, such as a parameter description, a parameter name type, etc., is specifically a plurality of basic parameter data extracted based on the content parameter, such as a parameter description of the content parameter of the interface, and a parameter type, etc., such as user basic information, order basic information, etc.
According to the obtained parameter definition data, the internal data of the database matched with the parameter definition data is utilized, according to a corresponding data service model, in a corresponding real service database, the field association relation between key parameters and fields of each parameter definition data is analyzed, and the analysis and the acquisition of the field association relation can be realized through a storage process, wherein the field association relation can define the interrelationships between attribute fields and interface parameters and between attribute fields in at least one data table in an actual database, namely the association relation between each parameter data, such as the relation between quantity, total price and unit price, the relation between total price and balance in an order, and the like.
Specifically, as shown in fig. 5, the test data management platform 540 may further include a database retrieval module 543 and an association analysis establishment module 544.
The database retrieving module 543 may access a database corresponding to the real service according to the matched data service model, read a storage process of the database, obtain a data table stored therein, and query a specific data table field.
The association analysis establishing module 544 may then perform statistical analysis on the fields queried by the database based on the reading of the storage process to obtain an association between the database fields, match the fields in the database according to the type, name, definition, etc. of the interface content parameters, obtain the association between the interface parameters and the association between the fields of the interface parameters and the association between the database fields according to the association between the fields of the database, and may use the association as the field association in the embodiments of the present disclosure.
Therefore, the test data construction can be automatically completed, the test efficiency is obviously improved, meanwhile, due to the fact that the actual data service model and the data field association relation are combined in the process, compared with a traditional mode of manually and automatically constructing the test data or completely and randomly testing the data, the test data can be more attached to the actual service process, the scientificity and the authenticity of the data are higher, the test is more in accordance with the actual situation, and meanwhile, the influence of subjective factors can be eliminated.
As shown in fig. 3-5, in operation S302, generating field test data based on the interface data parameters of the API interface document and the data service model matched with the API interface document further includes:
randomizing to generate random data of the API interface document;
and generating field test data of the random data based on the field association relation.
As shown in fig. 4B, in operation S410, random data corresponding to an API interface document may be generated based on a randomization function, and processing is performed on the random data based on field association relationships between fields of the API interface document to generate other field data so as to be field test data.
As shown in fig. 5, the test data management platform may further include a data creation module 545, where the data creation module 545 may utilize the test data management platform to match data of an existing parameter field, and for data that does not exist, may generate random data as supplementary data based on a randomization function, and simultaneously perform unified adjustment on the random data and the existing parameter field data based on a field association relationship between fields, so as to generate field test data, that is, complete construction of the test data. In the processing of the random data, a data change rule may be generated according to the data service model and the field association relationship.
Therefore, in the field test data in the embodiment of the present disclosure, the content of the actual data is not the content of the completely random data, and the actually random data is only one supplementary content of the extracted test data defined by the field association relationship, so that the field test data is more attached to the actual service content on the basis of ensuring the data integrity, the scientificity and the authenticity of the data are higher, and the test is more in accordance with the actual situation.
As shown in fig. 3-5, before the operation S303 executes the field test data through a barrier test server deployed based on the API interface document, according to an embodiment of the present disclosure, it further includes:
analyzing interface attribute parameters of the interface data parameters;
and deploying the baffle test server based on the interface attribute parameters.
As shown in fig. 4A, in operation S423, the construction of the test server may be implemented based on the API interface document defined as described above, and in particular, the deployment operation may be performed on the test server using the URL address, input parameters, output parameters, document format, document type, etc. of the interface attribute parameters of the API interface document, which relate specifically to data related to the attributes of the API interface document. The test server is used as an execution main body of the baffle test, can realize baffle simulation service, and calls each API interface defined by the API interface document.
Therefore, the construction of the test server can be automatically completed based on the developed API interface document, and a simulation test server is not required to be manually built, so that the development efficiency is improved; in the development process, when the content related to interface design and the like is changed frequently, documents and definitions can be automatically generated based on an API platform, and further related test services are automatically deployed and configured, so that the baffle is not required to be modified and set manually and repeatedly like the prior art, the project changing cost is greatly reduced, and the development and test efficiency is improved.
As shown in fig. 3-5, in the deploying the baffle test server based on the interface attribute parameter according to an embodiment of the present disclosure, the method includes:
mapping the interface attribute parameters to generate interface routing information;
converting class definition codes of the interface attribute parameters into interface codes through an interface definition grammar tree;
and compiling and packaging the interface codes, and deploying the baffle test server based on the interface routing information.
As shown in fig. 4B, in operation S404, a corresponding development test task may be newly built at the front end through the API unified interface platform 510 to select a determined API interface document.
In operation S405, data parsing may be performed on the API interface document, where the API interface document may be stored in JSON data format, and JSON may be parsed by the API unified interface platform 510 to obtain relevant attribute data of each interface in the API interface document as an interface attribute parameter.
Based on the API address parameter of the interface attribute parameter of the API interface document, the corresponding interface route information can be mapped by adopting a k8s container virtualization technology.
In operation S406, an interface definition syntax tree may be parsed based on the interface attribute parameters, and the interface attribute parameters are parsed through the syntax tree, so that class definition codes of the interface attribute parameters can be converted into interface codes through the syntax tree.
And compiling and packaging the interface codes, deploying interface routing information based on container technology to form a test server, and completing the construction of baffle service.
The whole process can be visually operated, managed and supervised through the API unified interface platform 510, and specifically, the operations of adding, deleting, modifying, restarting, stopping and the like to the test server can be involved.
As shown in fig. 5, the test task management platform 520 may be used to perform unified management control on test tasks of API interfaces of all items, and the test task management platform 520 may include a task management module 521, an API parsing module 522, a mirror image generating module 523, and a timing management module 524.
The task management module 521 may be mainly used for performing conventional management on test tasks, including creating, querying, deleting, editing, modifying, etc., and may regulate and control the open/close states of each test task, after the test tasks are created and opened, the test easy management platform is controlled to load the corresponding test service instance according to the configuration of the test item and the test task configuration file, and after the test tasks are closed, the relevant test service instance is destroyed. One test task may correspond to multiple test service instances, specifically related to the configuration of the project and the configuration of the interface.
The API parsing module 522 may be configured to retrieve an API interface document of a corresponding version according to the project configuration, parse the API definition or the API interface document, and generate a test task configuration file, where the test task configuration file includes routing mapping information (i.e. interface routing information) corresponding to the test address. In the embodiment of the disclosure, the API interface document may be stored in json data format, and the platform obtains relevant data of each interface in the API interface document by parsing json data.
The mirror image generating module 523 may parse and generate an interface definition syntax tree based on the interface related data, and convert class definition codes of the interface attribute parameters into interface codes through syntax tree parsing; and adding or shielding corresponding functional logic according to the regulation parameters of the project, and compiling and packaging the interface codes to form a test service mirror image.
The timing management module 524 may be used to time the enablement status of the various test tasks.
In cooperation with the test task management platform 520 described above, as shown in FIG. 5, the test container management platform 530 may include a creation module 531 and a management module 532.
The creation module 531 may be configured to load a test service image according to a call request of the test task management platform, deploy the test service image based on a container technology, form a test server, and complete the construction of the baffle service.
The management module 532 may be used for visually managing all containers on the current platform, implementing operation and management of the whole process visualized on the platform, and performing operations of adding, deleting, modifying, restarting, stopping, etc. on the test server.
Therefore, the API interface document and the definition of the interface can be automatically generated based on the API unified interface platform, and further related test services are automatically deployed, without manually repeating modification and setting of the baffle as in the prior art, so that the cost of project change is greatly reduced, and the development and test efficiency is improved. Moreover, the current test tasks, test services and the like can be visually managed through the test task management platform and the test container management platform, and overall management and control of projects are facilitated. Therefore, the method can basically realize that the test data construction can be automatically completed without manually setting the data, and the efficiency of executing the whole test can be remarkably improved.
As shown in fig. 3 to 5, in the step S303, the field test data is executed by a barrier test server deployed based on the API interface document, according to an embodiment of the present disclosure, including:
generating a data change rule according to the data service model and the field association relation;
and dynamically adjusting the field test data according to the data change rule and returning the field test data to the interface of the baffle test server corresponding to the API interface document.
As shown in fig. 4A, test data is executed in operation S424 to implement call to the API interface, and in particular, as shown in fig. 4B, a data change rule may be generated according to a data service model and field association relations of other field data in operation S411. According to the data change rule, the field test data can be dynamically returned, at least part of the returned data is dynamically adjusted, new changed test data is formed, and the new changed test data is returned to the corresponding API interface.
Specifically, as shown in fig. 5, the test data management platform 540 may further include: a data change rule generation module 546 and a dynamic return module 547.
The data change rule generating module 546 may generate a data change rule according to a field association relationship between fields or parameter fields, for example, a change rule between an account balance and a total price is generated in an order interface according to an association relationship between an order quantity, an order unit price, a total price of an order, and an account balance.
The dynamic return module 547 may dynamically adjust the data returned before according to the returned data dynamically returned based on the data change rule, and utilize the call parameters of the current interface, the field association relationship between the data and the data change rule to form new changed data to return to the interface.
Therefore, in the data testing process, the test server returns the front-end data instead of being unchanged, and can dynamically return according to the data change rule, so that the system can be tested more comprehensively, meanwhile, the test data can be stored in the unified management platform, so that the tested data has certain continuity, the program debugging and problem reproduction are convenient, other projects and application development can reuse related data, the operation of reconstructing repeated data fields is avoided, the test cost is greatly reduced, and the test development efficiency is remarkably improved.
Based on the above description, the above test data execution method based on an API interface document according to an embodiment of the present disclosure should have at least the following technical effects:
(1) By constructing the API unified interface platform, definition of an API interface and interface document design can be visually completed, a whole-process file-reserving record can be reserved, associated projects corresponding to the API document and API setting of the projects can be designated and regulated, version, configuration parameters and the like of the API can be regulated, targeted customization of different projects can be realized, and the interface document in any format can be automatically generated. In addition, reusability of the API interface design can be effectively improved, and efficiency of subsequent development and design work is improved.
(2) The construction of the test server can be automatically completed based on the development document, the simulation test server is not required to be manually constructed, and the development efficiency is improved. In addition, in the development process, when the content related to interface design and the like is changed frequently, documents and definitions can be automatically generated based on an API platform, so that relevant test services are automatically deployed, modification and setting of a baffle are not needed like manual repetition in the prior art, the cost of project change is greatly reduced, and the development and test efficiency is improved. In addition, the current test tasks, test services and the like can be visually managed through the test task management platform and the test container management platform, and overall management and control of projects are facilitated.
(3) The test data construction can be almost automatically completed without manually setting data, and the test efficiency is improved. Meanwhile, due to the fact that the actual data service model and the data field association relation are combined in the process, compared with a traditional mode that a developer constructs test data or completely random data by himself, the test process can be more fit with a real service process, the scientificity and the authenticity of the data are higher, and the test process is more fit with the real situation. In addition, in the testing process, the front-end data returned by the testing server is not invariable, dynamic return operation can be carried out according to the data change rule, the system can be tested more comprehensively, meanwhile, the data can be stored in the unified management platform, so that the tested data has certain continuity, program debugging and problem reproduction are convenient, related data can be reused for other projects and application development, repeated data fields do not need to be reconstructed, the testing cost can be obviously reduced, and the testing development efficiency is greatly improved.
Based on the test data executing method based on the API document, the disclosure also provides a test data executing device based on the API document. The device will be described in detail below in connection with fig. 6.
Fig. 6 schematically illustrates a block diagram of a test data execution apparatus based on an API interface document according to an embodiment of the present disclosure.
As shown in fig. 6, the API-interface document-based test data execution apparatus 600 of this embodiment includes a document generating module 610, a data generating module 620, and a test executing module 630.
The document generation module 610 is configured to generate an API interface document according to the interface document parameters and the preset interface design rules. In an embodiment, the document generating module may be configured to perform the operation S301 described above, which is not described herein.
The data generating module 620 is configured to generate field test data based on the interface data parameters of the API interface document and the data service model matched with the API interface document. In an embodiment, the data generating module may be configured to perform the operation S302 described above, which is not described herein.
The test execution module 630 is configured to execute the field test data by using a baffle test server deployed based on the API interface document. In an embodiment, the test execution module may be configured to execute the operation S303 described above, which is not described herein.
Any of the document generation module 610, the data generation module 620, and the test execution module 630 may be combined in one module to be implemented, or any of the modules may be split into multiple modules, according to embodiments of the present disclosure. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the document generation module 610, the data generation module 620, and the test execution module 630 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware, such as any other reasonable way of integrating or packaging circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the document generation module 610, the data generation module 620, and the test execution module 630 may be at least partially implemented as a computer program module that, when executed, performs the corresponding functions.
Fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement a test data execution method based on an API interface document, according to an embodiment of the present disclosure.
As shown in fig. 7, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. Note that the program may be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 700 may further include an input/output (I/O) interface 705, the input/output (I/O) interface 705 also being connected to the bus 704. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 702 and/or RAM 703 and/or one or more memories other than ROM 702 and RAM 703 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, causes the computer system to perform the methods provided by embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed over a network medium in the form of signals, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (12)

1. A test data execution method based on an API interface document, comprising:
generating an API interface document according to the interface document parameters and preset interface design rules;
Generating field test data based on interface data parameters of the API interface document and a data service model matched with the API interface document; and
and executing the field test data through a baffle test server deployed based on the API interface document.
2. The method of claim 1, wherein the generating an API interface document according to interface document parameters and preset interface design rules comprises:
screening preset document definition parameters;
calling historical document parameters according to the document definition parameters to generate the interface document parameters;
and based on the interface document parameters stored by the preset interface design rules, the API interface document is derived.
3. The method of claim 1, wherein prior to generating field test data based on the interface data parameters of the API interface document and the data traffic model matching the API interface document, further comprising:
identifying interface content parameters of the API interface document, and extracting interface keywords;
and logically matching the data service model corresponding to the API interface document by combining the interface keywords and a preset service model.
4. A method according to claim 3, wherein in generating field test data based on the interface data parameters of the API interface document and the data traffic model matching the API interface document, comprising:
Analyzing the interface data parameters to generate corresponding parameter definition data;
invoking a field association relation matched with the data service model through the parameter definition data;
wherein the interface data parameters include the interface content parameters.
5. The method of claim 4, wherein in generating field test data based on the interface data parameters of the API interface document and a data traffic model matching the API interface document, further comprising:
randomizing to generate random data of the API interface document;
and generating field test data of the random data based on the field association relation.
6. The method of claim 1, wherein prior to executing the field test data by the baffle test server deployed based on the API interface document, further comprising:
analyzing interface attribute parameters of the interface data parameters;
and deploying the baffle test server based on the interface attribute parameters.
7. The method of claim 6, wherein in the deploying the baffle test server based on the interface attribute parameters, comprising:
mapping the interface attribute parameters to generate interface routing information;
Converting class definition codes of the interface attribute parameters into interface codes through an interface definition grammar tree;
and compiling and packaging the interface codes, and deploying the baffle test server based on the interface routing information.
8. The method of claim 5, wherein in the executing the field test data by a baffle test server deployed based on the API interface document comprises:
generating a data change rule according to the data service model and the field association relation;
and dynamically adjusting the field test data according to the data change rule and returning the field test data to the interface of the baffle test server corresponding to the API interface document.
9. A test data execution device based on an API interface document, comprising:
the document generation module is used for generating an API interface document according to the interface document parameters and the preset interface design rules;
the data generation module is used for generating field test data based on the interface data parameters of the API interface document and a data service model matched with the API interface document; and
and the test execution module is used for executing the field test data through a baffle test server deployed based on the API interface document.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-8.
11. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-8.
12. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.
CN202310356854.2A 2023-04-04 2023-04-04 Test data execution method, device, equipment, medium and product based on API (application program interface) document Pending CN116414707A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310356854.2A CN116414707A (en) 2023-04-04 2023-04-04 Test data execution method, device, equipment, medium and product based on API (application program interface) document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310356854.2A CN116414707A (en) 2023-04-04 2023-04-04 Test data execution method, device, equipment, medium and product based on API (application program interface) document

Publications (1)

Publication Number Publication Date
CN116414707A true CN116414707A (en) 2023-07-11

Family

ID=87059166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310356854.2A Pending CN116414707A (en) 2023-04-04 2023-04-04 Test data execution method, device, equipment, medium and product based on API (application program interface) document

Country Status (1)

Country Link
CN (1) CN116414707A (en)

Similar Documents

Publication Publication Date Title
US20210049137A1 (en) Building and managing data-processign attributes for modeled data sources
US11151323B2 (en) Embedding natural language context in structured documents using document anatomy
CN110673839B (en) Distributed tool configuration construction generation method and system
US11132755B2 (en) Extracting, deriving, and using legal matter semantics to generate e-discovery queries in an e-discovery system
US20110055373A1 (en) Service identification for resources in a computing environment
US20140095527A1 (en) Expanding high level queries
US11966710B2 (en) System and method for implementing an open digital rights language (ODRL) visualizer
US20240127379A1 (en) Generating actionable information from documents
US20230385952A1 (en) System and method for serverless modification and execution of machine learning algorithms
US20230418859A1 (en) Unified data classification techniques
CN116594683A (en) Code annotation information generation method, device, equipment and storage medium
CN115543428A (en) Simulated data generation method and device based on strategy template
CN117009397A (en) Data query method, data query device, electronic equipment and storage medium
CN115292352A (en) Question query method, device, equipment, medium and program product
CN116414707A (en) Test data execution method, device, equipment, medium and product based on API (application program interface) document
CN111798309B (en) Wind-controlled variable processing system, method and readable medium
US11755633B2 (en) Entity search system
US10902046B2 (en) Breaking down a high-level business problem statement in a natural language and generating a solution from a catalog of assets
CN113095078A (en) Associated asset determination method and device and electronic equipment
KR20130068601A (en) Apparatus and method for dynamic customization and execution of query based software logic for multitenant
CN111949259A (en) Risk decision configuration method, system, electronic equipment and storage medium
CN112181407A (en) Service implementation processing method, device, system, electronic equipment and storage medium
US20210349902A1 (en) Database query processing
US11443101B2 (en) Flexible pseudo-parsing of dense semi-structured text
CN113935301B (en) Report generation method and device, storage medium and electronic equipment

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