CN116501596A - Application program testing method and device - Google Patents

Application program testing method and device Download PDF

Info

Publication number
CN116501596A
CN116501596A CN202210053493.XA CN202210053493A CN116501596A CN 116501596 A CN116501596 A CN 116501596A CN 202210053493 A CN202210053493 A CN 202210053493A CN 116501596 A CN116501596 A CN 116501596A
Authority
CN
China
Prior art keywords
function
tested
test
application program
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210053493.XA
Other languages
Chinese (zh)
Inventor
丁金锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210053493.XA priority Critical patent/CN116501596A/en
Publication of CN116501596A publication Critical patent/CN116501596A/en
Pending legal-status Critical Current

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/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides a test method and device of an application program, electronic equipment and a computer readable storage medium; the method comprises the following steps: acquiring test configuration information of an application program to be tested, wherein the test configuration information comprises parameters for indicating a function to be tested; starting execution from an entry function of an application program, and pre-inserting test codes at the head and tail of each function to be tested in the application program; and responding to the execution of the function to be tested, recording the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested, and generating a test result of the function to be tested, wherein the test result comprises the function name and the running time consumption of the function to be tested. By the method and the device, the running performance of the application program can be accurately and efficiently detected.

Description

Application program testing method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for testing an application program.
Background
With the development of the internet and computer technology, various application programs are endless, and extend through various aspects of work, study, entertainment and the like. The developer needs to test to ensure the stability of the application functions before issuing the application to the application store.
In the performance test process of an application program, the performance of the application program is generally judged by detecting whether the application program runs with a stuck phenomenon. In the prior art, whether the performance of the application program is blocked is determined mainly by detecting the main thread of the application program, and a more accurate and efficient test mode is not available in the related art.
Disclosure of Invention
The embodiment of the application provides a method and a device for testing an application program and a computer readable storage medium, which can accurately and efficiently detect the running performance of the application program.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a test method of an application program, which comprises the following steps:
acquiring test configuration information of an application program to be tested, wherein the test configuration information comprises parameters for indicating a function to be tested;
starting execution from an entry function of the application program, wherein test codes are inserted in advance at the head and tail of each function to be tested in the application program;
recording the running time of the function to be tested based on the test codes of the head and tail of the function to be tested in response to the function to be tested being executed, and
And generating a test result of the function to be tested, wherein the test result comprises the function name of the function to be tested and the operation time consumption.
The embodiment of the application provides a testing device of an application program, which comprises:
the information acquisition module is configured to acquire test configuration information of an application program to be tested, wherein the test configuration information comprises parameters for indicating a function to be tested;
the function test module is configured to be executed from an entry function of the application program, wherein test codes are pre-inserted at the head part and the tail part of each function to be tested in the application program;
the function test module is further configured to respond to the function to be tested being executed, record the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested, and generate a test result of the function to be tested, wherein the test result comprises the function name of the function to be tested and the running time consumption.
The embodiment of the application provides an electronic device for testing an application program, which comprises:
a memory for storing executable instructions;
And the processor is used for realizing the test method of the application program provided by the embodiment of the application program when executing the executable instructions stored in the memory.
The embodiment of the application provides a computer readable storage medium, which stores executable instructions that when executed by a processor implement the method for testing the application program provided by the embodiment of the application.
Embodiments of the present application provide a computer program product, including a computer program or instructions, which when executed by a processor implement a test method for an application program provided in the embodiments of the present application.
The embodiment of the application has the following beneficial effects:
through the test codes of the head and tail instrumentation of the function to be tested, the running time of the function to be tested can be accurately reflected due to the difference of the execution time of the head and tail instrumentation, so that the running time can be recorded efficiently and accurately when the function is finished in running, the test granularity of the application program is thinned to the function, and the fine granularity and the accuracy of the performance test of the application program are improved.
Drawings
Fig. 1A is an application mode schematic diagram of a test method of an application program according to an embodiment of the present application;
Fig. 1B is an application mode schematic diagram of a test method of an application program according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a terminal device 400 provided in an embodiment of the present application;
FIG. 3 is a flowchart illustrating a testing method of an application according to an embodiment of the present disclosure;
FIG. 4A is a flowchart illustrating a method for testing an application according to an embodiment of the present disclosure;
FIG. 4B is a flowchart illustrating a method for testing an application according to an embodiment of the present disclosure;
FIG. 4C is a flowchart illustrating a method for testing an application according to an embodiment of the present disclosure;
FIG. 4D is a flowchart illustrating a method for testing an application according to an embodiment of the present disclosure;
FIG. 4E is a flowchart illustrating a method for testing an application according to an embodiment of the present disclosure;
FIG. 5A is a schematic diagram of an interface of an application provided in an embodiment of the present application;
FIG. 5B is a schematic diagram of an interface of an application provided in an embodiment of the present application;
FIG. 5C is a schematic diagram of an interface of an application provided by an embodiment of the present application;
FIG. 5D is a schematic diagram of an interface of an application provided by an embodiment of the present application;
fig. 6 is a schematic flow chart of an alternative testing method of an application program according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to the accompanying drawings, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Before further describing embodiments of the present application in detail, the terms and expressions that are referred to in the embodiments of the present application are described, and are suitable for the following explanation.
1) And the byte code is used for an instruction executed by the Java virtual machine.
2) The instrumentation is to insert some probes into the program on the basis of ensuring the original logic integrity of the tested program.
3) Processes, instances of running applications, each process has its own address space, typically including text regions, data regions, and stacks. The text region stores code executed by the processor; the data area stores variables and dynamically allocated memory used during process execution; the stack area stores the instructions and local variables of the active procedure call.
4) Threads, independently running subtasks in a process. For example: the instant messaging client can process tasks such as video call, file downloading, data transmission, expression sending and the like among friends at the same time, and the tasks are threads. One process has at least one thread, and one process can run a plurality of threads, and data can be shared among the plurality of threads.
5) A main thread, also known as a User Interface (UI) thread, handles the associated logic of Interface interactions. Four major basic components, activity, service, broadcast recipient Broadcast Receiver, content Provider, and various View controls, run in this thread.
6) Functions are concepts in programming, are partitions of functional modules, the functions themselves are codes, the codes are read-only, and one function can be called by a plurality of threads. One thread may complete execution by calling a different function.
7) Class (Class) files, full name Java Class files, are used to make Java more suitable for networks in terms of platform independence and network mobility. It has the task of providing Java programs with services in binary form independent of the underlying host platform in terms of platform independence.
For the application program in the terminal equipment, the equipment type and the system version of the terminal equipment are numerous, and the running performance test of the application program can be carried out in the development process of the application program so as to avoid the performance problem of the application program at the user side. Related art for detecting the running performance of an application program, it is usually to detect the running of the application program based on a detection function registered by a scheduler (chord), or detect the loop of the main thread of the application program, and for the running time of each function in the application program, there is no more fine-grained detection mode.
The embodiments of the present application provide a method for testing an application program, a device for testing an application program, an electronic device for testing an application program, a computer readable storage medium, and a computer program product, which can improve accuracy of performance detection of an application program, and hereinafter describe an exemplary application of a terminal device provided in the embodiments of the present application, where the electronic device for testing an application program provided in the embodiments of the present application may be implemented as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (for example, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device), a vehicle-mounted terminal, or any other type of user terminal.
The test scenario is described below in connection with a terminal device.
In one implementation scenario, referring to fig. 1A, fig. 1A is an application mode schematic diagram of a test method of an application program according to an embodiment of the present application. The method is suitable for application modes which can complete application program testing completely depending on hardware computing capability of the terminal equipment 400, such as application program testing in a single-machine/off-line mode, and output of test results is completed through various different types of terminal equipment 400 such as smart phones, tablet computers, virtual reality/augmented reality equipment and the like.
As an example, the terminal device 400 runs a single-version application program to be tested, performs testing of the application program based on test configuration information stored in the terminal device 400, executes the application program to be tested, records running time of the function to be tested based on test codes of the head and tail of the function to be tested, and generates a corresponding test result.
In another implementation scenario, referring to fig. 1B, fig. 1B is an application mode schematic diagram of a test method of an application program provided in an embodiment of the present application, applied to a terminal device 400 and a server 200, and suitable for the terminal device 400 to obtain test configuration information and an application program to be tested from the server 200, where the terminal device 400 executes the application program to be tested and records running time of the function to be tested based on test codes of a head part and a tail part of the function to be tested, and generates an application mode of a test result corresponding to the application program to be tested.
As an example, the terminal device 400 runs a client (for example, an application to be tested that needs to be networked), obtains test configuration information and data required by the application to be tested when running by connecting to an application server (i.e., the server 200), runs the application to be tested, records the running time of the function to be tested based on the test codes of the head and tail of the function to be tested, and generates a test result of the application to be tested.
The embodiment of the application can be applied to various scenes such as cloud technology, artificial Intelligence (AI), intelligent traffic, internet of vehicles and the like.
The embodiment of the application can be realized by means of Cloud Technology (Cloud Technology), wherein the Cloud Technology refers to a hosting Technology for integrating serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
As an example, the server 200 may be a stand-alone physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal device 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal device 400 and the server 200 may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
In some embodiments, multiple servers may be organized into a blockchain, and server 200 may be a node on the blockchain, where there may be an information connection between each node in the blockchain, and where information may be transferred between nodes via the information connection.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer. The data (e.g., logic of test of the application program, generated test result) related to the test method of the application program provided in the embodiment of the application program may be stored on the blockchain.
Embodiments of the present application may also be implemented by artificial intelligence (Artificial Intelligence, AI), which is a theory, method, technique, and application system that simulates, extends, and extends human intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, obtains knowledge, and uses the knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a terminal device 400 provided in an embodiment of the present application, and the terminal device 400 shown in fig. 2 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in terminal 400 are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable connected communication between these components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled in fig. 2 as bus system 440.
The processor 410 may be an integrated circuit chip having signal processing capabilities such as a general purpose processor, such as a microprocessor or any conventional processor, or the like, a digital signal processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable presentation of the media content. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
Memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 450 optionally includes one or more storage devices physically remote from processor 410.
Memory 450 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 450 described in the embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 451 including system programs, e.g., framework layer, core library layer, driver layer, etc., for handling various basic system services and performing hardware-related tasks, for implementing various basic services and handling hardware-based tasks;
network communication module 452 for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: bluetooth, wireless compatibility authentication (WiFi), and universal serial bus (USB, universal Serial Bus), etc.;
A presentation module 453 for enabling presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, speakers, etc.) associated with the user interface 430;
an input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software, and fig. 2 shows a test apparatus 455 of an application program stored in a memory 450, which may be software in the form of a program and a plug-in, and includes the following software modules: the information acquisition module 4551, the function test module 4552, which are logical, so that any combination or further splitting may be performed depending on the functions implemented. The functions of the respective modules will be described hereinafter.
In other embodiments, the apparatus provided by the embodiments of the present application may be implemented in hardware, and by way of example, the apparatus provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor that is programmed to perform the method of testing the application provided by the embodiments of the present application, e.g., the processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASIC, application Specific Integrated Circuit), DSPs, programmable logic devices (PLD, programmable Logic Device), complex programmable logic devices (CPLD, complex Programmable Logic Device), field programmable gate arrays (FPGA, field-Programmable Gate Array), or other electronic components.
In some embodiments, the terminal device or the server may implement the method for testing the application program according to the embodiments of the present application by running the application program to be tested. For example, the application to be tested may be a native program or a software module in the operating system; may be a Native Application (APP), i.e. a program that needs to be installed in an operating system to run, such as an accelerator APP; the method can also be an applet, namely a program which can be run only by being downloaded into a browser environment; but also an applet that can be embedded in any APP. In general, the application to be tested may be any form of application, module or plug-in.
Next, a test method in which the terminal device 400 in fig. 1A individually executes the application program provided in the embodiment of the present application will be described as an example. Referring to fig. 3, fig. 3 is a flowchart of a testing method of an application program according to an embodiment of the present application, and will be described with reference to the steps shown in fig. 3.
In step 101, test configuration information of an application to be tested is obtained.
Here, the test configuration information includes parameters for indicating the function to be tested.
As an example, the test configuration information may be preset test configuration information stored in the memory of the terminal device 400 in advance, or may be generated based on historical running data or fault log data of the application program acquired based on the test configuration interface of the application program.
As an example, the function to be tested is a function to be tested in an application to be tested, and the head and tail are both instrumented with test code. The parameter used to indicate the function to be tested may be an identification (name or code, serial number, etc.) of the particular function; the method can also be an identification (name or code, serial number and the like) of a specific thread, and when the parameter used for indicating the function to be tested is the parameter corresponding to the specific thread, the function to be tested is any function corresponding to the specific thread; and the identification of the specific thread and the specific function can be realized, and the function to be tested is the specific function associated with the specific thread.
For example, an application may have multiple threads (an application has only one main thread, and includes sub-threads in addition to the main thread, where sub-threads may be divided into daemon threads and user threads), and a thread may complete execution by calling one or more functions, where the same function may be called by multiple threads at the same time, and where there is no overlap in data required to execute the same function and between the multiple threads. The functions corresponding to the threads refer to functions executed when the threads run.
In some embodiments, the test configuration information is obtained based on a test configuration interface; referring to fig. 4C, fig. 4C is a flowchart illustrating a testing method of an application program according to an embodiment of the present application; step 101 may be implemented by steps 1011C through 1012C.
In step 1011C, at least one type of configuration item is displayed in response to a trigger operation for the test configuration interface.
Here, the at least one type of configuration item includes: the function time-out notification switch is used for indicating parameters of the function to be tested, time-consuming thresholds of the function to be tested and switch states of the function time-out notification switch.
Here, the parameters for indicating the function to be tested include at least one of the following parameters: identification of a particular thread, identification of a particular function.
In some embodiments, the parameter for indicating the function to be tested is optional and may be set by default to the identity corresponding to the main thread. The time-consuming threshold of the function to be tested may be set for each function to be tested or set uniformly for all functions to be tested, and the time-consuming threshold may be set to a preset value by default, for example: 30 milliseconds. The switch state of the function timeout notification switch is optional and may be set to an on state or an off state by default.
As an example, referring to fig. 5A, fig. 5A is a schematic diagram of an interface of an application provided in an embodiment of the present application; fig. 5A illustrates an optional test configuration interface 507A according to an embodiment of the present application, and the test configuration interface 507A is explained in conjunction with fig. 5A, where configuration items in the test configuration interface 507A include: a time-consuming function detection switch 501A, a time-out function notification switch 502A, a detection time-consuming function log switch 503A, a configuration entry 504A for a detection thread, and a configuration entry 505A for a time threshold (N may be any positive integer). Also included in test configuration interface 507A is a time consuming function view entry 506A. The time threshold configuration entry 505A shown in fig. 5A is configured to perform unified time-consuming threshold setting on the function to be tested.
In step 1021C, test configuration information is generated based on the edit result of at least one configuration item in response to the edit operation for each configuration item.
For example, in response to an editing operation for the configuration entry 504A of the detection thread, an identification of the thread to be detected is generated based on the editing result, and all functions corresponding to the thread to be detected may be used as the function to be detected. The thread to be detected may be a main thread or other thread. If no editing operation is performed for the configuration entry 504A of the detection thread, the parameter indicating the function to be tested is set as the identity of the main thread by default. The configuration entry 504A for the detection thread may also be represented in other forms, such as: the main thread detection switch is indicated, when the main thread detection switch is in an on state, a function corresponding to the main thread is used as a function to be tested, and when the main thread detection switch is in an off state, a function corresponding to each thread is used as a function to be tested.
By way of example, the editing result may be: the parameter used for indicating the function to be tested is the identification of the main thread, the time consuming threshold value of the function to be tested is N (N can be any positive integer), and the function overtime notification switch is in an on state. And the test configuration information generated according to the editing result is that the function to be tested is the function corresponding to the main thread, the time consumption threshold is N, and the record and the notification are carried out when the function with the operation time consumption greater than the time consumption threshold appears.
According to the embodiment of the application program performance test method and device, the test configuration information is obtained through the test configuration interface, so that a developer of the application program can flexibly configure the performance test of the application program based on the test configuration interface, and the degree of freedom of the test is improved. By configuring the function to be tested, the performance test of the application program is realized by taking the function as a unit, and the fine granularity of the performance test of the application program is improved.
In some embodiments, the test configuration information is automatically generated without configuration by the developer; for example, test configuration information for an application to be tested may be obtained based on fault log data. Referring to fig. 4D, fig. 4D is a flowchart illustrating a testing method of an application program according to an embodiment of the present application; step 101 may be implemented by steps 1011D through 1014D.
In step 1011D, a failure thread is determined based on the failure log data of the application.
Here, the fault log data includes a functional fault event and application error information.
As an example, the fault log data may be obtained through fault information related to the application program actively fed back by the user, or may be operation data of the application program obtained from a terminal device of the user based on authorization permission of the user to related terms in the privacy agreement of the user. A malfunction event is an event that causes a malfunction when an application runs a certain function (for example, an event may be an operation of adding or deleting a file or the like and time it takes for an operation), and application error information is a programming language (JavaScript) error message and stack trace in the application.
By way of example, for example: the application program is chat software, and the function fault event fed back by the user is file failure normal transmission (failure of transmission or blocking), red packet function fault, information delay, failure of normal display content of friend circle and the like, and the fault thread operated when the application program executes the fault functions is determined based on the operation data of the application program.
In some embodiments, step 1011D may be implemented by: acquiring fault log data of an application program, and extracting functional fault events and application error information in the fault log data; and determining a fault thread corresponding to the fault function according to the function fault event, and taking the thread indicated by the application error information as the fault thread.
In step 1012D, each failed thread is treated as a particular thread and the identity of the particular thread is treated as a parameter indicating the function to be tested.
As an example, in the case where the identification of the specific thread is used as a parameter for indicating the function to be tested, the function corresponding to the specific thread is the function to be tested.
In step 1013D, all functions running in the specific thread are used as functions to be tested, and a time consumption threshold corresponding to each function to be tested is determined according to the mapping relation table of the functions and the running time.
For example, the mapping relation table of the function and the running time contains names of all functions in the application program and the running time under the condition of normal performance of all functions, and the running time is taken as the running time of all functions. If the running time of the function is greater than the time consumption threshold, the function running performance problem is described.
In step 1014D, test configuration information is generated based on the parameters indicating the function to be tested, the time-consuming threshold of the function to be tested, and the function timeout notification switch being set to an on state.
For example, in the case where the test configuration information is automatically generated, the function timeout notification switch may be set to an on state by default. The test configuration information may be an identification of a particular thread, a time-consuming threshold value of each function to be tested, and a function timeout notification switch set to an on state.
According to the embodiment of the application program performance test method and device, the corresponding test configuration information is automatically generated based on the fault log data, personalized customization of the test configuration information corresponding to the application program is achieved, the function to be tested is positioned to the function with probability of causing the performance fault, pertinence and test efficiency of the application program performance test are improved, and optimization of fault threads in the application program after the test is finished is facilitated.
In some embodiments, the identification of the newly added function may also be used as a parameter indicating the function to be tested by comparing the newly added function between the current version and the historical version of the application.
In some embodiments, the functions corresponding to the fault threads may be compared, a function called by at least two threads is selected as a specific function, and the identifier of the specific function is used as a parameter for indicating the function to be tested.
In some embodiments, the test configuration information is automatically generated without configuration by the developer; for example, the test configuration information of the application to be tested may be obtained based on the frequency of use of each application function of the application. Referring to fig. 4E, fig. 4E is a flowchart illustrating a testing method of an application program according to an embodiment of the present application; step 101 may be implemented by steps 1011E through 1014E.
In step 1011E, the frequency of use of each application function in the application program is determined, and an application function whose frequency of use is greater than the frequency of use threshold is used as the application function to be tested.
By way of example, applications and corresponding functions are illustrated, such as: the application program can be input method software, and the application functions comprise character input, keyword search, simplified and traditional switching, chinese foreign language mutual translation and the like. The application program can be chat software, and the application functions comprise text messaging, picture messaging, file messaging, voice call, video call and the like.
In some embodiments, step 1011E may be implemented by: determining the historical use time length of each application function in the application function set and the total use time length of the application program based on the application function set and the historical operation data of the application program; and determining the use frequency of each application function in the application program based on the ratio of the historical use time length of each application function to the total use time length of the application program. And taking the application function with the use frequency larger than the use frequency threshold as the application function to be tested.
As an example, assuming that 10 application functions are included in the application function set, the frequencies of use of the respective application functions are added to 1, and the frequency of use threshold may be set to 10% (taking the average of the frequencies of use as the frequency of use threshold). When the use frequency of the application function is greater than 10%, the application function is determined as the application function to be tested.
As an example, the frequencies of use may be sorted according to the size, and a plurality of application functions with larger frequencies of use may be selected as the application functions to be tested. For example: and selecting the application function using the first three high frequencies as the application function to be tested.
In step 1012E, the thread associated with the application function to be tested is taken as a specific thread, and the identification of the specific thread is taken as a parameter for indicating the function to be tested.
As an example, the thread associated with the application function to be tested is a thread that runs when the application function to be tested is implemented. In the case that the identification of the specific thread is used as a parameter for indicating the function to be tested, the function corresponding to the specific thread is the function to be tested.
For example, in the case where the specific threads are plural, it may be determined whether the same function is called between the specific threads, the same function is taken as the specific function, and the identification of the specific function is taken as a parameter for indicating the function to be tested.
In step 1013E, all functions running in the specific thread are used as functions to be tested, and a time consumption threshold corresponding to each function to be tested is determined according to the mapping relation table of the functions and the running time.
For example, the mapping relation table of the function and the running time contains names of all functions in the application program and the running time under the condition of normal performance of all functions, and the running time is taken as the running time of all functions. If the running time of the function is greater than the time consumption threshold, the running performance of the function is described to have a problem.
In step 1014E, test configuration information is generated based on parameters indicating the function to be tested, a time-consuming threshold of the function to be tested, and the function timeout notification switch being set to an on state.
For example, in the case where the test configuration information is automatically generated, the function timeout notification switch may be set to an on state by default. The test configuration information may be an identification of a particular thread, a time-consuming threshold value of each function to be tested, and a function timeout notification switch set to an on state.
In the embodiment of the application program performance test method, the corresponding test configuration information is automatically generated based on the use frequency of each application function of the application program, the function to be tested is positioned at the function corresponding to the common application function, the common application function of the application program is conveniently optimized according to the test result, and the pertinence and the test efficiency of the application program performance test are improved.
With continued reference to FIG. 3, in step 102, execution begins with an entry function of an application.
Here, the head and tail of each function to be tested in the application program are pre-instrumented with test codes.
By way of example, execution from an entry function of an application indicates that performance testing of the application begins.
In step 103, in response to the function to be tested being executed, the running time of the function to be tested is recorded based on the test codes of the head and tail of the function to be tested.
In some embodiments, the test code includes: a first timing code instrumented to the head of the function to be tested, a second timing code instrumented to the tail of the function to be tested. The two timing codes respectively acquire the starting running time and the ending running time of the function to be tested.
Referring to fig. 4A, fig. 4A is a flowchart illustrating a testing method of an application program according to an embodiment of the present application; step 103 may be implemented by steps 1031 to 1033.
In step 1031, when the header of the function to be tested is executed, the running start time of the function to be tested is recorded based on the first timing code corresponding to the function to be tested.
For example, the first timing code is instrumented at the head of the function to be tested, and the first timing code is executed when the head of the function to be tested is executed. The first timing code is used for acquiring information such as a time stamp corresponding to the starting time of the operation of the function to be tested, a function name of the function to be tested, a corresponding thread name and the like, and storing the information corresponding to the function to be tested in the global array.
In some embodiments, for example: the first timing code may include "function access, visit ldcnss (tracemethod Utils, generator method name, desc, timestamp)" "function access, visit method lnss (invekestatic," function header "," (Ljava/lang/String;) V ", false)", and based on the above, the first timing code may be used to obtain information such as a timestamp corresponding to the start time of the function operation to be tested, a function name of the function to be tested, and a corresponding thread name.
In step 1032, when the tail of the function to be tested is executed, the running end time of the function to be tested is recorded based on the second timing code corresponding to the function to be tested.
For example, the second timing code is instrumented at the tail of the function to be tested, and the second timing code is executed when the tail of the function to be tested is executed. The second timing code is used for acquiring information such as a timestamp corresponding to the running end time of the function to be tested, a function name of the function to be tested, a corresponding thread name and the like, and storing the information corresponding to the function to be tested in the global array.
In some embodiments, for example: the second timing code may include "function access", "visi tdcnson (tracemethod Utils. Generator method name", "function access", "(Ljava/lang/String;) V", false) ", and based on the foregoing, the second timing code may be used to obtain information such as a timestamp corresponding to an operation end time of the function to be tested, a function name of the function to be tested, and a corresponding thread name.
In step 1033, the difference between the running end time and the running start time of the function to be tested is recorded as the running time consumption of the function to be tested.
For example, the time-consuming acquisition code may be instrumented after the position of the second timing code at the tail of each function to be tested, and when the time-consuming acquisition code at the tail of the function to be tested is executed, the time-consuming acquisition code is subtracted based on the end and start moments stored in the global array called by the function name of the function to be tested, so as to obtain the running time; or setting a global time-consuming calculation function module in the application program, wherein the time-consuming calculation function module is used for detecting data change in the global array, and subtracting the operation starting moment from the operation ending moment when the same function to be tested exists in the global array and the corresponding operation starting moment and operation ending moment are executed at the same time, so as to obtain the operation time consumption of the function to be tested.
In some embodiments, the time consuming computing function may be implemented by the following code, "MethodEntit y entity =new method entity (funcName, system, currenttimemill (), true, true, threadId)"; where system.currentTimeMillis () represents the computation of system time in milliseconds, i.e., the acquisition of runtime time in milliseconds.
In the embodiment of the application, the starting operation time and the ending operation time of the function to be tested are determined by setting the first timing code at the head part and the second timing code at the tail part of the function to be tested, so that the time-consuming calculation accuracy of the function to be tested is improved. Meanwhile, the test code can also acquire various information related to the function to be tested, so that the granularity of application program testing is improved, the information quantity of the test result is enriched, and the application program is conveniently optimized by a developer based on the test result.
In some embodiments, the running time of the function to be tested when executed last time or times can be recorded in the global array, so that excessive occupation of storage space is avoided.
In some embodiments, each time test code for the head or tail of the function to be tested is executed, the corresponding runtime is recorded. For example: the head and tail of the function to be tested are executed and the function to be tested is executed for a plurality of times, and the test code records the corresponding operation time consumption of the function to be tested when each time is executed. For another example: and if the function to be tested fails, the first timing code records the operation starting time of the function to be tested, and if the second timing code is not operated, the operation ending time is not recorded.
In some embodiments, some or all of the functions in the application program are pre-instrumented, the function instrumented with the test code is used as an instrumented function, and the functions to be tested indicated by the test configuration information are all instrumented functions; for the instrumentation function indicated as the function to be tested, when the instrumentation function is executed, the test code stores the running start time and the running end time in the global array, and the running time is recorded; for the instrumentation function which is not indicated as the function to be tested, the test code still stores the running start and end moments in the global array when the instrumentation function is executed, but the recorded running start and end moments are deleted from the global array instantly, or when the instrumentation function which is not indicated as the function to be tested is executed next time, the last obtained running time of the test code is covered by the next obtained running time.
In some embodiments, the parameter used to indicate the function to be tested is an identification (e.g., name, code, sequence number) of the particular thread, and all functions running in the particular thread of the application are functions to be tested. Step 103 may be implemented by: and responding to the execution of any one function in the specific thread of the application program, taking any one function as a function to be tested, and recording the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested.
As an example, assuming that thread a is a specific thread, all functions running in thread a are functions to be tested, if the same function a is called between thread a and other threads, function a is only used as a function to be tested when being executed in thread a, and the running time of function a is recorded. When the function A is executed in other threads, the function A is not used as a function to be tested, and the test code in the function A can still acquire the running time of the function A, but the running time is not effectively recorded.
In some embodiments, the parameter used to indicate the function to be tested is an identification (e.g., name, code, serial number) of the particular function, the particular function running in any thread of the application is the function to be tested; step 103 may be implemented by: and responding to the execution of the specific function in any thread of the application program, taking the specific function as the function to be tested, and recording the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested.
As an example, assuming that function B is indicated as the function to be tested, when function B is executed in any thread, the test code in function B will obtain the running time of function B, and the running time is effectively recorded.
In some embodiments, the parameter used to indicate the function to be tested is the identity of the particular thread (e.g., name, serial number) and the identity of the particular function, the particular function running in the particular thread of the application being the function to be tested; step 103 may be implemented by: and responding to the execution of the specific function in the specific thread of the application program, taking the specific function as the function to be tested, and recording the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested.
As an example, assuming that function C is a specific function, function D is not a specific function, both function C and function D are running in thread C, thread C is a specific thread, function C may also run in thread D, and thread D is not a specific thread; when the function C is operated in the thread C, the function C is used as a function to be tested, the test code in the function C obtains the operation time consumption of the function C, and the operation time consumption of the function C is recorded. However, when the function C is executed in the thread D, the function C is not regarded as a function to be tested even if it is a specific function. When the function D is executed in the thread C, the function D is not treated as a function to be tested even if the thread C is a specific thread.
In the embodiment of the application, the function to be tested is indicated by a plurality of different parameters, so that different testing requirements of performance testing of the application program to be tested are met, and the degree of freedom and the fine granularity of the application program testing are improved.
In step 104, a test result of the function to be tested is generated.
Here, the test result includes the function name and the running time of the function to be tested.
As an example, the test result may further include a thread name corresponding to the function to be tested, a time when the function to be tested is tested, a number of times the function to be tested is executed, a timeout rate of the function to be tested (e.g., the same function to be tested is executed multiple times in the test, and the timeout rate is obtained by dividing the timeout number by the executed number of times), etc.
In some embodiments, the test configuration information further includes a time-consuming threshold for the function to be tested. The time-consuming threshold may be a global threshold for a particular thread, and may be a one-to-one threshold for each function to be tested. Referring to fig. 4B, fig. 4B is a flowchart illustrating a testing method of an application program according to an embodiment of the present application; step 104 may be implemented by step 1041.
In step 1041, when the running time of the function to be tested is greater than the corresponding time-consuming threshold, a test result is generated according to the function name and the running time of the function to be tested, which are greater than the corresponding time-consuming threshold.
As an example, when the time consumption threshold is included in the test configuration information, the function to be tested whose running time consumption exceeds the time consumption threshold is taken as a function with a problem in performance, and a test result is generated by the function name and the running time consumption of the function. If the test configuration information does not indicate the time consumption threshold, the test result may include the function names and the running time consumption of all executed functions to be tested.
In the embodiment of the application, the corresponding test result is generated according to the time-consuming operation of the overtime function (namely the function with the fault) and the function name, so that the information redundancy is reduced, and the pertinence of the performance test is improved. And a developer can conveniently position the function with the fault according to the test result and optimize the application program.
In some embodiments, the test configuration information further includes a switch state of the function timeout notification switch. After step 1041, a notification message is displayed when the function timeout notification switch is set to the on state.
Here, the notification message includes: function name and running time of the function to be tested, the running time of which is larger than the corresponding time consumption threshold.
With continued reference to fig. 5A, a timeout function notification may be received when the timeout function notification switch 502A is set to an on state. Referring to fig. 5B, fig. 5B is a schematic diagram of an interface of an application provided in an embodiment of the present application, which is an alternative display scheme of a notification message in an embodiment of the present application. In fig. 5B, the notification message is displayed in the notification management interface 501B, and the application a is an application to be tested, and the notification content in the notification message display area 502B includes a function name and a running time corresponding to the function (the running time of the function 1 is 143 ms and the running time of the function 2 is 37 ms). The third time is the time when the application program a generates the notification, the first time is the time when the function 1 is detected to be running time greater than the corresponding time threshold, and the second time is the time when the function 2 is detected to be running time greater than the corresponding time threshold.
As an example, the notification message may also be displayed on a lock screen interface of the terminal device, and may also be accompanied by a prompt sound effect when the notification message is displayed.
In the embodiment of the application program testing method and device, the developer can be informed of the dynamic state of the application program testing in time by displaying the notification message, and the developer can debug the application program in time.
In some embodiments, step 104 further comprises, after: displaying a test result checking inlet; and responding to the triggering operation of the checking inlet aiming at the test result, and displaying the test result of the function to be tested.
With continued reference to fig. 5A, with the time consuming function log switch 503A in an on state, the test results may be viewed through the time consuming function viewing portal 506A. In this embodiment of the present application, a function corresponding to a main thread is taken as an example for explanation, and referring to fig. 5C and 5D, fig. 5C and 5D are schematic diagrams of an interface of an application provided in the embodiment of the present application; the test results are explained below with reference to fig. 5C and 5D.
The test results include, for example, a function name, a run time corresponding to the function name, and a corresponding thread, and may also include a time when the function is detected to run over time. In the display interface 501C of the test results of FIG. 5C, the run time of function 1 is 43 milliseconds (XXX date 16:53:35 is the time that function 1 was detected to run timeout), and function 1 was detected to timeout twice, with the corresponding thread being the main thread. The running time of the function 2 is 43 milliseconds, the running time of the function 3 is 43 milliseconds, the running time of the function 4 is 37 milliseconds, and the threads corresponding to the functions are all main threads. The display interface 501C of the test result further includes a clear button 503C, and when the clear button 503C is triggered, the recorded test result is cleared.
In some embodiments, in response to a trigger operation on an area corresponding to each function in the time consuming function viewing interface (e.g., area 502C corresponding to function 1), time consuming function call stack information for the function corresponding to the trigger operation is displayed. The display interface 501D of the time consuming function call stack in fig. 5D shows call stacks (call stack 1, call stack 2 … …, call stack n, n is a positive integer greater than or equal to 1) corresponding to the time consuming function, where the call stacks are sequentially arranged according to the time sequence of being called, so as to facilitate viewing.
In the embodiment of the application program testing method, the information richness of the application program testing is improved by displaying the testing results containing the function names, the corresponding threads and the time consuming operation, so that a developer can know the performance testing trend of the application program in time.
In some embodiments, prior to step 101, further comprising obtaining a source code file of the test code and the application program; determining functions to be instrumented in a source code file based on the list of functions to be instrumented, and instrumentation test codes to the head and tail of each function to be instrumented respectively; and compiling and packaging based on the source code file after the instrumentation to obtain an installation package of the application program, wherein the installation package is used for running the application program.
The list of functions to be instrumented includes, for example, all functions in the source code file, but may also be partial functions.
In some embodiments, the test code includes a first timing code and a second timing code; determining the functions to be instrumented in the source code file based on the list of functions to be instrumented, and instrumentation of the test codes to the head and tail of each function to be instrumented respectively, wherein the method comprises the following steps: obtaining a function list to be inserted and an inserting plug-in, and configuring the inserting plug-in based on the function list to be inserted; traversing the functions to be inserted in the source code file based on the configured inserting plug-in, and determining a head hook point and a tail hook point of each function to be inserted; stake a first timing code into the head of each stake-to-stake function based on the head hook point position of each stake-to-stake function; and instrumentation of the second timing code to the tail of each function to be instrumented based on the tail hook position of each function to be instrumented.
As an example, an ASseMbly (ASM, asembly) framework (a Java bytecode manipulation framework) may be inserted into an automation build open source tool (Gradle) plugin (plugin for defining flows and rules) to get a instrumented plugin. And configuring the instrumentation plug-in through the to-be-instrumented function list, so that the instrumentation plug-in has the function of obtaining the to-be-instrumented function from all functions in the source code file. The head hook point of the function may be a function entry (On Method Enter) and the tail hook point of the function may be a function Exit (On Method Exit).
In the embodiment of the application, the head and the tail of the function to be inserted are effectively positioned through the insert, so that the test code can be accurately inserted to the corresponding position of the function to be inserted, the time-consuming effectiveness of the test code is ensured, and the accuracy and the fine granularity of the application program performance test are improved.
In some embodiments, step 104 further comprises, after: determining a function to be updated in the application program according to a test result of the function to be tested, wherein the function to be updated is a function to be tested, and the operation time of the function to be updated is greater than a time consumption threshold indicated by the test configuration information; acquiring an optimization function corresponding to each function to be updated, and replacing each function to be updated in a source code file of an application program with the corresponding optimization function; and compiling and packaging based on the replaced source code file to generate a test installation package of the application program, wherein the test installation package is used for being installed to run the application program with the new version to be tested.
Illustratively, the head and tail of the optimization function are also instrumented with corresponding test code. The optimization function can be obtained by optimizing based on the original code of the function to be updated, or can be a function which is directly obtained and is used for replacing the same function of the function to be updated. After the test installation package is obtained, performance test of the new version of the application program to be tested can be performed based on the test installation package, and steps 101 to 104 are performed in a circulating manner so as to optimize the application program according to the test results of multiple tests.
As an example, in the next test of the application program, the test configuration information may be updated, and the parameters for indicating the function to be tested are configured as parameters corresponding to the optimization function, so that only the time consumed in running the optimization function is recorded in the next test, so as to reduce the calculation amount and the test time consumed in the test process, and improve the test efficiency.
In some embodiments, step 104 further comprises, after: when the test of the application program is represented to pass according to the test result, replacing the test code in the source code file of the application program passing the test with a null code with the same name interface as the test code; and compiling and packaging based on the replaced source code file to generate an installation package to be distributed, wherein the installation package to be distributed is used for being distributed into a network for downloading and installing.
As an example, according to the test result to characterize the passing of the test of the application program, that is, the test result does not include a function whose running time exceeds the time threshold, the application program is optimized and in the stage to be issued, the performance test function of the test stage of the application program can be removed from the application program. Replacing the test codes in the source code file obtained by final optimization with blank codes, obtaining an installation package to be distributed based on the replaced source code file, wherein the installation package to be distributed can be distributed into corresponding application stores
In the embodiment of the application, the test codes are replaced by the null codes, so that the application program is prevented from carrying the performance self-testing function in the release environment, and the self-testing function is prevented from affecting the performance of the application program at the user side.
In some embodiments, the test configuration interface corresponding to the test configuration information may be set in an application program other than the application program to be tested, and the test configuration information of the application program to be tested is configured by other application programs, so that performance tests of a plurality of different application programs may be performed simultaneously. For example: the application programs to be tested can be chat software, payment software, vocabulary software and video software, test codes are inserted into the functions to be tested in each application program, and a test configuration interface is arranged in the antivirus software. The antivirus software obtains test configuration information through a test configuration interface, scans the application programs to be tested based on the test configuration information to obtain the running time of functions in different application programs, and obtains the function name, the running time, the threads corresponding to the functions and the application programs of the functions to be tested, wherein the running time of the functions to be tested exceeds the time consumption threshold according to the time consumption threshold in the test configuration information. The antivirus software accelerates and kills the application software corresponding to the function to be tested, which is time-consuming to run and exceeds the time-consuming threshold, reminds a user to update the software version in time, and the like.
According to the method and the device, the test codes are inserted into the head and the tail of the function to be tested of the application program to be tested in advance, and the time consumption of the function to be tested is obtained based on the time difference of the head and the tail of the function to be tested. And the test result of the performance test of the application program is refined to each function to be tested in the application program, so that the fine granularity and the accuracy of the performance test of the application program are improved. The test result follows the executed function to be tested, so that the information redundancy degree is reduced, and the application program can be optimized in a targeted manner. The functions of test information configuration, overtime function notification, test result checking and the like are provided, so that a developer can perform test information configuration and check test results according to test requirements, and the test efficiency is improved; corresponding test configuration information is automatically generated in various modes, and flexibility and accuracy of application program performance test are improved.
In the following, an exemplary application of the embodiments of the present application in a practical application scenario will be described.
The embodiment of the application can have the following application scenarios, for example: test scenario in software development process. Referring to fig. 6, fig. 6 is a schematic flow chart of an alternative testing method of an application program according to an embodiment of the present application. Fig. 6 includes steps 601 to 609, and a terminal device will be described below as an execution subject based on the steps in fig. 6.
For example, in the embodiment of the present application, the implementation may be achieved through steps 601 to 604, where a corresponding test code is inserted into a function of a class file corresponding to an application to be tested, and compiling and packaging operations are performed on the class file after stub insertion, so as to obtain an installation package of the application to be tested.
In step 601, test code instrumented into a function is obtained.
For example, the obtained test code may be used as a specific implementation module, and the specific implementation module may be used as an independent module, which has suitability and may be used to obtain the time-consuming running of different functions and support the test items to multiple application programs. The specific implementation module comprises code inserted into the head of the function, code inserted into the tail of the function and time-consuming processing code of the function. For ease of explanation, the code inserted into the head of the function is referred to as a first timing code, and the code inserted into the tail of the function is referred to as a second timing code.
For example, when the function starts to be executed, the first timing code is inserted into the head of the function, and is used for recording the function name, the thread name corresponding to the function and the timestamp of the starting operation time of the function into the global array; when the execution of the function is finished, inserting a second timing code to the tail of the function, and recording a time stamp of the running time of the function to the global array; and the time-consuming function processing code is used for finding out the corresponding function starting operation time and function ending operation time from the global array according to the function name and the corresponding thread name, and subtracting the starting operation time from the ending operation time to obtain the operation time of the function.
In step 602, a stake pocket is obtained.
For example, the instrumentation plug-in the embodiment of the present application is an automatic construction open source tool (Gradle) plug-in (plug-in for defining flows and rules), through which test codes can be instrumented into functions in Class (Class) files of an application to be tested during the compilation process. All class files of an application, i.e. source code files of an application in the above.
Illustratively, in the embodiment of the present application, an ASseMbly (ASM, asembly) framework (a Java bytecode manipulation framework) is added to the instrumentation plug-in, so that the instrumentation plug-in can perform a corresponding instrumentation operation. In the embodiment of the application, pile insertion is implemented by using an assembly frame as an example. The assembly framework is used for dynamically generating class files or enhancing the functions of existing class files, and can directly generate binary class files or dynamically change the behavior of the class files before the class files are loaded into a virtual machine (a virtual machine based on Java language). Java class files possess sufficient metadata to parse all elements in a class: class name, method, attribute, and Java bytecode (instruction). After the assembly framework reads the information of the elements from the class file, the class behavior can be changed, the class information can be analyzed, and even a new class file can be generated according to the preconfigured information.
By way of example, test code may also be instrumented into functions by creating a class library of Java bytecodes (Java), tangential programming oriented (Aspect Oriented Programming, AOP, which may also be referred to as AspectJ), or other bytecode insertion techniques such as the android bytecode optimization tool (Redex).
In step 603, a class file to be detected is configured for the instrumentation plug-in, and test code instrumentation is performed on corresponding positions of the head and tail of the function in the class file to be detected through the instrumentation plug-in.
For example, in the configuration script corresponding to the instrumentation plug-in, information of the class file to be detected is configured, and the instrumentation plug-in after configuration can determine the class file to be detected in all the class files corresponding to the application program according to the information of the class to be detected. The instrumentation plug-in obtains the name of the current Class file through a Class access interface (Class identifier, information used in visiting classes, such as notes marked on the Class, a construction method of the Class, fields of the Class, a method of the Class and static code blocks), compares the name of the current Class file with the name in a configured Class file list to be detected, and determines whether the current Class file is the Class file to be detected. If the current class file is the class file to be detected, traversing each function in the current class file, and determining the head and tail positions of the functions based On two Hook (Hook) points of function entry (On Method end r) and function Exit (On Method Exit). The instrumentation plug-in inserts a first timing code at the head position of the function, inserts a second timing code at the tail position of the function, and the class file after instrumentation can cover the previous class file.
In step 604, compiling and packaging operations are performed on the class file after the stub insertion, and an installation package of the application program is generated.
By way of example, the compilation operation is to compile a class file into an executable (Dex, dalvik Executable) file that can be run in an android system. The packing operation is to pack the executable file obtained by compiling to generate an installation package of the application program to be tested.
For example, in the embodiment of the present application, the test operation and the optimization operation of the application program may be implemented through steps 604 to 609.
In step 605, test configuration information is configured in the application program, and the application program to be tested is run, and the running time of the executed function to be tested is obtained through the test code.
By way of example, in the embodiment of the present application, the test configuration interface corresponding to the performance test is implanted into the application to be tested, and the specific implementation module is combined, so that the application to be tested integrates the performance self-checking function. The test configuration interface may perform test switch settings (whether to begin testing), notification settings (whether to perform timeout function notifications), log settings (whether to record test logs, i.e., test results), and time threshold settings (when the corresponding switch of the log is on and the running time of the function is greater than a time threshold, the corresponding log to record the timeout function is generated).
For example, the test configuration information may be stored in advance in a memory of the terminal device executing the test method of the application program, or may be acquired based on the test configuration interface. The test configuration information comprises parameters indicating the function to be tested, and the operation time consumption corresponding to the function to be tested can be obtained based on the test code inserted in the function to be tested.
Referring to fig. 5A, fig. 5A is a schematic diagram of an interface of an application provided in an embodiment of the present application; explaining the test configuration interface 507A with reference to fig. 5A, configuration items in the test configuration interface 507A include: a time-consuming function detection switch 501A, a timeout function notification switch 502A, a detection time-consuming function log switch 503A, a configuration entry 504A for detecting threads (for configuring a thread to be tested, all functions corresponding to the thread to be tested are used as functions to be tested; if no thread to be tested is configured, the main line Cheng Moren is set as a thread to be tested, the function corresponding to the main line is a function to be tested), and a configuration entry 505A for a time threshold (N may be any positive integer). Also included in test configuration interface 507A is a time consuming function view entry 506A.
As an example, if the switch icon in the time-consuming function detection switch is displayed in dark color, it is explained that the time-consuming function detection is turned on. When the configuration entry of the detection thread is triggered, the thread to be detected may be edited, for example: and editing the threads to be detected into a main thread, a daemon thread and the like, and taking all functions corresponding to the threads corresponding to the editing result as the functions to be detected.
For example, the time threshold corresponding to the function to be detected may be obtained through the time threshold configuration entry 505A, where in the embodiment of the present application, the time threshold set by the time threshold configuration entry 505A is a global time threshold corresponding to the function to be detected.
In some embodiments, a more granular arrangement may also be used, such as by configuring the time thresholds for each function to be tested through a configuration interface. If the configured time threshold is not obtained through the configuration entry 505A of the time threshold, the time threshold of the function to be tested may be configured by using a default value, and the corresponding time thresholds of different functions to be tested may be different.
In step 606, it is determined whether the running time is greater than a time threshold, and when the running time is greater than the time threshold, step 608 is performed; when the running time is less than or equal to the time threshold, step 607 is performed.
By way of example, the test configuration information may also be determined based on the application functionality. Assuming that the application program newly develops a function relative to the previous version, after the application program is started, the function corresponding to the new function is configured as the function to be tested through the configuration interface. In the test process, the application program obtains the running time of the function to be tested based on the test code in the function to be tested, judges whether the running time is greater than a time threshold, and shifts to the execution of step 608 when the running time exceeds the time threshold.
In step 608, function information of the function that has been run for more than the time threshold is recorded and notified.
For example, when there is a configured time threshold and the time-consuming function log switch 503A is in an on state, a time-consuming function log is generated according to the function name of the function to be tested, whose running time is greater than the corresponding time threshold, and the corresponding thread name and running time. When there is no configured time threshold and the time-consuming function log switch 503A is in an on state, a time-consuming function log may be generated according to the function names of all executed functions to be tested, the corresponding thread names, and the running time.
For example, a timeout function notification may be received when the timeout function notification switch 502A is set to an on state. Referring to fig. 5B, fig. 5B is a schematic diagram of an interface of an application provided in an embodiment of the present application; the notification in step 608 is explained below in conjunction with FIG. 5B. The notification message in fig. 5B is displayed in the notification management interface 501B, and the application a is an application to be tested, and the notification content in the notification message display area 502B includes a function name, and the running time corresponding to the function (the running time of the function 1 is 143 ms, and the running time of the function 2 is 37 ms). The third time is the time when the application program a generates the notification, the first time is the time when the function 1 is detected to be running time greater than the corresponding time threshold, and the second time is the time when the function 2 is detected to be running time greater than the corresponding time threshold.
For example, when the time consuming function log switch 503A is in an on state, the test result may be viewed through the time consuming function viewing portal 506A. In this embodiment of the present application, a function corresponding to a main thread is taken as an example for explanation, and referring to fig. 5C and 5D, fig. 5C and 5D are schematic diagrams of an interface of an application provided in the embodiment of the present application; the test results are explained below with reference to fig. 5C and 5D.
The test results include, for example, a function name, a run time corresponding to the function name, and a corresponding thread, and may also include a time when the function is detected to run over time. In the display interface 501C of the test result in fig. 5C, the running time of the function 1 is 43 ms, and the function 1 is detected to timeout twice, and the corresponding thread is the main thread. The running time of the function 2 is 43 milliseconds, the running time of the function 3 is 43 milliseconds, the running time of the function 4 is 37 milliseconds, and the threads corresponding to the functions are all main threads. The display interface 501C of the test result further includes a clear button 503C, and when the clear button 503C is triggered, the recorded test result is cleared.
In some embodiments, in response to a trigger operation on an area corresponding to each function in the time consuming function viewing interface (e.g., area 502C corresponding to function 1), time consuming function call stack information for the function corresponding to the trigger operation is displayed. The display interface 501D of the time consuming function call stack in fig. 5D shows call stacks (call stack 1, call stack 2 … …, call stack n, n is a positive integer greater than or equal to 1) corresponding to the time consuming function, where the call stacks are sequentially arranged according to the time sequence of being called, so as to facilitate viewing.
In step 609, an optimization function corresponding to the function of the timeout is acquired, and the process proceeds to step 604.
For example, when the corresponding information of the timeout function is obtained, the timeout function may be optimized based on the code corresponding to the timeout function to obtain the corresponding optimized function, or the corresponding optimized function of the timeout function may be obtained through network downloading. And (3) pile-inserting the optimization function, repeating the step 604 to obtain an optimized installation package of the application program, and continuously executing subsequent steps based on the optimized installation package of the application program to form a closed loop so as to optimize a timeout function affecting the performance.
In step 607, the test is continuously executed, when the test passes, the empty implementation module corresponding to the test code is obtained, the test code in the application program is replaced based on the empty implementation module, and compiling and packaging are performed to generate the to-be-issued installation package.
For example, if a timeout function still occurs during the continued execution of the test, execution proceeds to step 609 until no timeout function exists.
By way of example, the test is in a wait-to-Release (Release) phase by a performance test link that indicates that the application has completed the test phase. Before the application enters the outgoing phase, the performance test function of the application test phase may be removed from the application to prevent the performance test function from affecting other functions of the application during use of the application by the user.
For example, a null implementation module corresponding to the implementation module (i.e. a null code corresponding to the test code above) may be obtained, where the null implementation module is the same as a Package Name (Package Name) of the implementation module, and the names of an interface provided in the null implementation module and an interface provided by the implementation module are the same. But only the empty implementation module has no code, so that the environment packaging is convenient to release.
It will be appreciated that in the embodiments of the present application, related data such as user information, user feedback data, etc. are referred to, and when the embodiments of the present application are applied to specific products or technologies, user permissions or consents need to be obtained, and the collection, use, and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
Continuing with the description below of an exemplary architecture of the application testing device 455 implemented as a software module provided in embodiments of the present application, in some embodiments, as shown in fig. 2, the software modules stored in the application testing device 455 of the memory 440 may include: the information acquisition module 4551 is configured to acquire test configuration information of an application program to be tested, wherein the test configuration information comprises parameters for indicating a function to be tested; the function test module 4552 is configured to start execution from an entry function of the application program, wherein a test code is pre-inserted at the head and tail of each function to be tested in the application program; the function test module 4552 is further configured to record a running time consumption of the function to be tested based on the test codes of the head and tail of the function to be tested in response to the function to be tested being executed, and generate a test result of the function to be tested, wherein the test result includes a function name and the running time consumption of the function to be tested.
In some embodiments, the test code includes: a first timing code which is inserted into the head of the function to be tested and a second timing code which is inserted into the tail of the function to be tested; the function test module 4552 is further configured to record an operation start time of the function to be tested based on the first timing code corresponding to the function to be tested when the header of the function to be tested is executed; when the tail of the function to be tested is executed, recording the running end time of the function to be tested based on a second timing code corresponding to the function to be tested; and recording the difference value between the running ending time and the running starting time of the function to be tested as the running time consumption of the function to be tested.
In some embodiments, the parameter used to indicate the function to be tested is an identification of a particular thread, and all functions running in the particular thread of the application are functions to be tested; the function test module 4552 is further configured to record the running time of the function to be tested based on the test codes of the head and tail of the function to be tested, with any one function as the function to be tested, in response to any one function in the specific thread of the application program being executed.
In some embodiments, the parameter used to indicate the function to be tested is an identification of a particular function, and the particular function running in any thread of the application is the function to be tested; the function test module 4552 is further configured to record the running time of the function to be tested based on the test codes of the head and tail of the function to be tested, with the specific function as the function to be tested in response to the specific function being executed in any thread of the application program.
In some embodiments, the parameter used to indicate the function to be tested is an identification of a particular thread and an identification of a particular function, the particular function running in the particular thread of the application being the function to be tested; the function test module 4552 is further configured to record the running time of the function to be tested based on the test codes of the head and tail of the function to be tested, with the specific function as the function to be tested in response to the specific function being executed in the specific thread of the application program.
In some embodiments, the test configuration information further includes a time-consuming threshold for the function to be tested; the function test module 4552 is further configured to generate a test result according to the function name and the operation time consumption of the function to be tested, which have the operation time consumption greater than the corresponding time consumption threshold, when the operation time consumption of the function to be tested is greater than the corresponding time consumption threshold.
In some embodiments, the test configuration information further includes a switch state of the function timeout notification switch; the function test module 4552 is further configured to display a notification message when the function timeout notification switch is set to an on state, wherein the notification message comprises: function name and running time of the function to be tested, the running time of which is larger than the corresponding time consumption threshold.
In some embodiments, the test configuration information is obtained based on a test configuration interface; the information acquisition module 4551 is further configured to display at least one type of configuration item in response to a trigger operation for the test configuration interface, wherein the at least one type of configuration item comprises: the method comprises the steps of indicating parameters of a function to be tested, time consumption threshold values of the function to be tested and a function overtime notification switch, wherein the parameters used for indicating the function to be tested comprise at least one of the following parameters: identification of a particular thread, identification of a particular function; in response to the editing operation for each configuration item, test configuration information is generated based on the editing result of at least one configuration item.
In some embodiments, the test configuration information is automatically generated; the information acquisition module 4551 is further configured to determine a fault thread based on the fault log data of the application; taking each fault thread as a specific thread, and taking the identification of the specific thread as a parameter for indicating a function to be tested; taking all functions running in a specific thread as functions to be tested, and determining a time consumption threshold value corresponding to each function to be tested according to a mapping relation table of the functions and the running time; and generating test configuration information based on parameters for indicating the function to be tested, a time-consuming threshold value of the function to be tested and a function timeout notification switch which are set to be in an on state.
In some embodiments, the test configuration information is automatically generated; the information acquisition module 4551 is further configured to determine a frequency of use of each application function in the application program, and use an application function whose frequency of use is greater than a frequency threshold value as an application function to be tested; taking the thread associated with the application function to be tested as a specific thread, and taking the identification of the specific thread as a parameter for indicating the function to be tested; taking all functions running in a specific thread as functions to be tested, and determining a time consumption threshold value corresponding to each function to be tested according to a mapping relation table of the functions and the running time; and generating test configuration information based on parameters for indicating the function to be tested, a time-consuming threshold value of the function to be tested and a function timeout notification switch which are set to be in an on state.
In some embodiments, the function test module 4552 is further configured to display a test result view entry; and responding to the triggering operation of the checking inlet aiming at the test result, and displaying the test result of the function to be tested.
In some embodiments, the information acquisition module 4551 is further configured to acquire test code and source code files for the application; determining functions to be instrumented in a source code file based on the list of functions to be instrumented, and instrumentation test codes to the head and tail of each function to be instrumented respectively; and compiling and packaging based on the source code file after the instrumentation to obtain an installation package of the application program, wherein the installation package is used for running the application program.
In some embodiments, the test code includes a first timing code and a second timing code; the information acquisition module 4551 is further configured to acquire a to-be-inserted function list and an inserted plug-in, and configure the inserted plug-in based on the to-be-inserted function list; traversing the functions to be inserted in the source code file based on the configured inserting plug-in, and determining a head hook point and a tail hook point of each function to be inserted; stake a first timing code into the head of each stake-to-stake function based on the head hook point position of each stake-to-stake function; and instrumentation of the second timing code to the tail of each function to be instrumented based on the tail hook position of each function to be instrumented.
In some embodiments, the function test module 4552 is further configured to replace test code in a source code file of the application passing the test with null code having a homonymic interface with the test code when the test of the application is characterized as passing according to the test result; and compiling and packaging based on the replaced source code file to generate an installation package to be distributed, wherein the installation package to be distributed is used for being distributed into a network for downloading and installing.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the test method of the application program according to the embodiment of the application program.
The embodiments of the present application provide a computer readable storage medium storing executable instructions that, when executed by a processor, cause the processor to perform a method of testing an application provided by the embodiments of the present application, for example, the method of testing an application as shown in fig. 3.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above memories.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
In sum, the embodiment of the application determines the operation time consumption of the function to be tested based on the test code of the instrumentation in the function to be tested, can timely acquire the operation time consumption corresponding to the function when the function operation is finished, refines the test result of the performance test of the application program to each function to be tested in the application program, and improves the fine granularity and accuracy of the performance test of the application program; the test configuration information is determined in different modes, so that different threads and different functions can be tested, the configuration of the application program performance test is more diversified and flexible, and the performance test is enabled to be implemented to different threads and functions.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and scope of the present application are intended to be included within the scope of the present application.

Claims (15)

1. A method for testing an application program, the method comprising:
acquiring test configuration information of an application program to be tested, wherein the test configuration information comprises parameters for indicating a function to be tested;
starting execution from an entry function of the application program, wherein test codes are inserted in advance at the head and tail of each function to be tested in the application program;
recording the running time of the function to be tested based on the test codes of the head and tail of the function to be tested in response to the function to be tested being executed, and
and generating a test result of the function to be tested, wherein the test result comprises the function name of the function to be tested and the operation time consumption.
2. The method of claim 1, wherein,
the test code includes: a first timing code instrumented to the head of the function to be tested and a second timing code instrumented to the tail of the function to be tested;
the responding to the execution of the function to be tested records the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested, including
When the head of the function to be tested is executed, recording the running starting time of the function to be tested based on a first timing code corresponding to the function to be tested;
when the tail of the function to be tested is executed, recording the running ending moment of the function to be tested based on a second timing code corresponding to the function to be tested;
and recording the difference value between the running ending time and the running starting time of the function to be tested as the running time consumption of the function to be tested.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the parameter used for indicating the function to be tested is the identification of a specific thread, and all functions running in the specific thread of the application program are the functions to be tested;
the responding to the function to be tested is executed, based on the test codes of the head part and the tail part of the function to be tested, the time consuming operation of the function to be tested is recorded, and the method comprises the following steps:
and responding to the execution of any one function in the specific thread of the application program, taking the any one function as the function to be tested, and recording the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested.
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the parameter used for indicating the function to be tested is the identification of a specific function, and the specific function running in any thread of the application program is the function to be tested;
the responding to the function to be tested is executed, based on the test codes of the head part and the tail part of the function to be tested, the time consuming operation of the function to be tested is recorded, and the method comprises the following steps:
and responding to the specific function in any thread of the application program to be executed, taking the specific function as the function to be tested, and recording the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested.
5. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the parameter used for indicating the function to be tested is the identification of a specific thread and the identification of a specific function, and the specific function running in the specific thread of the application program is the function to be tested;
the responding to the function to be tested is executed, based on the test codes of the head part and the tail part of the function to be tested, the time consuming operation of the function to be tested is recorded, and the method comprises the following steps:
And responding to the specific function in the specific thread of the application program to be executed, taking the specific function as the function to be tested, and recording the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the test configuration information also comprises a time consumption threshold of the function to be tested;
the generating the test result of the function to be tested comprises the following steps:
when the running time of the function to be tested is greater than the corresponding time consumption threshold, generating a test result according to the function name of the function to be tested, the running time of which is greater than the corresponding time consumption threshold, and the running time.
7. The method of claim 6, wherein,
the test configuration information also comprises a function timeout notification switch state;
after the test result of the function to be tested is generated, the method further comprises:
displaying a notification message when the function timeout notification switch is set to an on state, wherein the notification message includes: and the function name of the function to be tested, the operation time consumption of which is larger than the corresponding time consumption threshold, and the operation time consumption.
8. The method of claim 1, wherein,
the test configuration information is acquired based on a test configuration interface;
the obtaining the test configuration information of the application program to be tested includes:
in response to a trigger operation for the test configuration interface, displaying at least one type of configuration item, wherein the at least one type of configuration item comprises:
the method comprises the steps of indicating parameters of a function to be tested, time consumption threshold values of the function to be tested and a function overtime notification switch, wherein the parameters used for indicating the function to be tested comprise at least one of the following parameters: identification of a particular thread, identification of a particular function;
and generating the test configuration information based on the editing result of at least one configuration item in response to the editing operation for each configuration item.
9. The method of claim 1, wherein,
the test configuration information is automatically generated;
the obtaining the test configuration information of the application program to be tested includes:
determining a fault thread based on fault log data of the application;
taking each fault thread as a specific thread, and taking the identification of the specific thread as a parameter for indicating a function to be tested;
Taking all functions running in the specific thread as functions to be tested, and determining a time consumption threshold corresponding to each function to be tested according to a mapping relation table of functions and running time;
and generating the test configuration information based on the parameter for indicating the function to be tested, the time-consuming threshold value of the function to be tested and the function overtime notification switch which are set to be in an on state.
10. The method of claim 1, wherein,
the test configuration information is automatically generated;
the obtaining the test configuration information of the application program to be tested includes:
determining the use frequency of each application function in the application program, and taking the application function with the use frequency larger than the use frequency threshold as the application function to be tested;
taking the thread associated with the application function to be tested as a specific thread, and taking the identification of the specific thread as a parameter for indicating the function to be tested;
taking all functions running in the specific thread as functions to be tested, and determining a time consumption threshold corresponding to each function to be tested according to a mapping relation table of functions and running time;
and generating the test configuration information based on the parameter for indicating the function to be tested, the time-consuming threshold value of the function to be tested and the function overtime notification switch which are set to be in an on state.
11. The method of claim 1, wherein after the generating the test result of the function to be tested, the method further comprises:
displaying a test result checking inlet;
and responding to the triggering operation of the checking inlet aiming at the test result, and displaying the test result of the function to be tested.
12. The method of claim 1, wherein prior to the obtaining the test configuration information for the application to be tested, the method further comprises:
acquiring the test code and a source code file of the application program;
determining functions to be instrumented in the source code file based on a list of functions to be instrumented, and instrumentation the test codes to the head and tail of each function to be instrumented respectively;
and compiling and packaging based on the source code file after the instrumentation to obtain an installation package of the application program, wherein the installation package is used for running the application program.
13. The method of claim 12, wherein the test code comprises a first timing code and a second timing code;
the determining the function to be instrumented in the source code file based on the function list to be instrumented, and instrumentation the test code to the head and the tail of each function to be instrumented respectively includes:
Obtaining a function list to be inserted and an inserting plug-in, and configuring the inserting plug-in based on the function list to be inserted;
traversing the functions to be instrumented in the source code file based on the configured instrumentation plug-in, and determining a head hooking point and a tail hooking point of each function to be instrumented;
stake the first timing code into the head of each function to be stake based on the head hook point position of each function to be stake;
and instrumentation the second timing codes to the tail of each function to be instrumented based on the tail hook point position of each function to be instrumented.
14. The method of claim 1, wherein after the step of generating test results for the function under test, the method further comprises:
when the test of the application program is represented to pass according to the test result, replacing the test code in the source code file of the application program passing the test with a null code with the same name interface as the test code;
and compiling and packaging based on the replaced source code file to generate an installation package to be distributed, wherein the installation package to be distributed is used for being distributed into a network for downloading and installing.
15. An apparatus for testing an application program, the apparatus comprising:
the information acquisition module is configured to acquire test configuration information of an application program to be tested, wherein the test configuration information comprises parameters for indicating a function to be tested;
the function test module is configured to be executed from an entry function of the application program, wherein test codes are pre-inserted at the head part and the tail part of each function to be tested in the application program;
the function test module is further configured to respond to the function to be tested being executed, record the running time consumption of the function to be tested based on the test codes of the head part and the tail part of the function to be tested, and generate a test result of the function to be tested, wherein the test result comprises the function name of the function to be tested and the running time consumption.
CN202210053493.XA 2022-01-18 2022-01-18 Application program testing method and device Pending CN116501596A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210053493.XA CN116501596A (en) 2022-01-18 2022-01-18 Application program testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210053493.XA CN116501596A (en) 2022-01-18 2022-01-18 Application program testing method and device

Publications (1)

Publication Number Publication Date
CN116501596A true CN116501596A (en) 2023-07-28

Family

ID=87321786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210053493.XA Pending CN116501596A (en) 2022-01-18 2022-01-18 Application program testing method and device

Country Status (1)

Country Link
CN (1) CN116501596A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472785A (en) * 2023-12-25 2024-01-30 银河麒麟软件(长沙)有限公司 Openstack test method and system under Linux system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472785A (en) * 2023-12-25 2024-01-30 银河麒麟软件(长沙)有限公司 Openstack test method and system under Linux system
CN117472785B (en) * 2023-12-25 2024-04-16 银河麒麟软件(长沙)有限公司 Openstack test method and system under Linux system

Similar Documents

Publication Publication Date Title
US9535823B2 (en) Method and apparatus for detecting software bugs
CN100547562C (en) The method and system of the unit testing use-case of problem when generation can be reproduced operation automatically
CN110941528B (en) Log buried point setting method, device and system based on fault
US6484276B1 (en) Method and apparatus for providing extensible object-oriented fault injection
US20120060148A1 (en) Assigning runtime artifacts to software components
CN105468529A (en) Accurate traversal method and apparatus for UI controls of android application
CN110704306A (en) Assertion processing method, device, equipment and storage medium in test
CN105653946A (en) Android malicious behavior detection system based on combined event behavior triggering and detection method of Android malicious behavior detection system
US20190050209A1 (en) Method and system to develop, deploy, test, and manage platform-independent software
CN114978940B (en) Link monitoring and alarming method, device, computer equipment and storage medium
CN109857520B (en) Semantic reconstruction improvement method and system in virtual machine introspection
CN113590454A (en) Test method, test device, computer equipment and storage medium
CN115878207A (en) Micro-service management method, device and system
CN110928777A (en) Test case processing method, device, equipment and storage medium
CN111913878A (en) Program analysis result-based bytecode instrumentation method, device and storage medium
CN116501596A (en) Application program testing method and device
Singh et al. Parallel chopped symbolic execution
US7458063B2 (en) Method and apparatus for supporting functionality documentation
CN115617668A (en) Compatibility testing method, device and equipment
CN115544518A (en) Vulnerability scanning engine implementation method and device, vulnerability scanning method and electronic equipment
CN117707917A (en) Service testing method, device, medium and product
CN117667643A (en) Evolution method and device of test case set, computing device cluster and storage medium
CN112596823A (en) Safety control method and device and electronic equipment
Mahmood An evolutionary approach for system testing of android applications
CN116775040B (en) Pile inserting method for realizing code vaccine and application testing method based on code vaccine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication