ApiKit, the production tool for the whole life cycle of the interface

1. Overall introduction of ApiKit:

1. Requirements and status of interface management:

In the process of software project development, there must be the following requirements:

  • For the management of API interface documents, the common solution is Swagger

  • For API interface debugging, the common solution is Postman

  • The automated testing of the API interface shortens the test cycle of the version iteration process and improves the code quality of the version. The common solution is JMeter

  • The Mock of the API interface data saves the time of data construction and bids farewell to waiting for the back-end interface. The common solution is MockJs

Although Swagger, Postman, JMeter, and MockJS can each meet the needs of different links in the above R&D process very well, they need to use several different tools to complete interface design, document writing, debugging, data mocking, test verification, etc., so In actual use, the following situations will be encountered:

(1) After the developer defines the document based on Swagger, he needs to go to Postman to define it again when debugging the interface. (2) When developing the Mock data at the front end, he needs to define it again using MockJs, and manually set the Mock rules. (3) The tester is constructing The test case needs to be defined again using JMeter (4) The front-end is developed based on the data from MockJs Mock, and the back-end is developed according to the interface document defined by Swagger. Each of them has passed the test. I thought it could go online immediately, but found out Various problems: a. The interface was changed during the development process, but only Swagger was modified, and MockJs was not modified synchronously in time. b. The interface data type of the back-end development is inconsistent with the document, and it is difficult to find the problem with the naked eye. (5) Similarly, various inconsistencies will be found when the test cases written in JMeter are actually run. (6) Various inconsistencies get worse over time.

To sum up, there are the following problems:

(1) Multi-system data is not interoperable and cannot be imported into each other. After defining and writing interfaces with Swagger, API designers, front-end development, back-end development, and testers need to repeat a lot of the same when using tools such as Postman, MockJS, and Jmeter work, the efficiency is low.

(2) Data consistency is difficult. Because the data is not interoperable, every time the content of the interface is changed, different roles need to modify multiple systems. The maintenance of consistency is very difficult, and it becomes more and more serious as time goes by.

(3) There is no team collaboration between multiple systems, and changes cannot be notified and synchronized to team members in a timely manner, resulting in untimely communication, inefficient collaboration, and frequent problems.

2. What is ApiKit:

So is there a tool that can realize the unification of the above functions, so as to solve the problems just mentioned? The answer is definitely yes, which is ApiKit, the protagonist of our article.

The official positioning of ApiKit is: ApiKit = API management + Mock + automated testing + exception monitoring + teamwork, as a productivity tool for the full cycle of the interface, a one-stop interface management platform, it truly realizes the connection of data flow, in a Interface design-> interface documentation-> interface debugging-> interface modification-> interface mock-> interface testing-> interface automation-> interface iteration workflow closed-loop, back-end, front-end, testing in different fields can be realized on the software Each takes what they need and can work together.

Through ApiKit, as long as we define the interface document, we can directly use interface debugging, data mock, interface testing and other functions without redefining. After the interface debugging is completed, it can be guaranteed to be completely consistent with the definition of the interface document, efficient, timely and accurate! In other words, ApiKit mainly provides us with these five types of functions: API document design, API interface debugging, API automated testing, API data Mock, team collaboration

2. Interface management module:

1. Interface design (swagger):

Interface design, that is, define interface document specifications, such as interface request path, parameters, return value, data structure, etc. ApiKit's interface documents follow the OpenAPI specification, which not only has the core functions of swagger, but also has more advantages:

  • Visual API document design and management page, zero learning cost, low cost of getting started

  • The interface and document are integrated, modifying the interface can modify the document synchronously, saving the effort of maintaining the document

  • Support online sharing of API documents to facilitate collaboration with external teams.

  • Data model is supported, and the same data structure can be reused between interfaces.

2. Interface debugging (postman)

After completing the interface and document design, you can directly run the interface to debug. ApiKit's interface document function and debugging function are integrated, debugging and modifying documents can save the cost of switching tools and synchronizing data between systems.

 

The test content is saved as an API document

If there is no problem with the test, you can click "Save as new API" in the upper right corner to quickly save the test data as an API document, which is convenient for next debugging.

 

3. Automatic code generation:

The code generation function of ApiKit can automatically generate business code in various languages ​​according to the definition of interface and data model, so that the service caller can write less code, improve efficiency and improve accuracy.

4. Data import:

Speaking of which, if you really want to use ApiKit, you will definitely consider that our business has been iterated for so long, and there are a large number of interfaces. It must be unrealistic to use ApiKit to define interface documents one by one, right? Don't worry, since ApiKit supports the import of data formats such as OpenApi, Postman, Jmeter, etc., old projects can be migrated to Apikit painlessly with one click, without creating a new project again.

 

5. Automatically generate documents:

 

The test content is saved as an API document

If there is no problem with the test, you can click "Save as new API" in the upper right corner to quickly save the test data as an API document, which is convenient for next debugging.

 

3. Data Mock module:

Front-end development often depends on the back-end data interface, but in many cases, the pace of front-end and back-end development is inconsistent. It is usually difficult to start the front-end before the development of the back-end interface is completed. The Mock function is used to solve this problem. With the Mock tool, the front-end can use the Mock tool to create fake data interfaces to simulate interface calls, and the front-end and back-end can enter development simultaneously, thereby ensuring the development progress of the front-end.

 

4. Automated test module:

ApiKit's automated testing is implemented based on test cases. A test case is to combine multiple interfaces in an orderly manner to test a complete business process. ApiKit's automated testing has the following characteristics:

  • Support to quickly generate test steps by referring to the interface defined in the API document or referring to the interface use case.

  • Supports binding interfaces, and automatically updates test cases when the interface changes.

  • Support automatic generation of test reports

In the API automated testing platform, all test cases are managed in the project dimension, and an automated test project can reference API information from multiple API document projects to create API test cases.

Enter the API automation test project list page and click the Add button:

 

Enter the corresponding information in the pop-up window and click OK:

 

When creating a project, you can also designate a member in the space to be the initial administrator of the project. He can help you manage personnel permissions in the project, such as binding members in the space to the project, or modifying certain The operation authority of each member, etc.

 

5. Team management module:

In terms of team collaboration, ApiKit has mature team permissions and project permissions management, supports administrators, ordinary members, read-only members and other role settings to meet the needs of various enterprises. The team authority refers to the authority of the member to operate the team, and the project authority refers to the authority of the member to operate the project.

Click the function menu in the upper left corner of the page, and select the workspace to switch from the drop-down menu.

 

Click Create/Join, select Create Workspace on the guidance page, fill in the workspace name and domain name, and click OK.

 

Sixth, say at the end:

As a full-cycle productivity tool and a one-stop interface management platform, ApiKit has done a lot of operation optimization and team synergy to improve the efficiency of the traditional software. For developers, it can reduce meaningless work. The time-consuming and complicated and time-consuming communication costs are spent, and time is spent on places that can enhance their own competitiveness. For enterprises, it can save costs for enterprises by improving the overall cooperation efficiency; therefore, the official team collaboration process is as follows:

(1) The front/back end defines the first draft of each interface document of the project on the ApiKit visual interface design interface

(2) Review the front and back ends together, and improve the interface documents

(3) The front-end uses the interface document and uses the Mock function to automatically generate Mock data for development, without handwriting mock rules

(4) Every time a function is debugged in the backend, it is saved as an interface use case. If the interface changes during the development process, the document will be automatically updated during debugging, ensuring the timeliness of interface maintenance at zero cost.

(5) Test Generate interface parameter test cases with one click on the interface management page, and generate automated test cases according to business scenarios, run interface use cases with one click, completely test the entire interface call process, generate interface test reports and share them with relevant personnel.

(6) After the front-end and back-end are developed, the front-end switches the mock data to the official data for joint debugging. Since the same interface data source is used and the interface specification is followed, the joint debugging will generally be very smooth

(7) Even if the interface changes due to changes in version requirements, after the backend submits the modification, the frontend and the test can synchronize the modified data in real time

(8) The project manager assigns different operation permissions to R&D, product, testing, and external cooperation personnel through authority settings, maintaining project security

(9) The project manager follows up the progress of the project through the development status of each interface, and controls the project risk.

Official website:

https://www.eolink.com/?utm_source=cpcs&utm_content=cpy12

Guess you like

Origin blog.csdn.net/kungfuboy17/article/details/130872350