Interface Calling Simulation for Frontend Backend Decoupling
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In software development, frontend and backend integration tests require switching between real and simulated data, but without backend interface data, frontend development is affected, leading to inefficiencies in API Mock development.
Innovation Solution
An interface calling method that receives a request for a target interface, queries a simulated interface set, intercepts the request if a matching simulated interface is found, and outputs simulated response data based on the interface configuration information.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If frontend developers wait for actual backend interface data before conducting integration tests, then test accuracy is improved, but development time and productivity deteriorate
Solution Approach 1:
The patent creates simulated interface data in advance before actual backend interfaces are ready. The simulation module pre-generates mock data that mimics the structure and characteristics of real backend responses, allowing frontend developers to conduct integration tests concurrently with backend development without waiting for actual interface data.
Solution Approach 2:
The patent introduces a simulation module as an intermediary between frontend and backend. This module intercepts frontend requests for backend interfaces and returns simulated responses instead of requiring actual backend connections, thereby decoupling frontend testing from backend availability while maintaining test validity.
2Productivity
If developers use simulated mock data for integration testing, then development efficiency is improved, but data authenticity and test reliability worsen
Solution Approach 1:
The patent applies different data qualities to different testing scenarios. The simulation module generates highly authentic mock data that closely mirrors real backend interface structures, data types, and validation rules. By maintaining local quality characteristics of real data in the simulation layer, the system achieves both high development efficiency and acceptable test reliability for frontend validation.
3Productivity
If frontend and backend are developed simultaneously without interface data availability, then parallel development efficiency is improved, but integration test capability deteriorates
Solution Approach 1:
The simulation module serves as an intermediary that enables parallel development by decoupling frontend testing from backend dependency. It intercepts interface calls from the frontend and provides simulated responses without requiring actual backend services, thus maintaining integration test capability while enabling simultaneous frontend and backend development.
Solution Approach 2:
The system performs preliminary actions by pre-configuring simulation interfaces that replicate backend contract specifications. These simulated interfaces are set up in advance with proper data structures, validation rules, and response formats, allowing frontend developers to conduct integration tests immediately without waiting for backend implementation.
Data Source
AI summary
This application provides an interface calling simulation method for developing an application program performed by an electronic device. The electronic device receives an interface calling request for a target interface in an application program. The interface calling request includes interface calling information of the target interface. The electronic device identifies, within a simulated interface set for a simulation interface corresponding to the target interface. The simulated interface set includes simulated interfaces that simulate real interfaces in the application program. The electronic device compares the interface calling information of the target interface with interface configuration information of the simulated interface. In accordance with a determination that the interface calling information matches the interface configuration information, the electronic device obtains simulated response data corresponding to the target simulation interface and generates calling response data of the interface calling request based on the simulated response data.


