CN112241362A - Test method, test device, server and storage medium - Google Patents

Test method, test device, server and storage medium Download PDF

Info

Publication number
CN112241362A
CN112241362A CN201910659734.3A CN201910659734A CN112241362A CN 112241362 A CN112241362 A CN 112241362A CN 201910659734 A CN201910659734 A CN 201910659734A CN 112241362 A CN112241362 A CN 112241362A
Authority
CN
China
Prior art keywords
user operation
test
test case
service data
server
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.)
Pending
Application number
CN201910659734.3A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910659734.3A priority Critical patent/CN112241362A/en
Publication of CN112241362A publication Critical patent/CN112241362A/en
Pending legal-status Critical Current

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/3676Test management for coverage analysis
    • 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/3684Test management for test design, e.g. generating new test cases

Landscapes

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

Abstract

The embodiment of the invention discloses a test method, a test device, a server and a storage medium, wherein the method comprises the following steps: the method comprises the steps of obtaining business data corresponding to user operation of a target application, generating a test case corresponding to the user operation by utilizing the business data if the preset test case generating condition is determined to be met according to the user operation, and running the test case corresponding to the user operation so as to test the function of the target application triggered by the user operation. By implementing the method, the test case can be generated based on the operation of the user to perform the functional test, and the test efficiency of performing the functional test on the application program is improved.

Description

Test method, test device, server and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a test method, an apparatus, a server, and a storage medium.
Background
With the continuous development of computer technology, more and more application programs are produced, and in order to ensure that functions in the application programs run normally in terminals (mobile phones, computers, tablet computers and the like), a large number of function test operations need to be performed on the application programs.
The existing testing method mainly tests the application program by manually writing a script, and the mode needs developers to spend a large amount of time for code editing, and has higher technical requirements on the developers, so that the testing process is complicated, and the testing efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a testing method, a testing device, a server and a storage medium, which can generate a test case for functional testing based on the operation of a user and improve the testing efficiency of the functional testing of an application program.
In a first aspect, an embodiment of the present invention provides a testing method, where the method includes:
acquiring service data corresponding to user operation of a target application;
if the preset test case generation condition is determined to be met according to the user operation, generating a test case corresponding to the user operation by using the service data;
and running the test case corresponding to the user operation to test the function of the target application triggered by the user operation.
In a second aspect, an embodiment of the present invention provides a testing apparatus, including:
the acquisition module is used for acquiring service data corresponding to user operation of the target application;
the generating module is used for generating a test case corresponding to the user operation by using the service data if the preset test case generating condition is determined to be met according to the user operation;
and the running module is used for running the test case corresponding to the user operation so as to test the function of the target application triggered by the user operation.
In a third aspect, an embodiment of the present invention provides a test server, including a processor, an input interface, an output interface, and a memory, where the processor, the input interface, the output interface, and the memory are connected to each other, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program includes program instructions, which, when executed by a processor, cause the processor to execute the method of the first aspect.
In the embodiment of the invention, a test server acquires service data corresponding to user operation of a target application; if the preset test case generation condition is determined to be met according to the user operation, the test server generates a test case corresponding to the user operation by using the service data; and the test server runs the test case corresponding to the user operation so as to test the function of the target application triggered by the user operation. By implementing the method, the test case can be generated based on the operation of the user to perform the functional test, so that the test efficiency of performing the functional test on the application program is improved; and the test mode can carry out scene playback based on the actual running state of the function, so that the test scene which cannot be thought by developers in advance is covered, and the comprehensiveness of carrying out function test on the application program is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic structural diagram of a test system according to an embodiment of the present invention;
FIG. 2 is a flow chart of a testing method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of another testing method provided by the embodiment of the invention;
FIG. 4 is a schematic flow chart of another testing method provided by the embodiment of the invention;
fig. 5 is a schematic diagram of service data provided in an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating a time consuming comparison provided by an embodiment of the present invention;
FIG. 7 is a comparative illustration of a development threshold provided by an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a testing apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a test server according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
The purpose of the testing of the application is to ensure the quality of the application so that it operates in the correct manner. The main tasks of the test are to find the dislocation in the application program, effectively define and realize the assembly process of the components of the application program from the lower layer to the upper layer, verify whether the application program meets the technical requirements specified by a task book and a system definition document, provide a basis for establishing a quality model of the application program and the like. The functional test of the application program is not only to ensure that the function can be normally realized, but also to provide information for developers so as to conveniently prepare for risk assessment.
Related technologies of embodiments of the present invention mention that, in an existing functional test scheme, a manual coding mode is usually adopted to test functions of an application program, and the above mode requires developers to spend a lot of time to edit codes, and has a high technical requirement on the developers, which results in a complicated test process and low test efficiency. Further, a developer may not be able to consider all the operation scenarios in the operation process of the application program in the test process, so that the test cannot fully cover all the functions in the application program.
Based on this, the embodiment of the invention provides a test scheme, which can generate a test case for performing a functional test based on the operation of a user, and improve the coverage of performing the functional test on an application program and the test efficiency of the functional test.
Based on the above description, an embodiment of the present invention provides a test system, please refer to fig. 1, where the test system includes: a test server 101, a service distribution server 102, a data management server 103, a terminal 104 and a service server 105, wherein the service distribution server 102 is connected with at least one terminal 104, service server 105 and test server 101, the test server 101 is connected with the service distribution server 102 and data management server 103, and the terminal 104 may include but is not limited to: the mobile phone, the tablet computer, the computer, and the like are used for interacting with the user, for example, detecting a selection operation of the user for a function in the application program, and generating a corresponding request packet according to the operation of the user and sending the request packet to the service distribution server 102. The service distribution server 102 receives a request packet sent by the terminal 104, and sends the request packet to the service server 105, the service server 105 responds to the request packet to generate a response packet and returns the response packet to the service distribution server 102, and the service distribution server 102 sends the response packet to the terminal 104 and stores the request packet and the response packet in the process, specifically, the name of an application program, the name of a function corresponding to user operation, the request packet and the response packet can be stored in a log (log) file form to form a log file. When a data call instruction sent by the test service 101 is received, the service distribution server 102 sends the log file to the test server 101, the test server 101 obtains a template for generating a test case, calls a test automation tool (for example, QTA) to import the log file into a corresponding field of the template, generates a test case corresponding to a user operation, and sends the test case to the data management server 103, so that the data management server 103 stores the test case, and the test server 101 can call the test case stored in the data management server 103 at regular time based on a script and test the function of an application program based on the test case.
In summary, the test system shown in fig. 1 can obtain the request packet and the response packet formed based on the operation of the user, automatically generate the test case for performing the functional test, and does not need a developer to edit a large number of test codes, thereby improving the test efficiency of performing the functional test on the application program.
Based on the description of the embodiment of the test system, the embodiment of the present invention provides a test method, which may be applied to the test system shown in fig. 1, and specifically may be executed by the test server shown in fig. 1. Referring to fig. 2, the testing process may include the following steps S201 to S203:
s201, the test server obtains service data corresponding to user operation of the target application.
In the embodiment of the present invention, the target application may be any application program that needs to be tested, and the service data may specifically include a name of the target application used by a user operation, a name of a function of the target application, a request packet generated by the terminal based on the user operation, and a response packet returned by the service server based on the request packet. In a specific implementation, a flow of generating service data may be that a user inputs a corresponding user operation in a target application in a terminal, the terminal generates a corresponding request packet based on the user operation after detecting the user operation input by the user for the target application, and sends the request packet to a service distribution server, after receiving the request packet, the service distribution server may send the request packet to a corresponding service server based on a load balancing principle, the service server responds based on content in the request packet to generate a corresponding response packet, and sends the response packet to the service distribution server, and the service distribution server sends the response packet to the terminal. Through the above process, the service distribution server may use the name of the target application, the name of the function, the request packet, and the response packet corresponding to the user operation as service data, and store the service data in the form of a log file, where the request packet and the response packet may be specifically 16-ary numbers. As shown in fig. 5, a schematic diagram of service data is shown, where appid represents a name of a target application, cmd represents a name of a function corresponding to a user operation, qmfupstream represents a request packet, and qmfdownstream represents a response packet.
In a specific implementation, the test server may obtain the log file at regular time based on the script file, and specifically may obtain the log file corresponding to the service data from the service distribution server according to the first preset frequency, and further, the test server may analyze the log file to obtain the service data corresponding to the user operation of the target application.
S202, if the preset test case generation condition is determined to be met according to the user operation, the test server generates a test case corresponding to the user operation by using the service data.
In the embodiment of the invention, after the test server acquires the service data corresponding to the user operation of the target application, whether the preset test case generation condition is met or not is determined according to the user operation, and if the preset test case generation condition is met, the test server generates the test case corresponding to the user operation by using the service data.
In an implementation manner, the specific manner in which the test server determines whether the preset test case generation condition is met according to the user operation may be that the test server obtains a history operation record for the target application, and queries whether the history operation record includes an identifier of the user operation; if not, determining that the preset test case generation conditions are met. The historical operation record includes an identifier of a historical user operation for the target application, where the identifier of the user operation is used to represent a name of a function in the target application corresponding to the user operation, and a content "radio service. For example, the user operation identifier recorded in the historical operation record includes an identifier a, an identifier B, and an identifier C, and after the test server receives the service data including the identifier D, it is determined that the service data satisfies a preset test case generation condition, and a test case corresponding to the user operation is generated by using the service data. Further, after the test server generates the test case based on the service data corresponding to the user operation, the identifier of the user operation may be added to the historical operation record, so that the identifier stored in the historical operation record is updated. By the mode, the test server can generate the test case according to the new operation used by the user and test the function corresponding to the new operation in time.
In an implementation manner, the specific manner in which the test server determines whether the preset test case generation condition is met according to the user operation may be that the test server queries whether a test case corresponding to the user operation exists in the database; if not, the test server determines that the service data meets the preset test case generation conditions. Specifically, a plurality of tested reference test cases are stored in the database in advance, the test server can detect whether a reference request packet in the reference test case is the same as a request packet in the service data, and whether a reference response packet in the reference test case is the same as a response packet in the service data, and if so, the test case corresponding to the user operation is determined to exist in the database. If not, determining that the test case corresponding to the user operation does not exist in the database. By the mode, the test server can screen the functions corresponding to the user operation, so that the test cases are not generated repeatedly.
In an implementation manner, the specific manner in which the test server determines whether the preset test case generation condition is met according to the user operation may be that the test server detects whether the service data corresponding to the user operation includes complete information, that is, whether the service data includes a name of the target application, a name of a function corresponding to the user operation, a request packet, and a response packet, and if so, the test server determines that the service data meets the preset test case generation condition.
It should be noted that, a specific manner in which the test server generates the test case corresponding to the user operation by using the service data may be that the test server obtains a template for generating the test case; and calling a test automation tool to import the service data into the corresponding field of the template so as to generate a test case corresponding to the user operation. The template for generating the test case may specifically be a program code edited in advance, and the example is as follows:
Chn=RDChannel(qqacc)
svc=GetSpalshScreenService(chn)
….
upstream=qmf_protocal_define_jce.QmfUpsteam()
upstream.load(‘’)
after the terminal acquires the service data, directly importing the content in the service data into a corresponding field of the template, wherein if the request packet in the service data is' qmfupstream: 005124F ", importing the data into a code in a template to obtain a code" upstream. By implementing the method, the test server can directly generate the corresponding test case after receiving the service data, and developers do not need to edit codes for each test, so that the test efficiency of the application program test is improved.
S203, the test server runs the test case corresponding to the user operation to test the function of the target application triggered by the user operation.
In the embodiment of the invention, after the test server generates the test case corresponding to the user operation by using the service data, the test case corresponding to the user operation can be operated so as to test the function of the target application triggered by the user operation.
In one implementation, after the test server generates the test case, it is detected whether the current operating environment of the test server meets the test case operating conditions, and if so, the test server may operate the test case and obtain a test result, where the test case operating conditions may be that the current load amount is less than a preset load amount, the current time period is within a preset time period, the number of currently tested cases is less than a preset number, and the like, and may be specifically preset by a research and development staff.
In an implementation manner, after the test server generates the test case, the test case corresponding to the user operation may also be stored in the data management server, specifically, the test server sends the test case corresponding to the user operation to the data management server, and the data management server receives and stores the test case, where at least one test case is stored in the data management server, and the at least one test case is a test case that the data management server has historically received the test case sent by the test server. The test server may extract a test case corresponding to the user operation from the data management server at regular time based on the pre-edited script file for testing, and specifically, the test server extracts the test case corresponding to the user operation from at least one test case stored in the data management server according to a second preset frequency, so as to test a function of the target application triggered by the user operation.
In the embodiment of the invention, a test server acquires service data corresponding to user operation of a target application; if the test server determines that the preset test case generation condition is met according to the user operation, generating a test case corresponding to the user operation by using the service data; and the test server runs the test case corresponding to the user operation so as to test the function of the target application triggered by the user operation. By implementing the method, the test case can be generated based on the operation of the user to perform the functional test, and the test efficiency and comprehensiveness of the functional test for the application program are improved, as shown in fig. 6, a comparison schematic diagram of the time required for manually writing the test case and the time required for generating the test case by adopting the method provided by the embodiment of the invention is shown, as can be seen from fig. 6, a large amount of time is required for manually writing the test case, but the time for generating the case by adopting the method provided by the embodiment of the invention is close to 0, that is, the test case can be immediately generated, so that the method provided by the embodiment of the invention greatly improves the test efficiency of the functional test for the application program. As shown in fig. 7, which is a schematic diagram illustrating a comparison between a development threshold for manually writing a test case and a development threshold for generating a test case by using the method provided by the embodiment of the present invention, it can be seen from fig. 7 that the technical requirement for developers is higher when the test case is manually written, whereas the technical requirement for the developers is lower when the test case is generated by using the method provided by the embodiment of the present invention.
Based on the description of the embodiments of the test system and the test method, the embodiment of the present invention provides another test method, which may be applied to the test system shown in fig. 1, and specifically may be executed by the test server shown in fig. 1. Referring to fig. 3, the functional test procedure may include the following steps S301 to S305:
s301, the test server obtains service data corresponding to user operation of the target application.
In the embodiment of the present invention, the target application may be any application program that needs to be tested, the service data may include a name of the target application used by a user operation, a name of a function of the target application, a request packet generated by the terminal based on the user operation, and a response packet returned by the service server based on the request packet, and specifically, the service data may be generated by the service distribution server according to the received request packet and response packet when performing data interaction with the terminal and the service server.
Further, the service distribution server may classify the service data according to the name of the function of the target application in the service data, and count the number of times of triggering of the user operation corresponding to the service data in a preset period, that is, the number of the service data of the type, where the name of the function of the target application is determined by the user operation. The test server may send a data acquisition request instruction to the service distribution server, and receive service data corresponding to the user operation sent by the service distribution server, and the number of times of triggering of the user operation corresponding to the type of service data within a preset period.
S302, if the preset test case generation condition is determined to be met according to the user operation, the test server generates a test case corresponding to the user operation by using the service data.
In the embodiment of the invention, after the test server acquires the service data corresponding to the user operation of the target application, whether the preset test case generation condition is met or not is determined according to the user operation, and if the preset test case generation condition is met, the test server generates the test case corresponding to the user operation by using the service data.
In an implementation manner, the specific manner in which the test server determines whether the preset test case generation condition is met according to the user operation may be that the test server obtains a history operation record for the target application, and queries whether the history operation record includes an identifier of the user operation; if not, determining that the preset test case generation conditions are met.
In an implementation manner, the specific manner in which the test server determines whether the preset test case generation condition is met according to the user operation may be that the test server queries whether a test case corresponding to the user operation exists in the database; if not, the test server determines that the preset test case generation conditions are met.
In an implementation manner, the specific manner in which the test server determines whether the preset test case generation condition is met according to the user operation may be that the test server detects whether the number of trigger times of the user operation corresponding to the service data in the preset period is greater than the target number of trigger times, and if so, determines that the preset test case generation condition is met. The target triggering times may be the maximum triggering times recorded in the historical operation record, where the historical operation record specifically records the service data historically uploaded by the service distribution server and the historical triggering times of the user operation corresponding to the service data. Alternatively, the target number of triggers may be preset by the developer.
S303, the test server stores the test case corresponding to the user operation into the data management server.
In the embodiment of the invention, after the test server acquires the test case corresponding to the user operation, the test case can be sent to the data management server connected with the test case, and the data management server stores the received test case.
S304, the test server extracts the test case corresponding to the user operation from at least one test case stored in the data management server according to a second preset frequency.
In the embodiment of the invention, after the test case is sent to the data management server connected with the test server by the test server, the test case corresponding to the user operation can be extracted from at least one test case stored in the data management server according to the second preset frequency. The second preset frequency can be 1 hour, 1 day and the like, and can be preset by research and development personnel, and in the mode, the test server can directly acquire the corresponding test case from the data management server when the test is needed, and a developer does not need to edit codes, so that the test efficiency is improved.
S305, the test server runs a test case corresponding to the user operation so as to test the function of the target application triggered by the user operation.
In the embodiment of the invention, after the test server receives the test case corresponding to the user operation sent by the data management server, the test case corresponding to the user operation can be operated so as to test the function of the target application triggered by the user operation. The running times of the test cases can be determined by the triggering times of the user operations corresponding to the test cases. In one implementation mode, the test server obtains the number of triggering times of the user operation at this time and the historical number of triggering times of the user operation recorded in the historical record, determines a change rule of the number of triggering times based on the number of triggering times and the historical number of triggering times, and determines the number of running times of the test case of the test at this time based on the change rule. In an implementation manner, the number of times of running the test case may also be the same as the number of times of triggering the user operation, so that playback of a real function application scenario may be implemented. Or the running times of the test cases can be N times of the triggering times of the user operation to realize the pressure detection of the functions of the target application, wherein N is a positive integer and can be preset by research personnel.
It should be noted that before the test server runs the test case corresponding to the user operation, it may also be detected whether the test server itself meets a case running condition, and if the test case meets the case running condition, the test server runs the test case, where the case running condition may be that the current load amount is smaller than the preset load amount, the current time period is within the preset time period, the number of the currently tested cases is smaller than the preset number, and the like, and may be specifically preset by a research and development staff.
In the embodiment of the invention, a test server acquires service data corresponding to user operation of a target application; if the test server determines that the preset test case generation condition is met according to the user operation, generating a test case corresponding to the user operation by using the service data; the test server stores the test case corresponding to the user operation in the data management server, extracts the test case corresponding to the user operation from at least one test case stored in the data management server according to a second preset frequency, and runs the test case corresponding to the user operation so as to test the function of the target application triggered by the user operation. By implementing the method, the test case can be generated based on the operation of the user to perform the functional test, and the test efficiency of performing the functional test on the application program is improved.
Based on the description of the embodiments of the test system and the test method, the embodiment of the present invention provides another test method, which may be applied to the test system shown in fig. 1, and specifically may be executed by the terminal, the service distribution server, the service server, the test server, and the data management server shown in fig. 1 interactively. Referring to fig. 4, the method may include the following steps S401 to S409:
s401, the terminal detects user operation aiming at the target application, generates a request packet according to the user operation and sends the request packet to the service distribution server.
S402, the service distribution server sends the request packet to the service server.
S403, the service server generates a response packet according to the received request packet, and sends the generated response packet to the service distribution server.
S404, the service distribution server sends the response packet to the terminal, and generates service data corresponding to the user operation of the target application according to the request packet and the response packet.
S405, the test server sends a data acquisition request instruction to the service distribution server and acquires service data corresponding to user operation of the target application.
S406, the test server generates a test case according to the service data corresponding to the user operation and sends the test case to the data management server.
And S407, the data management server receives and stores the test case corresponding to the user operation.
S408, the test server extracts the test case corresponding to the user operation from at least one test case stored in the data management server according to a second preset frequency.
And S409, the test server runs the test case corresponding to the user operation so as to test the function of the target application triggered by the user operation.
By implementing the method, the test case can be generated based on the operation of the user to perform the functional test, and the test efficiency of performing the functional test on the application program is improved.
Based on the description of the foregoing testing method embodiment, the embodiment of the present invention further discloses a testing apparatus, which may be applied to the testing system shown in fig. 1, and specifically, the testing apparatus may be operated in a testing server in the testing system shown in fig. 1. The testing device may be a computer program (comprising program code) running in the testing server or may be a physical device comprised in the testing server. The test apparatus may perform the methods shown in fig. 2-4. Referring to fig. 8, the testing apparatus 80 includes: an acquisition module 801, a generation module 802, an execution module 803, a query module 804, a determination module 805, and a storage module 806.
An obtaining module 801, configured to obtain service data corresponding to a user operation for a target application;
a generating module 802, configured to generate a test case corresponding to the user operation by using the service data if it is determined that a preset test case generation condition is met according to the user operation;
an operation module 803, configured to operate the test case corresponding to the user operation, so as to test the function of the target application triggered by the user operation.
In an implementation manner, the service data includes an identifier of the user operation, and the obtaining module 801 is specifically configured to:
an obtaining module 801, configured to obtain a historical operation record for the target application, where the historical operation record includes an identifier of a historical operation for the target application;
a query module 804, configured to query whether the historical operation record includes the identifier of the user operation;
the determining module 805 is configured to determine that a preset test case generating condition is met if the test case generating condition is not met.
In an implementation manner, the query module 804 is configured to query whether a test case corresponding to the user operation exists in a database;
the determining module 805 is configured to determine that a preset test case generating condition is met if the test case generating condition is not met.
In an implementation manner, the obtaining module 801 is further configured to obtain a template for generating a test case;
a generating module 802, configured to invoke a test automation tool to import the service data into the corresponding field of the template, so as to generate a test case corresponding to the user operation.
In an implementation manner, the obtaining module 801 is specifically configured to:
acquiring a log file corresponding to the service data from a service distribution server according to a first preset frequency;
and analyzing the log file to acquire the service data.
In an implementation manner, the storage module 806 is configured to store a test case corresponding to the user operation in a data management server, where at least one test case is stored in the data management server;
an obtaining module 801, configured to extract, according to a second preset frequency, a test case corresponding to the user operation from the at least one test case stored in the data management server.
In one implementation, the storage module 806 is configured to add the identifier of the user operation to the historical operation record.
In the embodiment of the present invention, an obtaining module 801 obtains service data corresponding to a user operation for a target application; if it is determined that the preset test case generation condition is met according to the user operation, the generation module 802 generates a test case corresponding to the user operation by using the service data; the running module 803 runs the test case corresponding to the user operation to test the function of the target application triggered by the user operation. By implementing the method, the test case can be generated based on the operation of the user to perform the functional test, and the test efficiency of performing the functional test on the application program is improved.
Fig. 9 is a schematic structural diagram of a test server according to an embodiment of the present invention. As shown in fig. 9, the test server includes: at least one processor 901, an input device 903, an output device 904, a memory 905, at least one communication bus 902. Wherein a communication bus 902 is used to enable connective communication between these components. The memory 905 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 905 may optionally be at least one memory device located remotely from the processor 901. Wherein the processor 901 may be combined with the apparatus described in fig. 8, the memory 905 stores a set of program codes, and the processor 901, the input device 903, and the output device 904 call the program codes stored in the memory 905 to perform the following operations:
the input device 903 is used for acquiring service data corresponding to user operation of a target application;
a processor 901, configured to generate a test case corresponding to the user operation by using the service data if it is determined that a preset test case generation condition is met according to the user operation;
the processor 901 runs the test case corresponding to the user operation to test the function of the target application triggered by the user operation.
In one implementation, the processor 901 is specifically configured to:
obtaining a historical operation record aiming at the target application, wherein the historical operation record comprises an identifier of a historical operation aiming at the target application;
inquiring whether the historical operation record comprises the identification of the user operation;
if not, determining that the preset test case generation conditions are met
In one implementation, the processor 901 is specifically configured to:
inquiring whether a test case corresponding to the user operation exists in a database;
if not, determining that the preset test case generation conditions are met.
In one implementation, the processor 901 is specifically configured to:
acquiring a template for generating a test case;
and calling a test automation tool to lead the service data into the corresponding field of the template so as to generate a test case corresponding to the user operation.
In one implementation, the processor 901 is specifically configured to:
acquiring a log file corresponding to the service data from a service distribution server according to a first preset frequency;
and analyzing the log file to acquire the service data.
In one implementation, the processor 901 is specifically configured to:
storing the test case corresponding to the user operation into a data management server, wherein at least one test case is stored in the data management server;
and extracting the test case corresponding to the user operation from the at least one test case stored in the data management server according to a second preset frequency.
In one implementation, the processor 901 is specifically configured to:
and adding the identification of the user operation into the historical operation record.
In the embodiment of the present invention, the input device 903 obtains service data corresponding to a user operation for a target application; if it is determined that the preset test case generation condition is satisfied according to the user operation, the processor 901 generates a test case corresponding to the user operation by using the service data; the processor 901 runs a test case corresponding to the user operation to test the function of the target application triggered by the user operation. By implementing the method, the test case can be generated based on the operation of the user to perform the functional test, and the test efficiency of performing the functional test on the application program is improved.
The module in the embodiment of the present invention may be implemented by a general-purpose Integrated Circuit, such as a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit).
It should be understood that, in the embodiment of the present invention, the Processor 901 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The bus 902 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like, and the bus 902 may be divided into an address bus, a data bus, a control bus, or the like, where fig. 9 only shows one bold line for convenience of illustration, but does not show only one bus or one type of bus.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The computer-readable storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. A method of testing, the method comprising:
acquiring service data corresponding to user operation of a target application;
if the preset test case generation condition is determined to be met according to the user operation, generating a test case corresponding to the user operation by using the service data;
and running the test case corresponding to the user operation to test the function of the target application triggered by the user operation.
2. The method according to claim 1, wherein the service data includes an identifier of the user operation, and the determining that a preset test case generation condition is satisfied according to the user operation includes:
obtaining a historical operation record aiming at the target application, wherein the historical operation record comprises an identifier of a historical operation aiming at the target application;
inquiring whether the historical operation record comprises the identification of the user operation;
if not, determining that the preset test case generation conditions are met.
3. The method according to claim 1, wherein the determining that a preset test case generation condition is satisfied according to the user operation comprises:
inquiring whether a test case corresponding to the user operation exists in a database;
if not, determining that the preset test case generation conditions are met.
4. The method according to any one of claims 1 to 3, wherein the generating a test case corresponding to the user operation by using the service data includes:
acquiring a template for generating a test case;
and calling a test automation tool to lead the service data into the corresponding field of the template so as to generate a test case corresponding to the user operation.
5. The method according to claim 1, wherein the obtaining of the service data corresponding to the user operation for the target application comprises:
acquiring a log file corresponding to the service data from a service distribution server according to a first preset frequency;
and analyzing the log file to acquire the service data.
6. The method according to claim 1, wherein after the test case corresponding to the user operation is generated by using the service data, before the test case corresponding to the user operation is run to test the function of the target application triggered by the user operation, the method further comprises:
storing the test case corresponding to the user operation into a data management server, wherein at least one test case is stored in the data management server;
and extracting the test case corresponding to the user operation from the at least one test case stored in the data management server according to a second preset frequency.
7. The method of claim 2, wherein after determining that the predetermined test case generation condition is satisfied, the method further comprises:
and adding the identification of the user operation into the historical operation record.
8. A test apparatus, the apparatus comprising:
the acquisition module is used for acquiring service data corresponding to user operation of the target application;
the generating module is used for generating a test case corresponding to the user operation by using the service data if the preset test case generating condition is determined to be met according to the user operation;
and the running module is used for running the test case corresponding to the user operation so as to test the function of the target application triggered by the user operation.
9. A test server, comprising a processor, an input interface, an output interface and a memory, the processor, the input interface, the output interface and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-7.
CN201910659734.3A 2019-07-19 2019-07-19 Test method, test device, server and storage medium Pending CN112241362A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910659734.3A CN112241362A (en) 2019-07-19 2019-07-19 Test method, test device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910659734.3A CN112241362A (en) 2019-07-19 2019-07-19 Test method, test device, server and storage medium

Publications (1)

Publication Number Publication Date
CN112241362A true CN112241362A (en) 2021-01-19

Family

ID=74168038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910659734.3A Pending CN112241362A (en) 2019-07-19 2019-07-19 Test method, test device, server and storage medium

Country Status (1)

Country Link
CN (1) CN112241362A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817851A (en) * 2021-01-29 2021-05-18 北京嘀嘀无限科技发展有限公司 Service testing method, device, equipment, medium and computer program product
CN112925725A (en) * 2021-04-09 2021-06-08 网易(杭州)网络有限公司 Data testing method and device, readable storage medium and electronic equipment
CN113051183A (en) * 2021-04-30 2021-06-29 中国工商银行股份有限公司 Test data recommendation method and system, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101521608A (en) * 2009-01-22 2009-09-02 厦门东南融通系统工程有限公司 Method for edition management of test case
CN105512046A (en) * 2016-02-01 2016-04-20 北京理工大学 Particle swarm optimization (PSO) algorithm based Android automatic testing method
CN107133161A (en) * 2016-02-26 2017-09-05 中国移动(深圳)有限公司 One kind generation client performance test script method and device
CN108415831A (en) * 2018-02-05 2018-08-17 五八有限公司 Method for generating test case and device, electronic equipment and readable storage medium storing program for executing
CN109144842A (en) * 2017-06-16 2019-01-04 百度在线网络技术(北京)有限公司 Method and apparatus for test application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101521608A (en) * 2009-01-22 2009-09-02 厦门东南融通系统工程有限公司 Method for edition management of test case
CN105512046A (en) * 2016-02-01 2016-04-20 北京理工大学 Particle swarm optimization (PSO) algorithm based Android automatic testing method
CN107133161A (en) * 2016-02-26 2017-09-05 中国移动(深圳)有限公司 One kind generation client performance test script method and device
CN109144842A (en) * 2017-06-16 2019-01-04 百度在线网络技术(北京)有限公司 Method and apparatus for test application
CN108415831A (en) * 2018-02-05 2018-08-17 五八有限公司 Method for generating test case and device, electronic equipment and readable storage medium storing program for executing

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817851A (en) * 2021-01-29 2021-05-18 北京嘀嘀无限科技发展有限公司 Service testing method, device, equipment, medium and computer program product
CN112925725A (en) * 2021-04-09 2021-06-08 网易(杭州)网络有限公司 Data testing method and device, readable storage medium and electronic equipment
CN112925725B (en) * 2021-04-09 2024-03-15 网易(杭州)网络有限公司 Data testing method and device, readable storage medium and electronic equipment
CN113051183A (en) * 2021-04-30 2021-06-29 中国工商银行股份有限公司 Test data recommendation method and system, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN107193750B (en) Script recording method and device
CN107122258B (en) Method and equipment for checking state code of test interface
CN111897724B (en) Automatic testing method and device suitable for cloud platform
CN107391359B (en) Service testing method and device
CN107229559B (en) Detection method and device for testing integrity of service system
CN114546738B (en) Universal test method, system, terminal and storage medium for server
CN112241362A (en) Test method, test device, server and storage medium
CN110650531B (en) Base station coordinate calibration method, system, storage medium and equipment
CN113704117B (en) Algorithm testing system, method and device
CN109726091B (en) Log management method and related device
CN109189677B (en) Test method and device for updating state of variable value
CN114328250A (en) Automatic self-checking method, medium and device for software system
CN110838929B (en) System error checking method and system error checking device
CN115022201B (en) Data processing function test method, device, equipment and storage medium
CN109995931B (en) Method and device for realizing automatic calling
CN113608990B (en) Terminal performance detection method, device and storage medium
CN108563578A (en) SDK compatibility detection method, device, equipment and readable storage medium storing program for executing
CN113282506A (en) Test data acquisition method, device, equipment and computer readable storage medium
CN113452533B (en) Charging self-inspection and self-healing method and device, computer equipment and storage medium
CN112559368A (en) Interface automation test method and its use case generation method, equipment and storage medium
CN108255715B (en) Test result processing method and terminal equipment
CN117667604B (en) Data monitoring method, device, electronic equipment and storage medium for tracking event
CN112306723A (en) Operation information acquisition method and device applied to small program
CN113051176B (en) Automatic test data processing method and device, electronic equipment and storage medium
CN111026650B (en) Method and device for testing software, storage medium and electronic equipment

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