CN109815105A - Applied program testing method and device based on Btrace - Google Patents

Applied program testing method and device based on Btrace Download PDF

Info

Publication number
CN109815105A
CN109815105A CN201711156463.7A CN201711156463A CN109815105A CN 109815105 A CN109815105 A CN 109815105A CN 201711156463 A CN201711156463 A CN 201711156463A CN 109815105 A CN109815105 A CN 109815105A
Authority
CN
China
Prior art keywords
measured
application program
btrace
configuration file
program
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
CN201711156463.7A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711156463.7A priority Critical patent/CN109815105A/en
Publication of CN109815105A publication Critical patent/CN109815105A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the present application discloses applied program testing method and device based on Btrace.One specific embodiment of this method includes: the configuration file for receiving the configuration parameter that user sends and generating application program to be measured, wherein, configuration parameter includes the Internet protocol address of destination server and the characteristic information of application program to be measured where application program to be measured;Configuration file is parsed, so that Btrace, which utilizes parsed configuration file to monitor application program to be measured, obtains monitoring data;Test result is generated according to monitoring data, and test result is sent to user.The embodiment obtains the performance parameter of the application program to be measured by monitoring application program to be measured using configuration file, reduces the manpower testing cost of application program.

Description

Applied program testing method and device based on Btrace
Technical field
The invention relates to field of computer technology, and in particular to Internet technical field, more particularly to be based on The applied program testing method and device of Btrace.
Background technique
With the development of computer technology, more and more application programs are developed, however due to each terminal device Hardware configuration and install operating system version height it is different, for enable application program preferably with different hardware configurations with And the operating system of each version is compatible, needs to test the application program developed in program development process.
In the test of existing application program capacity, there are a variety of monitoring tools can hardware level to application program, Resource is monitored on the inferior line of software layer, but software under the lines such as the call number of application program, operation time-consuming is provided Performance in terms of source needs to complete by way of manual testing toward contact.
Summary of the invention
The embodiment of the present application proposes applied program testing method and device based on Btrace.
In a first aspect, the embodiment of the present application provides a kind of applied program testing method based on Btrace, this method packet It includes: receiving the configuration file that the configuration parameter that user sends generates application program to be measured, wherein configuration parameter includes application to be measured The Internet protocol address of destination server and the characteristic information of application program to be measured where program;Configuration file is parsed, so that Btrace utilizes parsed configuration file to monitor application program to be measured and obtains monitoring data;Test knot is generated according to monitoring data Fruit, and test result is sent to user.
In some embodiments, configuration file is parsed, so that Btrace utilizes parsed configuration file to monitor to be measured answer Monitoring data is obtained with program, comprising: parsing configuration file generates the script file of Btrace;In application program launching to be measured When, using Btrace perform script file monitor application program to be measured, obtain the monitoring data of application program to be measured.
In some embodiments, the characteristic information of application program to be measured includes realization class, the method for the application program to be measured Name;Configuration file is parsed, the script file of Btrace is generated, comprising: parsing configuration file reads to be measured answer from configuration file With the realization class and method name of program, the realization class and method name of application program to be measured are written to the script file of Btrace.
In some embodiments, the characteristic information of application program to be measured further includes the access domain name of the application program to be measured; Before using Btrace perform script file monitor application program to be measured, method further include: obtained from configuration file to be measured The access domain name of application program judges in destination server with the presence or absence of application program to be measured;If so, obtaining to be measured using journey The process identification (PID) of sequence, so that Btrace monitors the calling situation of application program to be measured and starts time-consuming situation;If it is not, then to user Send the prompt information of application exception to be measured.
In some embodiments, test result is generated according to monitoring data, and test result is sent to user, comprising: By the calling situation of the application program to be measured monitored and start time-consuming situation write-in log;Building calculates script file, and benefit It is handled with script file is calculated from the calling situation of the application program to be measured of log acquisition and the time-consuming situation of starting, generates and test knot Fruit;Test result is sent to user.
In some embodiments, method further include: after the process identification (PID) for obtaining application program to be measured, apply journey for be measured The process identification (PID) of sequence is stored into global variable so that when application program launching to be measured Btrace read in from global variable into Journey mark.
Second aspect, the embodiment of the present application provide a kind of Application testing device based on Btrace, and device includes: Generation unit is configured to receive the configuration file that the configuration parameter that user sends generates application program to be measured, wherein configuration ginseng Number includes the Internet protocol address of destination server and the characteristic information of application program to be measured where application program to be measured;Monitoring Unit is configured to parsing configuration file, obtains so that Btrace utilizes parsed configuration file to monitor application program to be measured Monitoring data;Transmission unit is configured to generate test result according to monitoring data, and test result is sent to user.
In some embodiments, monitoring unit includes: script generation module, is configured to parsing configuration file, generates The script file of Btrace;Execution module is configured in application program launching to be measured, utilizes Btrace perform script file Application program to be measured is monitored, the monitoring data of application program to be measured is obtained.
In some embodiments, the characteristic information of application program to be measured includes realization class, the method for the application program to be measured Name;Script generation module is further configured to: parsing configuration file reads the realization of application program to be measured from configuration file Class and method name, by the script file of realization class and method name the write-in Btrace of application program to be measured.
In some embodiments, the characteristic information of application program to be measured further includes the access domain name of the application program to be measured; Device further include: judging unit is configured to obtain the access domain name of application program to be measured from configuration file, judges that target takes It is engaged in whether there is application program to be measured in device;If so, obtain the process identification (PID) of application program to be measured so that Btrace monitoring to It surveys the calling situation of application program and starts time-consuming situation;If it is not, then sending the prompt letter of application exception to be measured to user Breath.
In some embodiments, transmission unit is further configured to: by the calling feelings of the application program to be measured monitored Log is written in condition and the time-consuming situation of starting;Building calculates script file, and is handled using script file is calculated from log acquisition The calling situation of application program to be measured and the time-consuming situation of starting, generate test result;Test result is sent to user.
In some embodiments, device includes: storage unit, is configured in the process identification (PID) for obtaining application program to be measured Afterwards, the process identification (PID) of application program to be measured is stored into global variable, so that Btrace is from full when application program launching to be measured Office's variable is in middle reading process identification (PID).
Applied program testing method and device provided by the embodiments of the present application based on Btrace is sent by receiving user Configuration parameter generate configuration file, then parse configuration file, can use the configuration in configuration file in order to Btrace Parameter monitoring application program to be measured simultaneously obtains monitoring data, can finally be correspondingly generated according to acquired monitoring data to be measured The test result of application program is simultaneously sent to user, so as to realize by using configuration file monitor application program to be measured come Application program capacity parameter to be measured is obtained, method is simple, reduces the manpower testing cost of application program.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 shows that this application can be applied to exemplary system architecture figures therein;
Fig. 2 shows the processes according to one embodiment of the applied program testing method based on Btrace of the application Figure;
Fig. 3 shows the process of another embodiment of the applied program testing method based on Btrace according to the application Figure;
The structure that Fig. 4 shows one embodiment of the Application testing device based on Btrace according to the application is shown It is intended to;
Fig. 5 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present application Figure.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the applied program testing method based on Btrace using the application or answering based on Btrace With the exemplary system architecture 100 of the embodiment of program test device.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various application programs to be measured can be installed on terminal device 101,102,103, such as web browser applications, Shopping class application, searching class application, instant messaging tools, mailbox client, social platform software etc..Server 105 can obtain The application program to be measured on terminal device 101,102,103 is taken, and it is to be measured using journey that this can be obtained from each application program to be measured The characteristic information of sequence.
Terminal device 101,102,103 can be with display screen and information input, the page supported the functions such as to show Various electronic equipments, including but not limited to smart phone, tablet computer, E-book reader, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) is broadcast Put device, pocket computer on knee and desktop computer etc..
Server 105 can be to provide the server of various services, such as to installing on terminal device 101,102,103 Application program provides the background server supported.Background server can be monitored the application program of operation, obtain and locate Monitoring data is managed, and processing result (such as performance parameter of application program) is fed back into terminal device.
It should be noted that the applied program testing method based on Btrace provided by the embodiment of the present application is generally by taking Business device 105 executes, and correspondingly, the Application testing device based on Btrace is generally positioned in server 105.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, an implementation of the applied program testing method based on Btrace according to the application is shown The process 200 of example.The applied program testing method based on Btrace, comprising the following steps:
Step 201, the configuration file that the configuration parameter that user sends generates application program to be measured is received.
In the present embodiment, electronic equipment (such as the Fig. 1 of the applied program testing method operation based on Btrace thereon Shown in server) it can be utilized to carry out the end of parameter configuration from user by wired connection mode or radio connection End receives configuration parameter to generate the configuration file of application program to be measured, wherein above-mentioned configuration parameter may include above-mentioned to be measured The Internet protocol address (IP) of destination server and the characteristic information of above-mentioned application program to be measured where application program.As it can be seen that User can read application program to be measured by the terminal device where it before sending configuration parameter to above-mentioned electronic equipment The IP address of place destination server.Meanwhile the terminal device where user can also be from the target where application program to be measured Server obtains the characteristic information of the application program to be measured.In general, the characteristic information of application program to be measured can be used for identify and Characterize the application program to be measured.It should be pointed out that above-mentioned radio connection can include but is not limited to 3G/4G connection, WiFi connection, bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection and other now The radio connection known or developed in the future.
Step 202, configuration file is parsed, is obtained so that Btrace utilizes parsed configuration file to monitor application program to be measured Take monitoring data.
In the present embodiment, based on the configuration file generated in step 201, above-mentioned electronic equipment can parse configuration text Part, to obtain the configuration parameter of user's transmission.Specifically, the target clothes where the available application program to be measured of electronic equipment The IP address of business device, so that Btrace can be uploaded to the destination server where the application program to be measured by it;Electronics Equipment can also obtain the characteristic information to be measured for answering program, so that it can configure corresponding environmental variance for Btrace, In order to which Btrace can monitor the application program to be measured.In general, Btrace can the dynamically running application of trace analysis Program, to realize analysis, the monitoring etc. to application program.Therefore, above-mentioned Btrace can be according to the configuration file parsed In configuration parameter monitor the operating condition of application program to be measured.It can be seen that user can be by configuring phase for configuration file The configuration parameter of pass realizes the monitoring to application program to be measured, and test method is simple, high-efficient, and does not need professional's dimension Shield, reduces the human cost of Application testing.
Step 203, test result is generated according to monitoring data, and test result is sent to user.
In the present embodiment, the monitoring data of the application program to be measured obtained based on step 202, above-mentioned electronic equipment can be with The processing such as analyzed acquired monitoring data, calculated, to generate corresponding test result.Further, above-mentioned electricity The test result that sub- equipment can also obtain is sent to user by the various approach such as mail, short message, in order to which user can root The performance of the application program to be measured is determined according to the test result.
The applied program testing method provided by the above embodiment based on Btrace of the application, can be by receiving user The configuration parameter of transmission generates configuration file, then parses configuration file, and Btrace can be made using matching in configuration file It sets parameter monitoring application program to be measured and obtains monitoring data, corresponding survey finally can be generated according to acquired monitoring data Test result, and it is sent to user, application to be measured is obtained to realize by monitoring application program to be measured using configuration file Program feature parameter reduces the manpower testing cost of application program.
With continued reference to FIG. 3, it illustrates according to the another of the applied program testing method based on Btrace of the application Embodiment shows process 300.The applied program testing method based on Btrace of the present embodiment may include steps of:
Step 301, the configuration file that the configuration parameter that user sends generates application program to be measured is received.
In this embodiment, electronic equipment (such as Fig. 1 institute of the applied program testing method operation based on Btrace thereon The server shown) terminal of its progress parameter configuration can be utilized from user by wired connection mode or radio connection Configuration parameter is received to generate the configuration file of application program to be measured, wherein above-mentioned configuration parameter may include above-mentioned to be measured answers The Internet protocol address (IP) of destination server and the characteristic information of above-mentioned application program to be measured where program.As it can be seen that with Family can read application program institute to be measured by the terminal device where it before sending configuration parameter to above-mentioned electronic equipment In the IP address of destination server.Meanwhile the terminal device where user can also take from the target where application program to be measured Business device obtains the characteristic information of the application program to be measured.In general, the characteristic information of application program to be measured can be used for identifying and table Levy the application program to be measured.
Step 302, configuration file is parsed, the script file of Btrace is generated.
In the present embodiment, the configuration file generated based on step 301, above-mentioned electronic equipment can parse configuration text Part, and the IP address of the destination server where obtaining application program to be measured in the configuration file.Above-mentioned electronic equipment can be with Btrace tool is uploaded to the destination server where application program to be measured according to the IP address of server.Meanwhile above-mentioned electronics Equipment can also obtain the characteristic information of application program to be measured from configuration file, and be believed using the feature of the application program to be measured The script file of breath configuration Btrace.Above-mentioned Btrace can execute the script file to monitor above-mentioned application program to be measured.
In some optional implementations of the present embodiment, the characteristic information of above-mentioned application program to be measured may include this The realization class and method name of application program to be measured.Therefore, above-mentioned electronic equipment can therefrom read this when parsing configuration file Then the realization class of read application program to be measured and method name are written for the realization class and method name of application program to be measured In the script file of Btrace, so that above-mentioned Btrace can be realized by executing the script file to above-mentioned application to be measured The monitoring of program.
Step 303, the access domain name that application program to be measured is obtained from configuration file judges whether deposit in destination server In application program to be measured.
In this embodiment, the application program to be measured in configuration parameter that the user received by above-mentioned electronic equipment sends Characteristic information can also include the application program to be measured access domain name.Therefore, when above-mentioned electronic equipment parses application to be measured When the configuration file of program, the access domain name of the application program to be measured can be therefrom obtained.Above-mentioned electronic equipment can basis The application program to be measured is searched in the access domain name to destination server, to judge on the destination server with the presence or absence of upper State application program to be measured.When above-mentioned electronic equipment is judged then go on destination server there are when application program to be measured Step 304;When above-mentioned electronic equipment is judged then go to step there is no when application program to be measured on destination server 305。
Step 304, the process identification (PID) of application program to be measured is obtained, so that Btrace monitors the calling feelings of application program to be measured Condition and the time-consuming situation of starting.
In the present embodiment, there are above-mentioned application programs to be measured in the destination server judged based on step 303, at this When application program to be measured is run, the process identification (PID) (ID) of the available application program to be measured of above-mentioned electronic equipment.Then, above-mentioned Btrace can search the application program to be measured according to the process identification (PID) of the application program to be measured, so that Btrace can be supervised Control the application program to be measured.Finally, the monitoring data of the available application program to be measured of above-mentioned electronic equipment.Here, to be measured The monitoring data of application program may include the calling situation of the application program to be measured and time-consuming situation, such as application program to be measured are Time-consuming, operation time-consuming of the no called, call number in the unit time, calling etc..
In some optional implementations of the present embodiment, above-mentioned electronic equipment is in the process for obtaining application program to be measured After mark, the process identification (PID) of the application program to be measured can be stored into global variable.When application program launching to be measured, Above-mentioned Btrace can be from global variable in the middle process identification (PID) for reading the application program to be measured.
Step 305, the prompt information of application exception to be measured is sent to user.
In the present embodiment, above-mentioned application program to be measured is not present in the destination server judged based on step 303, on It states electronic equipment and can send the prompt information of application exception to be measured to user to prompt the user application program to be measured not In the presence of.
Step 306, in application program launching to be measured, using Btrace perform script file monitor application program to be measured, Obtain the monitoring data of application program to be measured.
In the present embodiment, when application program launching to be measured, above-mentioned electronic equipment can use Btrace thereon and hold The Btrace script file that row generates, to realize the monitoring to application program to be measured.And it is monitored in application program to be measured During, above-mentioned electronic equipment can correspondingly obtain the monitoring data of the application program to be measured, such as application program to be measured Call situation and start time-consuming situation etc..
Step 307, log is written into the calling situation of the application program to be measured monitored and the time-consuming situation of starting.
In this embodiment, the monitoring data of the application program to be measured obtained based on step 306, such as tune of application program to be measured With situation and start time-consuming situation, above-mentioned electronic equipment can consume the calling situation of acquired application program to be measured and starting When the related datas such as situation log is written.When user needs using monitoring data, above-mentioned electronic equipment can from log phase Read monitoring data with answering.
Step 308, building calculates script file, and applies journey from the to be measured of log acquisition using script file processing is calculated The calling situation of sequence and the time-consuming situation of starting, generate test result.
In the present embodiment, in order to obtain the performance of application program to be measured, above-mentioned electronic equipment is also needed to acquired in it Monitoring data handled, the relevant parameter of application program capacity to be measured can first be indicated by generating, for example, call number, The performance parameters such as Tp50, Tp99 and Tps (inquiry things per second).Therefore, above-mentioned electronic equipment can construct in advance for calculating Calculating script file, such as shell script file.Then, above-mentioned electronic equipment can obtain application program to be measured from log Calling situation and start the monitoring datas such as time-consuming situation.Finally, above-mentioned electronic equipment, which can use, calculates script file processing It generates the test result of the application program to be measured from the monitoring data of the application program to be measured of log acquisition.
Step 309, test result is sent to user.
In the present embodiment, the test result of the application program to be measured generated based on step 308, above-mentioned electronic equipment can be with The test result is written in the files such as excel, and mail transmission system is called to send out the test result by way of mail Give user.
As described above based on the applied program testing method of Btrace, one or more applications to be measured can be tested simultaneously The performance of program, when using this method simultaneously test multiple application programs to be measured when, need to configure in configuration file it is multiple to The corresponding configuration parameter of application program is surveyed, allows Btrace to monitor multiple application programs to be measured, and can correspondingly generate The test result of each application program to be measured.It, can be with alternatively, as described above based on the applied program testing method of Btrace Application program to be measured similarly needs to configure the clothes in configuration file at this time each of on the same server for monitoring deployment The characteristic information of each of the IP address of business device and the service application program to be measured, so that Btrace can monitor the clothes Each application program to be measured being engaged on device, and correspondingly generate the test result of each application program to be measured.
From figure 3, it can be seen that the application journey based on Btrace compared with the corresponding embodiment of Fig. 2, in the present embodiment The process 300 of sequence test method highlights the step of monitoring application program to be measured using Btrace.The present embodiment describes as a result, Scheme can realize that Btrace is answered to be measured by generating the script file of Btrace using the configuration parameter in configuration file With the monitoring of program, realizing and monitored under the line for rapidly disposing application program to be measured, method is simple, and testing efficiency is high, and The maintenance for not needing professional reduces the human cost of Application testing.
With further reference to Fig. 4, as the realization to method shown in above-mentioned each figure, this application provides one kind to be based on Btrace Application testing device one embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, the device It specifically can be applied in various electronic equipments.
As shown in figure 4, the Application testing device 400 based on Btrace of the present embodiment include: generation unit 401, Monitoring unit 402 and transmission unit 403.Wherein, generation unit 401 be configured to receive user send configuration parameter generate to Survey the configuration file of application program, wherein configuration parameter includes the Internet protocol of destination server where application program to be measured The characteristic information of address and application program to be measured;Monitoring unit 402 is configured to parsing configuration file, so that Btrace utilizes institute The configuration file of parsing monitors application program to be measured and obtains monitoring data;Transmission unit 403 is configured to raw according to monitoring data User is sent at test result, and by test result.
In some optional implementations of the present embodiment, monitoring unit 402 includes: script generation module, and configuration is used In parsing configuration file, the script file of Btrace is generated;Execution module is configured in application program launching to be measured, benefit With Btrace perform script file monitor application program to be measured, the monitoring data of application program to be measured is obtained.
In some optional implementations of the present embodiment, the characteristic information of application program to be measured includes the application to be measured Realization class, the method name of program;Script generation module is further configured to: parsing configuration file is read from configuration file The realization class and method name of application program to be measured, by the script text of realization class and method name the write-in Btrace of application program to be measured Part.
In some optional implementations of the present embodiment, the characteristic information of application program to be measured further includes that this to be measured is answered With the access domain name of program;Application testing device 400 based on Btrace further include: judging unit is configured to from matching The access domain name for obtaining application program to be measured in file is set, is judged in destination server with the presence or absence of application program to be measured;If so, The process identification (PID) of application program to be measured is then obtained, so that Btrace monitors the calling situation of application program to be measured and starts time-consuming feelings Condition;If it is not, then sending the prompt information of application exception to be measured to user.
In some optional implementations of the present embodiment, transmission unit 403 is further configured to: by what is monitored Log is written in the calling situation of application program to be measured and the time-consuming situation of starting;Building calculates script file, and utilizes calculating script File process is from the calling situation of the application program to be measured of log acquisition and starts time-consuming situation, generates test result;To user Send test result.
In some optional implementations of the present embodiment, the Application testing device 400 based on Btrace is also wrapped Include: storage unit is configured to after the process identification (PID) for obtaining application program to be measured, the process identification (PID) of application program to be measured is deposited It stores up in global variable, so that Btrace is from global variable in middle reading process identification (PID) when application program launching to be measured.
Below with reference to Fig. 5, it illustrates the terminal device/server computers for being suitable for being used to realize the embodiment of the present application The structural schematic diagram of system 500.Terminal device/server shown in Fig. 5 is only an example, should not be to the embodiment of the present application Function and use scope bring any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 500 is also connected to I/O interface 505 as needed.Detachable media 501, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 500, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communications portion 509, and/or from detachable media 501 are mounted.When the computer program is executed by central processing unit (CPU) 501, limited in execution the present processes Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or Computer readable storage medium either the two any combination.Computer readable storage medium for example can be --- but Be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination. The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires electrical connection, Portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only deposit Reservoir (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory Part or above-mentioned any appropriate combination.In this application, computer readable storage medium, which can be, any include or stores The tangible medium of program, the program can be commanded execution system, device or device use or in connection.And In the application, computer-readable signal media may include in a base band or the data as the propagation of carrier wave a part are believed Number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, including but not It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer Any computer-readable medium other than readable storage medium storing program for executing, the computer-readable medium can send, propagate or transmit use In by the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc., Huo Zheshang Any appropriate combination stated.
The calculating of the operation for executing the application can be write with one or more programming languages or combinations thereof Machine program code, described program design language include object oriented program language-such as Java, Smalltalk, C+ +, further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet Include generation unit, monitoring unit and transmission unit.Wherein, the title of these units is not constituted under certain conditions to the unit The restriction of itself, for example, generation unit is also described as " receiving the configuration parameter that user sends and generating application program to be measured Configuration file unit ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be Included in device described in above-described embodiment;It is also possible to individualism, and without in the supplying device.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the device, so that should Device: the configuration file that the configuration parameter that user sends generates application program to be measured is received, wherein configuration parameter includes to be measured answers The Internet protocol address of destination server and the characteristic information of application program to be measured where program;Configuration file is parsed, with Make Btrace that parsed configuration file be utilized to monitor application program to be measured and obtains monitoring data;It is generated and is tested according to monitoring data As a result, and test result is sent to user.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (14)

1. a kind of applied program testing method based on Btrace, comprising:
Receive the configuration parameter that user sends and generate the configuration file of application program to be measured, wherein the configuration parameter include to The Internet protocol address of destination server and the characteristic information of the application program to be measured where surveying application program;
The configuration file is parsed, is obtained so that the Btrace utilizes parsed configuration file to monitor the application program to be measured Take monitoring data;
Test result is generated according to the monitoring data, and the test result is sent to user.
2. according to the method described in claim 1, wherein, parse the configuration file, so that the Btrace is using being parsed The configuration file monitoring application program to be measured obtain monitoring data, comprising:
The configuration file is parsed, the script file of the Btrace is generated;
In the application program launching to be measured, it is described to be measured using journey that the script file monitoring is executed using the Btrace Sequence obtains the monitoring data of the application program to be measured.
3. according to the method described in claim 2, wherein, the characteristic information of the application program to be measured includes that this described to be measured is answered With realization class, the method name of program;
The parsing configuration file, generates the script file of the Btrace, comprising:
The configuration file is parsed, the realization class and method name of the application program to be measured are read from the configuration file, it will The script file of the Btrace is written in the realization class and method name of the application program to be measured.
4. according to the method described in claim 1, wherein, the characteristic information of the application program to be measured further includes that this is described to be measured The access domain name of application program;
Before executing the script file using the Btrace and monitoring the application program to be measured, the method also includes:
The access domain name that the application program to be measured is obtained from the configuration file judges whether deposit in the destination server In the application program to be measured;
If so, the process identification (PID) of the application program to be measured is obtained, so that the Btrace monitors the application program to be measured Calling situation and start time-consuming situation;
If it is not, then sending the prompt information of the application exception to be measured to the user.
5. it is described that test result is generated according to the monitoring data according to the method described in claim 4, wherein, and will be described Test result is sent to user, comprising:
By the calling situation of the application program to be measured monitored and start time-consuming situation write-in log;
It constructs and calculates script file, and handled using the calculating script file from the described to be measured using journey of the log acquisition The calling situation of sequence and the time-consuming situation of starting, generate test result;
The test result is sent to the user.
6. according to the method described in claim 1, wherein, the method also includes:
After the process identification (PID) for obtaining the application program to be measured, by the process identification (PID) storage of the application program to be measured to the overall situation In variable, so that the Btrace is from the global variable in the middle reading process mark when application program launching to be measured Know.
7. a kind of Application testing device based on Btrace, comprising:
Generation unit is configured to receive the configuration file that the configuration parameter that user sends generates application program to be measured, wherein institute State the Internet protocol address and the application program to be measured that configuration parameter includes destination server where application program to be measured Characteristic information;
Monitoring unit is configured to parse the configuration file, so that the Btrace utilizes parsed configuration file to monitor The application program to be measured obtains monitoring data;
Transmission unit is configured to generate test result according to the monitoring data, and the test result is sent to user.
8. device according to claim 7, wherein the monitoring unit includes:
Script generation module is configured to parse the configuration file, generates the script file of the Btrace;
Execution module is configured in the application program launching to be measured, executes the script file using the Btrace The application program to be measured is monitored, the monitoring data of the application program to be measured is obtained.
9. according to right want 8 described in device, wherein the characteristic information of the application program to be measured includes the application to be measured Realization class, the method name of program;
The script generation module is further configured to:
The configuration file is parsed, the realization class and method name of the application program to be measured are read from the configuration file, it will The script file of the Btrace is written in the realization class and method name of the application program to be measured.
10. device according to claim 7, wherein the characteristic information of the application program to be measured further includes that this is described to be measured The access domain name of application program;
Described device further include:
Judging unit is configured to obtain the access domain name of the application program to be measured from the configuration file, described in judgement It whether there is the application program to be measured in destination server;
If so, the process identification (PID) of the application program to be measured is obtained, so that the Btrace monitors the application program to be measured Calling situation and start time-consuming situation;
If it is not, then sending the prompt information of the application exception to be measured to the user.
11. device according to claim 10, wherein the transmission unit is further configured to:
By the calling situation of the application program to be measured monitored and start time-consuming situation write-in log;
It constructs and calculates script file, and handled using the calculating script file from the described to be measured using journey of the log acquisition The calling situation of sequence and the time-consuming situation of starting, generate test result;
The test result is sent to the user.
12. device according to claim 7, wherein described device further include:
Storage unit is configured to after the process identification (PID) for obtaining the application program to be measured, by the application program to be measured Process identification (PID) is stored into global variable, so that the Btrace exists from the global variable when application program launching to be measured It is middle to read the process identification (PID).
13. a kind of server, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed Such as method as claimed in any one of claims 1 to 6 is realized when device executes.
CN201711156463.7A 2017-11-20 2017-11-20 Applied program testing method and device based on Btrace Pending CN109815105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711156463.7A CN109815105A (en) 2017-11-20 2017-11-20 Applied program testing method and device based on Btrace

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711156463.7A CN109815105A (en) 2017-11-20 2017-11-20 Applied program testing method and device based on Btrace

Publications (1)

Publication Number Publication Date
CN109815105A true CN109815105A (en) 2019-05-28

Family

ID=66598497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711156463.7A Pending CN109815105A (en) 2017-11-20 2017-11-20 Applied program testing method and device based on Btrace

Country Status (1)

Country Link
CN (1) CN109815105A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837455A (en) * 2019-11-07 2020-02-25 北京宝兰德软件股份有限公司 Script-based application configuration information acquisition method and device
CN110958155A (en) * 2019-11-08 2020-04-03 深圳市元征科技股份有限公司 Test configuration method and related device
CN112015640A (en) * 2020-08-06 2020-12-01 京东数字科技控股股份有限公司 Software testing method and system
CN112182581A (en) * 2020-09-24 2021-01-05 百度在线网络技术(北京)有限公司 Application testing method and device, application testing equipment and storage medium
CN112799933A (en) * 2019-11-14 2021-05-14 北京京东振世信息技术有限公司 Automatic testing method and device
CN113391994A (en) * 2021-03-09 2021-09-14 深圳市星锐游戏有限公司 Mobile phone software automatic testing method based on Unity platform
CN113806214A (en) * 2021-02-10 2021-12-17 京东科技控股股份有限公司 Application program testing method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064664A (en) * 2012-11-28 2013-04-24 华中科技大学 Hadoop parameter automatic optimization method and system based on performance pre-evaluation
CN105187554A (en) * 2015-09-29 2015-12-23 北京京东尚科信息技术有限公司 Method and system for monitoring server performance
CN105988925A (en) * 2015-02-10 2016-10-05 腾讯科技(深圳)有限公司 Method, device and system for testing start-up time of application program
US20160314060A1 (en) * 2005-06-10 2016-10-27 Wapp Tech Corp. Systems including network simulating for mobile application development
CN106815141A (en) * 2015-12-02 2017-06-09 北京奇虎科技有限公司 A kind of method for testing software and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160314060A1 (en) * 2005-06-10 2016-10-27 Wapp Tech Corp. Systems including network simulating for mobile application development
CN103064664A (en) * 2012-11-28 2013-04-24 华中科技大学 Hadoop parameter automatic optimization method and system based on performance pre-evaluation
CN105988925A (en) * 2015-02-10 2016-10-05 腾讯科技(深圳)有限公司 Method, device and system for testing start-up time of application program
CN105187554A (en) * 2015-09-29 2015-12-23 北京京东尚科信息技术有限公司 Method and system for monitoring server performance
CN106815141A (en) * 2015-12-02 2017-06-09 北京奇虎科技有限公司 A kind of method for testing software and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
(美)微软公司著: "《Microsoft SQL Server 2000数据库管理》", 31 May 2001, 北京希望电子出版社 *
MOUNTAINKING: "Java应用监控利器——BTrace教程", 《HTTPS://WWW.JIANSHU.COM/P/26F19095D396》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837455A (en) * 2019-11-07 2020-02-25 北京宝兰德软件股份有限公司 Script-based application configuration information acquisition method and device
CN110837455B (en) * 2019-11-07 2023-04-14 北京宝兰德软件股份有限公司 Script-based application configuration information acquisition method and device
CN110958155A (en) * 2019-11-08 2020-04-03 深圳市元征科技股份有限公司 Test configuration method and related device
CN110958155B (en) * 2019-11-08 2023-02-28 深圳市元征科技股份有限公司 Test configuration method and related device
CN112799933A (en) * 2019-11-14 2021-05-14 北京京东振世信息技术有限公司 Automatic testing method and device
CN112799933B (en) * 2019-11-14 2023-11-03 北京京东振世信息技术有限公司 Automatic test method and device
CN112015640A (en) * 2020-08-06 2020-12-01 京东数字科技控股股份有限公司 Software testing method and system
CN112015640B (en) * 2020-08-06 2024-04-05 京东科技控股股份有限公司 Software testing method and system
CN112182581A (en) * 2020-09-24 2021-01-05 百度在线网络技术(北京)有限公司 Application testing method and device, application testing equipment and storage medium
CN112182581B (en) * 2020-09-24 2023-10-13 百度在线网络技术(北京)有限公司 Application testing method, device, application testing equipment and storage medium
CN113806214A (en) * 2021-02-10 2021-12-17 京东科技控股股份有限公司 Application program testing method and device, computer equipment and storage medium
CN113391994A (en) * 2021-03-09 2021-09-14 深圳市星锐游戏有限公司 Mobile phone software automatic testing method based on Unity platform

Similar Documents

Publication Publication Date Title
CN109815105A (en) Applied program testing method and device based on Btrace
CN108459953A (en) test method and device
CN108614774A (en) Automated testing method and device
CN105630684B (en) Software Development Kit recognition methods and device
CN109062563B (en) Method and device for generating page
CN108958992A (en) test method and device
CN109684188A (en) Test method and device
CN108959087A (en) test method and device
CN109033464A (en) Method and apparatus for handling information
CN108494860A (en) WEB accesses system, WEB access methods and device for client
CN110209315A (en) The display methods of character, device, electronic equipment and storage medium in user interface
CN104978276B (en) Method, apparatus and system for inspection software
CN110069308A (en) The page starts method, apparatus, electronic equipment and storage medium
CN109347921A (en) A kind for the treatment of method and apparatus of digital certificate business
CN110377440A (en) Information processing method and device
CN109815107A (en) The method and apparatus of automatic test
CN110007936A (en) Data processing method and device
CN108958826A (en) The method and apparatus of dynamic configuration application installation package
CN109582317A (en) Method and apparatus for debugging boarding application
CN109656799A (en) Test method and device
CN109873732A (en) Test method and device for proxy server
CN108694120A (en) The method and apparatus of testing service component
CN109218041A (en) Request processing method and device for server system
CN107347093A (en) Collocation method and device for distributed server system
CN109819042A (en) For providing the method and apparatus of Software Development Kit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190528