CN104021071A - Method and system for obtaining process lifecycles - Google Patents

Method and system for obtaining process lifecycles Download PDF

Info

Publication number
CN104021071A
CN104021071A CN201310066582.9A CN201310066582A CN104021071A CN 104021071 A CN104021071 A CN 104021071A CN 201310066582 A CN201310066582 A CN 201310066582A CN 104021071 A CN104021071 A CN 104021071A
Authority
CN
China
Prior art keywords
thread
test
time point
sub
test pack
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
CN201310066582.9A
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 CN201310066582.9A priority Critical patent/CN104021071A/en
Publication of CN104021071A publication Critical patent/CN104021071A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and system for obtaining process lifecycles. The method comprises the steps that a capture sub thread is set up in a test main thread, the test main thread and the capture sub thread are operated, and the capture sub thread captures a system log in the operating process; the starting time point and the ending time point under the name of a preset test pack in the captured system log are searched for; according to the starting time point and the ending time point which are searched for, the process lifecycles corresponding to the test pack name are obtained. The method can accurately and quickly obtain changes of lifecycles of all processes in the software testing process and improve software testing accuracy, software tests can be completely controlled by a program and can be automatically achieved through a system, manual monitoring is not needed, and the labor source is saved. Moreover, on the premise of guaranteeing accuracy, a test platform can test software of a plurality of mobile terminals at the same time, and testing efficiency can be greatly improved.

Description

The acquisition methods of process lifetime and system
Technical field
The present invention relates to measuring technology, particularly a kind of acquisition methods of process lifetime and system.
Background technology
Along with developing rapidly of science and technology, what communication was scientific and technological makes rapid progress, and mobile communication terminal has been widely used in daily life and study by people, and increasing people gets used to using mobile terminal to chat, surf the Net.
At present, cloud test is the conventional a kind of means of mobile terminal software test, cloud test is a kind of testing scheme based on cloud computing, provide kinds of platform by service provider, user writes automatic test script at mobile terminal, then by network and service provider's line, Run Script complete test on the platform then providing in service provider.
For test result, can change directly and obtain by the life cycle of a certain screen process on mobile terminal, the process that the life cycle of a certain screen process changes the some picture states that refer to that mobile terminal screen the shows time cycle from start to end, for example, in the time of a certain software login of test situation, while starting to show login interface, this process starts, when logining successfully and converting the login interface of demonstration to other interface, this process finishes, and after the test data such as record login time, whether login successfully, completes test.
At present, the test that this certain screen process lifetime changes is all by manually testing conventionally, observes the variation of mobile terminal display screen test by test man.Because mobile terminal software is of a great variety, often need to repeatedly test, waste a large amount of human resources.And while artificially observing display screen, time point when process lifetime changes (process starts to finish with process) is difficult to accurate assurance, there will be unavoidably error, affects test accuracy.
Summary of the invention
The object of this invention is to provide a kind of acquisition methods and system of process lifetime, to solve, existing method of testing human resources expend greatly, accuracy is difficult to the problem ensureing.
The present invention proposes a kind of acquisition methods of process lifetime, comprising:
In test main thread, create and intercept sub-thread;
Move described test main thread and the sub-thread of described intercepting, and by the system journal in the sub-thread interception operational process of described intercepting;
Search start time point and end time point under test pack title default in the described system journal of intercepting;
According to the described start time point finding out and described end time put obtain described test pack title the life cycle of corresponding process.
The present invention also proposes a kind of system of obtaining of process lifetime, comprising:
Thread creation unit, for creating and intercept sub-thread at test main thread;
Processing unit, for moving described test main thread and the sub-thread of described intercepting, and by the system journal in the sub-thread interception operational process of described intercepting;
Search unit, for searching start time point and the end time point under the default test pack title of the described system journal of intercepting;
Computing unit, for put according to the described start time point finding out and described end time obtain described test pack title the life cycle of corresponding process.
With respect to prior art, the invention has the beneficial effects as follows: the life cycle that the present invention not only can obtain each process in software test procedure accurately and rapidly changes, and can be completed by system automation by programmed control completely, without artificial monitoring, save human resources.And, ensureing that under the prerequisite of accuracy, a test platform can carry out software test to multiple mobile terminals simultaneously, can greatly improve testing efficiency.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to better understand technological means of the present invention, and can be implemented according to the content of instructions, and for above and other object of the present invention, feature and advantage can be become apparent, below especially exemplified by preferred embodiment, and coordinate accompanying drawing, be described in detail as follows.
Brief description of the drawings
Fig. 1 is the process flow diagram of the acquisition methods of a kind of process lifetime of the embodiment of the present invention;
Fig. 2 is the structural drawing of the system of obtaining of a kind of process lifetime of the embodiment of the present invention.
Embodiment
Reach for further setting forth the present invention technological means and effect that predetermined goal of the invention is taked, below in conjunction with accompanying drawing and preferred embodiment, to acquisition methods and its embodiment of system, method, step and effect of the process lifetime proposing according to the present invention, be described in detail as follows.
Relevant aforementioned and other technology contents of the present invention, Characteristic, can clearly present in following cooperation in describing in detail with reference to graphic preferred embodiment.By the explanation of embodiment, when being able to more deeply and concrete understanding for technological means and effect of reaching predetermined object and taking the present invention, but appended graphic be only to provide with reference to the use of explanation, be not used for the present invention to be limited.
The present invention proposes a kind of acquisition methods of process lifetime, can be for the test of automated software, and the life cycle that particularly can be used for calculating a certain screen process that mobile terminal display screen shows changes.Refer to Fig. 1, the method comprises the following steps:
S11 creates and intercepts sub-thread in test main thread.
Test main thread refers to the program that testing software will move, and the effect that intercepts sub-thread is the system journal intercepting in software running process, and the execution of thread forms the process of software test.Mobile terminal system is in the situation of Android operating system, can utilize adb logcat order to create and intercept sub-thread in test main thread.Adb(Android Debug Bridge, Android system debugging bridge) be a kind of debugging acid, adb logcat order refers to the order of carrying out log truncation in adb order.
S12, moves described test main thread and the sub-thread of described intercepting, and by the system journal in the sub-thread interception operational process of described intercepting.
System journal is the information of hardware in register system, software and system problem, event in simultaneously all right surveillance, and it is txt document normally.The test process of software also can be recorded in system journal, by intercepting the system journal of recording in software test procedure, just can check the various variations in detail in test process.
S13, searches start time point and end time point under test pack title default in the described system journal of intercepting.
The test of software can be divided into several processes, for example can comprise login process, operational process, terminal procedure etc., test pack title described here arranges in advance, it refers to a certain section of corresponding title of process, and what this section of process showed on mobile terminal display screen can be a screen or the display frame of multi-screen continuously.For example " login " this test pack title, on mobile terminal display screen, can show the picture of a logging status, represent a logon process, the moment that this picture occurs represents that logon process starts, this picture finishes and moment of converting other picture (as logining successfully or the picture of login failure) to represents that logon process finishes, and these change informations all can obtain in system journal.
Searching start time under test pack title point and end time while putting, can be referred to as key word by test pack name, according to time sequencing from the near to the remote, to the system journal intercepting out search for (if system journal be according to order from top to bottom by program operational information recording in txt archives, while search, according to order from the bottom up, the information in txt archives is searched), find out the record matching with test pack title, then from the record of finding out, find out again corresponding start time point and end time point.
S14, according to the described start time point finding out and described end time put obtain described test pack title the life cycle of corresponding process.
The life cycle of a process refers to the process starting to finishing since obtained start time point and the end time point of test pack, both mistimings be test pack the life cycle of corresponding process.When concrete operations, ondestory time point and oncreate time point in can seeking system daily record under test pack title, the effect of oncreate order is the variable that will use in registration procedure, represent the beginning of this process, the effect of ondestory order is the anti-registration variable of registration before, the end of expression process, by calculating the mistiming between ondestory time point and oncreate time point, just can obtain the corresponding process lifetime of this test pack.
In order further to improve the accuracy of test, can repeatedly move test main thread and intercept after sub-thread, obtain multiple life cycles of same test pack, due to the network environment in test process each time, system resources in computation even hardware environment change and all likely cause the life cycle of process to change, so the multiple life cycles to the same test pack obtaining after repeatedly testing are averaged, and feed back as final process lifetime, can reflect more objectively like this running software situation, improve test accuracy.
The life cycle that the present invention not only can obtain each process in software test procedure accurately and rapidly changes, and can be completed by system automation by programmed control completely, without artificial monitoring, has saved human resources.And, ensureing that under the prerequisite of accuracy, a test platform can carry out software test to multiple mobile terminals simultaneously, can greatly improve testing efficiency.
The present invention also proposes a kind of system of obtaining of process lifetime, refer to Fig. 2, it comprises thread creation unit 21, processing unit 22, search unit 23 and computing unit 24, processing unit 22 is connected with thread creation unit 21, search unit 23 is connected with processing unit 22, and computing unit 24 is connected with search unit 23.
Before software test, first to create and intercept sub-thread in test main thread by thread creation unit 21.Test main thread refers to the program that testing software will move, and the effect that intercepts sub-thread is the system journal intercepting in software running process, and the execution of thread forms the process of software test.Mobile terminal system is in the situation of Android operating system, can utilize adb logcat order to create and intercept sub-thread in test main thread.
When software test, processing unit 22 can move described test main thread and the sub-thread of described intercepting, and by the system journal in the sub-thread interception operational process of described intercepting.
Afterwards, search unit 23 can be searched for the system journal being truncated to, start time point and end time point in seeking system daily record under default test pack title.Searching start time under test pack title point and end time while putting, can be referred to as key word by test pack name, according to time sequencing from the near to the remote, to the system journal intercepting out search for (if system journal be according to order from top to bottom by program operational information recording in txt archives, while search, according to order from the bottom up, the information in txt archives is searched), find out the record matching with test pack title, then from the record of finding out, find out again corresponding start time point and end time point.
Finally, by computing unit 24 according to the described start time point finding out and described end time put obtain described test pack title the life cycle of corresponding process.The life cycle of a process refers to the process starting to finishing since obtained start time point and the end time point of test pack, both mistimings be test pack the life cycle of corresponding process.In order further to improve the accuracy of test, can repeatedly move test main thread and intercept after sub-thread, obtain multiple life cycles of same test pack, due to the network environment in test process each time, system resources in computation even hardware environment variation all likely causes the life cycle of process to change, so multiple life cycles of the same test pack obtaining after repeatedly testing are averaged by computing unit 24, and feed back as final process lifetime, can reflect more objectively like this running software situation, improve test accuracy.
Through the above description of the embodiments, those skilled in the art can be well understood to the embodiment of the present invention and can realize by hardware, and the mode that also can add necessary general hardware platform by software realizes.Based on such understanding, the technical scheme of the embodiment of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise that each implements the method described in scene in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) carry out the embodiment of the present invention in some instructions.
The above, it is only preferred embodiment of the present invention, not the present invention is done to any pro forma restriction, although the present invention discloses as above with preferred embodiment, but not in order to limit the present invention, any those skilled in the art, do not departing within the scope of technical solution of the present invention, when can utilizing the technology contents of above-mentioned announcement to make a little change or being modified to the equivalent embodiment of equivalent variations, in every case be not depart from technical solution of the present invention content, any simple modification of above embodiment being done according to technical spirit of the present invention, equivalent variations and modification, all still belong in the scope of technical solution of the present invention.

Claims (10)

1. an acquisition methods for process lifetime, is characterized in that, comprising:
In test main thread, create and intercept sub-thread;
Move described test main thread and the sub-thread of described intercepting, and by the system journal in the sub-thread interception operational process of described intercepting;
Search start time point and end time point under test pack title default in the described system journal of intercepting;
According to the described start time point finding out and described end time put obtain described test pack title the life cycle of corresponding process.
2. the acquisition methods of process lifetime as claimed in claim 1, is characterized in that, described in search the step that start time under test pack title default in the described system journal of intercepting point and end time put and comprise:
Be referred to as the record matching in system journal described in keyword search with described default test pack name;
From described record, search start time point and end time point under default test pack title.
3. the acquisition methods of process lifetime as claimed in claim 2, it is characterized in that, in the described step that is referred to as the record matching in system journal described in keyword search with described default test pack name, search for according to time sequencing from the near to the remote.
4. the acquisition methods of process lifetime as claimed in claim 1, it is characterized in that, according to repeatedly move described test main thread and the sub-thread of described intercepting obtain described test pack title multiple life cycles of corresponding process, and the mean value that calculates multiple life cycles is as final life cycle.
5. the acquisition methods of process lifetime as claimed in claim 1, is characterized in that, creates and intercepts sub-thread in test main thread according to adb logcat order.
6. the system of obtaining of process lifetime, is characterized in that, comprising:
Thread creation unit, for creating and intercept sub-thread at test main thread;
Processing unit, for moving described test main thread and the sub-thread of described intercepting, and by the system journal in the sub-thread interception operational process of described intercepting;
Search unit, for searching start time point and the end time point under the default test pack title of the described system journal of intercepting;
Computing unit, for put according to the described start time point finding out and described end time obtain described test pack title the life cycle of corresponding process.
7. the system of obtaining of process lifetime as claimed in claim 6, it is characterized in that, described search unit is referred to as the record matching in system journal described in keyword search with described default test pack name, and from described record, searches start time point and end time point under described default test pack title.
8. the system of obtaining of process lifetime as claimed in claim 7, it is characterized in that, when described search unit is referred to as with described default test pack name recording of matching in system journal described in keyword search, search for according to time sequencing from the near to the remote.
9. the system of obtaining of process lifetime as claimed in claim 6, it is characterized in that, described computing unit according to repeatedly move described test main thread and the sub-thread of described intercepting obtain described test pack title multiple life cycles of corresponding process, and the mean value that calculates multiple life cycles is as final life cycle.
10. the system of obtaining of process lifetime as claimed in claim 6, is characterized in that, described thread creation unit creates and intercepts sub-thread in test main thread according to adb logcat order.
CN201310066582.9A 2013-03-01 2013-03-01 Method and system for obtaining process lifecycles Pending CN104021071A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310066582.9A CN104021071A (en) 2013-03-01 2013-03-01 Method and system for obtaining process lifecycles

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310066582.9A CN104021071A (en) 2013-03-01 2013-03-01 Method and system for obtaining process lifecycles

Publications (1)

Publication Number Publication Date
CN104021071A true CN104021071A (en) 2014-09-03

Family

ID=51437837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310066582.9A Pending CN104021071A (en) 2013-03-01 2013-03-01 Method and system for obtaining process lifecycles

Country Status (1)

Country Link
CN (1) CN104021071A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893251A (en) * 2016-03-29 2016-08-24 工业和信息化部电信研究院 Test method and system of time required for starting intelligent terminal APP
CN108345530A (en) * 2018-01-10 2018-07-31 链家网(北京)科技有限公司 A kind of acquisition methods of software development efficiency
CN112673354A (en) * 2018-10-26 2021-04-16 深圳市欢太科技有限公司 System state detection method, system state device and terminal equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0910018A3 (en) * 1997-10-15 2004-12-15 Alcatel Error checking method for real-time system software
CN102479151A (en) * 2010-11-26 2012-05-30 腾讯科技(深圳)有限公司 Testing method and device of webpage access speed
CN102479084A (en) * 2010-11-26 2012-05-30 腾讯科技(深圳)有限公司 Method and device for acquiring log by Android terminal
CN102662690A (en) * 2012-03-14 2012-09-12 腾讯科技(深圳)有限公司 Method and apparatus for starting application program
CN102831045A (en) * 2012-06-21 2012-12-19 北京奇虎科技有限公司 Method and device for detecting starting items in terminal equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0910018A3 (en) * 1997-10-15 2004-12-15 Alcatel Error checking method for real-time system software
CN102479151A (en) * 2010-11-26 2012-05-30 腾讯科技(深圳)有限公司 Testing method and device of webpage access speed
CN102479084A (en) * 2010-11-26 2012-05-30 腾讯科技(深圳)有限公司 Method and device for acquiring log by Android terminal
CN102662690A (en) * 2012-03-14 2012-09-12 腾讯科技(深圳)有限公司 Method and apparatus for starting application program
CN102831045A (en) * 2012-06-21 2012-12-19 北京奇虎科技有限公司 Method and device for detecting starting items in terminal equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893251A (en) * 2016-03-29 2016-08-24 工业和信息化部电信研究院 Test method and system of time required for starting intelligent terminal APP
CN105893251B (en) * 2016-03-29 2019-03-08 工业和信息化部电信研究院 A kind of test method and system of intelligent terminal APP starting required time
CN108345530A (en) * 2018-01-10 2018-07-31 链家网(北京)科技有限公司 A kind of acquisition methods of software development efficiency
CN108345530B (en) * 2018-01-10 2020-02-28 贝壳找房(北京)科技有限公司 Method for acquiring software development efficiency
CN112673354A (en) * 2018-10-26 2021-04-16 深圳市欢太科技有限公司 System state detection method, system state device and terminal equipment
CN112673354B (en) * 2018-10-26 2024-04-19 深圳市欢太科技有限公司 System state detection method, system state device and terminal equipment

Similar Documents

Publication Publication Date Title
WO2018010552A1 (en) Test method and device
CN108874268B (en) User behavior data acquisition method and device
RU2688757C1 (en) Device and method for analyzing imported video
CN109241174B (en) Data synchronization method and device, readable storage medium and electronic equipment
CN110347085B (en) Automated test system, method, vehicle, and computer-readable medium
US10942837B2 (en) Analyzing time-series data in an automated application testing system
CN106982368B (en) Video response speed detection method and system
CN109657675B (en) Image annotation method and device, computer equipment and readable storage medium
CN108536597A (en) A kind of terminal test method, device, terminal device and storage medium
CN110597704B (en) Pressure test method, device, server and medium for application program
US20140033179A1 (en) Application testing
US20180316587A1 (en) Automated analysis and recommendations for highly performant single page web applications
CN111967848A (en) Resume acquisition method, apparatus, system and medium
CN104021071A (en) Method and system for obtaining process lifecycles
CN105227949A (en) A kind of Android Set Top Box automated testing method
CN108898229B (en) Method and system for constructing machine learning modeling process
CN112199273A (en) Virtual machine pressure/performance testing method and system
CN111597111A (en) Application program starting speed monitoring method and device
US10169216B2 (en) Simulating sensors
Dzhagaryan et al. An Environment for Automated Measuring of Energy Consumed by Android Mobile Devices.
CN109977953A (en) Implementation method based on the algorithm of target detection of YOLOV3 on embedded device
CN111008140B (en) Cross-platform UI (user interface) automatic testing method and device
CN108960433B (en) Method and system for running machine learning modeling process
CN112231186A (en) Performance data processing method and device, electronic equipment and medium
CN111013156B (en) Scene detection method, device, terminal and medium based on robot

Legal Events

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

Application publication date: 20140903

RJ01 Rejection of invention patent application after publication