CN109271310B - Development testing method and device for network function of mobile application program - Google Patents

Development testing method and device for network function of mobile application program Download PDF

Info

Publication number
CN109271310B
CN109271310B CN201710585734.4A CN201710585734A CN109271310B CN 109271310 B CN109271310 B CN 109271310B CN 201710585734 A CN201710585734 A CN 201710585734A CN 109271310 B CN109271310 B CN 109271310B
Authority
CN
China
Prior art keywords
data
network
mode
server
data model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710585734.4A
Other languages
Chinese (zh)
Other versions
CN109271310A (en
Inventor
江浩
应晓立
景悦诚
徐阳泽
张华杰
刘永平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710585734.4A priority Critical patent/CN109271310B/en
Publication of CN109271310A publication Critical patent/CN109271310A/en
Application granted granted Critical
Publication of CN109271310B publication Critical patent/CN109271310B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Abstract

The embodiment of the invention discloses a method and a device for developing and testing network functions of a mobile application program, and relates to the technical field of computers. Wherein, the method comprises the following steps: capturing a network request sent by a network module, and generating a data model of the network request; configuring a data model of the network request according to network mode configuration information; and executing a corresponding processing flow when the data model is configured to be in a normal networking mode or an abnormal networking mode. Through the technical scheme, the development and test of the network function of the mobile application program can be realized without depending on a computer and a third-party software tool, and the workload of the development and test of the network function of the mobile application program is reduced.

Description

Development testing method and device for network function of mobile application program
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for developing and testing network functions of a mobile application program.
Background
Mobile applications, such as IOS applications and Android applications, rely on network data exchange with a server for most functions, except for a small part of the program logic implemented on the client. In the development and testing phase of mobile applications, the development and testing of network functions takes a major time. In the process, not only the client development tester is required to continuously perform interface switching and parameter change, but also the server interface development maintainer is required to cooperate with development and test work.
At present, when a developer develops and tests network functions of a mobile application program, the network packet capturing tools relied on mainly include the following:
wireshark: and the network packet analysis software runs on the computer side of the Windows system.
Charles: an HTTP protocol debugging agent tool running on the computer side of the Mac OS system. Because the software supports a Mac OS system, the software can support a simulator used for developing IOS application programs, and is more popular among IOS software developers.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
firstly, the network packet capturing tool is mainly operated at a computer end. Mobile applications must rely on network proxy operations when using these network capture tools. As the mobile network request protocol enters the HTTPS era, the complexity of development testing is further increased by this approach of network proxy. Meanwhile, the time cost consumed by development and test work is also increased by the establishment of the agent environment.
Secondly, the above network packet capturing tool is mainly used to meet the development and test requirements of the traditional computer-side application program, and the functions provided by the tool cannot be well compatible with the development and test requirements of the mobile application program, such as the mobile service requirements of HTTPS, CDN, DNS, and the like, and the requirements of network mode simulation, network state monitoring, and the like.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for developing and testing a network function of a mobile application, which can implement development and testing of the network function of the mobile application without relying on a computer and a third-party software tool, and reduce workload of development and testing of the network function of the mobile application.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for developing and testing a network function of a mobile application is provided.
The method for developing and testing the network function of the mobile application program comprises the following steps: capturing a network request sent by a network module, and generating a data model of the network request; configuring the data model according to network mode configuration information; if the data model is configured to be in a normal networking mode, sending the network request to a server, then receiving data returned by the server, and sending the data returned by the server to the network module; and if the data model is configured to be in an abnormal networking mode, sending data corresponding to the abnormal networking mode to the network module.
Optionally, the abnormal networking mode comprises at least one of: timeout mode, network outage mode, failure mode, local mode.
Optionally, the method further comprises: configuring the data model according to server switching configuration information; and sending the network request to the switched server under the condition that the data model is configured to be in a normal networking mode and server switching is carried out.
Optionally, the method further comprises: configuring a data model of the network request according to the data recording configuration information; and after receiving the data returned by the server and before sending the data returned by the server to the network module, recording the data returned by the server if the data model is also configured to be recorded, and modifying the data model from the data to be recorded to the recorded data after the recording is finished.
Optionally, if the data model is configured in the local mode, the method further includes: and acquiring local mapping data according to the local mapping data address corresponding to the network request, and sending the local mapping data to the network module.
In order to achieve the above object, according to another aspect of the embodiments of the present invention, a development testing apparatus for network functions of a mobile application is provided.
The development testing device for the network function of the mobile application program comprises: the monitoring control module is used for capturing a network request sent by the network module and generating a data model of the network request; the monitoring control module is further configured to: under the condition that the data model is configured to be in a normal networking mode, sending the network request to a server, then receiving data returned by the server, and sending the data returned by the server to the network module; sending the data corresponding to the abnormal networking mode to the network module if the data model is configured to the abnormal networking mode; and the mode management module is used for configuring the data model of the network request according to the network mode configuration information.
Optionally, the abnormal networking mode comprises at least one of: timeout mode, network outage mode, failure mode, local mode.
Optionally, the apparatus further comprises: the server management module is used for configuring the data model of the network request according to the server switching configuration information; the monitoring control module is further configured to: and under the condition that the data model is configured to be in a normal networking mode and server switching is carried out, the network request is sent to the switched server.
Optionally, the apparatus further comprises: the data management module is used for configuring a data model of the network request according to the data recording configuration information; after the monitoring control module receives the data returned by the server and before the monitoring control module sends the data returned by the server to the network module, if the data model is configured to be recorded, the data management module is further configured to: and recording the data returned by the server, and modifying the data model from the data to be recorded to the recorded data after the recording is finished.
Optionally, the data management module is further configured to: in a case where the data model is configured in a local mode, local mapping data is acquired according to a local mapping data address corresponding to the network request.
Optionally, the apparatus further comprises: the user operation control module is used for setting the configuration information of the development testing device; the configuration information includes: network mode configuration information, server switching configuration information and data recording configuration information.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a mobile terminal device.
The mobile terminal device of the embodiment of the invention comprises: one or more processors; and storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the development testing method for the network function of the mobile application program according to the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
The computer readable medium of the embodiment of the present invention stores thereon a computer program, and the program, when executed by a processor, implements the method for developing and testing the network function of the mobile application program of the embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of capturing a network request of a network module, constructing a data model of the network request according to preset network mode configuration information, executing corresponding operation when the data model is configured to be a normal networking mode and an abnormal networking mode, and the like, and can flexibly and simply realize the simulation of various network modes. Through the technical scheme, the development and test of the network function of the mobile application program can be realized without depending on a computer and a third-party software tool, and the workload of the development and test of the network function of the mobile application program is reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a method for developing and testing network functions of a mobile application according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of a method for developing and testing network functions of a mobile application according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of the main modules of a development testing device for network functions of mobile applications according to one embodiment of the present invention;
FIG. 4 is a schematic diagram of the main modules of a development testing device for network functions of mobile applications according to another embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic structural diagram of a computer system of a mobile terminal device suitable for implementing an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
Before describing the embodiments of the present invention in detail, some technical terms related to the embodiments of the present invention will be described.
HTTP: a HyperText Transfer Protocol (hereinafter abbreviated HyperText Transfer Protocol). HTTP is one of the most widely used network protocols on the internet.
HTTPS: is an HTTP channel (called Hyper Text Transfer Protocol over Secure Socket Layer) with security as the target. Briefly, HTTPS is a secure version of HTTP.
CDN: content Delivery networks (collectively referred to as Content Delivery networks). The basic idea of the CDN is to avoid bottlenecks and links on the internet that may affect the data transmission speed and stability as much as possible, so as to make the content transmission faster and more stable.
DNS: the Domain Name System (collectively referred to as the Domain Name System). The DNS, which is a distributed database in which domain names and IP addresses are mapped to each other, enables users to more conveniently access the internet without remembering IP strings that can be directly read by machines.
Fig. 1 is a schematic diagram of a development testing method of a mobile application network function according to an embodiment of the present invention. As shown in fig. 1, the development test method in this embodiment mainly includes steps S101 to S106.
Step 101, a monitoring control module captures a network request sent by a network module and generates a data model of the network request.
In particular, the monitoring control module may capture the network request at an interface where the network module initiates the network request. After capturing the network request, the monitoring control module generates a data model for the network request and transmits the generated data model to the mode management module. Wherein the generated data model includes a number of configurable attributes, such as network schema attributes.
And step S102, the mode management module configures the data model of the network request according to the network mode configuration information.
In this step, the network mode configuration information may be preset by a user, and includes: normal networking mode, abnormal networking mode. Wherein the normal networking mode comprises at least one of: mobile network modes such as 2G, 3G, 4G, 5G, WIFI, etc.; the abnormal networking mode includes at least one of: timeout mode, network outage mode, failure mode, local mode.
If the network mode configuration information for the network request is: if the data model is in the normal networking mode, the mode management module configures the network mode attribute in the data model into the normal networking mode, and the step S103 is entered; if the network mode configuration information for the network request is: and in the abnormal networking mode, the mode management module configures the network mode attribute in the data model into the abnormal networking mode, and the step S105 is entered.
And S103, under the condition that the data model is configured to be in a normal networking mode, the monitoring control module sends the network request to a server. Thereafter, the process proceeds to step S104.
And step S104, the monitoring control module receives the data returned by the server and sends the returned data to the network module.
Step S105, under the condition that the data model is configured to be in an abnormal networking mode, the mode management module acquires data corresponding to the abnormal networking mode. Thereafter, the process proceeds to step S106.
For example, when the data model is configured in the disconnected network mode, step S105 includes: and the mode management module assembles a return data packet in the network disconnection mode, and adds the return data packet in the network disconnection mode to the data model so as to transmit the return data packet to the monitoring control module.
For example, when the data model is configured as a timeout mode, step S105 includes: and the mode management module generates a return data packet in an overtime mode, and adds the return data packet in the overtime mode into the data model so as to transmit the return data packet to the monitoring control module.
For example, when the data model is configured to the local mode, step S105 includes: and the mode management module acquires local mapping data according to a preset local mapping data address corresponding to the network request, and adds the local mapping data into the data model so as to transmit the local mapping data to the monitoring control module.
And S106, the monitoring control module sends the data corresponding to the abnormal networking mode to the network module.
In the embodiment of the invention, through the steps from S101 to S106, various real mobile network environments can be simulated flexibly and simply. Through the technical scheme, the development and test of the network function of the mobile application program can be realized without depending on a computer and a third-party software tool, and the workload of the development and test of the network function of the mobile application program is reduced.
Fig. 2 is a schematic diagram of a method for developing and testing network functions of a mobile application according to another embodiment of the present invention. As shown in fig. 2, the method for developing and testing the network function of the mobile application program in this embodiment mainly includes steps S201 to S211.
Step S201, the network module sends a network request to the first server.
Wherein the network request typically comprises: request protocols (such as HTTP protocol, HTTPs protocol, FTP protocol, etc.), request domain names, request ports, request parameters. It will be appreciated that in some cases, the request port in the network request may also be default. The first server may be a server in a formal environment, a server in a pre-release environment, or a server in a test environment, etc.
Step S202, the monitoring control module captures the network request and assembles the network request into a data model.
In this step, the data model assembled by the monitoring and control module includes many configurable attributes, such as network mode attributes, server switching attributes, data recording attributes, data mapping attributes, and so on. In specific implementation, various default attribute values in the data model may or may not be null. For example, a default attribute value of the network mode attribute may be set to normal networking mode, a default attribute value of the server switch attribute may be set to no server switch, a default attribute value of the data recording attribute may be set to no data recording, and so on.
Step S203, the mode management module configures the data model according to preset network mode configuration information.
Wherein, the network mode configuration information can be a normal networking mode and an abnormal networking mode. Wherein the normal networking mode comprises at least one of: mobile network modes such as 2G, 3G, 4G, 5G, WIFI, etc.; the abnormal networking mode includes at least one of: timeout mode, network outage mode, failure mode, local mode.
In this step, if the network mode configuration information for the network request is "normal networking mode", the mode management module sets the attribute value of the network mode attribute in the data model to "normal networking mode", and proceeds to step S204; if the network mode configuration information is the 'abnormal networking mode', the step S204 is not carried out, but the mode management module acquires the data corresponding to the abnormal networking mode, and the monitoring control module sends the data corresponding to the abnormal networking mode to the network module. It is to be understood that if the network mode configuration information is the same as the default attribute value of the "network mode attribute" in the data model, the mode management module does not modify the attribute value of the network mode attribute.
For example, in a preferred embodiment, when the network mode configuration information is a local mode, the mode management module sets an attribute value of a network mode attribute in the data model to be a "local mode", assigns a value to a "local mapping data address attribute" in the data model according to a preset "local mapping data address", and transmits the configured data model to the data management module. Then, the data management module acquires local mapping data according to a local mapping data address in the data model, adds the local mapping data into the data model, transmits the configured data model to the monitoring control module, and then the monitoring control module sends the local mapping data to the network module.
And S204, the server management module configures the data model according to preset server switching configuration information.
The server switching configuration information may be server switching or not. And if the server switching configuration information is 'performing server switching', the server management module replaces the request domain name in the network request character string carried in the data model with the request domain name to be switched, so that the switching of the server is realized. And if the server switching configuration information is 'no server switching', the server management module does not execute the replacement operation of the request domain name.
And S205, configuring the data model by the data management module according to preset data recording configuration information.
The data recording configuration information may be data recording or data non-recording. And if the data recording configuration information is that data is recorded, the data management module configures the data recording attribute in the data model as 'to be recorded'.
After configuring the data model according to steps S203 to S205, the configured data model is transferred to the monitoring control module. If the data model is configured to: in the normal networking mode, the first server is switched to the second server to be recorded, and steps S206, S208, S210 and S211 are executed; if the data model is configured to: and (4) in a normal networking mode, without switching the servers and waiting for recording, executing steps S207, S209, S210 and S211. If the data model is configured to: and in the normal networking mode, switching the first server to the second server, and not recording data, executing the steps S206, S208 and S211. If the data model is configured to: and (4) executing steps S207, S209 and S211 in the normal networking mode without switching servers or recording data.
And S206, under the condition that the data model is configured to be in a normal networking mode, the first server is switched to be the second server, and recording is to be carried out, the monitoring control module sends the network request to the second server. For example, the first server is a server in a formal environment and the second server is a server in a pre-release environment. After this step, the flow proceeds to step S208.
And step S207, under the condition that the data model is configured to be in a normal networking mode, does not switch servers and is to be recorded, the monitoring control module sends the network request to a first server. After this step, the flow proceeds to step S209.
And step S208, the monitoring control module receives the data returned by the second server.
In specific implementation, after receiving the data returned by the second server, the monitoring control module carries the data returned by the second server in the data model, transmits the data model to the data management module, and then enters step S210.
Step S209, the monitoring control module receives data returned by the first server.
In specific implementation, after receiving the data returned by the first server, the monitoring control module carries the data returned by the first server in the data model, transmits the data model to the data management module, and then proceeds to step S210.
Step S210, the data management module records data.
In specific implementation, the data management module may store the data returned by the server in the specified path of the local hard disk, change the attribute value of the data recording attribute in the data model from "to be recorded" to "recorded", and then proceed to step S211.
And step S211, the monitoring control module sends the returned data to a network module.
In the embodiment of the invention, the development and test requirements of network functions of the mobile application program, such as simulation of various real mobile network environments, switching of the server, recording and mapping of data returned by the server, and the like, can be met through the steps. Through the technical scheme, development and test personnel do not need to rely on a computer and a third-party software tool when developing and testing the network function of the mobile application program, and the workload of developing and testing the network function of the mobile application program is greatly reduced.
Fig. 3 is a schematic diagram of main modules of a device for developing and testing network functions of a mobile application according to an embodiment of the present invention. As shown in fig. 3, the development testing apparatus 300 for network function of mobile application in this embodiment mainly includes the following modules: a monitoring control module 301 and a mode management module 302.
The monitoring control module 301 is mainly used for: capturing a network request initiated by a network module, and generating a data model of the network request; and, in the case that the data model is configured in a normal networking mode, sending the network request to a server, then receiving data returned by the server and sending it to the network module; and sending the data packet corresponding to the abnormal networking mode to the network module under the condition that the data model is configured to be the abnormal networking mode. In addition, the monitoring control module 301 may also monitor the real network status of the network module, such as the current real network speed, the current real network mode, and the like.
The mode management module 302 is mainly used for: configuring a data model of the network request according to preset network mode configuration information; and acquiring data corresponding to the abnormal networking mode under the condition that the network mode attribute is configured to be the abnormal networking mode.
Wherein, the network mode configuration information may be preset by a user, and includes: normal networking mode, abnormal networking mode. The normal networking mode includes at least one of: mobile network modes such as 2G, 3G, 4G, 5G, WIFI, etc.; the abnormal networking mode includes at least one of: timeout mode, network outage mode, failure mode, local mode.
For example, in an embodiment, when the network mode configuration information is a "local mode", the mode management module 302 is specifically configured to: setting an attribute value of a network mode attribute in a data model as a local mode, assigning a local mapping data address attribute in the data model according to a preset local mapping data address, acquiring local mapping data, and adding the local mapping data into the data model to be transmitted to a monitoring control module.
The following describes the operation of the mobile application network function development testing apparatus 300 shown in fig. 3. The workflow of the development test apparatus 300 mainly includes steps one to four.
Step one, the monitoring control module 301 captures a network request sent by the network module. In specific implementation, after the network request is captured, the monitoring control module 301 further generates a data model for the network request, and transmits the generated data model to the mode management module 302. Wherein the generated data model includes a number of configurable attributes, such as network mode attributes.
Step two, the mode management module 302 configures the data model of the network request according to the preset network mode configuration information. Wherein, the network mode configuration information can be a normal networking mode and an abnormal networking mode. If the network mode configuration information is: if the data model is in the normal networking mode, the mode management module 302 configures the network mode attribute in the data model into the normal networking mode, transmits the configured data model to the monitoring control module 301, and then enters step three; if the network mode configuration information is: and in the abnormal networking mode, the mode management module 302 configures the network mode attribute in the data model into the abnormal networking mode, and then the step four is performed.
Step three, the monitoring control module 301 sends the network request to a server; then, the monitoring control module 301 receives the data returned by the server, and sends the returned data to the network module.
Step four, under the condition that the data model is configured to be the abnormal networking mode, the mode management module 302 generates a data packet corresponding to the abnormal networking mode, transmits the data model carrying the data packet to the monitoring control module 301, and then the monitoring control module 301 sends the data packet corresponding to the abnormal networking mode to the network module.
In the embodiment of the invention, by constructing the mobile application program network function development testing device comprising the monitoring control module and the mode management module, various real mobile network environments can be simulated flexibly and simply. Through the device, the development and test of the network function of the mobile application program can be realized without depending on a computer and a third-party software tool, and the workload of the development and test of the network function of the mobile application program is reduced.
Fig. 4 is a schematic diagram of main modules of a mobile application network function development testing apparatus according to another embodiment of the present invention. As shown in fig. 4, the development test apparatus 400 in this embodiment mainly includes the following modules: a monitoring control module 401, a mode management module 402, a server management module 403, a data management module 404, and a user operation control module 405.
The monitoring control module 401 is mainly used for capturing network requests initiated by a network module, then assembling the network requests into a data model, and transmitting the data model to other modules; and after receiving the data model configured by other modules, executing a corresponding processing flow according to the configured data model.
For example, where the data model is configured to: in the normal networking mode, when the server is not switched and the recording is to be performed, the monitoring control module 401 is configured to execute the following processing procedures: the network request is sent to a server designated by the network request, and data returned by the server is received, and then after the data management module 404 finishes data recording, the returned data is sent to the network module.
For example, where the data model is configured to: in the normal networking mode, when the server is switched and the recording is to be performed, the monitoring control module 401 is configured to execute the following processing procedures: and sending the network request to the switched server, receiving data returned by the switched server, and sending the returned data to the network module after the data management module 404 finishes data recording.
For example, where the data model is configured to: in the normal networking mode, and when reading the local mapping data, the monitoring control module 401 is configured to execute the following processing procedures: and sending the local mapping data corresponding to the network request to the network module.
For example, where the data model is configured to: in the abnormal networking mode, the monitoring control module 401 is configured to execute the following processing procedures: and sending the data packet corresponding to the abnormal networking mode to a network module.
The mode management module 402 is mainly configured to configure the data model of the network request according to the network mode configuration information.
Wherein, the network mode configuration information can be a normal networking mode and an abnormal networking mode. The normal networking mode includes at least one of: network modes such as 2G, 3G, 4G, 5G, WIFI, etc.; the abnormal networking mode includes at least one of: timeout mode, network outage mode, failure mode, local mode.
Specifically, if the network mode configuration information for the network request is a normal networking mode, the mode management module 402 is configured to configure the network mode attribute in the data model as the normal networking mode, and pass the configured data model to the server management module 403. If the network mode configuration information for the network request is an abnormal networking mode, the mode management module 402 is configured to configure the network mode attribute in the data model as the abnormal networking mode, and acquire a data packet corresponding to the abnormal networking mode.
For example, if the network mode configuration information is the network disconnection mode, the mode management module 402 is configured to configure the network mode attribute in the data model as the network disconnection mode, generate a data packet in the network disconnection mode, and add the data packet in the network disconnection mode to the data model to be transmitted to the monitoring control module 401. For example, if the network mode configuration information is a local mode, the mode management module 402 sets the attribute value of the network mode attribute in the data model to be a "local mode", assigns a value to the "local mapping data address attribute" in the data model according to a preset "local mapping data address" corresponding to the network request, and transmits the configured data model to the data management module 404 through the server management module 403. Then, the data management module 404 obtains local mapping data according to a "local mapping data address" in the data model, adds the local mapping data to the data model, transmits the configured data model to the monitoring control module 401, and then the monitoring control module 401 sends the local mapping data to the network module.
The server management module 403 is configured to configure the data model of the network request according to preset server switching configuration information. The server switching configuration information may be server switching or not. In some preferred embodiments, the server management module may further configure the data model of the network request according to preset protocol switching configuration information. The protocol switching configuration information may be switching of a network protocol in a network request character string, or may not be switching of the network protocol. For example, the HTTPS protocol is switched to the HTTP protocol. By setting the server management module, the mobile service requirements of requesting domain name switching, requesting protocol switching and the like can be well met.
In specific implementation, if the server switching configuration information is: when the server is switched, the server management module 403 replaces the request domain name in the network request character string carried by the data model with the request domain name to be switched, and transmits the data model to the data management module. If the server switching configuration information is: without server switching, the server management module 403 does not perform the request domain name replacement operation and passes the data model to the data management module 404.
A data management module 404, configured to configure a data model of the network request according to preset data recording configuration information; and the data recording and mapping device is used for recording and mapping data. The data recording configuration information may be "record data", or "not record data". In addition, the data management module 404 may also be configured to edit and modify the recorded data for use in local data mapping.
In specific implementation, if the data recording configuration information is to record data, the data management module 404 sets an attribute value of a data recording attribute in the data model to be "to be recorded", and transmits the data model to the monitoring control module 401. After the monitoring control module 401 receives the data returned by the server, the data management module 404 records the data returned by the server. After the recording is completed, the data management module 404 modifies the attribute value of the data recording attribute in the data model from "to be recorded" to "recorded". If the data recording configuration information is "not to record data", the data management module 404 does not execute the data recording process.
The user operates the control module 405 to set the configuration information of the development test apparatus. Wherein the configuration information comprises: network mode configuration information, server switching configuration information, data recording configuration information, data mapping configuration information, and the like. In a specific implementation, the configuration information may be stored in a dictionary format, an array format, or boolean identifiers. In addition, the user operation control module 405 is also used to implement various switching operations, data editing and modifying operations, and the like. For example, a user-operated control module 405 may be used to implement a supervisory control switch that opens or closes. When the monitor control switch is closed, the development test device 400 for the network function of the mobile application can execute the development test function for the network function.
In the embodiment of the invention, by constructing the development testing device of the network function of the mobile application program, which comprises the monitoring control module, the mode management module, the server management module and the data management module, the development testing requirements of the network function of the mobile application program, such as simulation of various real mobile network environments, switching of the server, recording and mapping of data returned by the server, and the like, can be met. Through the device, development and test personnel do not need to rely on a computer and a third-party software tool when developing and testing the network function of the mobile application program, and the workload of developing and testing the network function of the mobile application program is greatly reduced.
In another aspect, an embodiment of the present invention further provides a mobile terminal device. The mobile terminal device of the embodiment of the invention comprises: one or more processors; and storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the development test method of the network function of the mobile application program according to the embodiment of the invention.
Fig. 5 illustrates an exemplary system architecture 500 of a mobile application network function development testing method or apparatus to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include mobile terminal devices 501, 502, a network 503, and a server 504. The network 503 is the medium used to provide communication links between the mobile terminal devices 501, 502 and the server 504. Network 503 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
The development tester may use the mobile terminal devices 501, 502 to interact with the server 504 through the network 503 to receive or send messages and the like. The mobile terminal devices 501 and 502 may have various communication client applications installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The mobile terminal devices 501, 502 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, and the like.
The server 504 may be various types of servers, such as a pre-release environment server, a test environment server, a formal environment server. The server 504 may also be a server that provides various services, such as a background management server that provides support for shopping-like applications on the mobile terminal device.
It should be noted that the development and test method for the network function of the mobile application provided in the embodiment of the present invention is generally executed by a mobile terminal device, and accordingly, the development and test apparatus for the network function of the mobile application is generally disposed in the mobile terminal device.
It should be understood that the number of mobile terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of mobile terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a mobile terminal device implementing an embodiment of the present invention is shown. The mobile terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a monitor control module, a mode management module. The names of these modules do not in some cases constitute a limitation on the modules themselves, and for example, the monitoring control module may also be described as a "module that performs monitoring control on a network request".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to: capturing a network request sent by a network module, and generating a data model of the network request; configuring a data model of the network request according to network mode configuration information; if the data model is configured to be in a normal networking mode, sending the network request to a server, then receiving data returned by the server, and sending the data to the network module; and if the data model is configured to be in an abnormal networking mode, acquiring a data packet corresponding to the abnormal networking mode, and sending the data packet to the network module.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. A development test method for network functions of mobile application programs is characterized in that the method is applied to mobile terminal equipment and comprises the following steps:
capturing a network request sent by a network module, and generating a data model of the network request;
configuring the data model according to network mode configuration information;
if the data model is configured to be in a normal networking mode, sending the network request to a server, then receiving data returned by the server, and sending the data returned by the server to the network module; and if the data model is configured to be in an abnormal networking mode, sending data corresponding to the abnormal networking mode to the network module.
2. The method of claim 1, wherein the abnormal networking mode comprises at least one of: timeout mode, network outage mode, failure mode, local mode.
3. The method of claim 2, further comprising:
configuring the data model according to server switching configuration information; and
and under the condition that the data model is configured to be in a normal networking mode and server switching is carried out, the network request is sent to the switched server.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
configuring a data model of the network request according to the data recording configuration information; and
after receiving data returned by a server and before sending the data returned by the server to the network module, if the data model is also configured to be recorded, recording the data returned by the server, and after the recording is finished, modifying the data model from the data to be recorded to the recorded data.
5. The method of claim 2, wherein if the data model is configured in a local mode, the method further comprises:
and acquiring local mapping data according to the local mapping data address corresponding to the network request, and sending the local mapping data to the network module.
6. A development testing device for network functions of mobile application programs is characterized in that the device is arranged on mobile terminal equipment and comprises:
the monitoring control module is used for capturing a network request sent by the network module and generating a data model of the network request; the monitoring control module is further configured to: under the condition that the data model is configured to be in a normal networking mode, sending the network request to a server, then receiving data returned by the server, and sending the data returned by the server to the network module; sending data corresponding to an abnormal networking mode to the network module if the data model is configured as the abnormal networking mode;
and the mode management module is used for configuring the data model of the network request according to the network mode configuration information.
7. The apparatus of claim 6, wherein the abnormal networking mode comprises at least one of: timeout mode, network outage mode, failure mode, local mode.
8. The apparatus of claim 7, further comprising:
the server management module is used for configuring a data model of the network request according to the server switching configuration information;
the monitoring control module is further configured to: and under the condition that the data model is configured to be in a normal networking mode and server switching is carried out, the network request is sent to the switched server.
9. The apparatus of claim 7 or 8, further comprising:
the data management module is used for configuring a data model of the network request according to the data recording configuration information;
after the monitoring control module receives the data returned by the server and before the monitoring control module sends the data returned by the server to the network module, if the data model is configured to be recorded, the data management module is further configured to: and recording the data returned by the server, and modifying the data model from the data to be recorded to the recorded data after the recording is finished.
10. The apparatus of claim 9, wherein the data management module is further configured to:
in a case where the data model is configured in a local mode, local mapping data is acquired according to a local mapping data address corresponding to the network request.
11. The apparatus of claim 10, further comprising:
the user operation control module is used for setting the configuration information of the development testing device; the configuration information includes: network mode configuration information, server switching configuration information and data recording configuration information.
12. A mobile terminal device, characterized by comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
13. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 5.
CN201710585734.4A 2017-07-18 2017-07-18 Development testing method and device for network function of mobile application program Active CN109271310B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710585734.4A CN109271310B (en) 2017-07-18 2017-07-18 Development testing method and device for network function of mobile application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710585734.4A CN109271310B (en) 2017-07-18 2017-07-18 Development testing method and device for network function of mobile application program

Publications (2)

Publication Number Publication Date
CN109271310A CN109271310A (en) 2019-01-25
CN109271310B true CN109271310B (en) 2022-07-05

Family

ID=65148210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710585734.4A Active CN109271310B (en) 2017-07-18 2017-07-18 Development testing method and device for network function of mobile application program

Country Status (1)

Country Link
CN (1) CN109271310B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116643902B (en) * 2023-07-27 2023-10-20 太平金融科技服务(上海)有限公司 Interface data simulation method, device, apparatus, storage medium, and program product

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090319247A1 (en) * 2008-06-18 2009-12-24 Eads Na Defense Security And Systems Solutions Inc Systems and Methods for A Simulated Network Environment and Operation Thereof
US8645589B2 (en) * 2009-08-03 2014-02-04 National Instruments Corporation Methods for data acquisition systems in real time applications
US20110282642A1 (en) * 2010-05-15 2011-11-17 Microsoft Corporation Network emulation in manual and automated testing tools
CN103297475B (en) * 2012-03-01 2017-03-01 阿里巴巴集团控股有限公司 Mock service system and the processing method of Mock service
CN103634137A (en) * 2012-08-27 2014-03-12 浙江大华技术股份有限公司 Simulated system of network transmission environment
GB2511027A (en) * 2012-12-04 2014-08-27 Anite Telecoms Ltd Apparatus and method for testing
CN103634154B (en) * 2013-12-17 2016-08-17 北京邮电大学 The analog systems of network state and analogy method thereof
JP6215033B2 (en) * 2013-12-17 2017-10-18 エヌ・ティ・ティ・コミュニケーションズ株式会社 Test control apparatus, communication system, test control method, and test control program
CN104767655B (en) * 2015-03-17 2018-09-21 微梦创科网络科技(中国)有限公司 A kind of analog result detection method and device
CN104699612B (en) * 2015-03-25 2019-05-31 北京嘀嘀无限科技发展有限公司 For processing method, equipment and the system in software test
CN105071995A (en) * 2015-08-28 2015-11-18 北京华青融天技术有限责任公司 Out-of-band network based network device patrolling method, device and system
CN106648556B (en) * 2015-10-28 2019-12-24 北京国双科技有限公司 Method and device for front-end and back-end integrated development test
CN106713059A (en) * 2015-11-16 2017-05-24 任子行网络技术股份有限公司 HTTP-based news APP data acquisition method and system
CN105847178A (en) * 2016-03-21 2016-08-10 珠海迈科智能科技股份有限公司 Network data request method and system for application program
CN106055383A (en) * 2016-05-26 2016-10-26 北京京东尚科信息技术有限公司 Request processing method and device
CN106294179B (en) * 2016-08-22 2018-01-19 上海亿账通互联网科技有限公司 Analog detection method and server in process of application development
CN106375142B (en) * 2016-08-26 2019-09-13 腾讯科技(深圳)有限公司 The test method and device of application program
CN106357480B (en) * 2016-11-23 2020-02-14 北京蓝海讯通科技股份有限公司 Method and device for monitoring network performance of application and mobile terminal
CN106844220A (en) * 2017-03-09 2017-06-13 北京融信易安信息技术有限公司 A kind of method of testing and system of simulation computer web application real running environment

Also Published As

Publication number Publication date
CN109271310A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
CN112119374B (en) Selectively providing mutual transport layer security using alternate server names
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN110324169B (en) Interface management method and device
CN110489192B (en) Remote communication method and device and electronic equipment
CN111177617A (en) Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment
CN113190464B (en) mock testing method and device, electronic equipment and medium
CN107644075B (en) Method and device for collecting page information
CN111258627A (en) Interface document generation method and device
WO2020217157A1 (en) On-premise and off-premise debugging
CN113595927A (en) Method and device for processing mirror flow in bypass mode
WO2018072095A1 (en) Load testing management method and system
CN113905030A (en) Intranet and extranet communication method and device, intranet terminal and proxy server
CN109271310B (en) Development testing method and device for network function of mobile application program
CN111786939B (en) Method, device and system for testing management platform of Internet of things
CN113821352A (en) Remote service calling method and device
CN110221910B (en) Method and apparatus for performing MPI jobs
CN111488268A (en) Dispatching method and dispatching device for automatic test
CN114915565A (en) Method and system for debugging network
CN112131095B (en) Pressure testing method and device
CN114338461A (en) Network connection monitoring method and related equipment
CN114520780A (en) Access method and device for proxy server
CN112433938A (en) Method and device for testing application of mobile terminal
CN115037572B (en) Application request identification method and device
CN111953718A (en) Page debugging method and device
CN111930709B (en) Data storage method, apparatus, electronic device, and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant