WO2018036273A1 - Simulation test method, server, device, and computer-readable storage medium - Google Patents

Simulation test method, server, device, and computer-readable storage medium Download PDF

Info

Publication number
WO2018036273A1
WO2018036273A1 PCT/CN2017/091259 CN2017091259W WO2018036273A1 WO 2018036273 A1 WO2018036273 A1 WO 2018036273A1 CN 2017091259 W CN2017091259 W CN 2017091259W WO 2018036273 A1 WO2018036273 A1 WO 2018036273A1
Authority
WO
WIPO (PCT)
Prior art keywords
request
interface
data
preset type
determined
Prior art date
Application number
PCT/CN2017/091259
Other languages
French (fr)
Chinese (zh)
Inventor
戴佳
Original Assignee
上海壹账通金融科技有限公司
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 上海壹账通金融科技有限公司 filed Critical 上海壹账通金融科技有限公司
Publication of WO2018036273A1 publication Critical patent/WO2018036273A1/en

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present invention further provides a computer readable storage medium, where the simulation test program is stored, and when the simulation test program is executed by the processor, the following steps are implemented:
  • the simulation test method in the application development process includes:
  • the first preset type request may be sent to the preset request processing server, for example, the first preset type request may be For the get request, that is, the pull data request, the first preset type request includes the destination server parameter corresponding to the pull data request.
  • the request processing server may determine the interface document of the APP to be tested that is configured on the request processing server. The first interface corresponding to the first preset type request, that is, the interface corresponding to the pull data request.
  • the request processing server analyzes the current switch state of the first interface corresponding to the first preset type request according to the configured interface document of the APP to be tested, and determines that the first preset type request corresponds to the first
  • the current switch state of an interface is either the on state or the off state.
  • Step S30 if the determined current switch state of the first interface is the open state, the request processing server finds the determined return data corresponding to the first interface, and maps according to the predetermined request type and the format of the returned data. a relationship, determining a first format of the returned data corresponding to the first preset type request, and encapsulating the found return data according to the determined first format to generate first encapsulated data, and returning the generated first encapsulated data Give the application under test.
  • the description may directly obtain return data from the first interface corresponding to the first preset type request.
  • the request processing server finds the first determined according to the configured interface document of the APP to be tested.
  • the return data corresponding to the interface determines a first format of the returned data corresponding to the first preset type request according to a mapping relationship between the predetermined request type and the format of the returned data. For example, if the format corresponding to the pull data request is “successful pull” format, when the current switch state of the interface corresponding to the pull data request is analyzed to be the open state, the return data corresponding to the determined interface is found, and determined.
  • the request processing server determines the first according to the interface document of the application to be tested stored on the request processing server.
  • the preset type requests the corresponding first interface, and when the current switch state of the first interface is analyzed, the return data corresponding to the first interface is found, and the returned data is encapsulated in a corresponding format and then returned to the Application to be tested. Since the application to be tested at the development end only needs to send the first preset type request, the return data sent by the request processing server can be received for testing, and the application to be tested can be performed in the development process without the development of the background data interface. Back-end data testing in the background avoids the need for re-development of the application under test due to loopbacks caused by background data, which effectively improves the accuracy and efficiency of application development.
  • Step S40 If the current switch state of the first interface is determined to be off, the request processing server analyzes the destination server corresponding to the destination server parameter in the first preset type request, and the first preset is The type request is sent to the analyzed destination server, and the returned data corresponding to the first preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the application to be tested.
  • the request processing server analyzes the current switch state of the second interface corresponding to the second preset type request according to the configured interface document of the APP to be tested, and determines that the second preset type request corresponds to the first
  • the current switch state of the two interfaces is the open state or the closed state.
  • the request processing server finds the returned data corresponding to the determined second interface according to the configured interface document of the APP to be tested, and determines the mapping according to the mapping relationship between the predetermined request type and the format of the returned data.
  • the second format of the returned data corresponding to the second preset type request For example, if the format corresponding to the change data request is the “successful change” format, when the current switch state of the interface corresponding to the change data request is analyzed to be the open state, the return data corresponding to the determined interface is found, and the predetermined one is determined.
  • the found return data is further encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the to-be-tested application.
  • the returned data corresponding to the found change data request may be encapsulated according to the determined “successful change” format to generate second package data corresponding to the change data request, and the generated second package data is returned to the to-be-processed data.
  • Test APP Test APP.
  • step S80 if the current switch state of the second interface is determined to be off, the request processing server analyzes the destination server corresponding to the destination server parameter in the second preset type request, and the second preset is The type request is sent to the analyzed destination server, and the returned data corresponding to the second preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the application to be tested.
  • the request processing server obtains the destination server parameter configured for the second interface corresponding to the second preset type request according to the configured interface document of the APP to be tested, and analyzes the second preset.
  • the destination server corresponding to the destination server parameter in the type request. Will The second preset type request is sent to the analyzed destination server, so that the second preset type request of the APP to be tested is successfully forwarded to the destination server corresponding to the change data request.
  • FIG. 6 is a schematic diagram of functional modules of a first embodiment of a request processing server for performing simulation testing in an application development process.
  • the first preset type request may be sent to the preset request processing server, for example, the first preset type request may be For the get request, that is, the pull data request, the first preset type request includes the destination server parameter corresponding to the pull data request.
  • the request processing server may determine the interface document of the APP to be tested that is configured on the request processing server. The first interface corresponding to the first preset type request, that is, the interface corresponding to the pull data request.
  • the request processing server analyzes the current switch state of the first interface corresponding to the first preset type request according to the configured interface document of the APP to be tested, and determines that the first preset type request corresponds to the first
  • the current switch state of an interface is either the on state or the off state.
  • the format corresponding to the pull data request is “successful pull” format
  • the return data corresponding to the determined interface is found, and determined.
  • the format of the returned data corresponding to the predetermined pull data request is in the format of "successfully pulled”.
  • the found return data is further encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the to-be-tested application.
  • the returned data corresponding to the extracted pull data request may be encapsulated according to the determined “successful pull” format to generate the first package data corresponding to the pull data request, and the generated first package data is returned to The APP to be tested.
  • the sent data sent by the analyzed destination server to the first preset type request is sent to the Test APP.
  • the APP to be tested to obtain the return data fed back by the destination server for the pull data request, and to test whether the APP to be tested has a bug based on the pull data request and the returned data, such as the format of the returned data. Errors, content, etc., and repair and eliminate bugs during development.
  • the third embodiment of the present invention provides a request processing server for performing a simulation test in an application development process.
  • the method further includes:
  • the second preset type request may be sent to the preset request processing server, for example, the second preset type request may be For the post request, that is, the data request is changed, the second preset type request includes the destination server parameter corresponding to the change data request.
  • the request processing server may determine the interface document of the APP to be tested that is configured on the request processing server. The second interface corresponding to the second preset type request, that is, the interface corresponding to the data request is changed.
  • the second sending module 08 is configured to: if the determined current switch state of the second interface is the off state, analyze the destination server corresponding to the destination server parameter in the second preset type request, The second preset type request is sent to the analyzed destination server, and the returned data corresponding to the second preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the to-be-tested application.
  • the second preset type corresponding to the data request is changed to the open state or the closed state. Test the returned data separately.
  • the second preset type request issued by the APP to be tested such as changing the data request, obtaining the return data from the corresponding second interface or destination server and testing, realizing the background data interface development in the application development process.
  • the returned background data is tested, which avoids the need for the application to be tested again due to the loopback caused by the back-end data after the development is completed, which effectively improves the accuracy and efficiency of the application development.
  • the simulation test device in the embodiment of the present invention may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
  • PC Personal Computer
  • terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
  • the device includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, SD or DX memory, etc.), a random access memory (RAM), and a static memory.
  • the memory 11 may be an internal storage unit of a simulated test device, such as a hard disk of the simulated test device, in some embodiments.
  • the memory 11 may also be an external storage device of the analog test device in other embodiments, such as a plug-in hard disk equipped on the analog test device, a smart memory card (SMC), and a secure digital (SD). Card, flash card Wait.
  • the memory 11 may also include both an internal storage unit of the analog test device and an external storage device.
  • the memory 11 can be used not only for storing application software installed in an analog test device and various types of data, such as code for simulating a test program, but also for temporarily storing data that has been output or will be output.
  • the processor 12 in some embodiments, may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as executing a simulation test program.
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • Data such as executing a simulation test program.
  • the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a wireless interface such as a WI-FI interface
  • the device can establish a network connection with the development terminal via the network interface 14.
  • Figure 10 shows only the simulated test equipment with components 11-14 and the simulated test program, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the device may further include a user interface
  • the user interface may include a display
  • an input unit such as a keyboard
  • the optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display may also be suitably referred to as a display screen or display unit for displaying information processed in the simulated test equipment and a user interface for displaying the visualization.
  • the simulation test program is stored in the memory 11; wherein the network interface 14 is used for communication connection with the development end to receive the first server parameter with the destination server sent by the application under test at the development end.
  • a preset type request when the processor 12 executes the simulation test program stored in the memory 11, implements the following steps:
  • the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
  • the determined return data corresponding to the first interface is found, and the first pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data.
  • the first format of the returned data corresponding to the type request is set, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the application to be tested.
  • processor is further configured to execute the simulation test program to implement the following steps:
  • the destination server corresponding to the destination server parameter in the first preset type request is analyzed, and the first preset type request is sent. And sending the returned data corresponding to the first preset type request from the analyzed destination server, and sending the obtained return data to the to-be-tested application.
  • the second interface corresponding to the second preset type request is determined according to the interface document of the application to be tested;
  • the determined return data corresponding to the second interface is found, and the second pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data.
  • the second format of the returned data corresponding to the type request is performed, and the found return data is encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the application to be tested.
  • processor is further configured to execute the simulation test program to implement the following steps:
  • the destination server corresponding to the destination server parameter in the second preset type request is analyzed, and the second preset type request is sent to the analyzed destination.
  • the server obtains the return data corresponding to the second preset type request from the analyzed destination server, and sends the obtained return data to the application to be tested.
  • the present invention also provides a computer readable storage medium having an emulation test program stored thereon, the emulation test program being executed by the processor to implement the following steps:
  • the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
  • the second interface corresponding to the second preset type request is determined according to the interface document of the application to be tested;
  • the determined return data corresponding to the second interface is found, and the second pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data.
  • the second format of the returned data corresponding to the type request is performed, and the found return data is encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the application to be tested.
  • the first preset type request is a pull data request
  • the first interface is a corresponding interface for the pull data request
  • the second preset type request is a change data request
  • the second The interface is the corresponding interface for the change data request.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • a storage medium such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

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

Abstract

A simulation test method in an application program development process, comprising: after a request processing server receives a first pre-set type request sent by an application program to be tested of a development terminal, determining a first interface corresponding to the first pre-set type request according to an interface document of the application program to be tested; analysing a current switch state of the first interface; and if the current switch state is an on state, finding returned data corresponding to the first interface, determining a first format of the returned data corresponding to the first pre-set type request according to a mapping relationship between a pre-determined request type and the format of the returned data, packaging the returned data in accordance with the first format, and returning the generated first packaged data to the application program to be tested. The method effectively improves development accuracy and efficiency of an application program.

Description

模拟测试方法、服务器、设备及计算机可读存储介质Analog test method, server, device, and computer readable storage medium
优先权申明Priority claim
本申请基于巴黎公约申明享有2016年8月22日递交的申请号为CN201610704675.3、名称为“应用程序开发过程中的模拟测试方法及服务器”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。The present application is based on the priority of a Chinese patent application filed on August 22, 2016, filed on Aug. 22, 2016, entitled "Analog Test Method and Server in Application Development Process", which is filed on August 22, 2016. The entire content is incorporated herein by reference.
技术领域Technical field
本发明涉及软件开发技术领域,尤其涉及一种模拟测试方法、服务器、设备及计算机可读存储介质。The present invention relates to the field of software development technologies, and in particular, to a simulation test method, a server, a device, and a computer readable storage medium.
背景技术Background technique
目前,在应用程序App开发过程中,通常要在后台数据接口开发完成之后,才能获取返回的后台数据及对后台数据返回造成的bug进行测试,这就导致后台数据返回造成的bug难以在后台数据接口开发完成之前被发现并修补,造成App在开发完成后可能由于存在漏洞需要再次开发,从而导致开发资源的浪费和开发进度的拖延。At present, in the development process of the application app, it is usually necessary to obtain the returned background data and the bug caused by the return of the background data after the background data interface is developed, which causes the bug caused by the return of the background data to be difficult in the background data. Interfaces were discovered and patched before development was completed, causing the App to be re-developed due to vulnerabilities after development, resulting in waste of development resources and delays in development.
发明内容Summary of the invention
本发明的主要目的在于提供一种模拟测试方法、服务器、设备及计算机可读存储介质,在应用程序开发过程中后台数据接口开发完成之前,对返回的后台数据进行测试,提升应用程序开发的准确度及效率。The main object of the present invention is to provide a simulation test method, a server, a device, and a computer readable storage medium. Before the background data interface is developed in the application development process, the returned background data is tested to improve the accuracy of application development. Degree and efficiency.
为实现上述目的,本发明提供的一种应用程序开发过程中的模拟测试方法,所述方法包括以下步骤:To achieve the above objective, the present invention provides a simulation test method in an application development process, the method comprising the following steps:
请求处理服务器收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the request processing server determines, according to the interface document of the application to be tested, the first corresponding to the first preset type request. interface;
所述请求处理服务器分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;The request processing server analyzes the determined current switch state of the first interface, where the switch state includes an open state and an off state;
若确定的第一接口的当前开关状态为开状态,则所述请求处理服务器找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be an open state, the request processing server finds the determined return data corresponding to the first interface, and determines according to a mapping relationship between the predetermined request type and the format of the returned data. The first preset type requests a first format of the returned data, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the Application to be tested.
此外,为实现上述目的,本发明还提供一种用于在应用程序开发过程中进行模拟测试的请求处理服务器,所述请求处理服务器包括:In addition, in order to achieve the above object, the present invention also provides a request processing server for performing a simulation test in an application development process, the request processing server comprising:
第一确定模块,用于收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第 一预设类型请求对应的第一接口;a first determining module, configured to: after receiving the first preset type request with the destination server parameter sent by the application to be tested at the development end, determining the first according to the interface document of the application to be tested a preset interface corresponding to the first interface;
第一分析模块,用于分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;a first analysis module, configured to analyze a current switch state of the determined first interface, where the switch state includes an open state and an off state;
第一返回模块,用于若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。The first returning module is configured to: if the determined current switch state of the first interface is the open state, find the return data corresponding to the determined first interface, according to a mapping relationship between the predetermined request type and the format of the returned data Determining a first format of the returned data corresponding to the first preset type request, and encapsulating the found return data according to the determined first format to generate first encapsulated data, and returning the generated first encapsulated data to The application to be tested.
此外,为实现上述目的,本发明还提出一种用于在应用程序开发过程中进行模拟测试的请求处理设备,所述请求处理设备包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的模拟测试程序,所述模拟测试程序被所述处理器执行时实现如下步骤:Furthermore, in order to achieve the above object, the present invention also provides a request processing device for performing a simulation test in an application development process, the request processing device including a memory, a processor, and a memory stored in the memory and A simulation test program running on the processor, the simulation test program being executed by the processor to implement the following steps:
接收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined first interface, the switch state including an open state and an off state;
若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be the open state, the determined return data corresponding to the first interface is found, and the first pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The first format of the returned data corresponding to the type request is set, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the application to be tested.
此外,为实现上述目的,本发明还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有模拟测试程序,所述模拟测试程序被处理器执行时实现如下步骤:In addition, in order to achieve the above object, the present invention further provides a computer readable storage medium, where the simulation test program is stored, and when the simulation test program is executed by the processor, the following steps are implemented:
接收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined first interface, the switch state including an open state and an off state;
若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be the open state, the determined return data corresponding to the first interface is found, and the first pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The first format of the returned data corresponding to the type request is set, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the application to be tested.
本发明提出的一种模拟测试方法、服务器、设备及计算机可读存储介质,请求处理服务器在收到开发端的待测应用程序发送的第一预设类型请求后, 根据保存在该请求处理服务器上的所述待测应用程序的接口文档来确定所述第一预设类型请求对应的第一接口,并在分析该第一接口的当前开关状态为开状态时,找出该第一接口对应的返回数据,对返回数据按相应格式进行封装后返回给所述待测应用程序。由于开发端的待测应用程序只需发送第一预设类型请求,即可收到由请求处理服务器发送的返回数据进行测试,无需后台数据接口开发完成就能在开发过程中进行待测应用程序的后台返回数据测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。The present invention provides a simulation test method, a server, a device, and a computer readable storage medium. After receiving a first preset type request sent by the application under test at the development end, the request processing server Determining, by the interface document of the application to be tested, the first interface corresponding to the first preset type request, and analyzing the current switch state of the first interface to an open state, The return data corresponding to the first interface is found, and the returned data is encapsulated in a corresponding format and returned to the application to be tested. Since the application to be tested at the development end only needs to send the first preset type request, the return data sent by the request processing server can be received for testing, and the application to be tested can be performed in the development process without the development of the background data interface. Back-end data testing in the background avoids the need for re-development of the application under test due to loopbacks caused by background data, which effectively improves the accuracy and efficiency of application development.
附图说明DRAWINGS
图1为本发明应用程序开发过程中的模拟测试系统一实施例的系统架构图;1 is a system architecture diagram of an embodiment of an analog test system in an application development process of the present invention;
图2为本发明应用程序开发过程中的模拟测试方法第一实施例的流程示意图;2 is a schematic flow chart of a first embodiment of a simulation test method in an application development process of the present invention;
图3为本发明应用程序开发过程中的模拟测试方法第二实施例的流程示意图;3 is a schematic flow chart of a second embodiment of a simulation test method in an application development process of the present invention;
图4为本发明应用程序开发过程中的模拟测试方法第三实施例的流程示意图;4 is a schematic flow chart of a third embodiment of a simulation test method in an application development process of the present invention;
图5为本发明应用程序开发过程中的模拟测试方法第四实施例的流程示意图;FIG. 5 is a schematic flowchart diagram of a fourth embodiment of a simulation test method in an application development process according to the present invention; FIG.
图6为本发明用于在应用程序开发过程中进行模拟测试的请求处理服务器第一实施例的功能模块示意图;6 is a schematic diagram of functional modules of a first embodiment of a request processing server for performing simulation testing in an application development process;
图7为本发明用于在应用程序开发过程中进行模拟测试的请求处理服务器第二实施例的功能模块示意图;7 is a schematic diagram of functional modules of a second embodiment of a request processing server for performing simulation testing in an application development process;
图8为本发明用于在应用程序开发过程中进行模拟测试的请求处理服务器第三实施例的功能模块示意图;8 is a schematic diagram of functional modules of a third embodiment of a request processing server for performing simulation testing in an application development process according to the present invention;
图9为本发明用于在应用程序开发过程中进行模拟测试的请求处理服务器第四实施例的功能模块示意图;9 is a schematic diagram of functional modules of a fourth embodiment of a request processing server for performing simulation testing in an application development process;
图10为本发明实施例模拟测试设备的硬件结构框图。FIG. 10 is a block diagram showing the hardware structure of a simulation test device according to an embodiment of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种应用程序开发过程中的模拟测试系统,参照图1,图1为本发明应用程序开发过程中的模拟测试系统一实施例的系统架构图。该模拟测试系统包括开发端1、请求处理服务器2及目的服务器3。在应用程序开发 过程中,开发端1或者其他任意使用的参数配置端可以登录请求处理服务器2获取用于参数配置的web页,通过所述web页,开发端1的用户可以为待测应用程序APP的接口文档中的所有接口配置目的服务器3参数、返回数据和开关状态,并将配置好接口的接口文档保存于请求处理服务器2。其中,所述web页包括待测APP的各个接口对应的当前配置好的目的服务器3参数、返回数据和开关状态信息,开发端1的用户可经由所述web页动态修改待测APP的各个接口对应的当前配置好的目的服务器3参数、返回数据及/或开关状态信息,以便待测APP进行各种模拟mock测试,如返回数据的测试等。开发端1的用户可经由所述web页动态修改待测APP的各个接口对应的开关状态信息,例如,若X接口的当前开关状态为开状态,通过所述web页,可以将X接口的开关状态修改为关状态。The present invention provides a simulation test system in an application development process. Referring to FIG. 1, FIG. 1 is a system architecture diagram of an embodiment of an analog test system in an application development process of the present invention. The simulation test system includes a development terminal 1, a request processing server 2, and a destination server 3. In application development In the process, the development terminal 1 or any other parameter configuration terminal that is used arbitrarily can log in to the request processing server 2 to obtain a web page for parameter configuration. Through the web page, the user of the development terminal 1 can be an interface document of the application APP to be tested. All the interfaces in the configuration configure the destination server 3 parameters, the return data, and the switch state, and save the interface document of the configured interface to the request processing server 2. The web page includes the currently configured destination server 3 parameters, return data, and switch state information corresponding to the interfaces of the APP to be tested, and the user of the development terminal 1 can dynamically modify each interface of the APP to be tested via the web page. Corresponding currently configured destination server 3 parameters, return data and/or switch status information, so that the APP to be tested performs various simulated mock tests, such as return data testing. The user of the development terminal 1 can dynamically modify the switch state information corresponding to each interface of the APP to be tested via the web page. For example, if the current switch state of the X interface is an open state, the X interface can be switched through the web page. The status is changed to the off state.
基于上述应用程序开发过程中的模拟测试系统,本发明还提供一种应用程序开发过程中的模拟测试方法。参照图2,图2为本发明应用程序开发过程中的模拟测试方法第一实施例的流程示意图。Based on the above simulation test system in the application development process, the present invention also provides a simulation test method in the application development process. Referring to FIG. 2, FIG. 2 is a schematic flowchart diagram of a first embodiment of a simulation test method in an application development process according to the present invention.
在第一实施例中,该应用程序开发过程中的模拟测试方法包括:In the first embodiment, the simulation test method in the application development process includes:
步骤S10,请求处理服务器收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;In step S10, after the request processing server receives the first preset type request with the destination server parameter sent by the application to be tested at the development end, the request processing server determines that the first preset type request corresponds to the interface document of the application to be tested. First interface;
本实施例中,开发端的待测应用程序APP在开发过程中需要进行后台数据返回的测试时,可向预设的请求处理服务器发送第一预设类型请求,如该第一预设类型请求可以为get请求,即拉取数据请求,该第一预设类型请求中包括拉取数据请求对应的目的服务器参数。请求处理服务器收到开发端的待测APP发送的带有目的服务器参数的第一预设类型请求之后,可根据保存在所述请求处理服务器上已配置好的该待测APP的接口文档来确定所述第一预设类型请求对应的第一接口,也即拉取数据请求对应的接口。In this embodiment, when the application to be tested of the development end needs to perform the test of returning the background data during the development process, the first preset type request may be sent to the preset request processing server, for example, the first preset type request may be For the get request, that is, the pull data request, the first preset type request includes the destination server parameter corresponding to the pull data request. After the request processing server receives the first preset type request with the destination server parameter sent by the APP to be tested at the development end, the request processing server may determine the interface document of the APP to be tested that is configured on the request processing server. The first interface corresponding to the first preset type request, that is, the interface corresponding to the pull data request.
步骤S20,所述请求处理服务器分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;Step S20, the request processing server analyzes the current switch state of the determined first interface, where the switch state includes an open state and an off state;
所述请求处理服务器根据已配置好的该待测APP的接口文档对所述第一预设类型请求对应的第一接口的当前开关状态进行分析,判断所述第一预设类型请求对应的第一接口的当前开关状态是开状态或关状态。The request processing server analyzes the current switch state of the first interface corresponding to the first preset type request according to the configured interface document of the APP to be tested, and determines that the first preset type request corresponds to the first The current switch state of an interface is either the on state or the off state.
步骤S30,若确定的第一接口的当前开关状态为开状态,则所述请求处理服务器找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。Step S30, if the determined current switch state of the first interface is the open state, the request processing server finds the determined return data corresponding to the first interface, and maps according to the predetermined request type and the format of the returned data. a relationship, determining a first format of the returned data corresponding to the first preset type request, and encapsulating the found return data according to the determined first format to generate first encapsulated data, and returning the generated first encapsulated data Give the application under test.
若分析所述第一预设类型请求对应的第一接口的当前开关状态是开状态,说明可直接从所述第一预设类型请求对应的第一接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档找出确定的第一 接口所对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式。例如,拉取数据请求对应的格式为“成功拉取”格式,则在分析该拉取数据请求对应的接口的当前开关状态是开状态时,找出确定的接口所对应的返回数据,并确定预先确定的拉取数据请求对应的返回数据的格式如“成功拉取”格式。再将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。如可将找出的拉取数据请求对应的返回数据按照确定的“成功拉取”格式进行封装以生成该拉取数据请求所对应的第一封装数据,并将生成的第一封装数据返回给所述待测APP。以供所述待测APP获取针对其发出的拉取数据请求所返回的第一封装数据,并基于拉取数据请求及返回的对应第一封装数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。If it is analyzed that the current switch state of the first interface corresponding to the first preset type request is an open state, the description may directly obtain return data from the first interface corresponding to the first preset type request. And the request processing server finds the first determined according to the configured interface document of the APP to be tested. The return data corresponding to the interface determines a first format of the returned data corresponding to the first preset type request according to a mapping relationship between the predetermined request type and the format of the returned data. For example, if the format corresponding to the pull data request is “successful pull” format, when the current switch state of the interface corresponding to the pull data request is analyzed to be the open state, the return data corresponding to the determined interface is found, and determined. The format of the returned data corresponding to the predetermined pull data request is in the format of "successfully pulled". The found return data is further encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the to-be-tested application. For example, the returned data corresponding to the extracted pull data request may be encapsulated according to the determined “successful pull” format to generate the first package data corresponding to the pull data request, and the generated first package data is returned to The APP to be tested. And the first package data returned by the APP to be tested for obtaining the pull data request issued by the APP, and testing whether the APP to be tested has a bug based on the pull data request and the returned corresponding first package data, such as returning Errors in the format, content, etc. of the data, and repair and eliminate bugs during the development process.
本实施例中请求处理服务器在收到开发端的待测应用程序发送的第一预设类型请求后,根据保存在该请求处理服务器上的所述待测应用程序的接口文档来确定所述第一预设类型请求对应的第一接口,并在分析该第一接口的当前开关状态为开状态时,找出该第一接口对应的返回数据,对返回数据按相应格式进行封装后返回给所述待测应用程序。由于开发端的待测应用程序只需发送第一预设类型请求,即可收到由请求处理服务器发送的返回数据进行测试,无需后台数据接口开发完成就能在开发过程中进行待测应用程序的后台返回数据测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after receiving the first preset type request sent by the application to be tested at the development end, the request processing server determines the first according to the interface document of the application to be tested stored on the request processing server. The preset type requests the corresponding first interface, and when the current switch state of the first interface is analyzed, the return data corresponding to the first interface is found, and the returned data is encapsulated in a corresponding format and then returned to the Application to be tested. Since the application to be tested at the development end only needs to send the first preset type request, the return data sent by the request processing server can be received for testing, and the application to be tested can be performed in the development process without the development of the background data interface. Back-end data testing in the background avoids the need for re-development of the application under test due to loopbacks caused by background data, which effectively improves the accuracy and efficiency of application development.
进一步地,如图3所示,本发明第二实施例提出一种应用程序开发过程中的模拟测试方法,在上述实施例的基础上,还包括:Further, as shown in FIG. 3, the second embodiment of the present invention provides a simulation test method in an application development process. On the basis of the foregoing embodiments, the method further includes:
步骤S40,若确定的第一接口的当前开关状态为关状态,则所述请求处理服务器分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。Step S40: If the current switch state of the first interface is determined to be off, the request processing server analyzes the destination server corresponding to the destination server parameter in the first preset type request, and the first preset is The type request is sent to the analyzed destination server, and the returned data corresponding to the first preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the application to be tested.
本实施例中,若分析所述第一预设类型请求对应的第一接口的当前开关状态是关状态,说明无法直接从所述第一预设类型请求对应的第一接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档获取为所述第一预设类型请求对应的第一接口所配置好的目的服务器参数,并分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器。将所述第一预设类型请求发送给分析出的目的服务器,以将该待测APP的第一预设类型请求如拉取数据请求成功转发至该拉取数据请求所对应的目的服务 器。所述请求处理服务器获取到分析出的目的服务器针对所述第一预设类型请求反馈的返回数据后,将分析出的目的服务器针对所述第一预设类型请求反馈的返回数据发送给该待测APP。以供所述待测APP获取目的服务器针对其发出的拉取数据请求所反馈的返回数据,并基于拉取数据请求及反馈的返回数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。In this embodiment, if the current switch state of the first interface corresponding to the first preset type request is an off state, the first interface that is corresponding to the first preset type request cannot obtain the return data. And the request processing server obtains the destination server parameter configured for the first interface corresponding to the first preset type request, and analyzes the first preset according to the configured interface document of the APP to be tested. The destination server corresponding to the destination server parameter in the type request. Sending the first preset type request to the analyzed destination server, so as to successfully forward the first preset type request of the APP to be tested, such as the pull data request, to the destination service corresponding to the pull data request Device. After the request processing server obtains the returned data that is sent back by the analyzed destination server for the first preset type, the sent data sent by the analyzed destination server to the first preset type request is sent to the Test APP. For the APP to be tested to obtain the return data fed back by the destination server for the pull data request, and to test whether the APP to be tested has a bug based on the pull data request and the returned data, such as the format of the returned data. Errors, content, etc., and repair and eliminate bugs during development.
本实施例在开发端的待测APP发出第一预设类型请求如拉取数据请求后,针对所述第一预设类型请求如拉取数据请求对应的第一接口为开状态或关状态这两种情况分别进行返回数据的测试。在开发过程中针对由待测APP发出的第一预设类型请求如拉取数据请求,从对应的第一接口或目的服务器获取返回数据并进行测试,实现了在应用程序开发过程中后台数据接口开发完成之前对返回的后台数据进行测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after the first test type request, such as the pull data request, is sent by the APP to be tested at the development end, the first interface corresponding to the pull request is requested to be the open state or the closed state. In each case, the test of the returned data is performed. In the development process, for the first preset type request issued by the APP to be tested, such as pulling data request, obtaining return data from the corresponding first interface or destination server and performing testing, realizing the background data interface in the application development process Before the development is completed, the returned background data is tested, which avoids the situation that the application to be tested may need to be redeveloped due to the loopback caused by the back-end data after the development is completed, which effectively improves the accuracy and efficiency of the application development.
进一步地,如图4所示,本发明第三实施例提出一种应用程序开发过程中的模拟测试方法,在上述实施例的基础上,还包括:Further, as shown in FIG. 4, a third embodiment of the present invention provides a simulation test method in an application development process. On the basis of the foregoing embodiments, the method further includes:
步骤S50,所述请求处理服务器收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;Step S50, after the request processing server receives the second preset type request with the destination server parameter sent by the application to be tested at the development end, determining the second preset type according to the interface document of the application to be tested. Requesting a corresponding second interface;
本实施例中,开发端的待测应用程序APP在开发过程中需要进行后台数据返回的测试时,可向预设的请求处理服务器发送第二预设类型请求,如该第二预设类型请求可以为post请求,即更改数据请求,该第二预设类型请求中包括更改数据请求对应的目的服务器参数。请求处理服务器收到开发端的待测APP发送的带有目的服务器参数的第二预设类型请求之后,可根据保存在所述请求处理服务器上已配置好的该待测APP的接口文档来确定所述第二预设类型请求对应的第二接口,也即更改数据请求对应的接口。In this embodiment, when the application to be tested of the development end needs to perform the test of returning the background data during the development process, the second preset type request may be sent to the preset request processing server, for example, the second preset type request may be For the post request, that is, the data request is changed, the second preset type request includes the destination server parameter corresponding to the change data request. After the request processing server receives the second preset type request with the destination server parameter sent by the APP to be tested at the development end, the request processing server may determine the interface document of the APP to be tested that is configured on the request processing server. The second interface corresponding to the second preset type request, that is, the interface corresponding to the data request is changed.
步骤S60,所述请求处理服务器分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;Step S60, the request processing server analyzes the current switch state of the determined second interface, where the switch state includes an open state and an off state;
所述请求处理服务器根据已配置好的该待测APP的接口文档对所述第二预设类型请求对应的第二接口的当前开关状态进行分析,判断所述第二预设类型请求对应的第二接口的当前开关状态是开状态或关状态。The request processing server analyzes the current switch state of the second interface corresponding to the second preset type request according to the configured interface document of the APP to be tested, and determines that the second preset type request corresponds to the first The current switch state of the two interfaces is the open state or the closed state.
步骤S70,若确定的第二接口的当前开关状态为开状态,则所述请求处理服务器找出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。Step S70: If the determined current switch state of the second interface is the open state, the request processing server finds the determined return data corresponding to the second interface, and maps according to the predetermined request type and the format of the returned data. a relationship, determining a second format of the return data corresponding to the second preset type request, encapsulating the found return data according to the determined second format to generate second encapsulated data, and returning the generated second encapsulated data Give the application under test.
若分析所述第二预设类型请求对应的第二接口的当前开关状态是开状 态,说明可直接从所述第二预设类型请求对应的第二接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档找出确定的第二接口所对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式。例如,更改数据请求对应的格式为“成功更改”格式,则在分析该更改数据请求对应的接口的当前开关状态是开状态时,找出确定的接口所对应的返回数据,并确定预先确定的更改数据请求对应的返回数据的格式如“成功更改”格式。再将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。如可将找出的更改数据请求对应的返回数据按照确定的“成功更改”格式进行封装以生成该更改数据请求所对应的第二封装数据,并将生成的第二封装数据返回给所述待测APP。以供所述待测APP获取针对其发出的更改数据请求所返回的第二封装数据,并基于更改数据请求及返回的对应第二封装数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。If the current switch state of the second interface corresponding to the second preset type request is analyzed, The state indicates that the return data can be directly obtained from the second interface corresponding to the second preset type request. And the request processing server finds the returned data corresponding to the determined second interface according to the configured interface document of the APP to be tested, and determines the mapping according to the mapping relationship between the predetermined request type and the format of the returned data. The second format of the returned data corresponding to the second preset type request. For example, if the format corresponding to the change data request is the “successful change” format, when the current switch state of the interface corresponding to the change data request is analyzed to be the open state, the return data corresponding to the determined interface is found, and the predetermined one is determined. Change the format of the returned data corresponding to the data request as the "successful change" format. The found return data is further encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the to-be-tested application. For example, the returned data corresponding to the found change data request may be encapsulated according to the determined “successful change” format to generate second package data corresponding to the change data request, and the generated second package data is returned to the to-be-processed data. Test APP. And the second package data returned by the APP to be tested for obtaining the change data request issued by the APP, and testing whether the APP to be tested has a bug based on the change data request and the returned second package data, such as returning data. Errors in format, content, etc., and fix and eliminate bugs during development.
本实施例中请求处理服务器在收到开发端的待测应用程序发送的第二预设类型请求后,根据保存在该请求处理服务器上的所述待测应用程序的接口文档来确定所述第二预设类型请求对应的第二接口,并在分析该第二接口的当前开关状态为开状态时,找出该第二接口对应的返回数据,对返回数据按相应格式进行封装后返回给所述待测应用程序。由于开发端的待测应用程序只需发送第二预设类型请求,即可收到由请求处理服务器发送的返回数据进行测试,无需后台数据接口开发完成就能在开发过程中进行待测应用程序的后台返回数据测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after receiving the second preset type request sent by the application to be tested at the development end, the request processing server determines the second according to the interface document of the application to be tested saved on the request processing server. The preset type requests the corresponding second interface, and when the current switch state of the second interface is analyzed, the return data corresponding to the second interface is found, and the returned data is encapsulated in a corresponding format and then returned to the Application to be tested. Since the application to be tested at the development end only needs to send the second preset type request, the returned data sent by the request processing server can be received for testing, and the application to be tested can be performed in the development process without the development of the background data interface. Back-end data testing in the background avoids the need for re-development of the application under test due to loopbacks caused by background data, which effectively improves the accuracy and efficiency of application development.
进一步地,如图5所示,本发明第四实施例提出一种应用程序开发过程中的模拟测试方法,在上述实施例的基础上,还包括:Further, as shown in FIG. 5, the fourth embodiment of the present invention provides a simulation test method in the process of application development. Based on the foregoing embodiments, the method further includes:
步骤S80,若确定的第二接口的当前开关状态为关状态,则所述请求处理服务器分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。In step S80, if the current switch state of the second interface is determined to be off, the request processing server analyzes the destination server corresponding to the destination server parameter in the second preset type request, and the second preset is The type request is sent to the analyzed destination server, and the returned data corresponding to the second preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the application to be tested.
本实施例中,若分析所述第二预设类型请求对应的第二接口的当前开关状态是关状态,说明无法直接从所述第二预设类型请求对应的第二接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档获取为所述第二预设类型请求对应的第二接口所配置好的目的服务器参数,并分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器。将所 述第二预设类型请求发送给分析出的目的服务器,以将该待测APP的第二预设类型请求如更改数据请求成功转发至该更改数据请求所对应的目的服务器。所述请求处理服务器获取到分析出的目的服务器针对所述第二预设类型请求反馈的返回数据后,将分析出的目的服务器针对所述第二预设类型请求反馈的返回数据发送给该待测APP。以供所述待测APP获取目的服务器针对其发出的更改数据请求所反馈的返回数据,并基于更改数据请求及反馈的返回数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。In this embodiment, if the current switch state of the second interface corresponding to the second preset type request is an off state, the return data cannot be directly obtained from the second interface corresponding to the second preset type request. And the request processing server obtains the destination server parameter configured for the second interface corresponding to the second preset type request according to the configured interface document of the APP to be tested, and analyzes the second preset. The destination server corresponding to the destination server parameter in the type request. Will The second preset type request is sent to the analyzed destination server, so that the second preset type request of the APP to be tested is successfully forwarded to the destination server corresponding to the change data request. After the request processing server obtains the returned data that is sent back by the analyzed destination server for the second preset type, the sent data sent by the analyzed destination server to the second preset type request is sent to the Test APP. For the APP to be tested to obtain the return data fed back by the destination server for the change data request, and test whether the APP to be tested has a bug based on the data of the change data request and the feedback, such as the format and content of the returned data. Wait for errors, fix them in the development process and eliminate bugs.
本实施例在开发端的待测APP发出第二预设类型请求如更改数据请求后,针对所述第二预设类型请求如更改数据请求对应的第二接口为开状态或关状态这两种情况分别进行返回数据的测试。在开发过程中针对由待测APP发出的第二预设类型请求如更改数据请求,从对应的第二接口或目的服务器获取返回数据并进行测试,实现了在应用程序开发过程中后台数据接口开发完成之前对返回的后台数据进行测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after the second test type request is sent by the APP to be tested at the development end, for example, after the data request is changed, the second preset type corresponding to the data request is changed to the open state or the closed state. Test the returned data separately. In the development process, for the second preset type request issued by the APP to be tested, such as changing the data request, obtaining the return data from the corresponding second interface or destination server and testing, realizing the background data interface development in the application development process. Before the completion of the test, the returned background data is tested, which avoids the need for the application to be tested again due to the loopback caused by the back-end data after the development is completed, which effectively improves the accuracy and efficiency of the application development.
本发明进一步提供一种用于在应用程序开发过程中进行模拟测试的请求处理服务器。The present invention further provides a request processing server for performing simulation testing during application development.
参照图6,图6为本发明用于在应用程序开发过程中进行模拟测试的请求处理服务器第一实施例的功能模块示意图。Referring to FIG. 6, FIG. 6 is a schematic diagram of functional modules of a first embodiment of a request processing server for performing simulation testing in an application development process.
在第一实施例中,该用于在应用程序开发过程中进行模拟测试的请求处理服务器包括:In the first embodiment, the request processing server for performing the simulation test during the application development process includes:
第一确定模块01,用于收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;The first determining module 01 is configured to: after receiving the first preset type request with the destination server parameter sent by the application to be tested at the development end, determine the first preset type according to the interface document of the application to be tested Requesting a corresponding first interface;
本实施例中,开发端的待测应用程序APP在开发过程中需要进行后台数据返回的测试时,可向预设的请求处理服务器发送第一预设类型请求,如该第一预设类型请求可以为get请求,即拉取数据请求,该第一预设类型请求中包括拉取数据请求对应的目的服务器参数。请求处理服务器收到开发端的待测APP发送的带有目的服务器参数的第一预设类型请求之后,可根据保存在所述请求处理服务器上已配置好的该待测APP的接口文档来确定所述第一预设类型请求对应的第一接口,也即拉取数据请求对应的接口。In this embodiment, when the application to be tested of the development end needs to perform the test of returning the background data during the development process, the first preset type request may be sent to the preset request processing server, for example, the first preset type request may be For the get request, that is, the pull data request, the first preset type request includes the destination server parameter corresponding to the pull data request. After the request processing server receives the first preset type request with the destination server parameter sent by the APP to be tested at the development end, the request processing server may determine the interface document of the APP to be tested that is configured on the request processing server. The first interface corresponding to the first preset type request, that is, the interface corresponding to the pull data request.
第一分析模块02,用于分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;a first analysis module 02, configured to analyze a current switch state of the determined first interface, where the switch state includes an open state and an off state;
所述请求处理服务器根据已配置好的该待测APP的接口文档对所述第一预设类型请求对应的第一接口的当前开关状态进行分析,判断所述第一预设类型请求对应的第一接口的当前开关状态是开状态或关状态。 The request processing server analyzes the current switch state of the first interface corresponding to the first preset type request according to the configured interface document of the APP to be tested, and determines that the first preset type request corresponds to the first The current switch state of an interface is either the on state or the off state.
第一返回模块03,用于若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。The first returning module 03 is configured to: if the determined current switch state of the first interface is the open state, find the return data corresponding to the determined first interface, according to a mapping between the predetermined request type and the format of the returned data. a relationship, determining a first format of the returned data corresponding to the first preset type request, and encapsulating the found return data according to the determined first format to generate first encapsulated data, and returning the generated first encapsulated data Give the application under test.
若分析所述第一预设类型请求对应的第一接口的当前开关状态是开状态,说明可直接从所述第一预设类型请求对应的第一接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档找出确定的第一接口所对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式。例如,拉取数据请求对应的格式为“成功拉取”格式,则在分析该拉取数据请求对应的接口的当前开关状态是开状态时,找出确定的接口所对应的返回数据,并确定预先确定的拉取数据请求对应的返回数据的格式如“成功拉取”格式。再将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。如可将找出的拉取数据请求对应的返回数据按照确定的“成功拉取”格式进行封装以生成该拉取数据请求所对应的第一封装数据,并将生成的第一封装数据返回给所述待测APP。以供所述待测APP获取针对其发出的拉取数据请求所返回的第一封装数据,并基于拉取数据请求及返回的对应第一封装数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。If it is analyzed that the current switch state of the first interface corresponding to the first preset type request is an open state, the description may directly obtain return data from the first interface corresponding to the first preset type request. And the request processing server finds the returned data corresponding to the determined first interface according to the configured interface document of the APP to be tested, and determines the mapping relationship between the predetermined request type and the format of the returned data according to the mapping relationship between the determined request type and the format of the returned data. The first format of the returned data corresponding to the first preset type request. For example, if the format corresponding to the pull data request is “successful pull” format, when the current switch state of the interface corresponding to the pull data request is analyzed to be the open state, the return data corresponding to the determined interface is found, and determined. The format of the returned data corresponding to the predetermined pull data request is in the format of "successfully pulled". The found return data is further encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the to-be-tested application. For example, the returned data corresponding to the extracted pull data request may be encapsulated according to the determined “successful pull” format to generate the first package data corresponding to the pull data request, and the generated first package data is returned to The APP to be tested. And the first package data returned by the APP to be tested for obtaining the pull data request issued by the APP, and testing whether the APP to be tested has a bug based on the pull data request and the returned corresponding first package data, such as returning Errors in the format, content, etc. of the data, and repair and eliminate bugs during the development process.
本实施例中请求处理服务器在收到开发端的待测应用程序发送的第一预设类型请求后,根据保存在该请求处理服务器上的所述待测应用程序的接口文档来确定所述第一预设类型请求对应的第一接口,并在分析该第一接口的当前开关状态为开状态时,找出该第一接口对应的返回数据,对返回数据按相应格式进行封装后返回给所述待测应用程序。由于开发端的待测应用程序只需发送第一预设类型请求,即可收到由请求处理服务器发送的返回数据进行测试,无需后台数据接口开发完成就能在开发过程中进行待测应用程序的后台返回数据测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after receiving the first preset type request sent by the application to be tested at the development end, the request processing server determines the first according to the interface document of the application to be tested stored on the request processing server. The preset type requests the corresponding first interface, and when the current switch state of the first interface is analyzed, the return data corresponding to the first interface is found, and the returned data is encapsulated in a corresponding format and then returned to the Application to be tested. Since the application to be tested at the development end only needs to send the first preset type request, the return data sent by the request processing server can be received for testing, and the application to be tested can be performed in the development process without the development of the background data interface. Back-end data testing in the background avoids the need for re-development of the application under test due to loopbacks caused by background data, which effectively improves the accuracy and efficiency of application development.
进一步地,如图7所示,本发明第二实施例提出一种用于在应用程序开发过程中进行模拟测试的请求处理服务器,在上述实施例的基础上,还包括:Further, as shown in FIG. 7, the second embodiment of the present invention provides a request processing server for performing a simulation test in an application development process. On the basis of the foregoing embodiments, the method further includes:
第一发送模块04,用于若确定的第一接口的当前开关状态为关状态,则分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请求对应的返回数据,并将获取的返回数据发送给所述 待测应用程序。The first sending module 04 is configured to: if the current switch state of the first interface is determined to be off, analyze the destination server corresponding to the destination server parameter in the first preset type request, and set the first preset The type request is sent to the analyzed destination server, and the returned data corresponding to the first preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the Application to be tested.
本实施例中,若分析所述第一预设类型请求对应的第一接口的当前开关状态是关状态,说明无法直接从所述第一预设类型请求对应的第一接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档获取为所述第一预设类型请求对应的第一接口所配置好的目的服务器参数,并分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器。将所述第一预设类型请求发送给分析出的目的服务器,以将该待测APP的第一预设类型请求如拉取数据请求成功转发至该拉取数据请求所对应的目的服务器。所述请求处理服务器获取到分析出的目的服务器针对所述第一预设类型请求反馈的返回数据后,将分析出的目的服务器针对所述第一预设类型请求反馈的返回数据发送给该待测APP。以供所述待测APP获取目的服务器针对其发出的拉取数据请求所反馈的返回数据,并基于拉取数据请求及反馈的返回数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。In this embodiment, if the current switch state of the first interface corresponding to the first preset type request is an off state, the first interface that is corresponding to the first preset type request cannot obtain the return data. And the request processing server obtains the destination server parameter configured for the first interface corresponding to the first preset type request, and analyzes the first preset according to the configured interface document of the APP to be tested. The destination server corresponding to the destination server parameter in the type request. Sending the first preset type request to the analyzed destination server, so that the first preset type request of the APP to be tested, such as the pull data request, is successfully forwarded to the destination server corresponding to the pull data request. After the request processing server obtains the returned data that is sent back by the analyzed destination server for the first preset type, the sent data sent by the analyzed destination server to the first preset type request is sent to the Test APP. For the APP to be tested to obtain the return data fed back by the destination server for the pull data request, and to test whether the APP to be tested has a bug based on the pull data request and the returned data, such as the format of the returned data. Errors, content, etc., and repair and eliminate bugs during development.
本实施例在开发端的待测APP发出第一预设类型请求如拉取数据请求后,针对所述第一预设类型请求如拉取数据请求对应的第一接口为开状态或关状态这两种情况分别进行返回数据的测试。在开发过程中针对由待测APP发出的第一预设类型请求如拉取数据请求,从对应的第一接口或目的服务器获取返回数据并进行测试,实现了在应用程序开发过程中后台数据接口开发完成之前对返回的后台数据进行测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after the first test type request, such as the pull data request, is sent by the APP to be tested at the development end, the first interface corresponding to the pull request is requested to be the open state or the closed state. In each case, the test of the returned data is performed. In the development process, for the first preset type request issued by the APP to be tested, such as pulling data request, obtaining return data from the corresponding first interface or destination server and performing testing, realizing the background data interface in the application development process Before the development is completed, the returned background data is tested, which avoids the situation that the application to be tested may need to be redeveloped due to the loopback caused by the back-end data after the development is completed, which effectively improves the accuracy and efficiency of the application development.
进一步地,如图8所示,本发明第三实施例提出一种用于在应用程序开发过程中进行模拟测试的请求处理服务器,在上述实施例的基础上,还包括:Further, as shown in FIG. 8, the third embodiment of the present invention provides a request processing server for performing a simulation test in an application development process. On the basis of the foregoing embodiments, the method further includes:
第二确定模块05,用于收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;The second determining module 05 is configured to: after receiving the second preset type request with the destination server parameter sent by the application to be tested at the development end, determining the second preset type according to the interface document of the application to be tested Requesting a corresponding second interface;
本实施例中,开发端的待测应用程序APP在开发过程中需要进行后台数据返回的测试时,可向预设的请求处理服务器发送第二预设类型请求,如该第二预设类型请求可以为post请求,即更改数据请求,该第二预设类型请求中包括更改数据请求对应的目的服务器参数。请求处理服务器收到开发端的待测APP发送的带有目的服务器参数的第二预设类型请求之后,可根据保存在所述请求处理服务器上已配置好的该待测APP的接口文档来确定所述第二预设类型请求对应的第二接口,也即更改数据请求对应的接口。In this embodiment, when the application to be tested of the development end needs to perform the test of returning the background data during the development process, the second preset type request may be sent to the preset request processing server, for example, the second preset type request may be For the post request, that is, the data request is changed, the second preset type request includes the destination server parameter corresponding to the change data request. After the request processing server receives the second preset type request with the destination server parameter sent by the APP to be tested at the development end, the request processing server may determine the interface document of the APP to be tested that is configured on the request processing server. The second interface corresponding to the second preset type request, that is, the interface corresponding to the data request is changed.
第二分析模块06,用于分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;a second analysis module 06, configured to analyze a current switch state of the determined second interface, where the switch state includes an open state and an off state;
所述请求处理服务器根据已配置好的该待测APP的接口文档对所述第二 预设类型请求对应的第二接口的当前开关状态进行分析,判断所述第二预设类型请求对应的第二接口的当前开关状态是开状态或关状态。The request processing server pairs the second according to the interface document of the APP to be tested that has been configured The current switch state of the second interface corresponding to the preset type request is analyzed, and the current switch state of the second interface corresponding to the second preset type request is determined to be an open state or an off state.
第二返回模块07,用于若确定的第二接口的当前开关状态为开状态,则找出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。The second returning module 07 is configured to: if the determined current switch state of the second interface is the open state, find the return data corresponding to the determined second interface, according to a mapping between the predetermined request type and the format of the returned data a relationship, determining a second format of the return data corresponding to the second preset type request, encapsulating the found return data according to the determined second format to generate second encapsulated data, and returning the generated second encapsulated data Give the application under test.
若分析所述第二预设类型请求对应的第二接口的当前开关状态是开状态,说明可直接从所述第二预设类型请求对应的第二接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档找出确定的第二接口所对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式。例如,更改数据请求对应的格式为“成功更改”格式,则在分析该更改数据请求对应的接口的当前开关状态是开状态时,找出确定的接口所对应的返回数据,并确定预先确定的更改数据请求对应的返回数据的格式如“成功更改”格式。再将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。如可将找出的更改数据请求对应的返回数据按照确定的“成功更改”格式进行封装以生成该更改数据请求所对应的第二封装数据,并将生成的第二封装数据返回给所述待测APP。以供所述待测APP获取针对其发出的更改数据请求所返回的第二封装数据,并基于更改数据请求及返回的对应第二封装数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。If the current switch state of the second interface corresponding to the second preset type request is the open state, the description may directly obtain the return data from the second interface corresponding to the second preset type request. And the request processing server finds the returned data corresponding to the determined second interface according to the configured interface document of the APP to be tested, and determines the mapping according to the mapping relationship between the predetermined request type and the format of the returned data. The second format of the returned data corresponding to the second preset type request. For example, if the format corresponding to the change data request is the “successful change” format, when the current switch state of the interface corresponding to the change data request is analyzed to be the open state, the return data corresponding to the determined interface is found, and the predetermined one is determined. Change the format of the returned data corresponding to the data request as the "successful change" format. The found return data is further encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the to-be-tested application. For example, the returned data corresponding to the found change data request may be encapsulated according to the determined “successful change” format to generate second package data corresponding to the change data request, and the generated second package data is returned to the to-be-processed data. Test APP. And the second package data returned by the APP to be tested for obtaining the change data request issued by the APP, and testing whether the APP to be tested has a bug based on the change data request and the returned second package data, such as returning data. Errors in format, content, etc., and fix and eliminate bugs during development.
本实施例中请求处理服务器在收到开发端的待测应用程序发送的第二预设类型请求后,根据保存在该请求处理服务器上的所述待测应用程序的接口文档来确定所述第二预设类型请求对应的第二接口,并在分析该第二接口的当前开关状态为开状态时,找出该第二接口对应的返回数据,对返回数据按相应格式进行封装后返回给所述待测应用程序。由于开发端的待测应用程序只需发送第二预设类型请求,即可收到由请求处理服务器发送的返回数据进行测试,无需后台数据接口开发完成就能在开发过程中进行待测应用程序的后台返回数据测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after receiving the second preset type request sent by the application to be tested at the development end, the request processing server determines the second according to the interface document of the application to be tested saved on the request processing server. The preset type requests the corresponding second interface, and when the current switch state of the second interface is analyzed, the return data corresponding to the second interface is found, and the returned data is encapsulated in a corresponding format and then returned to the Application to be tested. Since the application to be tested at the development end only needs to send the second preset type request, the returned data sent by the request processing server can be received for testing, and the application to be tested can be performed in the development process without the development of the background data interface. Back-end data testing in the background avoids the need for re-development of the application under test due to loopbacks caused by background data, which effectively improves the accuracy and efficiency of application development.
进一步地,如图9所示,本发明第四实施例提出一种用于在应用程序开发过程中进行模拟测试的请求处理服务器,在上述实施例的基础上,还包括:Further, as shown in FIG. 9, the fourth embodiment of the present invention provides a request processing server for performing a simulation test in an application development process. On the basis of the foregoing embodiments, the method further includes:
第二发送模块08,用于若确定的第二接口的当前开关状态为关状态,则分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所 述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。The second sending module 08 is configured to: if the determined current switch state of the second interface is the off state, analyze the destination server corresponding to the destination server parameter in the second preset type request, The second preset type request is sent to the analyzed destination server, and the returned data corresponding to the second preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the to-be-tested application.
本实施例中,若分析所述第二预设类型请求对应的第二接口的当前开关状态是关状态,说明无法直接从所述第二预设类型请求对应的第二接口获取返回数据。则所述请求处理服务器根据已配置好的该待测APP的接口文档获取为所述第二预设类型请求对应的第二接口所配置好的目的服务器参数,并分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器。将所述第二预设类型请求发送给分析出的目的服务器,以将该待测APP的第二预设类型请求如更改数据请求成功转发至该更改数据请求所对应的目的服务器。所述请求处理服务器获取到分析出的目的服务器针对所述第二预设类型请求反馈的返回数据后,将分析出的目的服务器针对所述第二预设类型请求反馈的返回数据发送给该待测APP。以供所述待测APP获取目的服务器针对其发出的更改数据请求所反馈的返回数据,并基于更改数据请求及反馈的返回数据进行测试该待测APP是否存在bug,如返回数据的格式、内容等错误,以及时在开发过程中进行修补并消除bug。In this embodiment, if the current switch state of the second interface corresponding to the second preset type request is an off state, the return data cannot be directly obtained from the second interface corresponding to the second preset type request. And the request processing server obtains the destination server parameter configured for the second interface corresponding to the second preset type request according to the configured interface document of the APP to be tested, and analyzes the second preset. The destination server corresponding to the destination server parameter in the type request. The second preset type request is sent to the analyzed destination server, so that the second preset type request of the APP to be tested is successfully forwarded to the destination server corresponding to the change data request. After the request processing server obtains the returned data that is sent back by the analyzed destination server for the second preset type, the sent data sent by the analyzed destination server to the second preset type request is sent to the Test APP. For the APP to be tested to obtain the return data fed back by the destination server for the change data request, and test whether the APP to be tested has a bug based on the data of the change data request and the feedback, such as the format and content of the returned data. Wait for errors, fix them in the development process and eliminate bugs.
本实施例在开发端的待测APP发出第二预设类型请求如更改数据请求后,针对所述第二预设类型请求如更改数据请求对应的第二接口为开状态或关状态这两种情况分别进行返回数据的测试。在开发过程中针对由待测APP发出的第二预设类型请求如更改数据请求,从对应的第二接口或目的服务器获取返回数据并进行测试,实现了在应用程序开发过程中后台数据接口开发完成之前对返回的后台数据进行测试,避免了待测应用程序在开发完成后可能由于后台数据返回造成的漏洞而需要再次开发的情况发生,有效的提升了应用程序开发的准确度及效率。In this embodiment, after the second test type request is sent by the APP to be tested at the development end, for example, after the data request is changed, the second preset type corresponding to the data request is changed to the open state or the closed state. Test the returned data separately. In the development process, for the second preset type request issued by the APP to be tested, such as changing the data request, obtaining the return data from the corresponding second interface or destination server and testing, realizing the background data interface development in the application development process. Before the completion of the test, the returned background data is tested, which avoids the need for the application to be tested again due to the loopback caused by the back-end data after the development is completed, which effectively improves the accuracy and efficiency of the application development.
如图10所示,图10为本发明实施例模拟测试设备的硬件结构框图。As shown in FIG. 10, FIG. 10 is a block diagram showing the hardware structure of a simulation test device according to an embodiment of the present invention.
本发明实施例的模拟测试设备可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、电子书阅读器、便携计算机等终端设备。The simulation test device in the embodiment of the present invention may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
参照图10所示,该设备包括:存储器11、处理器12,通信总线13,以及网络接口14。其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。Referring to FIG. 10, the device includes a memory 11, a processor 12, a communication bus 13, and a network interface 14. The memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, SD or DX memory, etc.), a random access memory (RAM), and a static memory. Random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like.
存储器11在一些实施例中可以是模拟测试设备的内部存储单元,例如该模拟测试设备的硬盘。存储器11在另一些实施例中也可以是模拟测试设备的外部存储设备,例如模拟测试设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card) 等。进一步地,存储器11还可以既包括模拟测试设备的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于模拟测试设备的应用软件及各类数据,例如模拟测试程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 may be an internal storage unit of a simulated test device, such as a hard disk of the simulated test device, in some embodiments. The memory 11 may also be an external storage device of the analog test device in other embodiments, such as a plug-in hard disk equipped on the analog test device, a smart memory card (SMC), and a secure digital (SD). Card, flash card Wait. Further, the memory 11 may also include both an internal storage unit of the analog test device and an external storage device. The memory 11 can be used not only for storing application software installed in an analog test device and various types of data, such as code for simulating a test program, but also for temporarily storing data that has been output or will be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行模拟测试程序等。The processor 12, in some embodiments, may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as executing a simulation test program.
通信总线13用于实现这些组件之间的连接通信。 Communication bus 13 is used to implement connection communication between these components.
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该设备与其他电子设备之间建立通信连接。例如,在该实施例中,该设备可以通过网络接口14与开发端建立网络连接。The network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices. For example, in this embodiment, the device can establish a network connection with the development terminal via the network interface 14.
图10仅示出了具有组件11-14以及模拟测试程序的模拟测试设备,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Figure 10 shows only the simulated test equipment with components 11-14 and the simulated test program, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
可选地,该设备还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在模拟测试设备中处理的信息以及用于显示可视化的用户界面。Optionally, the device may further include a user interface, the user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like. The display may also be suitably referred to as a display screen or display unit for displaying information processed in the simulated test equipment and a user interface for displaying the visualization.
在图10所示的实施例中,存储器11中存储有模拟测试程序;其中,网络接口14用于与开发端进行通信连接,以接收开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求,处理器12执行存储器11中存储的模拟测试程序时实现如下步骤:In the embodiment shown in FIG. 10, the simulation test program is stored in the memory 11; wherein the network interface 14 is used for communication connection with the development end to receive the first server parameter with the destination server sent by the application under test at the development end. A preset type request, when the processor 12 executes the simulation test program stored in the memory 11, implements the following steps:
接收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined first interface, the switch state including an open state and an off state;
若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be the open state, the determined return data corresponding to the first interface is found, and the first pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The first format of the returned data corresponding to the type request is set, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the application to be tested.
进一步地,所述处理器还用于执行所述模拟测试程序,以实现如下步骤:Further, the processor is further configured to execute the simulation test program to implement the following steps:
若确定的第一接口的当前开关状态为关状态,则分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发 送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the first interface is the off state, the destination server corresponding to the destination server parameter in the first preset type request is analyzed, and the first preset type request is sent. And sending the returned data corresponding to the first preset type request from the analyzed destination server, and sending the obtained return data to the to-be-tested application.
进一步地,所述处理器还用于执行所述模拟测试程序,以实现如下步骤:Further, the processor is further configured to execute the simulation test program to implement the following steps:
接收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;After receiving the second preset type request with the destination server parameter sent by the application to be tested, the second interface corresponding to the second preset type request is determined according to the interface document of the application to be tested;
分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined second interface, the switch state including an open state and an off state;
若确定的第二接口的当前开关状态为开状态,则找出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。If the current switch state of the determined second interface is the open state, the determined return data corresponding to the second interface is found, and the second pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The second format of the returned data corresponding to the type request is performed, and the found return data is encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the application to be tested.
进一步地,所述处理器还用于执行所述模拟测试程序,以实现如下步骤:Further, the processor is further configured to execute the simulation test program to implement the following steps:
若确定的第二接口的当前开关状态为关状态,则分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the second interface is determined to be off, the destination server corresponding to the destination server parameter in the second preset type request is analyzed, and the second preset type request is sent to the analyzed destination. The server obtains the return data corresponding to the second preset type request from the analyzed destination server, and sends the obtained return data to the application to be tested.
进一步地,所述第一预设类型请求为拉取数据请求,所述第一接口为所述拉取数据请求对应的接口;所述第二预设类型请求为更改数据请求,所述第二接口为所述更改数据请求对应的接口。Further, the first preset type request is a pull data request, the first interface is a corresponding interface for the pull data request; the second preset type request is a change data request, and the second The interface is the corresponding interface for the change data request.
本发明还提供一种计算机可读存储介质,该计算机可读存储介质上存储有模拟测试程序,所述模拟测试程序被处理器执行时实现如下步骤:The present invention also provides a computer readable storage medium having an emulation test program stored thereon, the emulation test program being executed by the processor to implement the following steps:
接收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined first interface, the switch state including an open state and an off state;
若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be the open state, the determined return data corresponding to the first interface is found, and the first pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The first format of the returned data corresponding to the type request is set, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the application to be tested.
进一步地,所述模拟测试程序被处理器执行时还实现如下步骤:Further, when the simulation test program is executed by the processor, the following steps are further implemented:
若确定的第一接口的当前开关状态为关状态,则分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请 求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the first interface is the off state, the destination server corresponding to the destination server parameter in the first preset type request is analyzed, and the first preset type request is sent to the analyzed destination. The server obtains the first preset type from the analyzed destination server. Corresponding return data is obtained, and the obtained return data is sent to the application to be tested.
进一步地,所述模拟测试程序被处理器执行时还实现如下步骤:Further, when the simulation test program is executed by the processor, the following steps are further implemented:
接收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;After receiving the second preset type request with the destination server parameter sent by the application to be tested, the second interface corresponding to the second preset type request is determined according to the interface document of the application to be tested;
分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined second interface, the switch state including an open state and an off state;
若确定的第二接口的当前开关状态为开状态,则找出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。If the current switch state of the determined second interface is the open state, the determined return data corresponding to the second interface is found, and the second pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The second format of the returned data corresponding to the type request is performed, and the found return data is encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the application to be tested.
进一步地,所述模拟测试程序被处理器执行时还实现如下步骤:Further, when the simulation test program is executed by the processor, the following steps are further implemented:
若确定的第二接口的当前开关状态为关状态,则分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the second interface is determined to be off, the destination server corresponding to the destination server parameter in the second preset type request is analyzed, and the second preset type request is sent to the analyzed destination. The server obtains the return data corresponding to the second preset type request from the analyzed destination server, and sends the obtained return data to the application to be tested.
进一步地,所述第一预设类型请求为拉取数据请求,所述第一接口为所述拉取数据请求对应的接口;所述第二预设类型请求为更改数据请求,所述第二接口为所述更改数据请求对应的接口。Further, the first preset type request is a pull data request, the first interface is a corresponding interface for the pull data request; the second preset type request is a change data request, and the second The interface is the corresponding interface for the change data request.
本发明计算机可读存储介质的具体实施例与上述模拟测试方法实施例基本相同,在此不作赘述。The specific embodiment of the computer readable storage medium of the present invention is substantially the same as the embodiment of the above simulation test method, and details are not described herein.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments. Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。 The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims (20)

  1. 一种应用程序开发过程中的模拟测试方法,其特征在于,所述方法包括以下步骤:A simulation test method in an application development process, characterized in that the method comprises the following steps:
    请求处理服务器收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the request processing server determines, according to the interface document of the application to be tested, the first corresponding to the first preset type request. interface;
    所述请求处理服务器分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;The request processing server analyzes the determined current switch state of the first interface, where the switch state includes an open state and an off state;
    若确定的第一接口的当前开关状态为开状态,则所述请求处理服务器找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be an open state, the request processing server finds the determined return data corresponding to the first interface, and determines according to a mapping relationship between the predetermined request type and the format of the returned data. The first preset type requests a first format of the returned data, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the Application to be tested.
  2. 如权利要求1所述的应用程序开发过程中的模拟测试方法,其特征在于,该方法还包括步骤:The simulation test method in the application development process according to claim 1, wherein the method further comprises the steps of:
    若确定的第一接口的当前开关状态为关状态,则所述请求处理服务器分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the first interface is the off state, the request processing server analyzes the destination server corresponding to the destination server parameter in the first preset type request, and sends the first preset type request And the returned destination data corresponding to the first preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the to-be-tested application.
  3. 如权利要求1所述的应用程序开发过程中的模拟测试方法,其特征在于,该方法还包括步骤:The simulation test method in the application development process according to claim 1, wherein the method further comprises the steps of:
    所述请求处理服务器收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;After the request processing server receives the second preset type request with the destination server parameter sent by the application to be tested at the development end, determining, according to the interface document of the application to be tested, the second preset type request Second interface;
    所述请求处理服务器分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;The request processing server analyzes the determined current switch state of the second interface, where the switch state includes an open state and an off state;
    若确定的第二接口的当前开关状态为开状态,则所述请求处理服务器找出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。If the current switch state of the determined second interface is the open state, the request processing server finds the returned data corresponding to the determined second interface, and determines according to the mapping relationship between the predetermined request type and the format of the returned data. The second preset type requests a second format of the returned data, and the found return data is encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the Application to be tested.
  4. 如权利要求3所述的应用程序开发过程中的模拟测试方法,其特征在于,该方法还包括步骤:The simulation test method in the application development process according to claim 3, wherein the method further comprises the steps of:
    若确定的第二接口的当前开关状态为关状态,则所述请求处理服务器分 析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the determined current switch state of the second interface is the off state, the request processing server is divided into And the destination server corresponding to the destination server parameter in the second preset type request is sent, the second preset type request is sent to the analyzed destination server, and the second preset type is obtained from the analyzed destination server. The corresponding return data is requested, and the obtained return data is sent to the application to be tested.
  5. 如权利要求1或3所述的应用程序开发过程中的模拟测试方法,其特征在于,所述第一预设类型请求为拉取数据请求,所述第一接口为所述拉取数据请求对应的接口;所述第二预设类型请求为更改数据请求,所述第二接口为所述更改数据请求对应的接口。The simulation test method in the application development process according to claim 1 or 3, wherein the first preset type request is a pull data request, and the first interface is corresponding to the pull data request The second preset type request is a change data request, and the second interface is a corresponding interface for the change data request.
  6. 一种用于在应用程序开发过程中进行模拟测试的请求处理服务器,其特征在于,所述请求处理服务器包括:A request processing server for performing simulation testing in an application development process, wherein the request processing server comprises:
    第一确定模块,用于收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;a first determining module, configured to: after receiving the first preset type request with the destination server parameter sent by the application to be tested at the development end, determining the first preset type request according to the interface document of the application to be tested Corresponding first interface;
    第一分析模块,用于分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;a first analysis module, configured to analyze a current switch state of the determined first interface, where the switch state includes an open state and an off state;
    第一返回模块,用于若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。The first returning module is configured to: if the determined current switch state of the first interface is the open state, find the return data corresponding to the determined first interface, according to a mapping relationship between the predetermined request type and the format of the returned data Determining a first format of the returned data corresponding to the first preset type request, and encapsulating the found return data according to the determined first format to generate first encapsulated data, and returning the generated first encapsulated data to The application to be tested.
  7. 如权利要求6所述的用于在应用程序开发过程中进行模拟测试的请求处理服务器,其特征在于,还包括:The request processing server for performing a simulation test in an application development process according to claim 6, further comprising:
    第一发送模块,用于若确定的第一接口的当前开关状态为关状态,则分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。The first sending module is configured to: if the current switch state of the first interface is determined to be off, analyze the destination server corresponding to the destination server parameter in the first preset type request, and set the first preset type The request is sent to the analyzed destination server, and the returned data corresponding to the first preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the application to be tested.
  8. 如权利要求6所述的用于在应用程序开发过程中进行模拟测试的请求处理服务器,其特征在于,还包括:The request processing server for performing a simulation test in an application development process according to claim 6, further comprising:
    第二确定模块,用于收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;a second determining module, configured to: after receiving the second preset type request with the destination server parameter sent by the application to be tested at the development end, determining the second preset type request according to the interface document of the application to be tested Corresponding second interface;
    第二分析模块,用于分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;a second analysis module, configured to analyze a current switch state of the determined second interface, where the switch state includes an open state and an off state;
    第二返回模块,用于若确定的第二接口的当前开关状态为开状态,则找 出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。a second returning module, configured to: if the current switch state of the determined second interface is an open state, Determining the return data corresponding to the determined second interface, determining a second format of the return data corresponding to the second preset type request according to a mapping relationship between the predetermined request type and the format of the returned data, and the found The return data is encapsulated in a determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the application under test.
  9. 如权利要求8所述的用于在应用程序开发过程中进行模拟测试的请求处理服务器,其特征在于,还包括:The request processing server for performing a simulation test in an application development process according to claim 8, further comprising:
    第二发送模块,用于若确定的第二接口的当前开关状态为关状态,则分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。a second sending module, configured to: if the current switch state of the second interface is determined to be off, analyzing the destination server corresponding to the destination server parameter in the second preset type request, and using the second preset type The request is sent to the analyzed destination server, and the returned data corresponding to the second preset type request is obtained from the analyzed destination server, and the obtained return data is sent to the to-be-tested application.
  10. 如权利要求6或8所述的用于在应用程序开发过程中进行模拟测试的请求处理服务器,其特征在于,所述第一预设类型请求为拉取数据请求,所述第一接口为所述拉取数据请求对应的接口;所述第二预设类型请求为更改数据请求,所述第二接口为所述更改数据请求对应的接口。The request processing server for performing the simulation test in the application development process according to claim 6 or 8, wherein the first preset type request is a pull data request, and the first interface is a The interface corresponding to the data request is pulled; the second preset type request is a change data request, and the second interface is an interface corresponding to the change data request.
  11. 一种用于在应用程序开发过程中进行模拟测试的请求处理设备,其特征在于,所述请求处理设备包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的模拟测试程序,所述模拟测试程序被所述处理器执行时实现如下步骤:A request processing device for performing simulation testing during application development, characterized in that the request processing device comprises a memory, a processor, and a simulation stored on the memory and operable on the processor a test program that, when executed by the processor, implements the following steps:
    接收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
    分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined first interface, the switch state including an open state and an off state;
    若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be the open state, the determined return data corresponding to the first interface is found, and the first pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The first format of the returned data corresponding to the type request is set, and the found return data is encapsulated according to the determined first format to generate first encapsulated data, and the generated first encapsulated data is returned to the application to be tested.
  12. 如权利要求11所述的用于在应用程序开发过程中进行模拟测试的请求处理设备,其特征在于,所述处理器还用于执行所述模拟测试程序,以实现如下步骤:The request processing device for performing a simulation test in an application development process according to claim 11, wherein the processor is further configured to execute the simulation test program to implement the following steps:
    若确定的第一接口的当前开关状态为关状态,则分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请 求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the first interface is the off state, the destination server corresponding to the destination server parameter in the first preset type request is analyzed, and the first preset type request is sent to the analyzed destination. The server obtains the first preset type from the analyzed destination server. Corresponding return data is obtained, and the obtained return data is sent to the application to be tested.
  13. 如权利要求11所述的用于在应用程序开发过程中进行模拟测试的请求处理设备,其特征在于,所述处理器还用于执行所述模拟测试程序,以实现如下步骤:The request processing device for performing a simulation test in an application development process according to claim 11, wherein the processor is further configured to execute the simulation test program to implement the following steps:
    接收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;After receiving the second preset type request with the destination server parameter sent by the application to be tested, the second interface corresponding to the second preset type request is determined according to the interface document of the application to be tested;
    分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined second interface, the switch state including an open state and an off state;
    若确定的第二接口的当前开关状态为开状态,则找出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。If the current switch state of the determined second interface is the open state, the determined return data corresponding to the second interface is found, and the second pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The second format of the returned data corresponding to the type request is performed, and the found return data is encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the application to be tested.
  14. 如权利要求13所述的用于在应用程序开发过程中进行模拟测试的请求处理设备,其特征在于,所述处理器还用于执行所述模拟测试程序,以实现如下步骤:The request processing device for performing a simulation test in an application development process according to claim 13, wherein the processor is further configured to execute the simulation test program to implement the following steps:
    若确定的第二接口的当前开关状态为关状态,则分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the second interface is determined to be off, the destination server corresponding to the destination server parameter in the second preset type request is analyzed, and the second preset type request is sent to the analyzed destination. The server obtains the return data corresponding to the second preset type request from the analyzed destination server, and sends the obtained return data to the application to be tested.
  15. 如权利要求13所述的用于在应用程序开发过程中进行模拟测试的请求处理设备,其特征在于,所述第一预设类型请求为拉取数据请求,所述第一接口为所述拉取数据请求对应的接口;所述第二预设类型请求为更改数据请求,所述第二接口为所述更改数据请求对应的接口。The request processing device for performing a simulation test in an application development process according to claim 13, wherein the first preset type request is a pull data request, and the first interface is the pull The interface corresponding to the data request is obtained; the second preset type request is a change data request, and the second interface is an interface corresponding to the change data request.
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有模拟测试程序,所述模拟测试程序被处理器执行时实现如下步骤:A computer readable storage medium, wherein the computer readable storage medium stores an analog test program, and when the simulation test program is executed by the processor, the following steps are implemented:
    接收到开发端的待测应用程序发送的带有目的服务器参数的第一预设类型请求后,根据所述待测应用程序的接口文档确定所述第一预设类型请求对应的第一接口;After receiving the first preset type request with the destination server parameter sent by the application to be tested, the first interface corresponding to the first preset type request is determined according to the interface document of the application to be tested;
    分析确定的第一接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined first interface, the switch state including an open state and an off state;
    若确定的第一接口的当前开关状态为开状态,则找出确定的第一接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第一预设类型请求对应的返回数据的第一格式,将找出的返回数据 按照确定的第一格式进行封装以生成第一封装数据,并将生成的第一封装数据返回给所述待测应用程序。If the current switch state of the first interface is determined to be the open state, the determined return data corresponding to the first interface is found, and the first pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. Set the first format of the returned data corresponding to the type request, and find the returned data. Encapsulating according to the determined first format to generate first package data, and returning the generated first package data to the application under test.
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述模拟测试程序被处理器执行时还实现如下步骤:The computer readable storage medium of claim 16, wherein the simulation test program is further executed by the processor to:
    若确定的第一接口的当前开关状态为关状态,则分析出所述第一预设类型请求中的目的服务器参数对应的目的服务器,将所述第一预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第一预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the first interface is the off state, the destination server corresponding to the destination server parameter in the first preset type request is analyzed, and the first preset type request is sent to the analyzed destination. The server obtains the return data corresponding to the first preset type request from the analyzed destination server, and sends the obtained return data to the application to be tested.
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述模拟测试程序被处理器执行时还实现如下步骤:The computer readable storage medium of claim 16, wherein the simulation test program is further executed by the processor to:
    接收到开发端的待测应用程序发送的带有目的服务器参数的第二预设类型请求后,根据所述待测应用程序的接口文档确定所述第二预设类型请求对应的第二接口;After receiving the second preset type request with the destination server parameter sent by the application to be tested, the second interface corresponding to the second preset type request is determined according to the interface document of the application to be tested;
    分析确定的第二接口的当前开关状态,所述开关状态包括开状态和关状态;Analyzing a current switch state of the determined second interface, the switch state including an open state and an off state;
    若确定的第二接口的当前开关状态为开状态,则找出确定的第二接口对应的返回数据,根据预先确定的请求类型与返回数据的格式之间的映射关系,确定所述第二预设类型请求对应的返回数据的第二格式,将找出的返回数据按照确定的第二格式进行封装以生成第二封装数据,并将生成的第二封装数据返回给所述待测应用程序。If the current switch state of the determined second interface is the open state, the determined return data corresponding to the second interface is found, and the second pre-determination is determined according to a mapping relationship between the predetermined request type and the format of the returned data. The second format of the returned data corresponding to the type request is performed, and the found return data is encapsulated according to the determined second format to generate second encapsulated data, and the generated second encapsulated data is returned to the application to be tested.
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述模拟测试程序被处理器执行时还实现如下步骤:The computer readable storage medium of claim 18, wherein the simulation test program is further executed by the processor to:
    若确定的第二接口的当前开关状态为关状态,则分析出所述第二预设类型请求中的目的服务器参数对应的目的服务器,将所述第二预设类型请求发送给分析出的目的服务器,从分析出的目的服务器获取所述第二预设类型请求对应的返回数据,并将获取的返回数据发送给所述待测应用程序。If the current switch state of the second interface is determined to be off, the destination server corresponding to the destination server parameter in the second preset type request is analyzed, and the second preset type request is sent to the analyzed destination. The server obtains the return data corresponding to the second preset type request from the analyzed destination server, and sends the obtained return data to the application to be tested.
  20. 如权利要求18所述的计算机可读存储介质,其特征在于,所述第一预设类型请求为拉取数据请求,所述第一接口为所述拉取数据请求对应的接口;所述第二预设类型请求为更改数据请求,所述第二接口为所述更改数据请求对应的接口。 The computer readable storage medium according to claim 18, wherein the first preset type request is a pull data request, and the first interface is a corresponding interface for the pull data request; The second preset type request is a change data request, and the second interface is a corresponding interface for the change data request.
PCT/CN2017/091259 2016-08-22 2017-06-30 Simulation test method, server, device, and computer-readable storage medium WO2018036273A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610704675.3 2016-08-22
CN201610704675.3A CN106294179B (en) 2016-08-22 2016-08-22 Analog detection method and server in process of application development

Publications (1)

Publication Number Publication Date
WO2018036273A1 true WO2018036273A1 (en) 2018-03-01

Family

ID=57614635

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/091259 WO2018036273A1 (en) 2016-08-22 2017-06-30 Simulation test method, server, device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN106294179B (en)
WO (1) WO2018036273A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446063A (en) * 2018-09-18 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium
CN110580224A (en) * 2019-09-20 2019-12-17 中国银行股份有限公司 System testing method, device and equipment
CN111858223A (en) * 2020-06-28 2020-10-30 北京金山云网络技术有限公司 Method, device, equipment and storage medium for testing storage service interface
CN112148580A (en) * 2019-06-26 2020-12-29 腾讯科技(深圳)有限公司 Test method and device and electronic equipment
CN112416750A (en) * 2020-10-10 2021-02-26 上海哔哩哔哩科技有限公司 Application program boundary testing method and system
CN115118625A (en) * 2018-05-11 2022-09-27 创新先进技术有限公司 Data verification method and device
CN117251385A (en) * 2023-11-20 2023-12-19 深圳大道云科技有限公司 method and device for acquiring mock data, terminal equipment and readable storage medium

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294179B (en) * 2016-08-22 2018-01-19 上海亿账通互联网科技有限公司 Analog detection method and server in process of application development
CN108304313B (en) * 2017-01-13 2022-05-27 阿里巴巴集团控股有限公司 Device, client and method for data testing
CN107040553A (en) * 2017-06-16 2017-08-11 腾讯科技(深圳)有限公司 Leak analysis method, device, terminal and storage medium
CN109271310B (en) * 2017-07-18 2022-07-05 北京京东尚科信息技术有限公司 Development testing method and device for network function of mobile application program
CN108134711B (en) * 2017-11-29 2021-07-16 海尔优家智能科技(北京)有限公司 Method for testing terminal APP, simulation household appliance system and storage medium
CN109582569A (en) * 2018-11-14 2019-04-05 深圳市佰仟金融服务有限公司 Lending platforms test method, device, terminal device and readable storage medium storing program for executing
CN110134607A (en) * 2019-05-17 2019-08-16 广州品唯软件有限公司 A kind of app automated testing method and device
CN110659215A (en) * 2019-09-30 2020-01-07 贵州航天云网科技有限公司 Open type industrial APP rapid development and test verification method
CN110851364A (en) * 2019-11-12 2020-02-28 深圳市前海随手数据服务有限公司 Software testing method, system and related equipment
CN113704657A (en) * 2021-08-30 2021-11-26 平安普惠企业管理有限公司 Front end deployment method, device, equipment and storage medium
CN114817067B (en) * 2022-05-25 2022-09-02 云账户技术(天津)有限公司 Automatic mock testing method and device
CN116643902B (en) * 2023-07-27 2023-10-20 太平金融科技服务(上海)有限公司 Interface data simulation method, device, apparatus, storage medium, and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5911066A (en) * 1994-02-22 1999-06-08 Microsoft Corporation Data transfer utilizing a single functionally independent data transfer mechanism
CN101145954A (en) * 2007-06-20 2008-03-19 中兴通讯股份有限公司 Implementation method for piling class of communication function
CN101576843A (en) * 2008-05-07 2009-11-11 阿里巴巴集团控股有限公司 Method and device for testing application program interface
CN101859272A (en) * 2009-04-09 2010-10-13 大唐移动通信设备有限公司 Method, system and device for simulating embedded software system
CN104809046A (en) * 2015-05-27 2015-07-29 广东欧珀移动通信有限公司 Application program networking control method and application program networking control device
CN106294179A (en) * 2016-08-22 2017-01-04 上海亿账通互联网科技有限公司 Analog detection method in process of application development and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927138B (en) * 2013-01-10 2017-06-06 山东新北洋信息技术股份有限公司 Print system and its Method of printing and printer

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5911066A (en) * 1994-02-22 1999-06-08 Microsoft Corporation Data transfer utilizing a single functionally independent data transfer mechanism
CN101145954A (en) * 2007-06-20 2008-03-19 中兴通讯股份有限公司 Implementation method for piling class of communication function
CN101576843A (en) * 2008-05-07 2009-11-11 阿里巴巴集团控股有限公司 Method and device for testing application program interface
CN101859272A (en) * 2009-04-09 2010-10-13 大唐移动通信设备有限公司 Method, system and device for simulating embedded software system
CN104809046A (en) * 2015-05-27 2015-07-29 广东欧珀移动通信有限公司 Application program networking control method and application program networking control device
CN106294179A (en) * 2016-08-22 2017-01-04 上海亿账通互联网科技有限公司 Analog detection method in process of application development and server

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118625A (en) * 2018-05-11 2022-09-27 创新先进技术有限公司 Data verification method and device
CN115118625B (en) * 2018-05-11 2023-06-27 创新先进技术有限公司 Data verification method and device
CN109446063A (en) * 2018-09-18 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium
CN112148580A (en) * 2019-06-26 2020-12-29 腾讯科技(深圳)有限公司 Test method and device and electronic equipment
CN112148580B (en) * 2019-06-26 2024-01-30 腾讯科技(深圳)有限公司 Test method and device and electronic equipment
CN110580224A (en) * 2019-09-20 2019-12-17 中国银行股份有限公司 System testing method, device and equipment
CN111858223A (en) * 2020-06-28 2020-10-30 北京金山云网络技术有限公司 Method, device, equipment and storage medium for testing storage service interface
CN112416750A (en) * 2020-10-10 2021-02-26 上海哔哩哔哩科技有限公司 Application program boundary testing method and system
CN117251385A (en) * 2023-11-20 2023-12-19 深圳大道云科技有限公司 method and device for acquiring mock data, terminal equipment and readable storage medium
CN117251385B (en) * 2023-11-20 2024-04-02 深圳大道云科技有限公司 method and device for acquiring mock data, terminal equipment and readable storage medium

Also Published As

Publication number Publication date
CN106294179A (en) 2017-01-04
CN106294179B (en) 2018-01-19

Similar Documents

Publication Publication Date Title
WO2018036273A1 (en) Simulation test method, server, device, and computer-readable storage medium
CN109302522B (en) Test method, test device, computer system, and computer medium
WO2018120722A1 (en) Asynchronous interface testing method, terminal, device, system, and storage medium
TWI533123B (en) Method and system for automated test and result comparison
CN110647471B (en) Interface test case generation method, electronic device and storage medium
US9003235B2 (en) Indicating coverage of web application testing
US20130117855A1 (en) Apparatus for automatically inspecting security of applications and method thereof
US9454467B2 (en) Method and apparatus for mining test coverage data
WO2019218513A1 (en) Apparatus and method for monitoring testing process, and computer-readable storage medium
WO2018184420A1 (en) Software testing method, apparatus, electronic device, and medium
WO2019019358A1 (en) Page compatibility detection method and apparatus, server, and storage medium
CN107608901B (en) Jmeter-based testing method and device, storage medium and electronic equipment
CN110532185B (en) Test method, test device, electronic equipment and computer readable storage medium
WO2019214109A1 (en) Monitoring device and method for testing process, and computer readable storage medium
CN108255701B (en) Scene testing method and mobile terminal
WO2019071891A1 (en) Code coverage analysis method and application server
US8868976B2 (en) System-level testcase generation
CN112799940B (en) Regression testing method, regression testing device, computer system and computer readable storage medium
CN110196809B (en) Interface testing method and device
CN111078539A (en) Test method, device, system and computer readable storage medium
WO2019100690A1 (en) Electronic device, testing method, system and computer readable storage medium
JP2018156294A (en) Software verification apparatus and software verification program
US9280627B1 (en) GUI based verification at multiple abstraction levels
US11030362B2 (en) Modeling and cooperative simulation of systems with interdependent discrete and continuous elements
CN111930629A (en) Page testing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17842697

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10.07.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17842697

Country of ref document: EP

Kind code of ref document: A1