CN101206616B - Method for testing resource leakage of graphical interface program and method for locating question - Google Patents

Method for testing resource leakage of graphical interface program and method for locating question Download PDF

Info

Publication number
CN101206616B
CN101206616B CN200610167719XA CN200610167719A CN101206616B CN 101206616 B CN101206616 B CN 101206616B CN 200610167719X A CN200610167719X A CN 200610167719XA CN 200610167719 A CN200610167719 A CN 200610167719A CN 101206616 B CN101206616 B CN 101206616B
Authority
CN
China
Prior art keywords
resource
resource leakage
leakage
time
software
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.)
Active
Application number
CN200610167719XA
Other languages
Chinese (zh)
Other versions
CN101206616A (en
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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN200610167719XA priority Critical patent/CN101206616B/en
Publication of CN101206616A publication Critical patent/CN101206616A/en
Application granted granted Critical
Publication of CN101206616B publication Critical patent/CN101206616B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention provides a determination method of resource leakage, comprising the following steps that: (1) after software runs, the same set of interface operation which can be circulated is continuously executed for N times; (2) the resource occupancy number of interface operation of each time is monitored; (3) if the resource occupancy number rises constantly, the present invention carries out the following steps of judging that the operation generates resource leakage and calculating the interface operation resource occupancy number which is equal to the average value X of resource leakage rate produced by the operation from a second time to a N-1 time.

Description

A kind of resource leakage test and positioning problems method of graphical interface program
Technical field
The invention belongs to the software test field, relate in particular to a kind of resource leakage test and positioning problems method of graphical interface program.
Background technology
The method of stability test mainly is artificial long period of operation interface at present, judges whether to exist the resource leakage of the running software long-time stability problem that influences in conjunction with observing the monitoring resource instrument.
Resource (Resource): refer to the inside and outside carrier that software is rely and played effectiveness, refer to memory source here, GDI resource and USER resource, system's handle etc., these resources promptly can be observed by the task manager or the related tool of operating system.As in Windows operating system, can be observed (as shown in Figure 2) by the task manager of Windows.
GDI (Graphics Device Interface): the graphical interfaces interface resource, the needed system resource of graphing, text and image in the Windows window is unit with " individual ".
Resources such as the window that the USER module of USER resource: Windows provides, menu are unit with " individual ".
Memory source: being meant the needed full memory of program run, is unit with " byte ".
Existing method limitation is:
1) a lot of softwares contain a large amount of graphical interfaces, with regular regression test (program that particularly is in the exploitation or often needs to upgrade), at this moment just need the tester that a large amount of and repeated operational observations is carried out at a large amount of interfaces, this can take a large amount of valuable manpowers certainly.
2) can not accurately determine the resource leakage amount.
3) can not accurately determine to cause the operation of resource leakage.
Summary of the invention
The resource leakage test is the important component part that ensures running software stability.The big and difficult resource leakage amount situation of accurately measuring of cost at present craft or semi-automatic software stability test, purpose of the present invention is exactly in order to solve the accurately locating resource problem of leaking and then make effect of test own and meaning to reduce of manual stability test, thereby improve the effect that stability test produced, save human cost, accelerate the test execution cycle.
The invention provides a kind of method of definite resource leakage, comprise the steps: (1) behind running software, N continuous time same group of interface operation capable of circulation of execution, N is the positive integer more than or equal to 3; (2) the resource occupation number of the each interface operation of monitoring; (3) if described resource occupation number rises constantly, then carry out following steps: judge that this operation produces resource leakage, and calculate the mean value X that this interface operation resource leakage number equals the 2nd time to the N-1 time operation resource leakage amount that produces.
Described resource be GDI, user resources, memory source, system's handle etc. one of at least.
Described software can be windows, linux, unix, java, the software on the operating systems such as .net.
According to a further aspect in the invention, also comprise the step (1) of utilizing robotization playback tool cycle said method-step (3) n time, for each iteration, calculate respectively X1, X2, ..., the resource leakage number of Xn, ask its average resource to leak number: average resource is leaked number=∑ (X1+X2+...+Xn)/n.
The relative prior art of the application has following advantage and effect:
This method can with robotization the combining closely of instrument (for example playback script) of resetting, avoided a large amount of artificial interface operations, to save a large amount of valuable human resources.
This method is accurately determined each caused by operations resource leakage amount, thereby provides foundation for assessment software stability accurately.
This method can accurately be located the operation that causes resource leakage, thereby for fast and effeciently solving the resource leakage problem, strengthening the software product operation stability provides householder method.
Description of drawings
Fig. 1 has shown the process flow diagram of definite resource leakage method according to an embodiment of the invention.
Fig. 2 has shown the method for a kind of definite resource occupation according to an embodiment of the invention.
Embodiment
The use of the resource of the program of graphical interfaces and release conditions are comparatively complicated.Sometimes after operation, may increase also and may reduce taking of resource, also may operation once increase X quantity resource occupation, and same operation has caused Y quantity resource occupation next time. there is operating-system resources to distribute the effect of reclaim mechanism here, the effect of internal system contingency mechanism is also arranged, consequently from the operation of single, be difficult to judge the resource leakage situation of software, and then strengthened the difficulty that people understand the system resource leakage situation.
The present invention is based on following mode and eliminate the disturbing factor of above-mentioned judgement resource leakage respectively.
1) continued operation method
The method is used to eliminate the effect of resources allocation reclaim mechanism, this be because system the first time interface operation (interface operation is meant the interface between user and the software, the user is in order to the software issuing command, obtain result etc.) time application resource, and the resource that interface operation is afterwards applied for when just quoting interface operation for the first time usually, eliminate behind the resources allocation reclaim mechanism so the resource increased numbers that calculates behind the interface operation that repeats the continuous in theory second time is, be operating as on average but increase one-time continuous to be on the safe side again.
The method that the computational resource of the present invention's suggestion leaks: interim at a running software, the lasting rising that continuous three times (can expand to n time the positive integer of n>=3) same interface operation all can produce the resource occupation number represents that promptly this operation produces resource leakage; This interface operation resource leakage amount be second and for the third time interface operation produce the mean value of resource leakage amount.
2) method of average
In addition, increase or reduce the influence that the resource leakage statistics is brought, can further use the method for average in order further to eliminate internal system contingency resource.
The concrete grammar of the method for average is: utilize n iteration of robotization playback tool cycle, for each iteration, by the continued operation method calculate respectively X1, X2 ..., the resource leakage number of Xn.Ask it
Average resource is leaked number=∑ (X1+X2+...+Xn)/n
With reference to the accompanying drawings 1, shown the process flow diagram of definite resource leakage method according to an embodiment of the invention.
But at first record the interface operation of playback, and produce playback script.Interface operation is meant the interface between user and the software, and the user obtains result etc. in order to the software issuing command.For example, one group of interface operation capable of circulation is to click certain button and close the dialog box that occurs subsequently.Add record specific resources (for example GDI) monitoring value function before each segment in playback script.
Playback script then, and produce the analytical table of monitored resource leakage.
At last, based on above-mentioned analytical table, utilize above-mentioned " continuity method " and/or " analytic approach " to analyze the resource leakage of described specific resources.
Below in conjunction with object lesson the present invention is described.
Example 1
Suppose that certain instant communication software need detect GDI resource leakage situation, this instant communication software has three operations commonly used, is respectively: " opening chat window ", " transmission chat message ", " change presence ".
Landing the original state that finishes is 314 GDI.
As shown in Figure 2, the resource occupation number of the GDI of software can be checked by the task manager of Windows operating system.
Calculate " opening chat window " GDI resource leakage:
Find that this moment, GDI was 365 after for the first time opening and close chat window, increment is 51 GDI, and then open same window and close the second time, this moment, GDI was 369, increment is 4 GDI, last open same window for the third time and close, this moment, GDI was 372, and increment is 3 GDI.(4+3)/and 2=3.5, so " opening chat window " on average can cause 3.5 GDI resource leakages.
Calculate " transmission chat message " GDI resource leakage:
Open chat window, sending chat message for three times, to observe the GDI sum respectively constant, and promptly the GDI resource leakage is 0.
Calculate " change presence " GDI resource leakage:
Close chat window, select to be different from other present state.Three observed GDI are respectively 375 (+3), 377 (+2), and 379 (+2), according to second for the third time the result: (2+2)/and 2=2, " change presence " produced 2 GDI resource leakages as can be known.
Record a script, in an iteration of script with the sequential operation of continued operation method: " opening chat window ", " transmission chat message ", " change presence " three operation is also calculated GDI one by one and is leaked number, iteration obtains following form 4 times:
Table 1
The 1st iteration The 2nd iteration The 3rd iteration The 4th iteration
Open chat window 3.5 4 4 4
Send chat message 0 0 0 0
The change presence 2 2 2.5 1.5
From this table as can be known:
On average " open chat window " GDI resource leakage number=∑ (3.5+4+4+4)/4=3.875~4.
On average " transmission chat message " GDI resource leakage number=∑ (0+0+0+0)/4=0.
On average " change presence " GDI resource leakage number=∑ (2+2+2.5+1.5)/4=2.
Attention will reflect the problem that tested program exists comparatively exactly in the application of reality, need a large amount of iterative datas, far not only 4 iteration, and these work just need automated test tool to control interface operation automatically and calculate automatically.
The invention provides the resource leakage amount that a kind of interface operation causes and determine method, it utilizes the stability of automatic playback instrument accurate assessment test interface program.Combining closely of this method and robotization playback instrument avoided a large amount of artificial interface operations, can save a large amount of valuable human resources; This method is accurately determined each caused by operations resource leakage amount, thereby provides foundation for assessment software stability accurately.This method can accurately be located the operation that causes resource leakage, thereby for fast and effeciently solving the resource leakage problem, strengthening the software product operation stability provides householder method.

Claims (5)

1. the method for a definite resource leakage comprises the steps:
(1) behind running software, N continuous time same group of interface operation capable of circulation of execution, N is the positive integer more than or equal to 3,
(2) the resource occupation number of the each interface operation of monitoring,
(3) if described resource occupation number rises constantly, then carry out following steps:
Judge that this operation produces resource leakage; And
Calculate the mean value X that this interface operation resource leakage number equals the 2nd time to the N-1 time operation resource leakage amount that produces.
2. the method for definite resource leakage according to claim 1, wherein said resource be GDI, user resources, memory source, system's handle one of at least.
3. the method for definite resource leakage according to claim 1, wherein said software can be windows, linux, unix, java, the software on the .net operating system.
4. the method for definite resource leakage according to claim 1, wherein said resource is to monitor by the task manager of WINDOWS.
5. the method for definite resource leakage according to claim 1 wherein also comprises the step (1) of utilizing robotization playback tool cycle claim 1-step (3) n time, for each iteration, calculate respectively X1, X2 ..., the resource leakage number of Xn, ask its average resource to leak number:
Average resource is leaked number=∑ (X1+X2+...+Xn)/n.
CN200610167719XA 2006-12-19 2006-12-19 Method for testing resource leakage of graphical interface program and method for locating question Active CN101206616B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200610167719XA CN101206616B (en) 2006-12-19 2006-12-19 Method for testing resource leakage of graphical interface program and method for locating question

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200610167719XA CN101206616B (en) 2006-12-19 2006-12-19 Method for testing resource leakage of graphical interface program and method for locating question

Publications (2)

Publication Number Publication Date
CN101206616A CN101206616A (en) 2008-06-25
CN101206616B true CN101206616B (en) 2010-06-09

Family

ID=39566841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200610167719XA Active CN101206616B (en) 2006-12-19 2006-12-19 Method for testing resource leakage of graphical interface program and method for locating question

Country Status (1)

Country Link
CN (1) CN101206616B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107179950A (en) * 2017-06-29 2017-09-19 努比亚技术有限公司 A kind of application process processing method, mobile terminal and computer-readable recording medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012122672A1 (en) * 2011-03-15 2012-09-20 Telefonaktiebolaget L M Ericsson (Publ) Detection on resource leakage
CN102999518B (en) * 2011-09-15 2016-11-09 腾讯科技(深圳)有限公司 A kind of Graphics Device Interface method for managing resource and device
CN104317702B (en) * 2014-09-30 2017-08-25 广东欧珀移动通信有限公司 A kind of intelligent mobile terminal internal memory automated testing method and device
CN106708605B (en) * 2015-07-14 2021-08-24 腾讯科技(深圳)有限公司 Method and device for detecting resource leakage

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1286429A (en) * 1999-11-20 2001-03-07 深圳市中兴通讯股份有限公司 Test and monitor method for embedded in processor memory
CN1538300A (en) * 2003-09-23 2004-10-20 中兴通讯股份有限公司 Method of detecting and location of leakage of internal storage of real-time system localization

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1286429A (en) * 1999-11-20 2001-03-07 深圳市中兴通讯股份有限公司 Test and monitor method for embedded in processor memory
CN1538300A (en) * 2003-09-23 2004-10-20 中兴通讯股份有限公司 Method of detecting and location of leakage of internal storage of real-time system localization

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
鲁军.Windows GDI资源泄漏问题分析.电脑编程技巧与维护.2006,84-86. *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107179950A (en) * 2017-06-29 2017-09-19 努比亚技术有限公司 A kind of application process processing method, mobile terminal and computer-readable recording medium

Also Published As

Publication number Publication date
CN101206616A (en) 2008-06-25

Similar Documents

Publication Publication Date Title
CN104182320B (en) A kind of method and device for monitoring memory overflow
CN100504807C (en) EMS memory leakage testing method in communication apparatus system
CN103984626B (en) A kind of method and device for generating test case script
US20130132933A1 (en) Automated compliance testing during application development
CN101206616B (en) Method for testing resource leakage of graphical interface program and method for locating question
CN102681938B (en) Memory leakage detecting method and device
CN106201882A (en) Automated operating system method of testing based on Jenkins and system
CN104461846B (en) The method and apparatus for detecting application program power consumption
CN105302714A (en) Method and apparatus for monitoring memory leak in test process
CN110907882B (en) Electric energy meter-oriented virtualization test method and system
CN107038120A (en) A kind of method for testing software and equipment
CN107506294A (en) Visualize automated testing method, device, storage medium and computer equipment
CN109032947A (en) Test method, device, equipment and storage medium for operating system
CN104516817A (en) Memory leak detection method and device
CN110837035A (en) Software and hardware testing system and method for air conditioning system
CN109240928A (en) Test method, device, equipment and storage medium
CN110888809B (en) Risk prediction method and device for test task
Gokhale et al. Software reliability analysis incorporating fault detection and debugging activities
CN108875368A (en) A kind of safety detection method, apparatus and system
CN111274143B (en) Buried point test method, buried point test device, buried point test equipment and storage medium
US7831879B2 (en) Generating test coverage bin based on simulation result
CN105808424A (en) Method suitable for process stack use depth detection of multi-task software
CN111291239A (en) Unit testing method, device, equipment and storage medium
CN110688298A (en) Nuclear power plant man-machine interaction system automatic testing device based on event driving
CN116302365B (en) Method and device for testing data persistence layer, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant