CN103744789B - Method of locating software errors by 3D surface representation - Google Patents

Method of locating software errors by 3D surface representation Download PDF

Info

Publication number
CN103744789B
CN103744789B CN201410033461.9A CN201410033461A CN103744789B CN 103744789 B CN103744789 B CN 103744789B CN 201410033461 A CN201410033461 A CN 201410033461A CN 103744789 B CN103744789 B CN 103744789B
Authority
CN
China
Prior art keywords
statement
mistake
program
suspicious degree
suspicious
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
CN201410033461.9A
Other languages
Chinese (zh)
Other versions
CN103744789A (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.)
Institute of Software of CAS
Original Assignee
Institute of Software of CAS
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 Institute of Software of CAS filed Critical Institute of Software of CAS
Priority to CN201410033461.9A priority Critical patent/CN103744789B/en
Publication of CN103744789A publication Critical patent/CN103744789A/en
Application granted granted Critical
Publication of CN103744789B publication Critical patent/CN103744789B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a method of locating software errors by 3D surface representation and belongs to the field of software testing. The method includes the steps: extracting running features of error statements of each version in a training program set, selecting a certain suspicion function to calculate suspicion degrees of the error statements, clustering, and acquiring a center of each cluster; fitting the centers of clusters into a 3D surface to obtain a 3D surface function which is a suspicion function corrected and optimized; running an application in the test set, calculating suspicion degree of each statement according to the running features of each statement of the application in the test set, ranking the statements according to suspicion values from large to small, inspecting the application statements one by one according to the sequence, inspecting the application statements one by one, and locating errors in the application. A feature of each cluster center represents an error pattern. The method has the advantages that the suspicion functions are corrected and optimized according to the error patterns, the suspicion functions can better meet actual situations and the errors can be more accurately located.

Description

The software error localization method that a kind of three-dimension curved surface represents
Technical field
The invention belongs to software testing technology field, relate generally to " the mistake of statistics localization method " of software debugging category.This Bright employing three-dimension curved surface represents that the character of the suspicious degree function to location of mistake carries out visualization and false to analyze, and utilizes software development Suspicious degree function is corrected and optimizes by the true error pattern in work.
Background technology
Software application in daily life is more and more extensive.Along with software function and the complication of framework, it is desirable at software product In thoroughly avoid the appearance of software error, remain highly difficult.Software error, i.e. causes the result of software actual motion with pre- Those factors that the operation result of phase does not corresponds, the existence of these mistakes, cause the corresponding afunction of software.Software test is For the conventional means of discovery and modification software error, being that one particularly significant but engineering that cost is the biggest, it generally includes three Individual step: the location of mistake, the reparation of mistake and the re-test to amended code.Wherein, the location of mistake is to attach most importance to most Also to be the most time-consuming and laborious process.
Statement level other " mistake of statistics localization method " is believed by collecting the operation when program performs unsuccessfully or be successful of every the statement Breath is analyzed and is assessed this statement and there is the suspicious degree of mistake.For example, if certain statement always performs in failed program In be run, and never successful program perform in be run, then, it is likely to relevant with software error.? In this type of " mistake of statistics localization method ", generally use suspicious degree function to assess statement and there is the probability of mistake.
When carrying out location of mistake, it is necessary first to program is performed a plurality of times, statistical procedure performs failed number of times m and statement siFortune Places number failed (si), and number of times m ' and the statement s that program runs succeedediNumber of run passed (si);Then basis Suspicious degree function is assessed every statement and be there is the probability of mistake, is ranked up statement from big to small according to dubious value;Finally The mistake come one by one in search program according to this sequence.For current major part suspicious degree function (as Tarantula, Jaccard, Ochiai, SBI) for, a statement siSuspicious degree RT(si)Only losing with two variable these statements relevant Number of times failed (the s that the program lost is run in performingi) and this statement number of times passed (s of operation in successful program performsi)。
But, merely utilize failed (si) and passed (si) method of assessing the suspicious degree of statement differs very with practical situation Far.When actual program, mistake is not randomly, has no to occur regularly, but presents certain pattern: some program Structure may occur mistake continually, and mistake may seldom occur in other program structure.Such as, C language is ground Studying carefully and show, have the mistake of 22.8% to occur at function entrance or in assignment statement, on the contrary, the mistake of only 7.8% occurs in On function exit or return statement, final result makes software error positional accuracy the highest.
Summary of the invention
The technology of the present invention solves problem: overcome the deficiencies in the prior art, it is provided that the software error location side that a kind of three-dimension curved surface represents Method, uses three-dimension curved surface that the suspicious degree function of location of mistake technology is carried out visual analyzing, utilizes error pattern to three-dimension curved surface It is corrected and optimizes so that suspicious degree function more tallies with the actual situation, thus improves the accuracy of location of mistake technology. The technology of the present invention solution: the software error localization method that a kind of three-dimension curved surface represents, it is achieved step is as follows:
(1) extract the operation characteristic of the wrong statement of each program in training set, select certain suspicious degree function, mistake in computation language Then these mistake statements are clustered by the suspicious degree of sentence;The operation characteristic of described mistake statement includes that this mistake statement is losing The number of times run in the program execution lost and the number of times run in successful program performs;
(2) according to operation characteristic and the corresponding suspicious angle value of statement wrong in each cluster, each cluster is carried out centralization, Obtaining the center of this cluster, to obtain certain characteristic of each cluster, the feature of each cluster centre just represents a kind of mistake mould Formula;
(3) described cluster centre is fitted to three-dimension curved surface, this three-dimension curved surface function be exactly corrected and optimize after suspicious Degree function;
(4) testing results concentrate program, according to the execution information of described program, utilize described corrected and optimize after In suspicious degree function calculation procedure, the suspicious degree of each statement, is ranked up each statement according to the size of suspicious angle value, obtains suspicious Degree ranking table, according to suspicious degree ranking table, investigates program statement, the mistake in finder one by one;Described execution information bag Whether the program of including runs succeeded, and program every statement is respectively at the executory number of run of successful program with in failed journey The executory number of run of sequence.
Described step (1) selects suspicious degree function to use Tarantula, Jaccard, Ochiai or SBI function to calculate described mistake The suspicious degree of statement.
Clustering method in described step (1) uses KNN algorithm or K-means algorithm.
The number of times that described step (2) is run in failed program according to mistake statement, the number of times run in successful program And the suspicious angle value of this mistake statement, the average asking for them respectively carries out centralization to cluster.
Described step (3) uses Spline Interpolation Method or these cluster centres is fitted to three-dimension curved surface.
Present invention advantage compared with prior art is: the present invention not operation characteristic merely with statement carrys out appraisal procedure each bar language The suspicious degree of sentence, it is also contemplated that the various error patterns that actual program Program is made mistakes, corrects with excellent according to these error patterns Change suspicious degree function, to such an extent as to suspicious function more conforms to the situation of reality, thus improve the accuracy of location of mistake.
Accompanying drawing explanation
Fig. 1 is the flowchart of the inventive method;
Fig. 2 is the three-dimension curved surface of several suspicious degree function, and wherein (a) is Tarantula suspicious degree function, and (b) is that Jaccard can Doubting degree function, (c) is Ochiai suspicious degree function, and (d) is SBI suspicious degree function;
Fig. 3 is the experiment effect contrast of several method.
Detailed description of the invention
As it is shown in figure 1, the present invention to implement step as follows:
1. training
(1) operation of each bar mistake statement in program code execution, execution information m of logging program and m ', and training set Information failed (si) and passed (si);
(2) certain suspicious function T is usedx, calculate the suspicious degree of every wrong statement
(3) use certain clustering method (such as KNN) to two dimension point set { (failed (si), passed (si)) cluster (each cluster representative one error pattern);
(4) each cluster represents with a central point, as kth clusters CkCentral point be:
failed ( C k ) = 1 | C k | Σ s t ∈ C k failed ( s i )
passed ( C k ) = 1 | C k | Σ s t ∈ C k passed ( s i )
R T x ( C k ) = Σ s t ∈ C k R T x ( s i )
It can be seen that failed (Ck) and passed (Ck) it is CkThe meansigma methods of apoplexy due to endogenous wind each point respective value, andIt it is the suspicious degree of each point Accumulated value, therefore, if fall certain cluster in wrong statement the most, then the suspicious degree of this cluster (error pattern) also can Increase therewith;
(5) utilizing Spline Interpolation Method that central point of each cluster above-mentioned is fitted to three-dimension curved surface, this is final suspicious Degree function surface;
2. test
Utilize suspicious degree function that is above-mentioned corrected and that optimize, calculate the dubious value of every statement, then root in program to be tested From big to small statement is ranked up according to dubious value, according to this order, program is investigated, the mistake in finder.
The present invention does not limit concrete clustering method and curved surface fitting method, and other clustering method or approximating method can also be applied; Suspicious function is visualized as three-dimension curved surface by the present invention, it is simple to the analysis to suspicious Functional Quality, such as, according to three-dimension curved surface, Can analyze the common property drawing 4 the suspicious functions mentioned in literary composition:
Character 1:(monotonic increase)
Fixing passed (si), suspicious functionIt is failed (si) increasing function;
Character 2:(monotone decline)
Fixing failed (si), suspicious functionIt is passed (si) subtraction function;
Mistake cluster, according to concrete condition during actual program, is several error pattern, then according to these mistakes by the present invention Pattern is carried out matching and is obtained more effective suspicious degree function surface, to reach the correction to original suspicious degree function and optimization, for frequency The error pattern of numerous appearance increases suspicious degree weight during location of mistake.
3. validity check
In order to verify the location of mistake effect of the present invention, Siemens data set is used the method for the present invention to be trained and tests, The details of this data set are as shown in table 1.
The characteristic information of table 1Siemens data set
Training program Statement number Wrong version number The ratio that failure performs
print_tokens 341–342 7 1.7%
print_tokens2 350–354 10 5.4%
replace 508–515 31 2.0%
schedule 291–294 5 3.2%
scheudule2 261–263 9 1.0%
tcas 133–137 41 2.4%
tot_info 272–274 23 5.6%
Experimental procedure:
(1) data set is divided: be training set and test set by 126 wrong random division in Siemens data set;
(2) training: utilize the method in the present invention and training set, respectively to Tarantula, Jaccard, Ochiai, SBI this Four kinds of suspicious functions are corrected and optimize (note: the distance in KNN uses Euclidean distance, surface fitting employing B-spline side Method);
(3) test: calculate the dubious value of each statement with suspicious function that is above-mentioned corrected and that optimize, then by these languages Sentence is ranked up from high to low by dubious value, then calculates determining of suspicious function according to the sorting position of the wrong statement in test set Position efficiency, it may be assumed that
( 1 - Positionoffaultystatementinlist numberofstatement sin list ) × 100 %
(4) compare: the efficiency of the method in the present invention and following four kinds of original suspicious functions is contrasted.
R Tarantula ( s i ) = failed ( s i ) / m failed ( s i ) / m + passed ( s i ) / m i
R Jaccard ( s i ) = failed ( s i ) m + failed ( s i )
R Ochiai ( s i ) = failed ( s i ) m × ( passed ( s i ) + failed ( s i ) )
R SBI ( s i ) = failed ( s i ) passed ( s i ) + failed ( s i ) ;
Experimental result:
According to the efficiency comparative in Fig. 2, it can be seen that the method in the present invention is better than other four kinds of methods, i.e. (a) in Fig. 2 Tarantula suspicious degree function, (b) Jaccard suspicious degree function, (c) Ochiai suspicious degree function, (d) SBI suspicious degree function, Particularly, in the present invention, the efficiency intermediate value of method is 92.6%, and the efficiency intermediate value of other four kinds of methods is respectively as follows: Tarantula 84.5%, Jaccard84.6%, Ochiai84.7%, SBI84.3%.
In sum, the method proposed in the present invention has advantage than traditional method in terms of location of mistake.
In a word, suspicious degree function is visualized as three-dimension curved surface by the present invention, it is simple to analyze its character.It addition, the present invention is by poly- Alanysis method obtains the various error patterns in actual program, is used for correcting and optimizing three-dimension curved surface, and generates final suspicious Degree function, thus promote the accuracy of software error location.

Claims (3)

1. the software error localization method that a three-dimension curved surface represents, it is characterised in that: use three-dimension curved surface to location of mistake technology Suspicious degree function carry out visual analyzing, utilize error pattern three-dimension curved surface is corrected and optimizes so that suspicious degree function More tally with the actual situation, thus improve the accuracy of location of mistake technology, implement step as follows:
(1) extract the operation characteristic of the wrong statement of each program in training set, select certain suspicious degree function, mistake in computation language Then these mistake statements are clustered by the suspicious degree of sentence;The operation characteristic of described mistake statement includes that this mistake statement is losing The number of times run in the program execution lost and the number of times run in successful program performs;
(2) according to operation characteristic and the corresponding suspicious angle value of statement wrong in each cluster, each cluster is carried out centralization, Obtaining the center of this cluster, to obtain certain characteristic of each cluster, the feature of each cluster centre just represents a kind of mistake mould Formula;
(3) described cluster centre is fitted to three-dimension curved surface, this three-dimension curved surface function be exactly corrected and optimize after suspicious Degree function, increases suspicious degree weight during location of mistake for the error pattern frequently occurred;
(4) testing results concentrate program, according to the execution information of described program, utilize described corrected and optimize after In suspicious degree function calculation procedure, the suspicious degree of each statement, is ranked up each statement according to the size of suspicious angle value, obtains suspicious Degree ranking table, according to suspicious degree ranking table, investigates program statement, the mistake in finder one by one;Described execution information bag Whether the program of including runs succeeded, and program every statement is respectively at the executory number of run of successful program with in failed journey The executory number of run of sequence;
The number of times that described step (2) is run in failed program according to mistake statement, the number of times run in successful program And the suspicious angle value of this mistake statement, the average asking for them respectively carries out centralization to cluster;
Described step (3) uses Spline Interpolation Method that these cluster centres are fitted to three-dimension curved surface.
The software error localization method that three-dimension curved surface the most according to claim 1 represents, it is characterised in that: described step (1) Suspicious degree function is selected to use Tarantula, Jaccard, Ochiai or SBI function to calculate the suspicious degree of described mistake statement.
The software error localization method that three-dimension curved surface the most according to claim 1 represents, it is characterised in that: described step (1) In clustering method use KNN algorithm or K-means algorithm.
CN201410033461.9A 2014-01-23 2014-01-23 Method of locating software errors by 3D surface representation Active CN103744789B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410033461.9A CN103744789B (en) 2014-01-23 2014-01-23 Method of locating software errors by 3D surface representation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410033461.9A CN103744789B (en) 2014-01-23 2014-01-23 Method of locating software errors by 3D surface representation

Publications (2)

Publication Number Publication Date
CN103744789A CN103744789A (en) 2014-04-23
CN103744789B true CN103744789B (en) 2017-01-11

Family

ID=50501808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410033461.9A Active CN103744789B (en) 2014-01-23 2014-01-23 Method of locating software errors by 3D surface representation

Country Status (1)

Country Link
CN (1) CN103744789B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317707B (en) * 2014-10-15 2017-09-29 中国科学院软件研究所 A kind of software error localization method for influenceing to perceive based on program structure

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446980A (en) * 2008-12-26 2009-06-03 北京大学 Tridimensional partial shape match and retrieval method based on color rotation picture
CN101814055A (en) * 2010-04-06 2010-08-25 南京大学 Sampling method for test cases in clusters
CN102193864A (en) * 2011-05-13 2011-09-21 南京大学 Test case set optimization method of coverage-based error positioning technology

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007206766A (en) * 2006-01-31 2007-08-16 Fujitsu Ltd Data storage system, data storage control device, and failure part diagnostic method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446980A (en) * 2008-12-26 2009-06-03 北京大学 Tridimensional partial shape match and retrieval method based on color rotation picture
CN101814055A (en) * 2010-04-06 2010-08-25 南京大学 Sampling method for test cases in clusters
CN102193864A (en) * 2011-05-13 2011-09-21 南京大学 Test case set optimization method of coverage-based error positioning technology

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向软件错误定位的基于分支聚类的测试用例选择方法;李佳婧,苏小红等;《智能计算机与应用》;20121031;第16-19页 *

Also Published As

Publication number Publication date
CN103744789A (en) 2014-04-23

Similar Documents

Publication Publication Date Title
US10706332B2 (en) Analog circuit fault mode classification method
CN106201871B (en) Based on the Software Defects Predict Methods that cost-sensitive is semi-supervised
De Carvalho et al. Applications of structural equation modeling in social sciences research
Fioravanti et al. A study on fault-proneness detection of object-oriented systems
CN105069470A (en) Classification model training method and device
CN102722892B (en) SAR (synthetic aperture radar) image change detection method based on low-rank matrix factorization
CN102831055B (en) Test case selection method based on weighting attribute
CN104317707B (en) A kind of software error localization method for influenceing to perceive based on program structure
CN103810101A (en) Software defect prediction method and system
CN107092829A (en) A kind of malicious code detecting method based on images match
CN110515826A (en) A kind of software defect positioning method based on number frequency spectrum and neural network algorithm
CN103886337A (en) Nearest neighbor subspace SAR target identification method based on multiple sparse descriptions
CN105678343A (en) Adaptive-weighted-group-sparse-representation-based diagnosis method for noise abnormity of hydroelectric generating set
CN103018177A (en) Spectrogram abnormal sample point detection method based on random sampling agree set
CN110471936A (en) A kind of hybrid SQL automatic scoring method
CN105609116A (en) Speech emotional dimensions region automatic recognition method
CN115629998B (en) Test case screening method based on KMeans clustering and similarity
CN103902798B (en) Data preprocessing method
Li et al. Identify coincidental correct test cases based on fuzzy classification
CN111782532A (en) Software fault positioning method and system based on network abnormal node analysis
CN103744789B (en) Method of locating software errors by 3D surface representation
CN104615910A (en) Method for predicating helix interactive relationship of alpha transmembrane protein based on random forest
Naish et al. Multiple bug spectral fault localization using genetic programming
CN111863135B (en) False positive structure variation filtering method, storage medium and computing device
CN105843744A (en) Metamorphic relation priority ranking method for metamorphic testing of parallel programs

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant