CN109871307A - A kind of automated testing method being accurately positioned starting matter of time - Google Patents
A kind of automated testing method being accurately positioned starting matter of time Download PDFInfo
- Publication number
- CN109871307A CN109871307A CN201811586757.8A CN201811586757A CN109871307A CN 109871307 A CN109871307 A CN 109871307A CN 201811586757 A CN201811586757 A CN 201811586757A CN 109871307 A CN109871307 A CN 109871307A
- Authority
- CN
- China
- Prior art keywords
- packet
- time
- comparison
- accurately positioned
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 33
- 238000000034 method Methods 0.000 claims abstract description 67
- 230000002159 abnormal effect Effects 0.000 claims abstract description 23
- 238000001514 detection method Methods 0.000 claims abstract description 5
- 238000012545 processing Methods 0.000 claims description 10
- 238000013507 mapping Methods 0.000 claims description 9
- 238000012163 sequencing technique Methods 0.000 claims description 4
- 238000002790 cross-validation Methods 0.000 claims description 3
- 239000000284 extract Substances 0.000 claims description 3
- 238000004891 communication Methods 0.000 claims 1
- 238000009877 rendering Methods 0.000 claims 1
- 238000011160 research Methods 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 4
- 238000012544 monitoring process Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Abstract
The present invention relates to a kind of automated testing methods for being accurately positioned starting matter of time, the following steps are included: 1) determine benchmark packet and comparison packet, detection comparison packet is relative to benchmark packet with the presence or absence of abnormal in Booting sequence, if 2) detect abnormal starting step, specific abnormal method or thread are navigated to.The present invention can be deconstructed by the depth to trace data so that research staff can on startup between it is abnormal when, navigate to the thread to go wrong and method rapidly.
Description
Technical field
The present invention relates to the test methods for starting the time to program more particularly to a kind of be accurately positioned to start matter of time
Automated testing method.
Background technique
The starting time is the first entrance that user perceives App, and when user is more and more, the function of product is got over also with iteration
Come more, it is a very common phenomenon that App, which gradually becomes too fat to move, it might even be possible to when saying and be inevitable phenomenon, and starting
Between, often determine the key element that the first impression of user experience and user are retained.Therefore, in order to guarantee user retain
Rate, the monitoring starting time increases and how positioning starting matter of time is exactly a very big project.
The testing scheme of automation starting time monitoring is mainly that pitching pile is got ready or using the method for cutting figure in the prior art,
For the testing scheme of monitoring starting time, generally from accuracy, whether composite users perception, can be used for the comparison of competing product and
The quality of intervention workload size several respects overall merit testing scheme of test, from figure 1 it appears that existing for supervising
The testing scheme of control starting time has many limitations, can not be automatically positioned the code line or thread to go wrong, generally only
Be only capable of accomplishing be it is abnormal it is time-consuming it is corresponding be which business scenario, but the service logic under business scenario is then completely unclear
Chu.If navigating to the code line or thread to go wrong, need manually to parse trace by traceview.Trace is log
One kind of message file, can be by the way that state pause judgments point pitching pile be arranged in method or is directly generated using order, and trace is one
The product generated in kind debugging contains the thread in operational process with method call stack and calls specific information,
Traceview is a tool built-in in Android SDK, it can load trace file, shows generation with the form of figure
Execution time, number and the call stack of code are analyzed convenient for us.I can be allowed by patterned mode by traceview
Understand the performance of the program that we to be tracked, and can be specific to method.Using the graphical tool of traceview, really
Positioning starting problem can bit by bit be gone, but have following defect: (1) cannot at a glance compartment system with operational approach
Start time loss;(2) it cannot find which method increases the starting time quickly;(3) follow-up, time-consuming consumption cannot be automated
Power;(4) helpless for obscuring to wrap.
Summary of the invention
To solve the above-mentioned problems, the purpose of the present invention is to provide a kind of automations for being accurately positioned starting matter of time
Test method parses trace, and mapping solution is obscured and customizing method filtering rule combines, by trace data
Depth destructing so that research staff can on startup between it is abnormal when, navigate to the thread to go wrong and side rapidly
Method.
In order to achieve the above purpose, present invention employs technical solutions below:
A kind of automated testing method being accurately positioned starting matter of time, comprising the following steps:
1) it determining benchmark packet and compares and wrap, detection comparison packet whether there is exception relative to benchmark packet in Booting sequence,
Specifically includes the following steps:
1.1) Booting sequence is divided into multiple steps, determines pitching pile and trace output in each step of Booting sequence
Point;
1.2) start test, comparison basis packet and comparison packet under cross validation to determine in comparison packet with the presence or absence of abnormal
Starting step, and export trace to the traceview of these steps;
If 2) detect abnormal starting step, specific abnormal method or thread are navigated to, specifically includes the following steps:
2.1) if benchmark packet and comparison packet are first obscured the trace file solution of step 1.2), otherwise directly by obscuring
Execute step 2.2);
2.2) file of the parsing by step 2.1) processing extracts corresponding time-consuming pass involved in the traceview panel
Key information is at traceHandler object;
2.3) using the traceHandler as parameter in benchmark packet and comparison packet sequencing comparison, output has abnormal side
Method and/or thread.
Preferably, step 1.2) includes:
Starting test, N > 1 are executed by preset number of starts N;
Average statistics are done by execution time of the log mode to each step in the Booting sequence of first N-1 times execution, are compared
Benchmark packet and comparison packet;
If first N-1 times comparison result has exception, when n-th executes Booting sequence, trace output switch is opened,
The trace file of output abnormality step.
Preferably, being obscured by mapping file trace file solution in step 2.1);
Preferably, the key message includes the call number of method, the total time-consuming of method, father and son in step 2.2)
The exclusive of method is time-consuming, father and son's method inclusive is time-consuming and thread dispatching stack.
Preferably, step 2.2) includes:
Trace file is converted into txt file by dmtracedump;
The source data in txt file is parsed, generates corresponding thread stacks and method storehouse, then by each thread stacks and side
Method storehouse corresponds, and compares their corresponding time-consuming situations in benchmark packet and comparison packet.
Preferably, step 2.2) includes that setting regularity is filtered method, the method for needing to be concerned about is filtered out.
Preferably, step 2) includes: that step 2.4) passes through generateTableData to step 2.3) output result wash with watercolours
Dye, obtains corresponding method time-consuming table.
Detailed description of the invention
Fig. 1 is the comparison diagram of existing testing scheme.
Fig. 2 is architecture diagram of the invention.
Fig. 3 is flow chart of the method for the present invention.
Fig. 4 is the schematic diagram of output result of the invention.
Specific embodiment
For the sake of clarity, illustrate the definition for the specific word or phrase that the present invention uses first.
Trace: the product generated in a kind of debugging contains the thread in operational process with method call stack and calling
Specific information.
Mapping: the mapped file after Code obfuscation.
Pitching pile: code is inserted into source code to realize some particular jobs.
Traceview:traceview is the tool that Android platform is equipped with the analysis of a good performance.It can lead to
The performance that patterned mode let us understands the program that we to be tracked is crossed, and can be specific to method.It is first when in use
Choosing to generate trace file must have this trace file that can just be translated into figure by pitching pile in a program.
Dmtracedump: the purpose of script is to combine entire calling process and time analysis, with the shape of function call graph
Formula shows.This project of google is constantly in broken state at present, delays to improve, but be that by
Trace file is converted into txt file.
TraceHandler class provides a synchronous HTTP handler, it can handle the request of tracking information.
Exclusive is time-consuming: the time run for the static fields of traceview file, function at the same level itself.
Inclusive is time-consuming: for the static fields of traceview file, in addition to the time that statistical function itself is run again
In addition the time for calling subfunction to be run.
The preferred embodiment of this patent is described in further detail with reference to the accompanying drawing.
A kind of automated testing method of accurate positioning starting matter of time as shown in Figures 2 and 3, comprising the following steps:
1) it determining benchmark packet and compares and wrap, detection comparison packet whether there is exception relative to benchmark packet in Booting sequence,
Wherein benchmark packet is the set for executing normal multiple program segments, is to need startup program to be tested in comparison packet, in comparison packet
Program segment it is corresponding with benchmark packet, their execution process is identical.
With the presence or absence of starting, abnormal specific step is as follows in detection comparison packet in step 1):
1.1) comparison packet and benchmark packet are divided into multiple steps by Booting sequence, determine and inserts in each step of Booting sequence
Stake and trace output point;
1.2) start test, comparison basis packet and comparison packet under cross validation to determine in comparison packet with the presence or absence of abnormal
Starting step, and export trace to the traceview of these steps;
The purpose of step 1) is to detect with the presence or absence of exception in Booting sequence, and determines and execute abnormal specific steps,
To reduce the output quantity of trace and the method i.e. data processing amount of thread of subsequent positioning exception.
Multiple test starting process takes mean value to improve test accuracy.Specifically, step 1.2) clicks step execution:
Starting test, N > 1 are executed by preset number of starts N;
Average statistics are done by execution time of the log mode to each step in the Booting sequence of first N-1 times execution, are compared
Benchmark packet and comparison packet;
If first N-1 times comparison result has exception, when n-th executes Booting sequence, trace output switch is opened,
The trace file of output abnormality step.
Due to trace very consumption energy, during the test, trace is only exported once and just for the tool in start-up course
The output of body subdivided step.
If detecting exception, thening follow the steps 2), analytical procedure 1) the trace file of output positions particular problem.
Wherein, described by log mode and is analyzed log file by grabbing object log file.
If 2) detect abnormal starting step, specific abnormal method or thread, the specific steps of step 2) are navigated to
It is as follows:
2.1) if benchmark packet and comparison packet are first obscured the trace file solution of step 1.2), otherwise directly by obscuring
Execute step 2.2);
2.2) file of the parsing by step 2.1) processing, extract the corresponding key message shown in traceview at
TraceHandler object;
2.3) it has been found out different using the traceHandler object as parameter in benchmark packet and comparison packet sequencing comparison
Normal method and/or thread simultaneously export result.
In the present embodiment, trace file solution is obscured by mapping file, mapping file defines the rule obscured
Then, the operation obscured its solution is to do the antialiasing operation of js using the mapping file of configuration.It is for benchmark packet and comparison packet
It is no to obscure by solution, it is first determined it is derived from the packet of environment or test environment on line, for deriving from the packet of environment on line,
Based on the considerations of code safety, defaulting its code is typically all by obscuring processing;For the packet from test environment, originally
It is to need to search whether that there are mapping files according to its store path in embodiment, if so, then assert this packet by obscuring
Processing, if it does not exist mapping file then assert the packet without obscure processing.Operation is obscured for solution, passes through JSDetox etc.
The antialiasing tool processing of common js.
Key message described in step 2.2) is corresponding with the information of traceview Display panel, the calling including method
Number, the total time-consuming of method, the exclusive of father and son's method are time-consuming, father and son's method inclusive is time-consuming and thread dispatching
Stack.Step 2.2) executes according to the following steps: trace file being converted into txt file by dmtracedump;Parse txt file
In source data, generate corresponding thread stacks and method storehouse, then each thread stacks and method storehouse are corresponded, compare
Their corresponding time-consuming situations in benchmark packet and comparison packet.In step 2.2), regularity can also be set, method is carried out
Filtering filters out the method for needing to be concerned about.For intuitive reaction test as a result, step 2) output is map file, for this
Map file renders the map file of output to obtain corresponding method time-consuming table, and this method time-consuming table is such as in the present embodiment
Shown in Fig. 4.In order to be rendered to output map file, definition generateTableData method,
The content of output field and corresponding field is defined in generateTableData method.
It compares described in step 2.3) using the traceHandler object as parameter in benchmark packet and comparison packet sequencing
Comparison, finds out abnormal method and/or thread and exports result.By Same Way or thread according in benchmark packet or comparison
It is executed in starting step in packet, be divided into the benchmark branch of this method or thread or compare branch, in table as shown in Figure 4
Field is obtained by the data processings such as traceHandler object obtained in step 2.2) being calculated, being sorted.This implementation
The time-consuming table exported in example includes call method, is subordinate to ranking, the consumption of thread, this method in benchmark branch and comparison branch
When and time-consuming difference and time-consuming rise ratio, the time-consuming situation of specific method and thread is intuitively reacted by these parameters, will
Positioning problems are to abnormal method and thread.
Present applicant proposes a kind of automatically-monitored schemes for getting method of the monitoring in conjunction with trace ready by pitching pile, pass through
To the destructing of the depth of trace data so that research staff can on startup between it is abnormal when, navigate to go wrong rapidly
Thread and method.
The embodiment of the present invention also provides a kind of terminal, including one or more processors, and logical with the processor
Believe the storage device of connection, wherein the storage device is stored with the program instruction that can be executed by the processor, the processing
Device calls described program instruction to be able to carry out a kind of automation for being accurately positioned starting matter of time provided by the above embodiment and surveys
Method for testing.
Those of ordinary skill in the art will appreciate that: realize that the embodiment all or part of the steps of the above method can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can store in computer readable storage medium, which holds
When row, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: that ROM, RAM, magnetic disk or CD etc. are each
Kind can store the medium of program code.
Claims (8)
1. a kind of automated testing method for being accurately positioned starting matter of time, which comprises the following steps:
1) it determines benchmark packet and compares and wrap, detection comparison packet whether there is exception relative to benchmark packet in Booting sequence, specifically
The following steps are included:
1.1) Booting sequence is divided into multiple steps, determines pitching pile and trace output point in each step of Booting sequence;
1.2) start test under cross validation, comparison basis packet and comparison packet are opened to determine in comparison packet with the presence or absence of abnormal
Dynamic step, and export trace to the traceview of these steps;
If 2) detect abnormal starting step, specific abnormal method or thread are navigated to, specifically includes the following steps:
2.1) if benchmark packet and comparison packet are first obscured the trace file solution of step 1.2), are otherwise directly executed by obscuring
Step 2.2);
2.2) file of the parsing by step 2.1) processing, extract corresponding time-consuming key message involved in the traceview at
TraceHandler object;
2.3) it is found out abnormal using the traceHandler object as parameter in benchmark packet and comparison packet sequencing comparison
Method and/or thread simultaneously export result.
2. a kind of automated testing method for being accurately positioned starting matter of time according to claim 1, which is characterized in that
Step 1.2) includes:
Starting test, N > 1 are executed by preset number of starts N;
Average statistics, benchmark are done by execution time of the log mode to each step in the Booting sequence of first N-1 times execution
Packet and comparison packet;
If first N-1 times comparison result has exception, when n-th executes Booting sequence, trace output switch is opened, is exported
The trace file of abnormal step.
3. a kind of automated testing method for being accurately positioned starting matter of time according to claim 1, which is characterized in that
In step 2.1), trace file solution is obscured by mapping file.
4. a kind of automated testing method for being accurately positioned starting matter of time according to claim 1, which is characterized in that
In step 2.2), the key message includes the exclusive consumption of the call number of method, the total time-consuming of method, father and son's method
When, father and son's method inclusive is time-consuming and thread dispatching stack.
5. a kind of automated testing method for being accurately positioned starting matter of time according to claim 1, which is characterized in that
Step 2.2) includes:
Trace file is converted into txt file by dmtracedump;
The source data in txt file is parsed, generates corresponding thread stacks and method storehouse, then by each thread stacks and method heap
Stack corresponds, and compares their corresponding time-consuming situations in benchmark packet and comparison packet.
6. a kind of automated testing method for being accurately positioned starting matter of time according to claim 1, which is characterized in that
Step 2.2) includes that setting regularity is filtered method, filters out the method for needing to be concerned about.
7. a kind of automated testing method for being accurately positioned starting matter of time according to claim 1, which is characterized in that
Step 2) includes: step 2.4) to step 2.3) output result rendering, obtains corresponding method time-consuming table.
8. a kind of terminal, which is characterized in that including one or more processors, and the storage being connect with the processor communication
Device, wherein the storage device is stored with the program instruction that can be executed by the processor, and the processor calls the journey
Sequence instruction is able to carry out such as a kind of automatic test for being accurately positioned starting matter of time of any of claims 1-7
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811586757.8A CN109871307A (en) | 2018-12-25 | 2018-12-25 | A kind of automated testing method being accurately positioned starting matter of time |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811586757.8A CN109871307A (en) | 2018-12-25 | 2018-12-25 | A kind of automated testing method being accurately positioned starting matter of time |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109871307A true CN109871307A (en) | 2019-06-11 |
Family
ID=66917266
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811586757.8A Pending CN109871307A (en) | 2018-12-25 | 2018-12-25 | A kind of automated testing method being accurately positioned starting matter of time |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109871307A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110442498A (en) * | 2019-06-28 | 2019-11-12 | 平安科技(深圳)有限公司 | Localization method, device, storage medium and the computer equipment of abnormal data node |
CN112667317A (en) * | 2020-12-28 | 2021-04-16 | 北京达佳互联信息技术有限公司 | Abnormal time consumption detection method and device, electronic equipment and storage medium |
CN113872823A (en) * | 2021-08-06 | 2021-12-31 | 中标慧安信息技术股份有限公司 | Internet of things terminal abnormal starting monitoring method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106681913A (en) * | 2016-12-08 | 2017-05-17 | 武汉斗鱼网络科技有限公司 | Application not responding positioning system and method |
CN106951298A (en) * | 2017-04-25 | 2017-07-14 | 广州优视网络科技有限公司 | A kind of method and apparatus for lifting application toggle speed |
CN107025173A (en) * | 2017-04-05 | 2017-08-08 | 腾讯科技(深圳)有限公司 | The method of testing and device of a kind of function timing |
CN108304330A (en) * | 2018-02-26 | 2018-07-20 | 腾讯科技(深圳)有限公司 | Method for extracting content, device and computer equipment |
-
2018
- 2018-12-25 CN CN201811586757.8A patent/CN109871307A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106681913A (en) * | 2016-12-08 | 2017-05-17 | 武汉斗鱼网络科技有限公司 | Application not responding positioning system and method |
CN107025173A (en) * | 2017-04-05 | 2017-08-08 | 腾讯科技(深圳)有限公司 | The method of testing and device of a kind of function timing |
CN106951298A (en) * | 2017-04-25 | 2017-07-14 | 广州优视网络科技有限公司 | A kind of method and apparatus for lifting application toggle speed |
CN108304330A (en) * | 2018-02-26 | 2018-07-20 | 腾讯科技(深圳)有限公司 | Method for extracting content, device and computer equipment |
Non-Patent Citations (2)
Title |
---|
吕照进等: "面向场景的安卓应用代码定位方法", 《计算机科学》 * |
李雷雷: "《利用Traceview精准定位启动时间测试的异常方法》", 《博客园》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110442498A (en) * | 2019-06-28 | 2019-11-12 | 平安科技(深圳)有限公司 | Localization method, device, storage medium and the computer equipment of abnormal data node |
CN110442498B (en) * | 2019-06-28 | 2022-11-25 | 平安科技(深圳)有限公司 | Abnormal data node positioning method and device, storage medium and computer equipment |
CN112667317A (en) * | 2020-12-28 | 2021-04-16 | 北京达佳互联信息技术有限公司 | Abnormal time consumption detection method and device, electronic equipment and storage medium |
CN113872823A (en) * | 2021-08-06 | 2021-12-31 | 中标慧安信息技术股份有限公司 | Internet of things terminal abnormal starting monitoring method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109284269B (en) | Abnormal log analysis method and device, storage medium and server | |
US8839203B2 (en) | Code coverage-based taint perimeter detection | |
US8584101B2 (en) | Apparatus and method for automatically analyzing program for detecting malicious codes triggered under specific event/context | |
US8370816B2 (en) | Device, method and computer program product for evaluating a debugger script | |
CN102789419B (en) | Software fault analysis method based on multi-sample difference comparison | |
US8291388B2 (en) | System, method and program for executing a debugger | |
CN109871307A (en) | A kind of automated testing method being accurately positioned starting matter of time | |
US7178135B2 (en) | Scope-based breakpoint selection and operation | |
EP3591485B1 (en) | Method and device for monitoring for equipment failure | |
CN103425572A (en) | Code analyzing method and system | |
US10459830B2 (en) | Executable code abnormality detection | |
CN108595343A (en) | The test method and device of application program | |
US8694831B2 (en) | Automatic bug reporting tool | |
CN103019942A (en) | Method and system for automatically testing applications to be tested based on android system | |
CN102681938A (en) | Memory leakage detecting method and device | |
CN110941553A (en) | Code detection method, device, equipment and readable storage medium | |
CN114238081A (en) | Method and system suitable for small satellite batch test | |
CN113568825A (en) | Program flow debugging method, device, equipment and storage medium | |
CN103425576A (en) | Information feedback method and terminal | |
CN112861138A (en) | Software security analysis method and analysis device, electronic device, and storage medium | |
CN108681506A (en) | A kind of method for testing pressure and device | |
CN111124820B (en) | Method for realizing off-line monitoring and analysis of operating system and process resources | |
US20130073526A1 (en) | Log message optimization to ignore or identify redundant log messages | |
US20170192878A1 (en) | Separating Test Coverage In Software Processes Using Shared Memory | |
CN110096281B (en) | Code analysis method, analysis server, storage medium and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190611 |