CN1115629C - Software resource detecting method - Google Patents

Software resource detecting method Download PDF

Info

Publication number
CN1115629C
CN1115629C CN 99117175 CN99117175A CN1115629C CN 1115629 C CN1115629 C CN 1115629C CN 99117175 CN99117175 CN 99117175 CN 99117175 A CN99117175 A CN 99117175A CN 1115629 C CN1115629 C CN 1115629C
Authority
CN
China
Prior art keywords
resource
sdl
resources
unit
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.)
Expired - Fee Related
Application number
CN 99117175
Other languages
Chinese (zh)
Other versions
CN1287310A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN 99117175 priority Critical patent/CN1115629C/en
Publication of CN1287310A publication Critical patent/CN1287310A/en
Application granted granted Critical
Publication of CN1115629C publication Critical patent/CN1115629C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention provides an SDL software resource detection method which relates to the computer software test technology. In the method, use counters of corresponding resources are added in various functions relevant to resource application and release in measured SDL software; the use counts of all resources are check when an SDL state machine is migrated to a stable state or before STOP; if the corresponding counts are zero or the use counts of some resources are possible not to be zero under the stable state but the total number is maintained within a relatively stable range, the relevant resources are shown in normal use. The present invention provides a method for detecting whether the use of various system resources in the SDL software is correct or not.

Description

The method that various resources in the software are detected
The present invention relates to the computer software testing technology, be specifically related to a kind of detection method of various resource operating positions in the SDL software.
SDL (Specification and Description Language) is a kind of formal descriptive language that CCITT formulates, and it mainly is conceived to the behavior of regulation telecommunication system, and a kind of information is delivered to another person from a people accurately.Therefore it uses quite extensive in telecommunications industry.In SDL software, relate to various system resources, as time slot, internal memory, User Status, timer etc.When the SDL state machine migrated to a stable status or STOP, all these system resources all will return to system or the use number of these system resources is maintained a metastable number, and promptly Shen Qing various resources should be released after finishing using.
In the prior art, there are a lot of detection internal memories whether to use correct method, be 98104528.6 for example at application number, Chinese patent and application number that name is called " recognition methods of internal stored operation error in the program design " are 97108834.9, and name is called in the Chinese patent of " maintaining method of computer memory ", all introduced the method that detects internal stored operation error, but there is following defective in these methods: (1) only is applicable to the detection of storer aspect operating mistake; (2) need to increase a large amount of codes or the complicated testing tool of design, implement inconvenience, dumb.
Purpose of the present invention overcomes the above-mentioned deficiency of prior art exactly, and a kind of convenience, method flexibly are provided, can detect in the SDL software various system resources use whether correct, thereby can improve the reliability of software.
The object of the present invention is achieved like this: the usage counter that increases a respective resources in tested SDL software in the correlated process of various resource bids and release, when promptly applying for a certain resource, if this resource was applied for, then a resource of having applied for is applied in expression, write down this mistake, otherwise this counter adds 1; When discharging this resource, if this resource do not apply for, illustrate that then SDL software discharges the resource do not apply for, write down this mistake, otherwise the corresponding counts device subtracts 1.When the SDL state machine migrates to a stable status or before the STOP, check the usage count of all resources,, then illustrate and such resource is used normal,, illustrate then that such resource has been applied for but do not discharge if greater than zero if corresponding counts is zero.Under steady state (SS), the usage count of some resource may be non-vanishing, but its sum should maintain in the metastable scope.
According to the definition of CCITT to SDL, the SDL process generally is divided into two kinds:
(1) process existence always in system.
(2) process stops (STOP) by carrying out an action.
For the process that in system, exists always, generally when this process migration to one stable status, carry out the detection of all resource operating positions; For process that can STOP, should before this process STOP, carry out the detection of all resource operating positions.
In the defined SDL standard of CCITT, a process can have a plurality of examples, and these examples can exist simultaneously, can carry out independently of one another and concomitantly.In addition, for same resource, also have a plurality of processes and all will visit.Therefore, the global variable that is used to write down certain class resource is general to use a two-dimensional structure array, and one dimension is used to represent the example of process, one dimension be used to represent such resource which.Except array, also can adopt methods such as chained list to write down the operating position of resource.
Implement SDL software resource detection method provided by the invention, can effectively detect the operating position of the various system resources that relate in the SDL software, these resources include but not limited to: internal memory, timer, time slot, User Status, interrupt.Promptly comprise needing application before the various uses, need the hardware resource given back after the use, and various and hardware does not have the software resource of direct relation.Specifically, the present invention can solve following problem:
Whether (1) detect the resource that relates in the SDL software correctly discharges after use;
(2) detect the situation whether SDL software exists the resource that application applied for;
(3) detect the situation that whether has the resource that release do not apply in the SDL software;
(4) detect SDL software when discharging resource, whether the parameter whether some parameters relevant with this resource are modified or are brought into is correct.
SDL software resource detection method provided by the invention is not limited to a certain product, it is a kind of general resource detection method, can detect the resource that takes place in programming and the computer program operational process in time and use wrong situation, thereby improve the reliability of software.Prompting exploitation, maintainer follow the tracks of solution.Need in the environment of continuous working procedure at some,, have very practical meaning and good effect as in the Maintenance of Program Control Exchange management.While method provided by the invention implements fairly simple, and it is also fewer that the code that need increase reaches the modification that tested program is done, and therefore has very high practicality.
Below in conjunction with drawings and Examples, further specify technical scheme of the present invention.
Fig. 1 utilizes method of the present invention to carry out the step that the SDL software resource detects;
Fig. 2 is the detection method workflow diagram of N resource of certain class resource of application;
Fig. 3 is the detection method workflow diagram that discharges N resource of certain class resource;
Fig. 4 is the workflow diagram of the detection method that when the SDL state machine is moved to steady state (SS) or before the STOP whether a certain class resource all discharged;
Fig. 5 is the system construction drawing that method of the present invention is applied to the SDL software test.
Fig. 1 adopts method of the present invention to carry out the job step that the SDL software resource detects.In Fig. 1, at first carry out 101, in the various resource bid processes of tested SDL software, add resource bid detection method as shown in Figure 2; Carry out 102, discharge the resource that adds in the function as shown in Figure 3 in various resources and discharge detection method; Carry out 103 again, add when the SDL state machine migrates to steady state (SS) as shown in Figure 4 or STOP before the detection method of all resources; Then carry out 104, in the master routine of tested program, add the used various initialization of variable processes of resource trace routine; Carry out 105 then, tested program is compiled, links the generation executable program with test procedure, move this program, can obtain error logging, thereby localization of fault realized in the profiling error record.Wherein above-mentioned step includes but not limited to above-mentioned order, as long as step 105 is last steps.
Fig. 2 is the workflow diagram of the resource bid detection method that adds in the resource bid process, and this figure is that example describes with N the resource of applying for certain class resource.Each class resource for SDL software exists all can add detection method shown in Figure 2 in the application process of such resource.
In Fig. 2,201 are used to obtain the process PID (Process ID) of application resource.Because all processes in the system all may be applied for certain resource, in order to distinguish different processes, we adopt the PID of process to identify is for which process application resource.Because in a system, the PID of process is unique; 202 are illustrated in the process of searching the pairing array location of this PID in the array of such resource operating position of record.Use a two-dimensional structure array to preserve the operating position of such resource among the present invention, if find corresponding PID, then can obtain its array first dimension subscript M, if do not find, then specify the unit M of a sky to preserve the usage count of resource, and apply for the process PID of resource; 203 are used to judge whether the resource of the individual unit of [M] [N] applied for; If applied for, represent that then the SDL program applies for the resource of having applied for again, write down this mistake by carrying out 204, then the ending resource testing process.It is pointed out that here some resources may repeatedly apply for also representing it is normal condition, for the second time the time, it just falls the timer that is provided with previously clearly simply, is rearranged into new timing length as the timer resource bid.Therefore to treat with a certain discrimination for some special resources; After carrying out 203, if the resource of the individual unit of [M] [N] was not applied for, then carry out 205, the individual unit of being brought into when preserving the application resource of correlation parameter to the [M] [N], correlation parameter is meant the out of Memory relevant with this resource, as node number, child node number, User Status etc., and these information can not change in program operation process, when discharging such resource, also to check like this this category information, when whether existing in situation about being revised mistakenly in the program operation process or discharging this resource, whether the parameter of being brought into is correct.For some resource, as User Status, when such resource of application, the relevant information of User Status will be brought into, this information will be used by SDL software and preserve, when discharging such resource, trace routine will check and be preserved the User Status of getting off and trace routine by SDL software whether preserve the User Status of getting off consistent, if inconsistent then illustrate that User Status has been revised mistakenly; Also has a class resource in addition, as bringing node relevant and child node number in the application process of time slot into this time slot, when discharging this resource, also can bring node relevant with this time slot and child node number into, trace routine just can detect whether discharge the parameter that parameter that resource method brings into and trace routine preserve consistent like this; Carry out 206 resource usage count values at last and add 1 corresponding units.
Fig. 3 is the workflow diagram that the resource that adds in the resource dispose procedure discharges detection method, and this figure is that example describes with N the resource that discharges certain class resource.Corresponding with Fig. 2, each the class resource for existing in the SDL software all can add detection method shown in Figure 3 in the dispose procedure of such resource.In Fig. 3,301 are used to obtain the process PID that discharges resource; Carry out 302 then and find the pairing array location M of this PID; Carry out 303, judge whether to find the unit M identical with the process PID that discharges resource; If do not find, what then explanation will discharge is the resource that does not also have application, then carries out 305 and writes down this mistake; If find unit M, then carry out 304, judge whether the individual element resources of [M] [N] applied for; If do not apply for, then carry out 305 and write down " discharging the resource of not applying for " mistake; If this resource applied for, then carry out 306 and check whether unanimity of parameter that the correlation parameter brought into and the parameter of being brought into when the application be whether consistent or the inspection trace routine is preserved parameter and SDL program preserved; If inconsistent, parameter error or the correlation parameter brought into when then explanation discharges resource are modified in program operation process, then carry out 307 and write down the mistake of " parameter is inconsistent ".For example: SDL software should discharge N resource of certain class resource, the node number of this resource is N, child node number is N, and bring into and discharge that node number is N in the function parameters, child node number be N, but N+1 resource of SDL program error ground release, and the node number of N+1 resource is N+1, child node number is N+1, and then resource discharges trace routine and finds that the data of the parameter of the resource that discharges and preservation are inconsistent, and trace routine will write down such mistake; Last trace routine is carried out 308 usage counts with respective resources and is subtracted 1, and ending resource discharges testing process.
Fig. 4 is when the SDL state machine migrates to a stable status or before the STOP, the method flow diagram that a certain class resource is detected.For each the class resource that exists in the SDL software, all to during to steady state (SS) or detect the operating position of this resource before the STOP, promptly add detection method as shown in Figure 4 in the SDL migration of programs.In Fig. 4, at first carry out 401 PID that obtain current process; Carry out 402 and search the unit M identical with current process PID; Carry out 403, judge whether to find unit M,, illustrate that then this process do not use such resource, the ending resource trace routine if do not find; If find unit M, then carry out 404, begin to detect from first of such resource; Carry out 405, judge whether the individual usage count of [M] [N] of such resource is zero,, then represented this resource bid but not release, carry out the mistake that 406 records do not discharge resource if non-vanishing; Then carry out the next element resources that 407 preparations detect such resource; Carry out 408 and judge N whether greater than the sum of such resource, if greater than the detection of end process otherwise would get back to 405, continue the detection of the next element resources of such resource, up to all resources of such resource are whole detected till.
In SDL software, there are some resources to take always and do not discharge, for this class situation, when entering steady state (SS), process can not directly judge whether to exist resource not have situation about discharging by the usage count of checking this resource, tackle method of the present invention and use flexibly and can solve such problem this moment, as: for the resource that takies after some applications always, do not count.
Even have after the resource bid occupiedly and do not discharge in addition, its sum that takies also should maintain a metastable number, if the sum of resource occupation increases always, then also represents wrong existence.
Fig. 5 is the structural drawing that method of the present invention is applied to back system in the SDL software test.This system comprises application layer, system layer, hardware platform, wherein 501 of application layer represent tested SDL software, and the tested SDL software of 502 expressions proposes the resource bid request, and this request is sent to 504 of system layer, the application of carrying out respective resources detects, and promptly finishes the function shown in Fig. 2.Resource bid promptly carries out 506 after detecting and finishing, and carries out the resource bid of the reality of hardware platform.The dispose procedure of resource similarly proposes resource release request at SDL software, promptly carry out application layer 503 after, this request is sent to system layer, carries out 505, carries out resource and discharges detection, promptly finish function shown in Figure 3, carry out 507 resources of carrying out the reality of hardware platform then and discharge.
Introduce at last and adopt the inventive method that a larger switch software has been carried out the concrete case study on implementation that resource detects: the SDL software resource trace routine of utilizing method construct of the present invention is a testing tool that has nothing to do with product and operation platform, and its using method is as follows:
There are following system resources in the tested software: as internal memory, T net speech time slot, digit receiver time slot, signal tone time slot, timer etc.For the SDL state machine of being concerned about, at each resource, define an overall array, in the application function of every kind of resource, add the code that detection method flow process as shown in Figure 2 obtains, in the release function of every kind of resource, add the code that detection method flow process as shown in Figure 3 obtains, when state machine migrates to steady state (SS) or before the STOP, add the code that detection method flow process as shown in Figure 4 obtains, and in master routine, add the initialization of variable code, be used for and will detect all global variable zero clearings of usefulness.Compile, link and move this switch software, obtain error logging at last, assist the developer to carry out localization of fault thereby analyze this error logging.

Claims (2)

1, the method that the various resources in the software are detected may further comprise the steps:
1) in the various resource bid processes of tested SDL software, adds resource bid detection method (101), that is:
A) obtain the process PID (Process ID) (201) that applies for resource;
B) write down in the array of such resource operating position and search the pairing array location of this PID (202);
C) whether the resource of judging certain unit of such resource applied for (203);
D), then write down the mistake (204) of the resource of having applied for if applied for;
E) if do not apply for, the correlation parameter of being brought into when then preserving the application resource is to this unit (205);
F) the resource usage count value with corresponding units adds 1 (206);
2) in various resource dispose procedures, add resource and discharge detection method (102), that is:
G) obtain the process PID (301) that discharges resource;
H) find the pairing array location of this PID (302);
I) judge whether to find the unit (303) identical with the process PID that discharges resource;
J) if do not find this unit, then record discharges the mistake (305) of the resource of not applying for;
K), judge then whether certain element resources of such resource applied for (304) if find this unit;
L) if do not apply for, then record discharges the mistake (305) of the resource of not applying for;
M) if this resource applied for, then check the correlation parameter brought into and the parameter of being brought into when the application
N) not consistent or check parameter that parameter that trace routine preserves and SDL program preserved whether consistent (306);
O) if inconsistent, the inconsistent mistake of recording parameters (307) then;
P) usage count with respective resources subtracts 1 (308);
3) add the SDL state machine when migrating to steady state (SS) or the detection method (103) of all resources before the STOP, that is:
Q) obtain the PID (401) of current process;
R) search the unit (402) identical with current process PID;
S) judge whether to find this unit (403), if do not find, ending resource trace routine then;
T), then begin to detect (404) from first of such resource if find this unit;
U) whether the usage count of judging certain unit of such resource is zero (405);
If v) non-vanishing, then write down the mistake (406) of " resource does not have to discharge ";
W) prepare to detect next unit (407);
X) judge whether sum greater than such resource, if greater than detection of end process (408);
Y) otherwise get back to step u), continue the detection of next unit, till all resources of such resource have all been examined;
4) in the master routine of tested program, add the resource used various initialization of variable processes of trace routine (104);
5) tested program is compiled, links the generation executable program with test procedure, move this program, obtain error logging, profiling error record (105); Step 1), 2 wherein), order 3), 4) can be exchanged.
2, the method that the various resources in the software are detected as claimed in claim 1 is characterized in that: do not discharge if described resource takies always, then it is not counted.
CN 99117175 1999-10-29 1999-10-29 Software resource detecting method Expired - Fee Related CN1115629C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 99117175 CN1115629C (en) 1999-10-29 1999-10-29 Software resource detecting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 99117175 CN1115629C (en) 1999-10-29 1999-10-29 Software resource detecting method

Publications (2)

Publication Number Publication Date
CN1287310A CN1287310A (en) 2001-03-14
CN1115629C true CN1115629C (en) 2003-07-23

Family

ID=5279816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 99117175 Expired - Fee Related CN1115629C (en) 1999-10-29 1999-10-29 Software resource detecting method

Country Status (1)

Country Link
CN (1) CN1115629C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10155092B4 (en) * 2001-11-09 2006-10-05 Siemens Ag Activation method for a utility part of a computer program and associated facilities
CN100345460C (en) * 2004-04-05 2007-10-24 华为技术有限公司 Smoothing releasing method
CN100353334C (en) * 2004-08-06 2007-12-05 华为技术有限公司 Method of software trace and system therefor
CN108052404A (en) * 2017-12-07 2018-05-18 郑州云海信息技术有限公司 A kind of data address error-detection mechanism in server interconnection chip

Also Published As

Publication number Publication date
CN1287310A (en) 2001-03-14

Similar Documents

Publication Publication Date Title
CN100538656C (en) The method and apparatus of debugging computer program in distributed debugger
Gokhale et al. An analytical approach to architecture-based software reliability prediction
Katoen et al. The ins and outs of the probabilistic model checker MRMC
US6754890B1 (en) Method and system for using process identifier in output file names for associating profiling data with multiple sources of profiling data
CN101645119B (en) Method and system for automatically analyzing malicious codes based on virtual hardware environment
US5701471A (en) System and method for testing multiple database management systems
US6161200A (en) Method and apparatus for analyzing software executed in embedded systems
US6192511B1 (en) Technique for test coverage of visual programs
US20040221115A1 (en) System and method for preparation of workload data for replaying in a data storage environment.
WO2014143279A1 (en) Bottleneck detector for executing applications
CN106021079A (en) A Web application performance testing method based on a user frequent access sequence model
US20070169051A1 (en) Identifying Code that Wastes Time Performing Redundant Computation
KR20000075835A (en) Method and apparatus for correcting errors in computer systems
CN105912458A (en) Method and system for dynamically detecting C/C++ memory leak
CN107547261A (en) Cloud platform performance test methods and device
CN104375941A (en) Automated evaluation method for binary code coverage of testing case set for executable program
Panigrahi et al. An approach to prioritize the regression test cases of object-oriented programs
WO1990010269A1 (en) System for evaluating the performance of a large scale programmable machine capable of having a plurality of terminals attached thereto
US20030074605A1 (en) Computer system and method for program execution monitoring in computer system
CN113778890B (en) Code testing method and device, electronic equipment and storage medium
CN1115629C (en) Software resource detecting method
US7464123B2 (en) Benchmark testing
CN107515803A (en) A kind of storing performance testing method and device
Johansson et al. On the impact of injection triggers for OS robustness evaluation
Fabre et al. Building dependable COTS microkernel-based systems using MAFALDA

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
C56 Change in the name or address of the patentee

Owner name: ZTE CO., LTD.

Free format text: FORMER NAME OR ADDRESS: SHENZHENG CITY ZTE CO., LTD.

CP03 Change of name, title or address

Address after: 518057 Department of law, Zhongxing building, South hi tech Industrial Park, Nanshan District hi tech Industrial Park, Guangdong, Shenzhen

Patentee after: ZTE Corporation

Address before: 518057 Zhongxing building, science and technology south road, Nanshan District hi tech Industrial Park, Guangdong, Shenzhen

Patentee before: Zhongxing Communication Co., Ltd., Shenzhen City

C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20030723

Termination date: 20131029