CN103198016B - Based on combining the software error localization method relying on probabilistic Modeling - Google Patents
Based on combining the software error localization method relying on probabilistic Modeling Download PDFInfo
- Publication number
- CN103198016B CN103198016B CN201310099997.6A CN201310099997A CN103198016B CN 103198016 B CN103198016 B CN 103198016B CN 201310099997 A CN201310099997 A CN 201310099997A CN 103198016 B CN103198016 B CN 103198016B
- Authority
- CN
- China
- Prior art keywords
- node
- dependence
- probability
- combining
- state
- 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
Links
Abstract
Based on combining the software error localization method relying on probabilistic Modeling, the present invention relates to computer program analysis field.The present invention is to solve the problem that traditional software error localization method positioning precision is low, and provide based on combining the software error localization method relying on probabilistic Modeling.Step 1: perform correct test case and error checking use-case respectively, and respectively correct test case and error checking use-case are set up associating dependence probabilistic model;Step 2: on the basis of step 1, according to combining dependence probabilistic model, calculates the suspicious degree of each node;Step 3: by suspicious degree, location of mistake information is carried out descending, the node that suspicious degree is high regards as the node more likely made mistakes, and i.e. completes and positions based on the mistake combining the software relying on probabilistic Modeling.The present invention is applied to computer program analysis field.
Description
Technical field
The present invention relates to computer program analysis field.
Background technology
Being widely used in along with computer software in the every field such as economy, military affairs, business, its integrity problem obtains the extensive attention of people day by day.Becoming increasingly complex however as software system, software often runs unlike expected from people, and in other words, software the most reliably runs, and computer application system is brought adverse effect, even causes huge economic loss and catastrophic consequence.Thus it is guaranteed that the high-quality of software, high reliability have become an indispensable importance of system development and maintenance work.
Causing the insecure main cause of software is the mistake in program source code.Programming is a complicated activity, is difficult to all possible execution route in derivation program, and prediction may affect program or the environmental factors affected by program.Mistake even if program seems correctly to perform, in the case of still there may be seldom or when specified conditions meet.Therefore software error is the problem needing solution at present badly.
Software test and debugging are the important stages in software development process, and they collaborative works can effectively identify and eliminate software error: test is used for exposing software error, and debugging is used for eliminating these software errors.But the speed eliminating software error in software debugging process does not often catch up with in software test procedure the speed finding software error.The most existing a lot of automation software testing instruments, but, software debugging uses the method for manual analysis the most mostly, and this is a highly difficult and time-consuming task, because: (1) first has to the mistake in positioning software.In some cases, when developer finds software error in program process, may be far from erroneous point, require a great deal of time and energy searches the program code causing mistake generation.(2) software error secondly it is appreciated that.Positioning software mistake is only the software debugging first step, next must be by being appropriately modified the mistake that program source code eliminates in statement.In some cases, how being appropriately modified statement is not it is apparent that there is a need of developer's manual analysis debugging enironment is wrong to be interpreted as what certain statement, then, find a kind of method to the mistake revising in code, and avoid introducing new mistake during amendment.
If software automation debugging can be realized, the errors present that is i.e. automatically found in program code by computer, analyze error reason and then automatically correct mistake, then can more effectively guarantee software reliability.Software error is automatically positioned analyzes, by computer, the run time behaviour produced in program source code or running, calculates and analyze the abnormal conditions in program, and it is independent as suspect code.The code automatic fitration unrelated with software error being fallen, only retaining needs the correlative code of debugging further, can reduce the scope of error code search, carrys out auxiliary development personnel and identifies mistake statement quickly, is effectively improved the efficiency of debugging.Therefore, mesh of the present invention aims to software reliability actual application background and demand, research software error is automatically positioned, and for software debugging and software error correction based theoretical, improves software quality, guarantees software high reliability, improves being appreciated that and maintainable of software.
Summary of the invention
The present invention is to solve the problem that traditional software error localization method positioning precision is low, and provide based on combining the software error localization method relying on probabilistic Modeling.
Comprise the following steps based on combining the software error localization method relying on probabilistic Modeling:
Step 1: perform correct test case and error checking use-case respectively, and respectively correct test case and error checking use-case are set up associating dependence probabilistic model;
Step 2: on the basis of step 1, according to combining dependence probabilistic model, calculates the suspicious degree of each node;
Step 3: by suspicious degree, location of mistake information is carried out descending, the node that suspicious degree is high regards as the node more likely made mistakes, and i.e. completes and positions based on the mistake combining the software relying on probabilistic Modeling.
Invention effect:
The basic thought of the present invention is: combining of node relies on the data dependence relation that can well represent between difference execution state lower node and its father node, contributes to carrying out location of mistake.If the frequency that the associating dependence of certain node occurs during error checking use-case performs is higher, and during correct test case performs, the frequency of appearance is relatively low or does not occur, then the associating dependence of this node is likely to mistake.The suspicious degree of the associating dependence of each statement, and then effectively positioning software mistake is calculated according to this thought.
The present invention based on combining the software error localization method relying on probabilistic Modeling, it is possible to effectively position the software error relevant to data dependence.Compared with location of mistake method SBI, SOBER, Tarantula, positioning precision can improve more than 15%, it is adaptable to the location of mistake technical field of extensive program code.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the method for the present invention;
Fig. 2 is that dependence probabilistic model schematic diagram is combined in detailed description of the invention one foundation;
Fig. 3 is detailed description of the invention one program control flowchart and data dependence graph example schematic;
Fig. 4 is detailed description of the invention one program control dependence path and data independent path example schematic.
Detailed description of the invention
Detailed description of the invention one: combine Fig. 1~Fig. 4 and present embodiment is described: comprising the following steps based on combining the software error localization method relying on probabilistic Modeling of present embodiment:
Step 1: perform correct test case and error checking use-case respectively, and respectively correct test case and error checking use-case are set up associating dependence probabilistic model;
Step 2: on the basis of step 1, according to combining dependence probabilistic model, calculates the suspicious degree of each node;
Step 3: by suspicious degree, location of mistake information is carried out descending, the node that suspicious degree is high regards as the node more likely made mistakes, and i.e. completes and positions based on the mistake combining the software relying on probabilistic Modeling.
In present embodiment, Fig. 3 left upper portion is divided into program voiddistance (), and left lower is divided into the data dependence graph corresponding to this program, and right side is the controlling stream graph corresponding to this program;
For the test case run, the control independent path obtained when mid portion is by implementation of test cases, the data dependence path obtained when right part is by implementation of test cases on the left of Fig. 4;Such as, for controlling 5 (true) in independent path, represent that node 5 is performed, and state when being performed is true;For 5 (true, [d1 (i), d2 (n)]) in data dependence path, represent that when node 5 is performed, execution state is true, and data dependence is in node 1 and node 2, and data dependence variable is respectively i and n;
Such as n (5 (true in present embodiment step E, [d1 (i), d2 (n)])) represent 5 (true in data dependence path, [d1 (i), d2 (n)]) number of times that occurs, n (5 (true)) represents that the state of node 5 is the total degree that true occurs.
Present embodiment effect:
The basic thought of present embodiment is: combining of node relies on the data dependence relation that can well represent between difference execution state lower node and its father node, contributes to carrying out location of mistake.If the frequency that the associating dependence of certain node occurs during error checking use-case performs is higher, and during correct test case performs, the frequency of appearance is relatively low or does not occur, then the associating dependence of this node is likely to mistake.The suspicious degree of the associating dependence of each statement, and then effectively positioning software mistake is calculated according to this thought.
Present embodiment based on combining the software error localization method relying on probabilistic Modeling, it is possible to effectively position the software error relevant to data dependence.Compared with location of mistake method SBI, SOBER, Tarantula, positioning precision can improve more than 15%, it is adaptable to the location of mistake technical field of extensive program code.
Detailed description of the invention two: present embodiment is unlike detailed description of the invention one: described foundation combine rely on probabilistic model method particularly as follows:
A, first set up controlling stream graph for program, then the control dependence between record statement;
B, set up data dependence graph for program again, the most respectively the data dependence relation between record statement;
C, then by testing results use-case, the control independent path of plug-in mounting capture node and data independent path;
D, control independent path according to controlling stream graph and node, calculate the State-dependence probability of each node;
Wherein, the probability that described each node is performed is designated as P (node), it is the probability of true and false for branch node recording status on the basis of being performed probability, is designated as P (node (true)) and P (node (false));
Described each node, the probability P (node) being performed according to following formula calculating node node:
Wherein, P (para (node)) is the probability that the father node of node node is performed, n (node) is for controlling in independent path, the number of times that node node is performed, n (para (node)) is to control the number of times that the father node of independent path interior joint node is performed;
Described branch node, calculates the probability that node state is true and false, i.e. P (node (true)) and P (node (false)) on the basis of being performed probability:
P (node)=P (node (true))+P (node (false)) (2)
Wherein, described
Wherein, n (node (true)) and n (node (false)) is respectively the number of times that execution state is true and false controlling independent path interior joint node;
E, data dependence path according to data dependence graph and node, calculate the condition of each node and rely on probability P (datadependency | statedependency):
N (node (statedependency, datadependency)) be the state of data dependence path interior joint node be state, data dependence be the number of times that datadependency occurs, n (node (statedependency)) be the state of data dependence path interior joint node be the total degree that state occurs;
F, relying on probability according to the State-dependence probability of each node and condition, calculate node combines dependence probability:
Dependence probability is combined according to what following formula calculated node:
Associating dependence probability=State-dependence probability × condition relies on probability (4)
G, foundation associating dependence probabilistic model
Theorem: (combine and rely on probabilistic model): the dependence probabilistic model of combining of program code P is a tlv triple (D, S, R), wherein:
(1) D=(N, E) is the data dependence graph of P, and N is node set, and E is the set of data dependence limit, the data dependence relation of representation program;
(2) S is the mapping that node arrives state;
(3) R be node combine dependence probability.
Other step and parameter are identical with detailed description of the invention one.
Detailed description of the invention three: present embodiment is unlike detailed description of the invention two: each node of described calculating is performed the method for the suspicious degree of state, particularly as follows:
Calculate the suspicious degree suspicious_score of the associating dependence of each node:
Wherein, Ppassed(jointdependency), time for performing correct test case, node node combines dependence probability;Pfailed(jointdependency), time for performing error checking use-case, node node combines dependence probability.
Other step and parameter are identical with detailed description of the invention two.
Detailed description of the invention four: present embodiment is unlike detailed description of the invention three: described node is corresponding to every statement in program.Other step and parameter are identical with detailed description of the invention three.
Detailed description of the invention five: present embodiment is unlike detailed description of the invention four: described branch node is corresponding to the selection in program and Do statement.Other step and parameter are identical with detailed description of the invention four.
Claims (4)
1. based on combining the software error localization method relying on probabilistic Modeling, it is characterised in that comprise the following steps based on combining the software error localization method relying on probabilistic Modeling:
Step 1: perform correct test case and error checking use-case respectively, and respectively correct test case and error checking use-case are set up associating dependence probabilistic model;
Described foundation combine rely on probabilistic model method particularly as follows:
A, first set up controlling stream graph for program, then the control dependence between record statement;
B, set up data dependence graph for program again, the most respectively the data dependence relation between record statement;
C, then by testing results use-case, the control independent path of plug-in mounting capture node and data independent path;
D, control independent path according to controlling stream graph and node, calculate the State-dependence probability of each node;
Wherein, the probability that described each node is performed is designated as P (node), the probability that node state is true and false, i.e. P (node (true)) and P (node (false)) are calculated on the basis of being performed probability for branch node;
Described each node, the probability P (node) being performed according to following formula calculating node node:
Wherein, P (para (node)) is the probability that the father node of node node is performed, n (node) is for controlling in independent path, the number of times that node node is performed, n (para (node)) is to control the number of times that the father node of independent path interior joint node is performed;
Described branch node calculates the probability that node state is true and false, i.e. P (node (true)) and P (node (false)) on the basis of being performed probability:
P (node)=P (node (true))+P (node (false)) (2)
Wherein, described
Wherein, n (node (true)) and n (node (false)) is respectively the number of times that execution state is true and false controlling independent path interior joint node;
E, data dependence path according to data dependence graph and node, calculate the condition of each node and rely on probability P (datadependency | statedependency):
N (node (statedependency, datadependency)) be the state of data dependence path interior joint node be state, data dependence be the number of times that datadependency occurs, n (node (statedependency)) be the state of data dependence path interior joint node be the total degree that state occurs;
F, relying on probability according to the State-dependence probability of each node and condition, calculate node combines dependence probability:
Dependence probability is combined according to what following formula calculated node:
Associating dependence probability=State-dependence probability × condition relies on probability (4)
G, foundation associating dependence probabilistic model
Theorem: the dependence probabilistic model of combining of program code P is a tlv triple (D, S, R), wherein:
(1) D=(N, E) is the data dependence graph of P, and N is node set, and E is the set of data dependence limit, the data dependence relation of representation program;
(2) S is the mapping that node arrives state;
(3) R be node combine dependence probability;
Step 2: on the basis of step 1, according to combining dependence probabilistic model, calculates the suspicious degree of each node;
Step 3: by suspicious degree, location of mistake information is carried out descending, the node that suspicious degree is high regards as the node more likely made mistakes, and i.e. completes and positions based on the mistake combining the software relying on probabilistic Modeling.
The most according to claim 1 based on combining the software error localization method relying on probabilistic Modeling, it is characterised in that described according to combining dependence probabilistic model, calculate the suspicious degree of each node, particularly as follows:
Calculate suspicious degree suspicious_score (node) of the associating dependence of each node:
Wherein, Ppassed(jointdependency), time for performing correct test case, node node combines dependence probability;Pfailed(jointdependency), time for performing error checking use-case, node node combines dependence probability.
The most according to claim 2 based on combining the software error localization method relying on probabilistic Modeling, it is characterised in that described node is corresponding to every statement in program.
The most according to claim 3 based on combining the software error localization method relying on probabilistic Modeling, it is characterised in that described branch node is corresponding to the selection in program and Do statement.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310099997.6A CN103198016B (en) | 2013-03-26 | 2013-03-26 | Based on combining the software error localization method relying on probabilistic Modeling |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310099997.6A CN103198016B (en) | 2013-03-26 | 2013-03-26 | Based on combining the software error localization method relying on probabilistic Modeling |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103198016A CN103198016A (en) | 2013-07-10 |
CN103198016B true CN103198016B (en) | 2016-08-03 |
Family
ID=48720598
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310099997.6A Active CN103198016B (en) | 2013-03-26 | 2013-03-26 | Based on combining the software error localization method relying on probabilistic Modeling |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103198016B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105117331B (en) * | 2015-08-17 | 2018-04-13 | 浪潮(北京)电子信息产业有限公司 | Coincidence correctness test case recognition methods and device towards location of mistake |
CN105760295A (en) * | 2015-12-28 | 2016-07-13 | 天津大学 | Multi-defect positioning method based on search algorithm |
CN107992414B (en) * | 2017-11-28 | 2020-11-17 | 曲明成 | Method for acquiring dependency relationship between process modules based on test cases |
CN109002684B (en) * | 2018-06-20 | 2021-08-06 | 北京大学 | Interval information analysis method |
CN108959091B (en) * | 2018-07-06 | 2021-06-25 | 哈尔滨工业大学 | Event sequence fault positioning method supporting constraint |
CN112131132A (en) * | 2020-10-12 | 2020-12-25 | 苏州浪潮智能科技有限公司 | Problem code assisted positioning method and device based on graph and probability and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6067639A (en) * | 1995-11-09 | 2000-05-23 | Microsoft Corporation | Method for integrating automated software testing with software development |
CN102508766A (en) * | 2011-09-29 | 2012-06-20 | 中国航天科技集团公司第七一〇研究所 | Static analysis method of errors during operation of aerospace embedded C language software |
-
2013
- 2013-03-26 CN CN201310099997.6A patent/CN103198016B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6067639A (en) * | 1995-11-09 | 2000-05-23 | Microsoft Corporation | Method for integrating automated software testing with software development |
CN102508766A (en) * | 2011-09-29 | 2012-06-20 | 中国航天科技集团公司第七一〇研究所 | Static analysis method of errors during operation of aerospace embedded C language software |
Non-Patent Citations (1)
Title |
---|
Capturing Propagation of Infected Program States;Zhenyu Zhang等;《Proceedings of the 7th Joint Meeting of the European Software Engineering Conference and ACM SIGSOFT Symposium on the Foundations of Software Engineering》;20090828;第43-52页 * |
Also Published As
Publication number | Publication date |
---|---|
CN103198016A (en) | 2013-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103198016B (en) | Based on combining the software error localization method relying on probabilistic Modeling | |
CN102831056B (en) | Regression testing sample generating method based on modification impact analysis | |
US20150370685A1 (en) | Defect localization in software integration tests | |
CN102110051A (en) | Static defect detection method of application program slicing technology | |
Bartocci et al. | Localizing faults in Simulink/Stateflow models with STL | |
CN103136103A (en) | Test case reduction method for error locating demand | |
CN101937396B (en) | Detecting method of unsafe variable use in software program | |
CN110515826A (en) | A kind of software defect positioning method based on number frequency spectrum and neural network algorithm | |
CN102968369B (en) | Method and system for automatically generating dynamic breakpoints | |
CN104572474A (en) | Dynamic slicing based lightweight error locating implementation method | |
CN107992426A (en) | A kind of software error localization method excavated based on Frequent tree mining and processing unit | |
CN102306098A (en) | Implicit taint propagation system and scheme thereof | |
Xu et al. | A logic Petri net-based model repair approach by constructing choice bridges | |
CN103150254B (en) | Error locating method for software based on state-dependent probabilistic modeling | |
CN104598375A (en) | Failure prediction method for software development | |
CN108959391A (en) | Show the equipment, system, method, storage medium of data-base cluster architecture diagram | |
CN106875015B (en) | A kind of airplane fault diagnostic method and system | |
CN106095663B (en) | Program based on hierarchical model returns location of mistake method | |
CN109002723B (en) | Sectional type symbol execution method | |
Kaur et al. | A modelling framework for automotive software design and optimal test path generation | |
CN110851353A (en) | Concurrent program defect positioning method based on Delta debug and constraint solution | |
CN107391377B (en) | Method for testing software integration based on combined flow chart | |
CN111859492B (en) | Simulink hazard occurrence and propagation analysis method based on MAPS fault comprehensive analysis tool | |
US20220100640A1 (en) | Generating test input values for functional components based on test coverage analysis | |
JP2014126900A (en) | Program analysis device, program analysis method, and program analysis program |
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 |