CN112749080A - Target program testing method and device, storage medium and electronic equipment - Google Patents
Target program testing method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN112749080A CN112749080A CN201911054597.7A CN201911054597A CN112749080A CN 112749080 A CN112749080 A CN 112749080A CN 201911054597 A CN201911054597 A CN 201911054597A CN 112749080 A CN112749080 A CN 112749080A
- Authority
- CN
- China
- Prior art keywords
- function
- target program
- test
- modification
- key interface
- 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
Links
- 238000012360 testing method Methods 0.000 claims abstract description 210
- 238000000034 method Methods 0.000 claims abstract description 54
- 230000003631 expected effect Effects 0.000 claims abstract description 9
- 230000006870 function Effects 0.000 claims description 231
- 238000012986 modification Methods 0.000 claims description 88
- 230000004048 modification Effects 0.000 claims description 88
- 238000010998 test method Methods 0.000 claims description 12
- 230000003068 static effect Effects 0.000 claims description 8
- 238000004891 communication Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 12
- 238000005516 engineering process Methods 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 12
- 238000004590 computer program Methods 0.000 description 10
- 238000012545 processing Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000013515 script Methods 0.000 description 3
- 238000001914 filtration Methods 0.000 description 2
- 238000011056 performance test Methods 0.000 description 2
- 238000007639 printing Methods 0.000 description 2
- 230000001915 proofreading effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000003550 marker Substances 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Abstract
The embodiment of the application provides a method and a device for testing a target program, a storage medium and electronic equipment, wherein the method comprises the following steps: setting test parameters of the target program, wherein the test parameters at least comprise: the method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test; determining the function and the pressure test point of the target program through the key interface function of the target program and the call function related to the key interface function; the function of the target program and the pressure test point are tested according to the test parameters, and the problem that the online failure is caused by long test time due to test point redundancy in the online service process in the related technology is solved.
Description
Technical Field
The present application relates to the field of computer programming technologies, and in particular, to a method and an apparatus for testing a target program, a storage medium, and an electronic device.
Background
In the online business process, related tests need to be performed, for example, when a project needs to be online, a large number of test cases generally need to be prepared, and in most cases, the online project only updates a few function points. In the prior art, the test emphasis is not prominent, and a large amount of redundancy occurs in the test, so that the test time is long and is uncontrollable. The time window of the online service is often very short, and the online service is released after insufficient testing, which often results in online failure.
In the related art, no reasonable solution exists at present for the problem of online failure caused by long test time due to test point redundancy in the online service process.
Disclosure of Invention
The embodiment of the application provides a method and a device for testing a target program, a storage medium and electronic equipment, so as to at least solve the problem that in the related art, in the process of online service, the testing time is long due to redundancy of testing points, and further the online failure is caused.
According to an embodiment of the present application, there is provided a method of testing an object program, including: setting test parameters of a target program, wherein the test parameters at least comprise: the test method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test; determining the function and the pressure test point of the target program through the key interface function of the target program and the call function related to the key interface function; and testing the function and pressure test points of the target program according to the test parameters.
Optionally, before determining the function and the pressure test point of the target program through the key interface function of the target program and the call function related to the key interface function, the method further includes: searching an identification code and a version parameter carried in the target program in a source code library to determine a modification position and a modification function of the target program, wherein the identification code is used for indicating the modification position of the target program, and the version parameter is used for indicating the modification function of the target program; and determining a key interface function of the target program and a calling function related to the key interface function according to the modification position and the modification function of the target program.
Optionally, determining a key interface function of the target program and a call function related to the key interface function according to the modification position and the modification function of the target program includes: determining a key interface function of the target program according to the modification position and the modification function of the target program, wherein the key interface function corresponds to the modification position and the modification function of the target program; and dynamically analyzing the internal function and the external interface called by the key interface function, and determining the calling function of the key interface function.
Optionally, the testing the function and pressure test point of the target program according to the test parameter includes: downloading test data of the test scene, wherein the test data comprises: historical data of a database to which the target program belongs, and static or dynamic webpage resources; starting an online environment of the target program, the key interface function and the calling function related to the key interface function; determining the test time of the target program according to the expected value; and testing the function and pressure test points of the target program in the test time.
Optionally, determining the modification position and the modification function of the target program according to the identification code and the version parameter carried in the target program includes: and checking in historical data of the source code library according to the identification code and the version parameter, and modifying the position and the modifying function of the target program.
According to another embodiment of the present application, there is also provided a test apparatus for an object program, including: the system comprises a setting module, a test module and a control module, wherein the setting module is used for setting test parameters of a target program, and the test parameters at least comprise: the test method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test; the first determining module is used for determining the function and the pressure test point of the target program through a key interface function of the target program and a calling function related to the key interface function; and the test module is used for testing the function and pressure test points of the target program according to the test parameters.
Optionally, the apparatus further comprises: a second determining module, configured to search, in a source code library, an identification code and a version parameter that are carried in the target program to determine a modification position and a modification function of the target program, where the identification code is used to indicate the modification position of the target program, and the version parameter is used to indicate the modification function of the target program; and the third determining module is used for determining the key interface function of the target program and the calling function related to the key interface function according to the modification position and the modification function of the target program.
Optionally, the third determining module includes: the first determining unit is used for determining a key interface function of the target program according to the modification position and the modification function of the target program, wherein the key interface function corresponds to the modification position and the modification function of the target program; and the second determining unit is used for dynamically analyzing the internal function and the external interface called by the key interface function and determining the calling function of the key interface function.
Optionally, the test module comprises: a downloading unit, configured to download test data of the test scenario, where the test data includes: historical data of a database to which the target program belongs, and static or dynamic webpage resources; the starting unit is used for starting an online environment of the target program, the key interface function and the calling function related to the key interface function; a third determining unit, configured to determine a test time of the target program according to the expected value; and the test unit is used for testing the function and pressure test points of the target program in the test time.
Optionally, the second determining module includes: and the fourth determining unit is used for performing proofreading in the historical data of the source code library according to the identification code and the version parameter, and determining the modification position and the modification function of the target program.
According to another embodiment of the present application, there is also provided a computer-readable storage medium storing a program for implementing a method of testing an object program described in any one of the above method embodiments when the program is executed.
There is also provided, in accordance with another embodiment of the present application, an electronic device, including at least one processor, at least one memory, and a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to call the program instructions in the memory to execute the test method of the target program in any one of the above method embodiments.
According to the embodiment of the application, the test parameters including the test scene, the test time, the expected value and the like are set firstly, the target program to be tested is obtained through the identification code and the version parameter, and then the function and the pressure point of the target program are tested according to the set test parameters, so that the problem that the online failure is caused due to long test time caused by test point redundancy in the online service process in the related technology is solved, the directional test of the newly added function and the pressure test point of the target program is realized, the test time is effectively saved, and the newly added function and the pressure test point are comprehensively tested.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flowchart of a method for testing an object program in an embodiment of the present application;
FIG. 2 is a hardware environment diagram of a method for testing a target program according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a test apparatus for a target program according to an embodiment of the present application;
fig. 4 is a block diagram of an alternative device architecture according to an embodiment of the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The embodiment of the application provides a method for testing a target program. Fig. 1 is a flowchart of a method for testing an object program in an embodiment of the present application, where printing is referred to as displaying a log, preprocessing before displaying, outputting the log to a specified device or a specified system, and the like, and is not limited to printing the log, as shown in fig. 1, and the method includes:
step S102, setting test parameters of the target program, wherein the test parameters at least comprise: the method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test;
step S104, determining the function and the pressure test point of the target program through the key interface function of the target program and the call function related to the key interface function;
and step S106, testing the function of the target program and the pressure test point according to the test parameters.
By the method, the test parameters including the test scene, the test time, the expected value and the like are set firstly, the target program to be tested is obtained through the identification code and the version parameter, and then the function and the pressure point of the target program are tested according to the set test parameters, so that the problem of on-line failure caused by long test time due to test point redundancy in the on-line service process in the related art is solved, the directional test of the newly added function and the pressure test point of the target program is realized, the test time is effectively saved, and the newly added function and the pressure test point are comprehensively tested.
Fig. 2 is a hardware environment diagram of a method for testing a target program according to an embodiment of the present disclosure. Optionally, in this embodiment, the filtering information configuration method may be applied to a hardware environment formed by the server 202 and the user terminal 204 shown in fig. 2, and the execution subject of each step shown in fig. 1 may be, but is not limited to, the server 202. As shown in fig. 2, after the server 202 obtains the program code modified by the user terminal 204, the modified code and the function point of the program may be determined according to the identification code and the version parameter (version number) pre-positioned in the program code, the modified code and the function point are filtered, the key entry function is found out, the function, the called internal function and external interface are dynamically analyzed, and the function and the pressure test point are automatically generated. The server 202 and the user terminal 204 may implement data interaction through a network, which may include but is not limited to a wireless network or a wired network. Wherein, this wireless network includes: bluetooth, WIFI, and other networks that enable wireless communication. Such wired networks may include, but are not limited to: wide area networks, metropolitan area networks, and local area networks. The above is merely an example, and this is not limited in this embodiment.
The processing steps in server 202 include:
step S202, setting the testing parameters of the target program, wherein the testing parameters at least comprise: the method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test;
step S204, determining the function and the pressure test point of the target program through the key interface function of the target program and the call function related to the key interface function;
and step S206, testing the function of the target program and the pressure test point according to the test parameters.
It should be noted that the set test scenario represents a function test corresponding to the target program, for example, a high performance test at a front end of an e-commerce or a high performance test at a back end, the expected value is an effect expected to be achieved by the target program, for example, the expected value is 10 ten thousand concurrences, which indicates that simultaneous online access of 10 ten thousand users needs to be supported, the test time may be calculated according to the expected value or determined according to the test scenario, which is not limited in this embodiment of the application.
Optionally, before determining the function and the pressure test point of the target program through a key interface function of the target program and a call function related to the key interface function, the method further includes:
s1, searching an identification code and a version parameter carried in the target program in a source code library to determine a modification position and a modification function of the target program, wherein the identification code is used for indicating the modification position of the target program, and the version parameter is used for indicating the modification function of the target program;
and S2, determining the key interface function of the target program and the calling function related to the key interface function according to the modification position and the modification function of the target program.
Optionally, determining the modification position and the modification function of the target program according to the identification code and the version parameter carried in the target program includes: and checking in historical data of the source code library according to the identification code and the version parameters, and determining the modification position and modification function of the target program.
The principle of the script is that a person who writes a program code uses a predetermined position identification code, after the person who writes the program code modifies the code, the person who writes the program code writes an identification code and a version number in a specified source code library, and the script performs verification in history according to the identification code and the version number, wherein the identification code is a feature code of 128 bytes, and network information, a database to which the target program belongs, and the like can be determined according to keywords in the identification code. The identification code may also be similar to a revision marker, e.g., a target program modifies 5 codes, and the version of the target program contains 5 identification codes, each corresponding to a revision location. The version number (version parameter) is used to indicate which functions, including deletion, addition, revision, etc., of the target program of the version are recorded in the database, and may also be recorded in the source code library. The modified function of the code of the target program which is newly modified can be determined by the version number, and the specific code position can be determined by the identification code.
Optionally, determining a key interface function of the target program and a call function related to the key interface function according to the modification position and the modification function of the target program includes:
s1, determining a key interface function of the target program according to the modification position and the modification function of the target program, wherein the key interface function corresponds to the modification position and the modification function of the target program;
s2, dynamically analyzing the internal function and the external interface called by the key interface function, and determining the calling function of the key interface function.
In the embodiment of the application, codes (target programs) modified online can be automatically analyzed through scripts, key interface functions are listed, other related calling processes are dynamically analyzed through the interface functions, and then the related calling functions are determined.
Optionally, the testing the function and pressure test point of the target program according to the test parameter includes: downloading test data of the test scene, wherein the test data comprises: historical data of a database to which the target program belongs, and static or dynamic webpage resources; starting an online environment of the target program, the key interface function and the calling function related to the key interface function; determining the test time of the target program according to the expected value; and testing the function and pressure test points of the target program in the test time.
It should be noted that, the test data of the test scenario, including the historical data of the database and the static/dynamic web page resources, is automatically downloaded; starting an online environment and a function process, generating a preset value through distributed function layout calling, if the function has 20 Structured Query Language (sql) queries, the online main table is associated and queried for 3 times, the average consumption is 0.3 second, other queries are returned for 0.01 second, the log function is requested to log for 1 time, each time the log function consumes 0.1 second, the external gateway is requested for 1 time, each time the external gateway is 1 second, the analysis program automatically obtains that the function is expected to be returned for 1.5 seconds, and according to 10 ten thousand concurrent scenes, the number of resources and time consumed by 10 ten thousand concurrent tasks are calculated; according to 10 ten thousand concurrent enabled test cases, the start time/end time is set.
The method can be used for filtering the modified code and the function point, finding out a key entry function, dynamically analyzing the function and a called internal function and an external interface, automatically generating a function and pressure test point, simulating by using data in an online environment, and obtaining a test report after testing for 10 rounds. Of course, 20 or 30 rounds of tests may also be performed, and the setting is performed according to a specific test scenario, which is not limited in the embodiment of the present application.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
In this embodiment, a device for testing an object program is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 3 is a block diagram of a test apparatus for a target program according to an embodiment of the present application, and as shown in fig. 3, the apparatus includes:
a setting module 302, configured to set test parameters of a target program, where the test parameters at least include: the test method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test;
a first determining module 304, configured to determine a function and a pressure test point of the target program through a key interface function of the target program and a call function related to the key interface function;
and the test module 306 is configured to test the function and pressure test points of the target program according to the test parameters.
Optionally, the apparatus further comprises:
a second determining module, configured to search, in a source code library, an identification code and a version parameter that are carried in the target program to determine a modification position and a modification function of the target program, where the identification code is used to indicate the modification position of the target program, and the version parameter is used to indicate the modification function of the target program;
and the third determining module is used for determining the key interface function of the target program and the calling function related to the key interface function according to the modification position and the modification function of the target program.
Optionally, the third determining module includes:
the first determining unit is used for determining a key interface function of the target program according to the modification position and the modification function of the target program, wherein the key interface function corresponds to the modification position and the modification function of the target program;
and the second determining unit is used for dynamically analyzing the internal function and the external interface called by the key interface function and determining the calling function of the key interface function.
Optionally, the test module comprises:
a downloading unit, configured to download test data of the test scenario, where the test data includes: historical data of a database to which the target program belongs, and static or dynamic webpage resources;
the starting unit is used for starting an online environment of the target program, the key interface function and the calling function related to the key interface function;
a third determining unit, configured to determine a test time of the target program according to the expected value;
and the test unit is used for testing the function and pressure test points of the target program in the test time.
Optionally, the second determining module includes:
and the fourth determining unit is used for performing proofreading in the historical data of the source code library according to the identification code and the version parameter, and determining the modification position and the modification function of the target program.
The testing device of the target program comprises a processor and a memory, wherein the setting module 302, the determining module 304, the testing module 306 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set with one or more than one, test parameters including test scenes, test time, expected values and the like are set firstly, then the target program to be tested is obtained through the identification code and the version parameters, and then the function and the pressure point of the target program are tested according to the set test parameters, so that the problem that in the process of online service in the related technology, the test time is long due to test point redundancy, and further online failure is caused is solved.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present application provides a storage medium on which a program is stored, the program implementing a test method of the target program when executed by a processor.
The embodiment of the application provides a processor, wherein the processor is used for running a program, and the program runs to execute a test method of the target program.
Fig. 4 is a block diagram of an alternative device architecture according to an embodiment of the present application. The embodiment of the present application provides a device, the device 40 includes at least one processor 401, and at least one memory 402, a bus 403; the processor and the memory complete mutual communication through a bus; the processor is used for calling the program instructions in the memory so as to execute the test method of the target program. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
s1, setting test parameters of the target program, wherein the test parameters at least comprise: the method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test;
s2, determining the function and the pressure test point of the target program through the key interface function of the target program and the call function related to the key interface function;
and S3, testing the function and pressure test points of the target program according to the test parameters.
Optionally, the computer program product provided by the present application is further adapted to execute the program with the following method steps:
searching an identification code and a version parameter carried in the target program in a source code library to determine a modification position and a modification function of the target program, wherein the identification code is used for indicating the modification position of the target program, and the version parameter is used for indicating the modification function of the target program; and determining a key interface function of the target program and a calling function related to the key interface function according to the position change and the modification function of the target program.
Optionally, the computer program product provided by the present application is further adapted to execute the program with the following method steps:
determining a key interface function of the target program according to the repositioning and modifying functions of the target program, wherein the key interface function corresponds to the repositioning and modifying functions of the target program; and dynamically analyzing the internal function and the external interface called by the key interface function, and determining the calling function of the key interface function.
Optionally, the computer program product provided by the present application is further adapted to execute the program with the following method steps:
downloading test data of the test scene, wherein the test data comprises: historical data of a database to which the target program belongs, and static or dynamic webpage resources; starting an online environment of the target program, the key interface function and the calling function related to the key interface function; determining the test time of the target program according to the expected value; and testing the function and pressure test points of the target program in the test time.
Optionally, the computer program product provided by the present application is further adapted to execute the program with the following method steps:
and checking in historical data of the source code library according to the identification code and the version parameters, and determining the position change and the function modification of the target program.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A method for testing an object program, comprising:
setting test parameters of a target program, wherein the test parameters at least comprise: the test method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test;
determining the function and the pressure test point of the target program through the key interface function of the target program and the call function related to the key interface function;
and testing the function and pressure test points of the target program according to the test parameters.
2. The method of claim 1, wherein before determining the function and stress test points of the target program through the key interface function of the target program and the call function related to the key interface function, the method further comprises:
searching an identification code and a version parameter carried in the target program in a source code library to determine a modification position and a modification function of the target program, wherein the identification code is used for indicating the modification position of the target program, and the version parameter is used for indicating the modification function of the target program;
and determining a key interface function of the target program and a calling function related to the key interface function according to the modification position and the modification function of the target program.
3. The method according to claim 2, wherein determining the key interface function of the target program and the calling function related to the key interface function according to the modification position and the modification function of the target program comprises:
determining a key interface function of the target program according to the modification position and the modification function of the target program, wherein the key interface function corresponds to the modification position and the modification function of the target program;
and dynamically analyzing the internal function and the external interface called by the key interface function, and determining the calling function of the key interface function.
4. The method of claim 2, wherein searching a source code library for an identification code and a version parameter carried in the target program to determine a modification location and a modification function of the target program comprises:
and checking in historical data of the source code library according to the identification code and the version parameters, and determining the modification position and modification function of the target program.
5. The method of claim 1, wherein testing the functional and stress test points of the target program according to the test parameters comprises:
downloading test data of the test scene, wherein the test data comprises: historical data of a database to which the target program belongs, and static or dynamic webpage resources;
starting an online environment of the target program, the key interface function and the calling function related to the key interface function;
determining the test time of the target program according to the expected value;
and testing the function and pressure test points of the target program in the test time.
6. An apparatus for testing an object program, comprising:
the system comprises a setting module, a test module and a control module, wherein the setting module is used for setting test parameters of a target program, and the test parameters at least comprise: the test method comprises the following steps of (1) testing a scene, testing time and an expected value, wherein the expected value is used for expressing the expected effect of the current test;
the first determining module is used for determining the function and the pressure test point of the target program through a key interface function of the target program and a calling function related to the key interface function;
and the test module is used for testing the function and pressure test points of the target program according to the test parameters.
7. The apparatus of claim 6, further comprising:
a second determining module, configured to search, in a source code library, an identification code and a version parameter that are carried in the target program to determine a modification position and a modification function of the target program, where the identification code is used to indicate the modification position of the target program, and the version parameter is used to indicate the modification function of the target program;
and the third determining module is used for determining the key interface function of the target program and the calling function related to the key interface function according to the modification position and the modification function of the target program.
8. The apparatus of claim 7, wherein the third determining module comprises:
the first determining unit is used for determining a key interface function of the target program according to the modification position and the modification function of the target program, wherein the key interface function corresponds to the modification position and the modification function of the target program;
and the second determining unit is used for dynamically analyzing the internal function and the external interface called by the key interface function and determining the calling function of the key interface function.
9. A computer-readable storage medium storing a program for implementing a test method of an object program according to any one of claims 1 to 5 when the program is executed.
10. An electronic device comprising at least one processor, at least one memory, and a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform the method of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911054597.7A CN112749080A (en) | 2019-10-31 | 2019-10-31 | Target program testing method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911054597.7A CN112749080A (en) | 2019-10-31 | 2019-10-31 | Target program testing method and device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112749080A true CN112749080A (en) | 2021-05-04 |
Family
ID=75645426
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911054597.7A Pending CN112749080A (en) | 2019-10-31 | 2019-10-31 | Target program testing method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112749080A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101814052A (en) * | 2010-02-04 | 2010-08-25 | 浪潮集团山东通用软件有限公司 | Automatic test method |
CN108255699A (en) * | 2017-03-27 | 2018-07-06 | 平安科技(深圳)有限公司 | regression testing method and device |
US20180246803A1 (en) * | 2017-02-28 | 2018-08-30 | Ca, Inc. | Targeted software testing |
CN109491894A (en) * | 2018-10-25 | 2019-03-19 | 深圳壹账通智能科技有限公司 | A kind of method and apparatus of interface testing |
CN110389896A (en) * | 2019-06-18 | 2019-10-29 | 中国平安人寿保险股份有限公司 | Code automated analysis and test method, device and computer readable storage medium |
-
2019
- 2019-10-31 CN CN201911054597.7A patent/CN112749080A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101814052A (en) * | 2010-02-04 | 2010-08-25 | 浪潮集团山东通用软件有限公司 | Automatic test method |
US20180246803A1 (en) * | 2017-02-28 | 2018-08-30 | Ca, Inc. | Targeted software testing |
CN108255699A (en) * | 2017-03-27 | 2018-07-06 | 平安科技(深圳)有限公司 | regression testing method and device |
CN109491894A (en) * | 2018-10-25 | 2019-03-19 | 深圳壹账通智能科技有限公司 | A kind of method and apparatus of interface testing |
CN110389896A (en) * | 2019-06-18 | 2019-10-29 | 中国平安人寿保险股份有限公司 | Code automated analysis and test method, device and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109446068B (en) | Interface test method, device, computer equipment and storage medium | |
CN106648556B (en) | Method and device for front-end and back-end integrated development test | |
US20160283357A1 (en) | Call stack relationship acquiring method and apparatus | |
JP2017514218A (en) | Running third-party applications | |
CN109543891B (en) | Method and apparatus for establishing capacity prediction model, and computer-readable storage medium | |
CN108255708B (en) | Method, device, storage medium and equipment for accessing production file in test environment | |
CN111522728A (en) | Method for generating automatic test case, electronic device and readable storage medium | |
CN112433923A (en) | Backtracking file generation method, backtracking method and equipment | |
CN111124480B (en) | Method and device for generating application program package, electronic equipment and storage medium | |
CN112016283A (en) | Form generation method and device | |
CN110941632A (en) | Database auditing method, device and equipment | |
CN112613275A (en) | Receipt generation method and device, computer equipment and storage medium | |
CN112650689A (en) | Test method, test device, electronic equipment and storage medium | |
CN112749080A (en) | Target program testing method and device, storage medium and electronic equipment | |
CN113485746B (en) | Method and device for generating application program interface document | |
CN110968500A (en) | Test case execution method and device | |
CN112699129A (en) | Data processing system, method and device | |
CN109492144B (en) | Association relation analysis method, device and storage medium for software system | |
CN113031995A (en) | Rule updating method and device, storage medium and electronic equipment | |
CN112749159A (en) | Form generation method and device, electronic equipment and storage medium | |
CN111104107A (en) | User interface generation method, test method and device | |
CN110874238A (en) | Online service updating method and device | |
CN113467888B (en) | Cross-chain calling method and device of intelligent contract, electronic equipment and storage medium | |
CN112346761B (en) | Front-end resource online method, device, system and storage medium | |
CN113377674B (en) | Log code adding method and device |
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 |