CN114666301A - APP testing method and system based on mock server - Google Patents

APP testing method and system based on mock server Download PDF

Info

Publication number
CN114666301A
CN114666301A CN202011528702.9A CN202011528702A CN114666301A CN 114666301 A CN114666301 A CN 114666301A CN 202011528702 A CN202011528702 A CN 202011528702A CN 114666301 A CN114666301 A CN 114666301A
Authority
CN
China
Prior art keywords
app
tested
preset
test case
test
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.)
Granted
Application number
CN202011528702.9A
Other languages
Chinese (zh)
Other versions
CN114666301B (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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202011528702.9A priority Critical patent/CN114666301B/en
Publication of CN114666301A publication Critical patent/CN114666301A/en
Application granted granted Critical
Publication of CN114666301B publication Critical patent/CN114666301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides an APP testing method and system based on a mock server, wherein the method comprises the following steps: establishing connection with a terminal to be tested through a DNS according to a connection request sent by the DNS; and acquiring a preset test case, and testing the APP to be tested on the terminal to be tested according to the preset test case. According to the invention, the mock server is used for testing the APP to be tested, so that the bug problem of the APP to be tested can be quickly positioned, and the testing efficiency is improved.

Description

APP testing method and system based on mock server
Technical Field
The invention relates to the technical field of computer testing, in particular to an APP testing method and system based on a mock server.
Background
The APP appearing in the market is various, and various APPs are developed rapidly and are distributed on a downloading platform to enrich the life of people. However, not all the APPs flowing into the download platform are strictly tested, and the APP with problems therein has many bugs in the actual use process, thereby affecting the user fluency.
Meanwhile, the process of testing the APP is complicated, a large amount of time and resources are consumed, the cost is too high, the improvement of the test period is not facilitated, and therefore a plurality of APP developers can directly skip the test link to directly release the APP, and the APP is easily led to appear in practical application.
Therefore, the prior art has defects and needs to be improved and developed.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide an APP test method and system based on mock server, aiming at solving the problems of long APP test period and high cost in the prior art.
The technical scheme adopted by the invention for solving the technical problem is as follows:
establishing connection with a terminal to be tested through a DNS according to a connection request sent by the DNS;
and acquiring a preset test case, and testing the APP to be tested on the terminal to be tested according to the preset test case.
Further, the establishing, by the DNS server, a connection with the terminal to be tested according to the connection request sent by the DNS server includes:
receiving a connection request sent by the DNS server which is connected with the terminal to be tested in advance;
and connecting the terminal to be tested according to the domain name of the terminal to be tested analyzed by the DNS server in the connection request.
Further, the obtaining of the preset test case further includes, before testing the to-be-tested APP on the to-be-tested terminal according to the preset test case, detection of a test environment, wherein the detection of the test environment includes:
sending an address resolution instruction to the DNS server;
judging whether an address returned from the terminal to be tested can be received or not;
if yes, the test environment is normal.
Further, the determining whether the address returned from the terminal to be tested can be received further includes:
if the address returned from the terminal to be tested can be received, sending a communication request to the terminal to be tested;
judging whether the communication connection returned from the terminal to be tested can be received or not;
if yes, the test environment is normal.
Further, the obtaining of the preset test case, the testing the to-be-tested APP on the to-be-tested terminal according to the preset test case includes:
acquiring a preset function test case, wherein the preset function test case is used for testing the basic function of the APP;
sending a function test request to the APP to be tested according to the preset function test case;
after receiving a function test result returned from the APP to be tested, comparing the function test result with a preset expected result, and judging whether the function test result conforms to the preset expected result;
if so, feeding back that the function of the APP to be tested is normal;
and if not, feeding back that the function of the APP to be tested is abnormal.
Further, the obtaining of the preset test case tests the to-be-tested APP on the to-be-tested terminal according to the preset test case, and the method further includes:
constructing a functional test case for testing the APP to be tested according to the functions of the APP to be tested;
appointing a calling interface of the functional test case;
and setting an expected result corresponding to the functional test case according to the calling interface, wherein the expected result is normal return data of the functional test case.
Further, if the function of the APP to be tested is normal, the method further includes:
acquiring a preset robustness test case, wherein the preset robustness test case is used for testing the abnormal performance of APP processing;
sending preset abnormal data to the APP to be tested according to the preset robustness test case;
checking whether the APP to be tested can process the preset abnormal data or not;
if so, feeding back that the abnormal performance of the APP to be tested is normal;
if not, feeding back that the APP to be tested does not reach the standard.
Further, the obtaining of the preset test case further includes, before testing the to-be-tested APP on the terminal to be tested according to the preset test case:
constructing a robustness test case for testing the abnormal processing capability of the APP to be tested according to the abnormal parameters of the APP to be tested;
and setting abnormal data corresponding to the abnormal parameters according to the robustness test case.
Further, before the obtaining the preset robustness test case, the method further includes:
and modifying the preset configuration file to correspond to the test of the robustness of the APP to be tested.
The present invention also provides a mock server for APP testing, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and configured to be executed by the one or more processors comprises means for performing the mock server based APP testing method as described above.
The invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a mock server-based APP test program, and the mock server-based APP test program realizes the steps of the mock server-based APP test method when being executed by a processor.
The invention also provides an APP test system based on the mock server, which comprises the following components:
the terminal to be tested is used for loading the APP to be tested and establishing communication connection with the mock server through the DNS server;
the mock server is used for obtaining a preset test case and testing the to-be-tested APP on the to-be-tested terminal according to the preset test case.
According to the APP testing method and system based on the mock server, provided by the invention, the APP to be tested and the mock server are decoupled, and only the function test and the robustness test are carried out on the APP, so that the bug can be accurately positioned to occur in the APP instead of the cloud. Different data are constructed by the mock server and are issued to the APP to be tested, so that the problems of the APP to be tested can be quickly and preferentially positioned, and the testing efficiency and quality are improved.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the APP testing method based on mock server in the present invention.
FIG. 2 is a flowchart of step S100 in the preferred embodiment of the method for testing APP based on mock server;
fig. 3 is a schematic diagram of establishing a connection with a terminal to be tested through a DNS server according to a connection request sent by the DNS server in the mock server-based APP testing method according to the present invention;
FIG. 4 is a flowchart of detecting a test environment in the mock server-based APP test method of the present invention;
FIG. 5 is a flow chart of the function test in the mock server-based APP test method of the present invention;
FIG. 6 is a flowchart of steps before step S211 in the preferred embodiment of the method for testing APP based on mock server according to the present invention;
FIG. 7 is a flow chart of robustness testing in the mock server-based APP testing method of the present invention;
FIG. 8 is a flowchart illustrating steps before step S221 in the preferred embodiment of the method for testing APP based on mock server according to the present invention;
FIG. 9 is a functional block diagram of a mock-based server according to the present invention;
FIG. 10 is a functional block diagram of a preferred embodiment of the APP test system based on mock server in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
For testers with abundant working experience, the reason why a defect is caused can be quickly judged, but for the defect which is not obvious, the problem cannot be found by manual testing, and the problem cannot be accurately positioned.
Therefore, the to-be-tested APP is connected with the mock server during testing, the to-be-tested APP is subjected to function testing through the mock server, and meanwhile, the mock server executes the function test case corresponding to the to-be-tested APP to realize the function testing of the to-be-tested APP, so that the bug existing in the to-be-tested APP can be found, and the problem that the bug exists in the to-be-tested APP is determined.
Referring to fig. 1, fig. 1 is a flowchart of an APP testing method based on a mock server in the present invention. As shown in fig. 1, an APP testing method based on a mock server according to an embodiment of the present invention includes the following steps:
and S100, the mock server establishes connection with the terminal to be tested through the DNS according to the connection request sent by the DNS.
Specifically, a mock server is set up in advance, the mock server can be set up by using an http library of Python, and the functional logic of the APP is configured. Certainly, the method for building the mock Server is not limited to the http library through Python, but can also be built in manners such as SVN, Quick Easy Ftp Server, and the like.
After the mock server is built successfully, the mock server can be stored in the mock server to run locally or stored in the mock server to run, and the method is not limited herein.
In a specific embodiment, as shown in fig. 2 and 3, step S100 includes:
and step S110, the mock server receives a connection request sent by the DNS server which is connected with the terminal to be tested in advance.
The method comprises the following steps of connecting a terminal to be tested with a DNS (domain name system) server in advance, wherein the following steps can be adopted for connecting the terminal to be tested with the DNS server:
and step S111, respectively configuring DNS addresses pointing to the DNS servers for the terminal to be tested and the router connected with the terminal to be tested.
The terminal to be tested is connected with the router, and the DNS of the router connected with the terminal to be tested is set to point to the DNS address of the DNS server, so that the connection between the terminal to be tested and the DNS server can be realized.
Further, before step S110 is executed, a DNS Server needs to be built, and the method of building the DNS Server may adopt installing Windows Server 2003 in the virtual machine and configuring the Windows Server, and the built DNS Server may analyze the DNS.
After the DNS server is built successfully, the DNS server may be stored in a local area for operation, or may be stored in a cloud for operation, which is not limited herein.
Specifically, by configuring a DNS server, the domain name of the APP to be tested is resolved into the IP of the mock server.
Step S120, connecting the terminal to be tested according to the domain name of the terminal to be tested analyzed by the DNS server in the connection request.
Specifically, after the DNS server acquires the IP of the mock server, the DNS address of the DNS pointing to the DNS server of the terminal to be tested is set, after configuration is completed, data exchange between the APP to be tested and the mock server can be achieved, then the fact that the DNS server and the mock server can communicate with each other is confirmed, and whether communication is achieved or not can be checked through ping commands mutually.
S200, obtaining a preset test case, and testing the APP to be tested on the terminal to be tested according to the preset test case.
Where a test case is a set of conditions or variables in the software project from which a tester determines whether an application or software system is working correctly.
Specifically, after test data are constructed and issued to the APP to be tested through the mock server, the APP to be tested receives the test data and executes the test data so as to return a test result to the mock server, the mock server judges whether the bug exists in the APP to be tested according to the returned test result, and when the bug exists, the problem of the APP to be tested is located according to the returned test result. Among them, the common bug problems are: crash, flash back, dead cycle, etc.
To test whether the mock server and the APP to be tested implement data exchange, in a specific embodiment, as shown in fig. 4, after step S120, the method includes:
and step S130, the mock server sends an address resolution instruction to the DNS server.
And step S140, judging whether the mock server can receive the address returned from the terminal to be tested.
If so, indicating that the test environment is normal, executing the step S200, obtaining a preset test case, and testing the to-be-tested APP on the terminal to be tested according to the preset test case.
Specifically, before executing the preset test case, it is necessary to ensure that the test environment operates normally, and it is necessary to check whether the DNS server can resolve the mock server address normally. When normal resolution is possible, the next step can be performed.
Further, after step S140, the method includes:
and S150, if the mock server can receive the address returned from the terminal to be tested, the mock server sends a communication request to the terminal to be tested.
Specifically, it is judged that the terminal to be tested can realize communication with the mock server through the configured DNS server, and if so, it is indicated that the terminal can realize data exchange with the mock server, and it is indicated that the test environment is normal. When normal communication is enabled, the next step can be performed.
And step S160, judging whether the communication connection returned from the terminal to be tested can be received or not.
And if so, executing the step S200, obtaining a preset test case, and testing the to-be-tested APP on the terminal to be tested according to the preset test case.
In an embodiment, as shown in fig. 5, the step S200 includes:
step S211, the mock server obtains a preset function test case, wherein the preset function test case is used for testing the basic function of the APP.
And S212, the mock server sends a function test request to the APP to be tested according to the preset function test case.
Step S213, after the mock server receives the function test result returned from the APP to be tested, comparing the function test result with a preset expected result, and judging whether the function test result accords with the preset expected result.
And if so, executing the step S214, and feeding back the function normality of the APP to be tested by the mock server.
If not, step S215 is executed, and the mock server feeds back that the function of the APP to be tested is abnormal.
The functional test is an essential link for any product test, is the basis of various higher-order tests, and needs to be preceded by the functional test normally regardless of automatic test or robustness test, so that the correctness of the product function is guaranteed.
In the conventional functional test, the functional test cases of some functional modules are troublesome to execute, a plurality of developers are often required to cooperate to modify data, and the workload is increased in vain.
Further, as shown in fig. 6, before step S210, the method further includes:
step S201, the mock server constructs a function test case for testing the APP to be tested according to the functions of the APP to be tested.
And S202, the mock server appoints a calling interface of the functional test case.
And S203, the mock server sets an expected result corresponding to the functional test case according to the calling interface, wherein the expected result is normal return data of the functional test case.
Specifically, before performing function test on the APP to be tested, normal return data of an interface related to the function of the APP to be tested needs to be constructed first, so as to ensure that the request sent by the mock server to the APP to be tested can return correct function test data, and thus the processing result of the APP to be tested to the correct function test data conforms to an expected result. Wherein, the APP to be tested receives the correct function test data after receiving the request.
And after the correct response data is constructed, executing the steps S120 and S130 to ensure that the terminal to be tested and the mock server can exchange data.
And then, performing a function test, wherein the mock server can perform the function test by executing the function test case of the APP to be tested. Wherein, no matter be manual test or automatic test, when testing out the function of awaiting measuring APP and having the bug, because the mock server of structure has guaranteed the exactness of returning test data, therefore the tester can discharge the server to the interference of bug, and then fixes a position the bug fast and in order to await measuring APP self, and then makes things convenient for the tester to carry out the formulation of repair scheme.
Under common conditions, the function test is only carried out on the APP and then the APP is sent out, however, the situations such as flash back exist in the APP use process, which shows that only partial problems of the APP can be found only by carrying out the function test and the APP is unreliable, therefore, the robustness test is also carried out after the function test is carried out.
The robustness test aims at testing the capability of the App to normally run under abnormal data, and mainly tests the fault-tolerant capability and the recovery capability of a product. The robustness test can find the problems of running, flash back, dead cycle and the like which are difficult to occur to the App under the normal condition, the quality of the App can be effectively improved, and the user experience is improved.
However, the conventional robustness test constructs abnormal data through a tester, and has the disadvantages of tedious test and low effect.
The scheme of the invention can solve the defect that the robustness test can be realized by establishing the connection with the terminal to be tested through the DNS according to the connection request sent by the DNS, constructing abnormal data return by the mock server, such as deleting fields, increasing fields, changing field types and the like, and then checking whether the App can normally process the data instead of the occurrence of the abnormal conditions such as crash flash back and the like.
The function test and the robustness test can be realized by modifying the json configuration file on the mock server constructed by the invention, and the switching and the test of the function test and the robustness test can be conveniently carried out. The json configuration file is used for carrying out global configuration on the mock server.
Namely before the robustness test, the following steps are also included:
and the mock server modifies the preset configuration file to correspond to the test of the robustness of the APP to be tested.
Specifically, in an embodiment, as shown in fig. 7, the step S200 further includes:
step S221, the mock server obtains a preset robustness test case, wherein the preset robustness test case is used for testing the abnormal performance of APP processing.
Step S222, the mock server sends preset abnormal data to the APP to be tested according to the preset robustness test case.
And S223, the mock server checks whether the APP to be tested can process the preset abnormal data.
If yes, step S224 is executed, and the mock server feeds back that the APP to be tested has abnormal and normal processing performance.
If not, step S225 is executed, and the mock server feeds back that the performance of the APP to be tested does not reach the standard.
Further, as shown in fig. 8, before step S221, the method further includes:
and S204, the mock server constructs a robustness test case for testing the abnormal processing capability of the APP to be tested according to the abnormal parameters of the APP to be tested.
And S205, the mock server sets abnormal data corresponding to the abnormal parameters according to the robustness test case.
Specifically, server abnormal return data is constructed for robustness test of the APP to be tested, and steps S120 and S130 are executed after the server abnormal return data is constructed, so that the terminal to be tested and the mock server can exchange data.
And then, performing robustness test, wherein the mock server can perform robustness test by executing the robustness test case of the APP to be tested. After the mock server sends the constructed abnormal data to the APP to be tested, the App to be tested receives the abnormal data and returns a test result, and the mock server analyzes the test result and judges the capability of the App to be tested to normally run under the abnormal data, which is shown in the aspect of observing the fault tolerance and recovery capability of the APP to be tested.
According to the method and the system, the APP to be tested and the mock server are decoupled, so that only the defects existing in the APP are tested, the problems existing in the APP to be tested can be accurately positioned, and the problem does not need to be analyzed by consuming excessive resources to appear in the App or the cloud. Still carry out the robustness test to the APP that awaits measuring in further scheme, through issuing the abnormal data and judging the ability of awaiting measuring APP to the abnormal data for the APP that awaits measuring, if the APP that awaits measuring can normally handle the abnormal data, then can guarantee that the APP that awaits measuring is in stable, normal state for a long time, and then promote user experience.
Further, as shown in fig. 9, based on the above APP test method based on a mock server, the present invention also provides a mock server for APP test, where the mock server includes a processor 10, a memory 20, and a display 30. Fig. 9 shows only some of the components of the mock server, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 20 may in some embodiments be an internal storage unit of the mock server, such as a hard disk or a memory of the mock server. The memory 20 may also be an external storage device of the mock server in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the mock server. Further, the memory 20 may also include both an internal storage unit and an external storage device of the mock server. The memory 20 is used for storing application software installed in the mock server and various types of data, such as program codes of the mock server. The memory 20 may also be used to temporarily store data that has been output or is to be output. In an embodiment, the memory 20 stores a mock server-based APP test program 40, and the mock server-based APP test program 40 can be executed by the processor 10, so as to implement the mock server-based APP test method in the present application.
The processor 10 may be a Central Processing Unit (CPU), microprocessor or other data Processing chip in some embodiments, and is used to run program codes stored in the memory 20 or process data, such as executing the mock server-based APP test method.
The display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 30 is used for displaying information at the mock server and for displaying a visualized user interface. The components 10-30 of the mock server communicate with each other via a system bus.
In an embodiment, the following steps are implemented when processor 10 executes mock server based APP test program 40 in said memory 20:
establishing connection with a terminal to be tested through a DNS according to a connection request sent by the DNS;
and acquiring a preset test case, and testing the APP to be tested on the terminal to be tested according to the preset test case.
The establishing of the connection with the terminal to be tested through the DNS according to the connection request sent by the DNS comprises the following steps:
receiving a connection request sent by the DNS server which is connected with the terminal to be tested in advance;
and connecting the terminal to be tested according to the domain name of the terminal to be tested analyzed by the DNS server in the connection request.
The method comprises the steps of obtaining a preset test case, and detecting a test environment before testing an APP to be tested on a terminal to be tested according to the preset test case, wherein the detection of the test environment comprises the following steps:
sending an address resolution instruction to the DNS server;
judging whether an address returned from the terminal to be tested can be received or not;
if yes, the test environment is normal.
The judging whether the address returned from the terminal to be tested can be received or not further comprises:
if the address returned from the terminal to be tested can be received, sending a communication request to the terminal to be tested;
judging whether the communication connection returned from the terminal to be tested can be received or not;
if yes, the test environment is normal.
The acquiring of the preset test case, and the testing of the to-be-tested APP on the terminal to be tested according to the preset test case comprises the following steps:
acquiring a preset function test case, wherein the preset function test case is used for testing the basic function of the APP;
sending a function test request to the APP to be tested according to the preset function test case;
after receiving a function test result returned from the APP to be tested, comparing the function test result with a preset expected result, and judging whether the function test result conforms to the preset expected result;
if so, feeding back that the function of the APP to be tested is normal;
and if not, feeding back that the function of the APP to be tested is abnormal.
The method comprises the steps of obtaining a preset test case, testing an APP to be tested on a terminal to be tested according to the preset test case, and comprising the following steps:
constructing a functional test case for testing the APP to be tested according to the functions of the APP to be tested;
appointing a calling interface of the functional test case;
and setting an expected result corresponding to the functional test case according to the calling interface, wherein the expected result is normal return data of the functional test case.
If yes, feeding back that the function of the APP to be tested is normal, and then:
acquiring a preset robustness test case, wherein the preset robustness test case is used for testing the performance of APP processing abnormity;
sending preset abnormal data to the APP to be tested according to the preset robustness test case;
checking whether the APP to be tested can process the preset abnormal data or not;
if yes, feeding back that the abnormal processing performance of the APP to be tested is normal;
if not, feeding back that the APP to be tested does not reach the standard.
The method comprises the following steps of obtaining a preset test case, and before testing an APP to be tested on a terminal to be tested according to the preset test case, further comprising:
constructing a robustness test case for testing the abnormal processing capability of the APP to be tested according to the abnormal parameters of the APP to be tested;
and setting abnormal data corresponding to the abnormal parameters according to the robustness test case.
Before the obtaining of the preset robustness test case, the method further comprises the following steps:
and modifying the preset configuration file to correspond to the test of the robustness of the APP to be tested.
The invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a mock server-based APP test program, and the mock server-based APP test program realizes the steps of the mock server-based APP test method when being executed by a processor.
The present invention further provides an APP test system based on mock server 70, wherein as shown in fig. 10, the APP test system includes:
the terminal to be tested 50 is used for loading the APP to be tested and establishing communication connection with the mock server 70 through the DNS server 60;
the mock server 70 is used for obtaining a preset test case, and testing the to-be-tested APP on the to-be-tested terminal 50 according to the preset test case.
In a specific embodiment, the APP test system based on the mock server 70 further includes:
a DNS server 60, where the DNS server 60 is used to establish a connection between the terminal 50 to be tested and the mock server 70.
In a specific embodiment, the DNS server 60 is further configured to resolve the domain name of the APP to be tested into the IP of the mock server 70, and establish a connection with the mock server 70 according to the IP of the mock server 70.
In a specific embodiment, the mock server 70 is further configured to obtain a preset functional test case, execute the preset functional test case, and test the function of the to-be-tested APP; and acquiring a preset robustness test case, executing the preset robustness test case, and testing the robustness of the APP to be tested.
In a specific embodiment, the mock server 70 sends a function test request to the APP to be tested according to the preset function test case; and after receiving a function test result returned from the APP to be tested, comparing the function test result with a preset expected result, and judging whether the function test result accords with the preset expected result.
And the APP to be tested is also used for receiving the function test request and returning a function test result.
In a specific embodiment, the mock server 70 is further configured to send preset abnormal data to the APP to be tested according to the preset robustness test case, and check whether the APP to be tested can process the preset abnormal data.
The APP to be tested is also used for receiving abnormal data and returning a test result.
In summary, according to the APP testing method and system based on the mock server disclosed by the invention, the APP to be tested and the mock server thereof are decoupled, only the function test and the robustness test are carried out on the APP, the bug can be accurately positioned to occur in the APP instead of the cloud, and the performance of the APP to be tested can be effectively judged by carrying out the robustness test on the APP to be tested.
Of course, it can be understood by those skilled in the art that all or part of the processes in the methods of the embodiments described above can be implemented by instructing relevant hardware (such as a processor, a controller, etc.) by a computer program, and the program can be stored in a computer-readable storage medium, and when executed, the program can include the processes of the embodiments of the methods described above. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (12)

1. An APP testing method based on a mock server is characterized by comprising the following steps:
establishing connection with a terminal to be tested through a DNS according to a connection request sent by the DNS;
and acquiring a preset test case, and testing the APP to be tested on the terminal to be tested according to the preset test case.
2. The mock server-based APP test method according to claim 1, wherein the establishing, according to the connection request sent by the DNS server, the connection with the terminal to be tested through the DNS server comprises:
receiving a connection request sent by the DNS server which is connected with the terminal to be tested in advance;
and connecting the terminal to be tested according to the domain name of the terminal to be tested analyzed by the DNS server in the connection request.
3. The mock server-based APP test method according to claim 2, wherein the obtaining of the preset test case further comprises detecting a test environment before testing the to-be-tested APP on the terminal to be tested according to the preset test case, wherein the detecting of the test environment comprises:
sending an address resolution instruction to the DNS server;
judging whether an address returned from the terminal to be tested can be received or not;
if yes, the test environment is normal.
4. The APP test method based on the mock server according to claim 3, wherein the determining whether the address returned from the terminal to be tested can be received further comprises:
if the address returned from the terminal to be tested can be received, sending a communication request to the terminal to be tested;
judging whether the communication connection returned from the terminal to be tested can be received or not;
if yes, the test environment is normal.
5. The APP testing method based on the mock server according to claim 1, wherein the obtaining of the preset test case, and the testing of the APP to be tested on the terminal to be tested according to the preset test case comprises:
acquiring a preset function test case, wherein the preset function test case is used for testing the basic function of the APP;
sending a function test request to the APP to be tested according to the preset function test case;
after receiving a function test result returned from the APP to be tested, comparing the function test result with a preset expected result, and judging whether the function test result conforms to the preset expected result;
if yes, feeding back that the function of the APP to be tested is normal;
and if not, feeding back that the function of the APP to be tested is abnormal.
6. The APP testing method based on the mock server according to claim 5, wherein the obtaining of the preset test case and the testing of the APP to be tested on the terminal to be tested according to the preset test case further comprise:
constructing a functional test case for testing the APP to be tested according to the functions of the APP to be tested;
appointing a calling interface of the functional test case;
and setting an expected result corresponding to the functional test case according to the calling interface, wherein the expected result is normal return data of the functional test case.
7. The mock server-based APP test method according to claim 5, wherein if the determined result is satisfied, the function of the APP to be tested is fed back to be normal, and then the method further comprises:
acquiring a preset robustness test case, wherein the preset robustness test case is used for testing the performance of APP processing abnormity;
sending preset abnormal data to the APP to be tested according to the preset robustness test case;
checking whether the APP to be tested can process the preset abnormal data or not;
if so, feeding back that the abnormal performance of the APP to be tested is normal;
if not, feeding back that the APP to be tested does not reach the standard.
8. The APP testing method based on mock server according to claim 7, wherein before the obtaining of the preset test case, the method for testing the APP to be tested on the terminal to be tested according to the preset test case further comprises:
constructing a robustness test case for testing the abnormal processing capability of the APP to be tested according to the abnormal parameters of the APP to be tested;
and setting abnormal data corresponding to the abnormal parameters according to the robustness test case.
9. The mock server-based APP test method according to claim 8, wherein said obtaining a preset robustness test case further comprises:
and modifying the preset configuration file to correspond to the test of the robustness of the APP to be tested.
10. A mock server for APP testing, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and wherein the one or more programs configured to be executed by the one or more processors comprise means for performing the mock server based APP testing method of any of claims 1-9.
11. A computer readable storage medium storing a mock server based APP test program which, when executed by a processor, implements the steps of the mock server based APP test method of any of claims 1-9.
12. An APP test system based on mock server, comprising:
the terminal to be tested is used for loading the APP to be tested and establishing communication connection with the mock server through the DNS server;
the mock server is used for obtaining a preset test case and testing the to-be-tested APP on the to-be-tested terminal according to the preset test case.
CN202011528702.9A 2020-12-22 2020-12-22 APP testing method and system based on mock server Active CN114666301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011528702.9A CN114666301B (en) 2020-12-22 2020-12-22 APP testing method and system based on mock server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011528702.9A CN114666301B (en) 2020-12-22 2020-12-22 APP testing method and system based on mock server

Publications (2)

Publication Number Publication Date
CN114666301A true CN114666301A (en) 2022-06-24
CN114666301B CN114666301B (en) 2024-07-05

Family

ID=82024724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011528702.9A Active CN114666301B (en) 2020-12-22 2020-12-22 APP testing method and system based on mock server

Country Status (1)

Country Link
CN (1) CN114666301B (en)

Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110130172A1 (en) * 2006-11-22 2011-06-02 Bindu Rama Rao Mobile based learning and testing system for automated test assignment, automated class registration and customized material delivery
US20140282420A1 (en) * 2013-03-15 2014-09-18 Vmware, Inc. Test automation booster
CN105512031A (en) * 2015-11-30 2016-04-20 惠州Tcl移动通信有限公司 Mobile terminal and automatic test method
US20170258390A1 (en) * 2016-02-12 2017-09-14 Newton Howard Early Detection Of Neurodegenerative Disease
US20180146001A1 (en) * 2016-11-22 2018-05-24 Daniel Chien Network security based on device identifiers and network addresses
WO2018120722A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Asynchronous interface testing method, terminal, device, system, and storage medium
CN108563575A (en) * 2018-04-16 2018-09-21 百度在线网络技术(北京)有限公司 Applied program testing method, device, terminal and computer readable storage medium
CN109067938A (en) * 2018-10-15 2018-12-21 网宿科技股份有限公司 A kind of method and device for testing dns server
CN109542758A (en) * 2018-09-29 2019-03-29 中国平安人寿保险股份有限公司 Application program fault-tolerant ability test method, device, computer readable storage medium
CN109857652A (en) * 2019-01-16 2019-06-07 深圳壹账通智能科技有限公司 A kind of automated testing method of user interface, terminal device and medium
US20190222553A1 (en) * 2016-11-17 2019-07-18 Tencent Technology (Shenzhen) Company Limited Method, device and system for service platform address resolution
CN110059011A (en) * 2019-04-22 2019-07-26 泰康保险集团股份有限公司 Interface test method, device, medium and electronic equipment
CN110535945A (en) * 2019-08-30 2019-12-03 苏州浪潮智能科技有限公司 Test method, device, equipment and the storage medium of storage cluster alarm function
CN110687888A (en) * 2019-09-26 2020-01-14 上海赫千电子科技有限公司 Automatic upgrading test device and system applied to locomotive
CN110716850A (en) * 2018-07-11 2020-01-21 腾讯科技(深圳)有限公司 Page testing method, device and system and storage medium
CN110727589A (en) * 2019-09-30 2020-01-24 北京创鑫旅程网络技术有限公司 Test method, device and equipment
CN110798380A (en) * 2019-10-23 2020-02-14 北京奇艺世纪科技有限公司 Data acquisition method, system, device, test equipment and test server
CN110955589A (en) * 2018-09-27 2020-04-03 北京京东尚科信息技术有限公司 Method, system, device and medium for testing headless mode based on browser
CN111026672A (en) * 2019-12-16 2020-04-17 广州品唯软件有限公司 Test method, terminal equipment and mock server
CN111475417A (en) * 2020-04-13 2020-07-31 广东美的暖通设备有限公司 Automatic testing method, device, equipment and storage medium
CN111478823A (en) * 2020-02-29 2020-07-31 新华三大数据技术有限公司 Multi-cloud management platform testing method and device
CN111694729A (en) * 2020-04-29 2020-09-22 北京三快在线科技有限公司 Application testing method and device, electronic equipment and computer readable medium
CN111858381A (en) * 2020-07-31 2020-10-30 北京字节跳动网络技术有限公司 Application program fault tolerance capability test method, electronic device and medium
CN111858296A (en) * 2019-12-31 2020-10-30 北京嘀嘀无限科技发展有限公司 Interface test method, device, equipment and storage medium

Patent Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110130172A1 (en) * 2006-11-22 2011-06-02 Bindu Rama Rao Mobile based learning and testing system for automated test assignment, automated class registration and customized material delivery
US20140282420A1 (en) * 2013-03-15 2014-09-18 Vmware, Inc. Test automation booster
CN105512031A (en) * 2015-11-30 2016-04-20 惠州Tcl移动通信有限公司 Mobile terminal and automatic test method
US20170258390A1 (en) * 2016-02-12 2017-09-14 Newton Howard Early Detection Of Neurodegenerative Disease
US20190222553A1 (en) * 2016-11-17 2019-07-18 Tencent Technology (Shenzhen) Company Limited Method, device and system for service platform address resolution
US20180146001A1 (en) * 2016-11-22 2018-05-24 Daniel Chien Network security based on device identifiers and network addresses
WO2018120722A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Asynchronous interface testing method, terminal, device, system, and storage medium
CN108563575A (en) * 2018-04-16 2018-09-21 百度在线网络技术(北京)有限公司 Applied program testing method, device, terminal and computer readable storage medium
CN110716850A (en) * 2018-07-11 2020-01-21 腾讯科技(深圳)有限公司 Page testing method, device and system and storage medium
CN110955589A (en) * 2018-09-27 2020-04-03 北京京东尚科信息技术有限公司 Method, system, device and medium for testing headless mode based on browser
CN109542758A (en) * 2018-09-29 2019-03-29 中国平安人寿保险股份有限公司 Application program fault-tolerant ability test method, device, computer readable storage medium
CN109067938A (en) * 2018-10-15 2018-12-21 网宿科技股份有限公司 A kind of method and device for testing dns server
CN109857652A (en) * 2019-01-16 2019-06-07 深圳壹账通智能科技有限公司 A kind of automated testing method of user interface, terminal device and medium
CN110059011A (en) * 2019-04-22 2019-07-26 泰康保险集团股份有限公司 Interface test method, device, medium and electronic equipment
CN110535945A (en) * 2019-08-30 2019-12-03 苏州浪潮智能科技有限公司 Test method, device, equipment and the storage medium of storage cluster alarm function
CN110687888A (en) * 2019-09-26 2020-01-14 上海赫千电子科技有限公司 Automatic upgrading test device and system applied to locomotive
CN110727589A (en) * 2019-09-30 2020-01-24 北京创鑫旅程网络技术有限公司 Test method, device and equipment
CN110798380A (en) * 2019-10-23 2020-02-14 北京奇艺世纪科技有限公司 Data acquisition method, system, device, test equipment and test server
CN111026672A (en) * 2019-12-16 2020-04-17 广州品唯软件有限公司 Test method, terminal equipment and mock server
CN111858296A (en) * 2019-12-31 2020-10-30 北京嘀嘀无限科技发展有限公司 Interface test method, device, equipment and storage medium
CN111478823A (en) * 2020-02-29 2020-07-31 新华三大数据技术有限公司 Multi-cloud management platform testing method and device
CN111475417A (en) * 2020-04-13 2020-07-31 广东美的暖通设备有限公司 Automatic testing method, device, equipment and storage medium
CN111694729A (en) * 2020-04-29 2020-09-22 北京三快在线科技有限公司 Application testing method and device, electronic equipment and computer readable medium
CN111858381A (en) * 2020-07-31 2020-10-30 北京字节跳动网络技术有限公司 Application program fault tolerance capability test method, electronic device and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李云春;许可;张建华;: "基于PlanetLab平台的校园网DNS服务性能测试方法", 华东师范大学学报(自然科学版), no. 1, 20 March 2015 (2015-03-20) *

Also Published As

Publication number Publication date
CN114666301B (en) 2024-07-05

Similar Documents

Publication Publication Date Title
US8954930B2 (en) System and method for reducing test effort by object risk analysis
US20140211021A1 (en) Test system for evaluating mobile device and driving method thereof
CN111427765B (en) Method and system for automatically starting interface performance test realized based on jmeter
CN105302722B (en) CTS automatic testing method and device
CN106648762B (en) Method and device for building development environment
CN110990289B (en) Method and device for automatically submitting bug, electronic equipment and storage medium
CN111309602A (en) Software testing method, device and system
CN110119348B (en) Software upgrading test method and terminal
CN106708727B (en) Distributed virus characteristic sample verification method and system
CN110704315B (en) Fault injection device for embedded software test
CN113127329B (en) Script debugging method and device and computer storage medium
US20210406158A1 (en) Systems and methods for automated device testing
CN112988578A (en) Automatic testing method and device
CN114666301A (en) APP testing method and system based on mock server
CN111581081B (en) Automatic test system and method
CN111666200A (en) Testing method and terminal for time consumption of cold start of PC software
CN115599683A (en) Automatic testing method, device, equipment and storage medium
CN111611148B (en) Compatibility concurrent test method and system for iOS system application software
CN109358564B (en) Method and device for detecting configuration software and computer readable storage medium
CN111427795A (en) Code test control method and device, storage medium and electronic equipment
CN115705293A (en) Program checking method, program checking device, electronic equipment and storage medium
CN114090454B (en) Interface automation test method, device, equipment and storage medium
CN112612710B (en) Automatic test method and system
CN115473832B (en) Internet of vehicles end cloud communication testing method, device, server, client and system
CN116010239B (en) Automatic test method based on assembly line

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