CN109240924B - Application program testing method and device - Google Patents

Application program testing method and device Download PDF

Info

Publication number
CN109240924B
CN109240924B CN201811019892.4A CN201811019892A CN109240924B CN 109240924 B CN109240924 B CN 109240924B CN 201811019892 A CN201811019892 A CN 201811019892A CN 109240924 B CN109240924 B CN 109240924B
Authority
CN
China
Prior art keywords
test
application program
program
test environment
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811019892.4A
Other languages
Chinese (zh)
Other versions
CN109240924A (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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201811019892.4A priority Critical patent/CN109240924B/en
Publication of CN109240924A publication Critical patent/CN109240924A/en
Application granted granted Critical
Publication of CN109240924B publication Critical patent/CN109240924B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention is applicable to the technical field of information processing, and provides a method and equipment for testing an application program, wherein the method comprises the following steps: if a test starting instruction of the application program is received, acquiring a program file of the application program; extracting a test template associated with the test environment type from a test template library, importing test environment parameters into the test template, and building a test environment of an application program; operating an application program in a test environment, and acquiring operation parameters of each interface in the application program; based on the operating parameters, a test report of the application is generated. According to the invention, parameters required by constructing the test environment of the application program, namely the test environment type and the test environment parameters, are packaged in the program file of the application program, so that the time for configuring the test environment by a developer is reduced, and the test efficiency of the application program is improved.

Description

Application program testing method and device
Technical Field
The invention belongs to the technical field of information processing, and particularly relates to a method and equipment for testing an application program.
Background
With the continuous development of terminal technology, in order to meet various demands of users in the use process, the number of application programs and the update speed are also continuously increased, so how to efficiently verify the application programs directly affects the release speed of the application programs. Before the application program is released, the completeness and correctness of the application program are required to be tested, and the existing application program testing technology generally uploads the application program to be tested to a testing platform, builds a corresponding testing environment in the testing platform, and tests the application program in the testing environment; however, the application program often needs to be tested repeatedly, and the test platform can respond to test requests of other application programs and construct another test environment in the test interval period of the application program, so that a developer needs to reconfigure the test environment of the test platform manually every time the application program is uploaded for testing, thereby wasting labor cost and reducing the test efficiency of the application program.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a method and an apparatus for testing an application program, so as to solve the problems of the existing method for testing an application program, such as high load pressure on a file server, low capacity of a system, and high capacity expansion difficulty.
A first aspect of an embodiment of the present invention provides a method for testing an application program, including:
if a test starting instruction of an application program is received, acquiring a program file of the application program; the program file carries a test environment type and test environment parameters;
extracting a test template associated with the test environment type from a test template library, importing the test environment parameters into the test template, and building a test environment of the application program;
operating the application program in the test environment, and acquiring the operation parameters of each interface in the application program;
and generating a test report of the application program based on the operation parameters.
A second aspect of an embodiment of the present invention provides a terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the first aspect when executing the computer program.
A third aspect of the embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the first aspect.
The application program testing method and the application program testing equipment provided by the embodiment of the invention have the following beneficial effects:
according to the embodiment of the invention, parameters required by the test environment of the application program, namely the test environment type and the test environment parameters, are packaged in the program file of the application program, so that the terminal equipment can extract the test environment type and the test environment parameters from the program file, build the test environment required by the application program, automatically start the test flow of the application program, output the test report of the application program, reduce the time for a developer to configure the test environment, and improve the test efficiency of the application program.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an implementation of a test method for an application program according to a first embodiment of the present invention;
FIG. 2 is a flowchart showing a test method for an application program according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating an implementation of a method for testing an application program according to a third embodiment of the present invention;
fig. 4 is a flowchart showing an implementation of a test method S103 for an application according to a fourth embodiment of the present invention;
fig. 5 is a flowchart showing an implementation of a test method S104 for an application according to a fifth embodiment of the present invention;
fig. 6 is a block diagram of a terminal device according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a terminal device according to another embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
According to the embodiment of the invention, parameters required by the test environment of the application program, namely the test environment type and the test environment parameters, are packaged in the program file of the application program, so that the terminal equipment can extract the test environment type and the test environment parameters from the program file, build the test environment required by the application program, automatically start the test flow of the application program, output the test report of the application program, manually reconfigure the test environment of the test platform every time the application program is tested, and the problems of labor cost waste and application program test efficiency reduction are solved.
In the embodiment of the present invention, the execution subject of the flow is a terminal device. The terminal device includes, but is not limited to: and equipment with the test function of the application program, such as a server, a computer, a smart phone, a tablet computer and the like. The terminal device may be a test platform of an application program, which is used for building a test environment for testing the application program, and responding to an application program test request initiated by each user terminal, and the test platform of the application program may be a test system formed by one or more servers. Fig. 1 shows a flowchart of an implementation of a test method for an application program according to a first embodiment of the present invention, which is described in detail below:
in S101, if a test start instruction of an application program is received, a program file of the application program is obtained; the program file carries the test environment type and the test environment parameters.
In this embodiment, when the user terminal needs to test the application program, a test start instruction of the application program may be sent to the terminal device, so that when the terminal device receives the test start instruction, the operation of S101 may be performed. Of course, the test start instruction includes a program identifier of the application program, and the terminal obtains a program file of the application program corresponding to the program identifier according to the program identifier. The program file may be stored in a local storage unit of the terminal device, in which case the terminal device directly queries a storage path of the program file in the local storage unit according to the program identifier, and extracts the program file of the application program from the storage path to the corresponding storage address. The program files of the application programs can also be stored on the cloud server, in which case, the terminal device can establish communication connection with the cloud server, send an application program acquisition request to the cloud server, and the cloud server returns the program files of the application programs corresponding to the application program acquisition request to the terminal device according to the program identifiers contained in the application program acquisition request.
Optionally, if the terminal device does not acquire the program file of the obtained application program, that is, the local storage unit and/or the cloud server of the terminal device does not store the application program, an application program uploading request is returned to the user terminal initiating the test starting instruction, so that the user terminal sends the program file to the terminal device, and after the terminal device receives the program file of the application program, the relevant operation of S102 is executed.
In this embodiment, the program file of the application program has been pre-packaged with the test environment type and the test environment parameters that need to be set during the test. The test environment type is specifically used for determining a test template used for testing the application program, the test template can include types of input parameters, for example, for an application program of an image processing type, the types of the input parameters are data of an image type or a video type, for an application program of a social interaction type, the types of the input parameters are interaction instructions, for different types of application programs, the used test templates are different, and the terminal equipment can select the test template matched with the application program by setting the test environment type. The test environment parameters are specifically used for defining each custom test parameter in the test template to meet the test requirement of the application program, and the test environment parameters can be used for defining test items of the application program and specific test signals required by each test item. Because the application program often needs to be tested repeatedly in the process from development to release, when the test fails, the source code data of the application program needs to be adjusted to repair the abnormal situation. The test environment type and the test environment parameters are packaged in the program file of the application program, so that configuration can be carried out only once, in the subsequent test process, only the source code data part of the application program is required to be modified, the test flow can still obtain the test parameters which are set in advance, repeated configuration of the test parameters is avoided, and the test efficiency is improved.
Alternatively, the test environment type and test environment parameters of the application program may be automatically configured by the developer, in addition to manually configuring the test environment type and test environment parameters when the developer first generates the program file, in the following manner: the terminal equipment identifies the program type of the application program, queries a test template corresponding to the program type based on the corresponding relation between the program type and the test template, and acquires the test environment type of the test template; meanwhile, the terminal equipment detects interface parameters contained in the program file and outputs test environment parameters of the application program based on the interface parameters; and encapsulating the determined test environment type and the test environment parameters in a program file of the application program to realize automatic configuration of the test parameters.
In S102, a test template associated with the test environment type is extracted from a test template library, and the test environment parameters are imported into the test template to build a test environment of the application program.
In this embodiment, after receiving a program file of an application program, a terminal device extracts a test environment type and a test environment parameter contained in the program file, matches a test template in a test module library according to the test environment type, selects a test module successfully matched as the test template of the application program, and fills each parameter value in the test environment parameter into a region corresponding to the test template after determining the test template. The specific filling mode can be as follows: and the terminal equipment matches each option in the test template based on the parameter description information, selects the option with the highest matching degree as a filling area corresponding to the parameter value, and imports the filling area into the option of the test template. After the test environment parameters are all imported, the test environment of the application program can be built based on the imported test template, and the subsequent test operation of the application program can be executed.
In this embodiment, the test template library may be stored in a local storage area of the application program, or may be stored in a cloud server, which is not limited herein. If the test template library does not have the test template matched with the test template type, outputting test abnormality information to the user terminal so that the user terminal creates the corresponding test template according to the application program and uploads the test template to the test template library. Of course, the terminal device may also parse the program file to determine whether the program file includes a test template corresponding to the application program, and if so, add the test template to a test template library and associate with the test environment type.
In S103, the application program is run in the test environment, and the running parameters of each interface in the application program are obtained.
In this embodiment, after the terminal device builds a test environment for the application program, the terminal device may execute a test procedure of the application program. If the test environment is a virtual device system, that is, the virtual device does not have the registration information of the application program, in order to normally start the application program, the terminal device may execute the installation operation of the application program in the virtual device system, and after the installation is completed, the application program is run, and the application program is tested by a preset test instance, and the running parameters of each interface of the application program are obtained.
In this embodiment, application test cases of different test items may be stored in the terminal device, and the terminal device extracts application test cases of each test item from the test case library by detecting the test item included in the test template, so that operation parameters required by each test item can be acquired based on a plurality of application test cases, and the related operation of S104 is performed. Optionally, if the terminal device does not include the application test case of the application program, the terminal device may parse the application program to obtain a performance parameter of the application program, and adjust a parameter value in a test case template based on the performance parameter, for example, the application program may perform 3-thread parallel operation at the same time, and then three concurrent analog signals may be configured in the test case template and input to the application program, so as to determine whether the application program passes the test by detecting an operation parameter when the application program processes the three-way analog input signals at the same time.
In S104, a test report of the application is generated based on the operation parameters.
In this embodiment, after the terminal device collects the required operation parameters, the terminal device matches the test parameters with a preset operation threshold value, and determines whether the application program operates within the rated parameter range, so as to determine whether the application program has an abnormality, such as memory leakage, operation logic confusion, and the like, and generates a test report of the application program according to the test results of each test item.
Optionally, if the test report contains a test item which fails to pass the test, returning program exception information to the user terminal, and adding the test item information which fails to pass the test in the program exception information, so that a developer of the application program can optimize and adjust the application program according to the program exception information; otherwise, if all the test items in the test report pass the test, the application program can be uploaded to the program release platform so that other user terminals can download the application program.
It can be seen from the foregoing that, in the test method for an application program provided by the embodiment of the present invention, parameters required by a test environment of an application program, that is, a test environment type and a test environment parameter, are encapsulated in a program file of the application program, so that a terminal device can extract the test environment type and the test environment parameter from the program file, build the test environment required by the application program, automatically start a test flow of the application program, output a test report of the application program, reduce a time for a developer to configure the test environment, and improve test efficiency of the application program.
Fig. 2 is a flowchart showing a specific implementation of a test method for an application according to a second embodiment of the present invention. Referring to fig. 2, with respect to the embodiment of fig. 1, in the method for testing an application provided in this embodiment, before the obtaining of the program file of the application, the method further includes: s201 to S202, and S101 includes: s203 to S204, specifically described below:
Further, before the acquiring the program file of the application program, the method further includes:
in S201, a program file setting instruction regarding the application program is received; the program file setting instruction includes the test environment type and the test environment parameter.
In this embodiment, the terminal device may further modify the native file of the application program, so that the program files of the application programs uploaded to the terminal device for testing each include a test environment type and a test environment parameter required for building a test environment. Since most application native files typically contain only program data that originates from the program execution logic, and the synchronization frames that are required when the application is sent. Optionally, the format of the native file of the application program includes: a sync frame field, an application status field, a source code data field, and a reserved field, as shown in table 1.
Synch Frame APP State MainData Reserve
TABLE 1
In this embodiment, the user may send a program file setting instruction related to the application program to the mobile terminal, where the program file setting instruction carries the test environment type and the test environment parameter, so as to implement a configuration operation on the test environment of the application program. The user can directly input the two types of information on the terminal equipment, and click a button such as 'set-up completion' or 'instruction generation' to generate the program file setting instruction. Of course, the user can also configure the local user terminal, after the setting is completed, the communication connection between the user terminal and the terminal device is established, and a program file setting instruction of the application program is sent to the terminal device. It should be noted that, the program file setting instruction includes, in addition to the above two types of test environment parameters, a program identifier of an application program, so that the terminal device determines which application program's native file needs to be modified.
In S202, a test configuration frame is generated based on the program file setting instruction, and the test configuration frame is inserted between a synchronization frame field and a program data field of a native file of the application program, and the program file is output.
In this embodiment, after receiving a program file setting instruction, the terminal device extracts a corresponding native file from an application program library based on a program identifier of an application program, parses the native file, identifies a synchronization frame field and a program data field included in the native file, inserts a test configuration frame between the two fields, where the test configuration frame includes a test environment parameter and a test environment type, and identifies the native file inserted with the test configuration frame as a program file of the application program. Optionally, the data format of the program file of the application program is shown in table 2, where "Testing Environment" is a test configuration frame; "Environment Type" is the test Environment Type; "Environment Parameter" is a test environment parameter.
TABLE 2
Optionally, after receiving the environment test instruction of the application program, the terminal device identifies whether the application program has adjusted the native file of the application program, that is, the application program has generated the program file including the test configuration frame, in this case, the terminal device only needs to replace the data in the test configuration frame of the program file according to the test environment type and the test environment parameter included in the program file setting instruction sent at this time, without regenerating the test configuration frame, and inserting the test configuration frame into the native file of the application program, thereby improving the modification efficiency of the application program.
Further, the acquiring the program file of the application program includes:
in S203, a sync frame identification thread is invoked to detect whether the data received by the communication port is a sync frame field.
In this embodiment, during the process of receiving an application program, the terminal device starts a synchronization frame identification thread, analyzes data received in the data communication interface, and identifies whether the received data is a synchronization frame field. The specific process of identification is as follows: the data format of the synchronization frame is already agreed between the terminal equipment and the user terminal based on the preset communication protocol, for example, a pulse signal with the frequency of 100Hz is sent for 2S, namely, the data format is an synchronization frame, so the terminal equipment can check the received data based on the preset agreed data format, detect whether the received data accords with the data format of the synchronization frame field, if so, identify the received data as the synchronization frame field, and execute the related operation of S204; otherwise, the data is identified as noise data, and monitoring and data format verification are continuously carried out on the received data.
In this embodiment, after the terminal device reforms the native file of the application program, the native file may need to be returned to the user terminal to modify the source code data of the application program, so that the acquisition operation of the program file may need to be performed again.
In S204, if the sync frame field is detected, identifying data of fields adjacent to the sync frame field as the test configuration frame, extracting a test environment type and a test environment parameter included in the test configuration frame, and executing the operation of extracting the test template associated with the test environment type from the test template library.
In this embodiment, after detecting that there is a synchronization frame field, the terminal device may use the data received after the synchronization frame field as a test configuration frame of the application program, intercept the received data to obtain the test configuration frame after presetting the byte number, thereby extracting the test environment type and the test environment parameter of the program file of the application program, and jump to the step of executing the test environment creation, where at the same time, the terminal device may still obtain the content of the program data field of the application program through the communication interface.
In the embodiment of the invention, the application range of the application program test can be improved by modifying the original file of the application program, and on the other hand, the test environment of the application program can be configured in the process of receiving the program data by identifying the synchronous frame field, so that the test efficiency of the application program is improved.
Fig. 3 is a flowchart of a specific implementation of a test method for an application according to a second embodiment of the present invention. Referring to fig. 3, with respect to the embodiment of fig. 1, the method for testing an application program provided in this embodiment further includes, before the acquiring the program file of the application program: s301 to S304 are specifically described below:
in S301, a version number of the application program is acquired, and a program file of an associated program of the application program is acquired based on the version number.
In this embodiment, the terminal device not only manually configures the test environment type and the test environment parameters by the user, but also automatically configures and adjusts according to the test environment of the association program having an association relationship with the application program, thereby reducing the operations required to be executed by the user. In this case, the terminal device may acquire the version number of the application program, and match the version number with the version number of each application program in the application program library based on the version number, so as to identify and obtain the associated program of the application program. Optionally, the version number of the associated program and the version number of the application program to be tested are two adjacent version numbers, that is, the associated program is the program of the last version of the application program.
In this embodiment, the associated application program of the application program is identified by the version number, so that the associated program with smaller program data difference from the application program can be determined, and the accuracy of the test environment configuration can be greatly improved by adjusting the test environment parameters of the associated program as the test environment parameters of the application program. Of course, if the terminal device stores the association program correspondence table, the association program of the application program may be queried from the correspondence table according to the version number of the application program, so as to obtain the program file of the association program.
In S302, version change information between the associated program and the application program is identified based on the program file of the associated program and the program file of the application program.
In this embodiment, after acquiring the program file of the associated program and the program file of the application program, the terminal device compares the program data of the two application programs, determines a difference portion existing between the two application programs, and generates a version change record, that is, a different portion existing between the two program files is stored in the form of the version change record, so that all the version change records are aggregated, and version change information between the associated program and the application program can be obtained.
In S303, the test environment type of the associated program is used as the test environment type of the application program, and the test environment parameters of the application program are generated according to the version change information and the test environment parameters of the associated program.
In this embodiment, since two application programs with relatively similar versions between the application program and the associated program, that is, the program types of the two application programs are identical, but there is only a difference in function or program performance, the test environment type of the associated program may be used as the test environment type of the application program, that is, a test environment is built through the same test template, and the test environment parameters of the associated program are adjusted through version change information, so that the adjusted test environment parameters are matched with the function and performance of the application program, and the specific adjustment process is as follows: the terminal equipment identifies a change item based on version change information, matches description information of each test item in the test environment parameters, determines the test item corresponding to the change item, and adjusts the parameter value of the test item based on the parameter value of the change item, so that the adjusted test environment parameters are matched with the application program.
In S304, the test environment type and the test environment parameters of the application program are encapsulated in a program file of the application program.
In this embodiment, the terminal device may encapsulate the test environment type and the test environment parameters obtained by automatic configuration in a program file of the application program, so as to achieve the purpose of automatic configuration of the setting parameters required by the test environment.
In the embodiment of the invention, the automatic configuration of the two types of parameters is realized by acquiring the associated program of the application program and determining the test environment type and the test environment parameter of the application program based on the test environment type and the test environment parameter of the associated program, so that manual adjustment of a user is not required, and the test efficiency of the application program is improved.
Fig. 4 is a flowchart showing a specific implementation of an application program testing method S103 according to a third embodiment of the present invention. Referring to fig. 4, with respect to the embodiments described in fig. 1 to 3, in a test method of an application program provided in this embodiment, S103 includes: s1031 to S1032 are specifically described as follows:
in S1031, if it is detected that the test environment includes a touch test item, a simulated touch process is started.
In this embodiment, most of the clicking operations can be completed by sending corresponding instructions during the remote test, but the test items requiring the sliding operation cannot be simulated by the control instructions. Based on the above, the terminal device may start a touch simulation program, for example, a monkey test program, so that the terminal device can simulate the sliding track function, and complete the test operation of the touch test item.
In S1032, a touch command is randomly generated by the simulated touch process to collect operation parameters of the interface associated with the touch test item.
In this embodiment, the terminal device may randomly generate a plurality of touch instructions through the simulated touch, and use each touch instruction as an input of the application program, so as to detect an operation parameter output by the application program after the touch input, thereby completing a test requirement about a touch test item.
In the embodiment of the invention, the touch simulation program is started to realize that the test items requiring the sliding track can still be carried out in the process of remote test, so that the application field and the application range of the test method of the application program are improved.
Fig. 5 shows a flowchart of a specific implementation of an application program testing method S104 according to a fourth embodiment of the present invention. Referring to fig. 5, with respect to the embodiments described in fig. 1 to 3, in the test method of an application program provided in this embodiment, S104 includes: s1041 to S1042 are specifically described as follows:
in S1041, importing the operation parameters into each test item in a preset test report template, and determining a test result of each test item; the test item records a rated working range of the operation parameters.
In this embodiment, after the terminal device collects the operation parameters of the application program interface, it may identify whether the application program passes the test based on the operation parameters, which is specifically implemented as follows: the terminal equipment can acquire a test report template corresponding to the application program from a local database, the test report template comprises a plurality of test items, each test item records a rated working range of corresponding operation parameters, and the terminal equipment can introduce the test item into the corresponding test item according to the acquired operation parameters and compare the test item with the rated working range of the test item; if the actual operation parameters are within the rated working range, identifying the test item as passing the test; otherwise, if the actual operation parameter is outside the rated operation range, the test item is identified as the test failure.
In S1042, a test report of the application is generated based on the test results of the respective test items.
In this embodiment, the terminal device may generate a test report corresponding to the application program according to the test results of each test item. Of course, if the test result of any test item is test failure, sending a program exception message to the user terminal, and marking all test items failing to test, so that the user can adjust the application program based on the content of test failure; otherwise, if the test result of each test item is that the test is passed, the application program can be issued, and issue confirmation information is sent to the user terminal, so that the user terminal can judge whether the application program needs to be issued.
In the embodiment of the invention, whether the application program is tested is judged by detecting whether the operation parameters of the application program are in the rated working range, so that the test efficiency of the application program and the reading speed of a user on a test report are improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
Fig. 6 shows a block diagram of a terminal device according to an embodiment of the present invention, where the terminal device includes units for performing the steps in the corresponding embodiment of fig. 1. Please refer to fig. 1 and the related description of the embodiment corresponding to fig. 1. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 6, the terminal device includes:
a test start instruction receiving unit 61, configured to obtain a program file of an application program if a test start instruction of the application program is received; the program file carries a test environment type and test environment parameters;
a test environment setting up unit 62, configured to extract a test template associated with the test environment type from a test template library, and import the test environment parameters into the test template, so as to set up a test environment of the application program;
an operation parameter obtaining unit 63, configured to operate the application program in the test environment, and obtain operation parameters of each interface in the application program;
and a test report generating unit 64, configured to generate a test report of the application program based on the operation parameter.
Optionally, the terminal device further includes:
A test environment configuration receiving unit configured to receive a program file setting instruction concerning the application program; the program file setting instruction comprises the test environment type and the test environment parameters;
a test configuration frame inserting unit, configured to generate a test configuration frame based on the program file setting instruction, insert the test configuration frame between a synchronization frame field and a program data field of a native file of the application program, and output the program file;
the test initiation instruction receiving unit 61 includes:
the synchronous frame identification unit is used for calling a synchronous frame identification thread to detect whether the data received by the communication port is a synchronous frame field or not;
and the test configuration frame extraction unit is used for identifying data of fields adjacent to the synchronous frame field as the test configuration frame if the synchronous frame field is detected, extracting the test environment type and the test environment parameter contained in the test configuration frame, and executing the operation of extracting the test template associated with the test environment type from the test template library.
Optionally, the terminal device further includes:
the related program identification unit is used for acquiring the version number of the application program and acquiring a program file of the related program of the application program based on the version number;
A version change information identifying unit configured to identify version change information between the associated program and the application program based on a program file of the associated program and a program file of the application program;
the environment parameter configuration unit is used for taking the test environment type of the associated program as the test environment type of the application program and generating the test environment parameters of the application program according to the version change information and the test environment parameters of the associated program;
and the program file packaging unit is used for packaging the test environment type and the test environment parameters of the application program into the program file of the application program.
Optionally, the operation parameter acquisition unit 63 includes:
the simulated touch process starting unit is used for starting a simulated touch process if the fact that the test environment contains a touch test item is detected;
and the touch instruction output unit is used for randomly generating a touch instruction through the simulated touch process so as to acquire the operation parameters of the interface associated with the touch test item.
Optionally, the test report generating unit 64 includes:
the test item detection unit is used for importing the operation parameters into each test item in a preset test report template and determining a test result of each test item; the test item records a rated working range of the operation parameters;
And the test report output unit is used for generating a test report of the application program based on the test result of each test item.
Therefore, the terminal equipment provided by the embodiment of the invention can also encapsulate parameters required by the test environment of the application program, namely the test environment type and the test environment parameters, in the program file of the application program, so that the terminal equipment can extract the test environment type and the test environment parameters from the program file, build the test environment required by the application program, automatically start the test flow of the application program, output the test report of the application program, reduce the time for a developer to configure the test environment, and improve the test efficiency of the application program.
Fig. 7 is a schematic diagram of a terminal device according to another embodiment of the present invention. As shown in fig. 7, the terminal device 7 of this embodiment includes: a processor 70, a memory 71 and a computer program 72, such as a test program for an application program, stored in said memory 71 and executable on said processor 70. The processor 70, when executing the computer program 72, implements the steps in the test method embodiments of the respective application programs described above, such as S101 to S105 shown in fig. 1. Alternatively, the processor 70, when executing the computer program 72, performs the functions of the units in the above-described device embodiments, such as the functions of the modules 61 to 65 shown in fig. 6.
By way of example, the computer program 72 may be divided into one or more units, which are stored in the memory 71 and executed by the processor 70 to accomplish the present invention. The one or more units may be a series of computer program instruction segments capable of performing a specific function for describing the execution of the computer program 72 in the terminal device 7. For example, the computer program 72 may be divided into a test initiation instruction receiving unit, a test environment building unit, an operating parameter obtaining unit, and a test report generating unit, each unit functioning specifically as described above.
The terminal device 7 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal device may include, but is not limited to, a processor 70, a memory 71. It will be appreciated by those skilled in the art that fig. 7 is merely an example of the terminal device 7 and does not constitute a limitation of the terminal device 7, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The processor 70 may be a central processing unit (Central Processing Unit, CPU), or may be another general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may be an external storage device of the terminal device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used for storing the computer program as well as other programs and data required by the terminal device. The memory 71 may also be used for temporarily storing data that has been output or is to be output.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (6)

1. A method for testing an application program, comprising:
if a test starting instruction of an application program is received, acquiring a program file of the application program; the program file carries a test environment type and test environment parameters;
Extracting a test template associated with the test environment type from a test template library, importing the test environment parameters into the test template, and building a test environment of the application program;
operating the application program in the test environment, and acquiring the operation parameters of each interface in the application program;
generating a test report of the application program based on the operation parameters;
before the acquiring the program file of the application program, the method further comprises:
receiving a program file setting instruction about the application program; the program file setting instruction comprises an instruction for setting the test environment type and the test environment parameters;
generating a test configuration frame based on the program file setting instruction, inserting the test configuration frame between a synchronous frame field and a program data field of a native file of the application program, and outputting the program file;
the acquiring the program file of the application program comprises the following steps:
invoking a sync frame identification thread to detect whether data received by the communication port is a sync frame field, comprising: checking the received data based on a preset communication protocol and a preset data format, and detecting whether the received data accords with the data format of the synchronous frame field;
If the synchronous frame field is detected, identifying data of fields adjacent to the synchronous frame field as the test configuration frame, extracting a test environment type and a test environment parameter contained in the test configuration frame, and executing the operation of extracting a test template associated with the test environment type from a test template library;
before the acquiring the program file of the application program, the method further comprises:
acquiring a version number of the application program, and acquiring a program file of an associated program of the application program based on the version number;
identifying version change information between the associated program and the application program based on the program file of the associated program and the program file of the application program;
taking the test environment type of the associated program as the test environment type of the application program, and generating the test environment parameters of the application program according to the version change information and the test environment parameters of the associated program;
and packaging the test environment type and the test environment parameters of the application program into the program file of the application program.
2. The method of claim 1, wherein running the application in the test environment and obtaining the operating parameters of each interface in the application comprises:
If the fact that the test environment contains touch test items is detected, starting a simulated touch process;
and randomly generating a touch instruction through the simulated touch process so as to acquire the operation parameters of the interface associated with the touch test item.
3. The method of any of claims 1-2, wherein the generating a test report for the application based on the operating parameters comprises:
importing the operation parameters into each test item in a preset test report template, and determining a test result of each test item; the test item records a rated working range of the operation parameters;
and generating a test report of the application program based on the test result of each test item.
4. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
if a test starting instruction of an application program is received, acquiring a program file of the application program; the program file carries a test environment type and test environment parameters;
Extracting a test template associated with the test environment type from a test template library, importing the test environment parameters into the test template, and building a test environment of the application program;
operating the application program in the test environment, and acquiring the operation parameters of each interface in the application program;
generating a test report of the application program based on the operation parameters;
before the program file of the application program is obtained, the processor executes the computer program to realize the following steps:
receiving a program file setting instruction about the application program; the program file setting instruction comprises the test environment type and the test environment parameters;
generating a test configuration frame based on the program file setting instruction, inserting the test configuration frame between a synchronous frame field and a program data field of a native file of the application program, and outputting the program file;
the acquiring the program file of the application program comprises the following steps:
invoking a sync frame identification thread to detect whether data received by the communication port is a sync frame field, comprising: checking the received data based on a preset communication protocol and a preset data format, and detecting whether the received data accords with the data format of the synchronous frame field;
If the synchronous frame field is detected, identifying data of fields adjacent to the synchronous frame field as the test configuration frame, extracting a test environment type and a test environment parameter contained in the test configuration frame, and executing the operation of extracting a test template associated with the test environment type from a test template library;
before the program file of the application program is obtained, the processor executes the computer program to realize the following steps:
acquiring a version number of the application program, and acquiring a program file of an associated program of the application program based on the version number;
identifying version change information between the associated program and the application program based on the program file of the associated program and the program file of the application program;
taking the test environment type of the associated program as the test environment type of the application program, and generating the test environment parameters of the application program according to the version change information and the test environment parameters of the associated program;
and packaging the test environment type and the test environment parameters of the application program into the program file of the application program.
5. The terminal device of claim 4, wherein the running the application in the test environment and obtaining the running parameters of each interface in the application comprises:
if the fact that the test environment contains touch test items is detected, starting a simulated touch process;
and randomly generating a touch instruction through the simulated touch process so as to acquire the operation parameters of the interface associated with the touch test item.
6. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 3.
CN201811019892.4A 2018-09-03 2018-09-03 Application program testing method and device Active CN109240924B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811019892.4A CN109240924B (en) 2018-09-03 2018-09-03 Application program testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811019892.4A CN109240924B (en) 2018-09-03 2018-09-03 Application program testing method and device

Publications (2)

Publication Number Publication Date
CN109240924A CN109240924A (en) 2019-01-18
CN109240924B true CN109240924B (en) 2024-03-08

Family

ID=65059966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811019892.4A Active CN109240924B (en) 2018-09-03 2018-09-03 Application program testing method and device

Country Status (1)

Country Link
CN (1) CN109240924B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109767138B (en) * 2019-01-21 2023-02-03 武汉裕量信息科技有限公司 Testing technology based on association matching and personality adjustment
CN111506492B (en) * 2019-01-31 2023-05-26 百度在线网络技术(北京)有限公司 Application program testing method and device, equipment and storage medium
CN110147318B (en) * 2019-04-19 2023-12-29 天航长鹰(江苏)科技有限公司 Method and device for generating test data and electronic equipment
CN110245076A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 Method, apparatus and terminal device are determined based on the factor influence degree of functional test
CN110245077A (en) * 2019-05-22 2019-09-17 深圳壹账通智能科技有限公司 A kind of response method and equipment of program exception
CN110334019B (en) * 2019-06-18 2024-01-05 天航长鹰(江苏)科技有限公司 Test method, test device and readable storage medium
CN110362487A (en) * 2019-07-11 2019-10-22 腾讯科技(深圳)有限公司 A kind of test method and device of application program
CN110347604A (en) * 2019-07-11 2019-10-18 中国工商银行股份有限公司 Programming interface test method and equipment, electronic equipment and readable storage medium storing program for executing
CN110377517A (en) * 2019-07-17 2019-10-25 中国工商银行股份有限公司 Applied program testing method and device, electronic equipment and readable storage medium storing program for executing
CN110532170B (en) * 2019-07-18 2023-08-08 北京文渊佳科技有限公司 Method and device for building test environment, electronic equipment and medium
CN111159048A (en) * 2019-12-30 2020-05-15 深圳Tcl数字技术有限公司 Application program testing method and device and computer readable storage medium
CN111629205B (en) * 2020-07-28 2020-11-20 天津美腾科技股份有限公司 System and method applied to industrial camera simulation test
CN112631618A (en) * 2020-12-16 2021-04-09 平安普惠企业管理有限公司 Application program packaging method, application program testing method, terminal and storage medium
CN112905534B (en) * 2021-02-25 2023-09-05 北京安天网络安全技术有限公司 Sample analysis method and device based on sandbox environment
CN116627848B (en) * 2023-07-24 2023-09-29 成都中科合迅科技有限公司 Automatic test method and system for application program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239613A (en) * 2014-08-29 2014-12-24 北京动力机械研究所 Engine collaborative design integrated application system
CN108108297A (en) * 2016-11-25 2018-06-01 腾讯科技(深圳)有限公司 The method and apparatus of automatic test
CN108170588A (en) * 2016-12-07 2018-06-15 阿里巴巴集团控股有限公司 A kind of test environment building method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003248582A (en) * 2002-02-26 2003-09-05 Fujitsu Ltd Execution environment construction processing method and execution environment construction processing program
US20100218168A1 (en) * 2009-02-23 2010-08-26 Gonzales Ii Jesus Orlando System and Method for Generating a Test Environment Script File

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239613A (en) * 2014-08-29 2014-12-24 北京动力机械研究所 Engine collaborative design integrated application system
CN108108297A (en) * 2016-11-25 2018-06-01 腾讯科技(深圳)有限公司 The method and apparatus of automatic test
CN108170588A (en) * 2016-12-07 2018-06-15 阿里巴巴集团控股有限公司 A kind of test environment building method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于嵌入式技术的电梯测试台的研究与实现;张东东;《中国优秀硕士学位论文全文数据库 (工程科技Ⅱ辑)》(第06期);C038-395 *

Also Published As

Publication number Publication date
CN109240924A (en) 2019-01-18

Similar Documents

Publication Publication Date Title
CN109240924B (en) Application program testing method and device
CN109885311B (en) Application program generation method and device
CN109495306B (en) Method and equipment for expanding capacity of service network
CN109376069B (en) Method and device for generating test report
CN106940695B (en) Data source information verification method and device
CN107145437B (en) Java annotation test method and device
CN104246767A (en) Telemetry system for a cloud synchronization system
WO2021072861A1 (en) Application service processing method and apparatus, and terminal and storage medium
WO2017036228A1 (en) Method and apparatus for implementing system upgrading
CN110737594B (en) Database standard conformance testing method and device for automatically generating test cases
CN110727581B (en) Crash positioning method and electronic equipment
CN114168190A (en) Interface document generation method and device, computer equipment and storage medium
CN112953983A (en) SFTP transmission method and device
CN113656503A (en) Data synchronization method, device and system and computer readable storage medium
CN108874425A (en) Configuration file update method, device, baseboard management controller and storage medium
CN112115060A (en) Audio test method and system based on terminal
CN110261758B (en) Device under test verification device and related product
CN112181822A (en) Test method and test method for starting time consumption of application program
CN112286786A (en) Database testing method and device and server
US20240045733A1 (en) Method and apparatus for deploying deep learning system
CN111752677B (en) Cloud resource configuration method, system, terminal and storage medium
CN114172978A (en) Multi-protocol equipment access method and related device
CN113535578A (en) CTS (clear to send) testing method, device and testing equipment
CN109240906B (en) Database configuration information adaptation method and device, computer equipment and storage medium
CN113535580A (en) CTS (clear to send) testing method, device and testing 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
GR01 Patent grant
GR01 Patent grant