CN104461867B - A kind of software evolution process failure analysis methods - Google Patents

A kind of software evolution process failure analysis methods Download PDF

Info

Publication number
CN104461867B
CN104461867B CN201410623526.5A CN201410623526A CN104461867B CN 104461867 B CN104461867 B CN 104461867B CN 201410623526 A CN201410623526 A CN 201410623526A CN 104461867 B CN104461867 B CN 104461867B
Authority
CN
China
Prior art keywords
node
efagm
modification
cnode1
influence
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
CN201410623526.5A
Other languages
Chinese (zh)
Other versions
CN104461867A (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.)
Space Cqc Associate Software Testing And Evaluating Technology Beijing Co ltd
Sunshine Intellectual Property Group Co ltd
Original Assignee
Nantong University
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 Nantong University filed Critical Nantong University
Priority to CN201410623526.5A priority Critical patent/CN104461867B/en
Publication of CN104461867A publication Critical patent/CN104461867A/en
Application granted granted Critical
Publication of CN104461867B publication Critical patent/CN104461867B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The present invention proposes a kind of software evolution process failure analysis methods, is mainly used in solving software failure understanding and problem analysis in continuous evolutionary process, comprises the following steps:Step 1, use AST analyzers, the intermediate representation abstract syntax tree EFAGM_AST of structural evolution modification program;Step 2, changed based on developing, establish EFAGM crucial modification set of node, the forward and backward of structure modification set of node influences node and path successively;Step 3, the domain according to calculating EFAGM node of graph, EFAGM static factor of influence and the dynamic effects factor are generated, complete evolution accident analysis graph model EFAGM structure;When failure occurs, realized using EFAGM to accident analysis caused by program evolution modification.The present invention can not only represent to develop modification influence element and its between relation, and the efficiency of evolution accident analysis can be effectively improved.

Description

A kind of software evolution process failure analysis methods
Technical field
The present invention proposes a kind of method for carrying out accident analysis to software evolution process using evolution fault analysis model, Belong to the technical field of software debugging.
Background technology
With the development of technology and the raising of demand, software is constantly complicated and maximized.In this kind of Software Development In maintenance process, often along with software program evolution acts of revision such as iterative development, demand change, performance optimizations, and drill The progress of change, add the risk for introducing new software program failure.Therefore, software in evolutionary process, it is necessary to constantly build Mould is analyzed, and to find potential failure as early as possible, software development and maintenance expense is preferably minimized.
When failure occurs in software program, there is following several method:
(1) most traditional simple method inserts output statement in a program.This is established in troubleshooting personnel to program pole It is familiar with, and very big subjectivity be present, and is not suitable for the failture evacuation of modern large complicated software.
(2) by debugging acid, the gimmick of troubleshooting personnel generally is to set breakpoint to fix a breakdown, this same mistake It is inefficient in subjectivity, cause the significant wastage of personnel.
(3) be the failure that finds in software based on program spectrum current popular fault location scheme, its shortcoming is journey For sequence during modification of developing, there is the possibility destroyed in historical procedures spectrum, and can not ensure Test oracle after the modification Still it is effective.Due to troubleshooting personnel may not very familiar whole software program, they also be difficult to according to program element can Doubt the root of property debug.
(4) accident analysis is carried out using system dependence graph.Although system dependence graph is provided between all program elements Detailed dependence, but in the continuous evolutionary process of program, continuous constructing system dependency graph, its time cost and space generation Valency is difficult to the appraisal, and it does not possess evolution accident analysis ability.
Based on above mentioned problem, it is very necessary to design efficiently accurate evolution fault analysis model.How to be changed according to developing Evolution fault analysis model is efficiently built, and can propose that reasonable proposal is particularly important to software fault.
The content of the invention
The technical problems to be solved by the invention are the defects of being directed to background technology, there is provided a kind of evolution accident analysis artwork Type (Evolution Fault Analysis Graph Model, EFAGM), related forward direction is changed by structural evolution and relied on Element, backward dependence element and its static state and the dynamic effects factor are asked to analyze the accident analysis as caused by being changed program evolution Topic.
The present invention uses following technical scheme to solve above-mentioned technical problem:
A kind of software evolution process failure analysis methods, comprise the following steps:
Step 1, use AST analyzers, the intermediate representation evolution accident analysis graph model of structural evolution modification program EFAGM abstract syntax tree EFAGM_AST;
Wherein, the evolution accident analysis graph model EFAGM is two tuples<CINode,CDEdge>, wherein, CINode influences set of node for modification, and CDEdge is modification dependence edge collection;
Step 2, based on develop change, in initial EVOLUTION ANALYSIS graph model EFAGM add node by way of, really Vertical EFAGM crucial modification set of node;The crucial modification nodal informations of EFAGM are then based on, successively before structure modification set of node Node and path are influenceed to backward;
Step 3, the domain according to calculating EFAGM node of graph, EFAGM static factor of influence and the dynamic effects factor are generated, Complete evolution accident analysis graph model EFAGM structure;When failure occurs, realized using EFAGM and program evolution modification is drawn The accident analysis risen.
Further, a kind of software evolution process failure analysis methods of the invention, in step 1, the modification influences section Point set CINode include common node BlockNode, IfNode, SwitchNode, WhileNode, DoNode, ForNode, BreakNode, ContinueNode, ReturnNode, InvocationNode, MethodNode, wherein, BlockNode is Sequential node, IFNode are conditional branching node, and SwitchNode is switch branch node, and WhileNode is While repetends Point, DoNode are Do cyclic nodes, and ForNode is For cyclic nodes, and BreakNode is Break sentence nodes, ContinueNode is Continue sentence nodes, and ReturnNode is Return sentence nodes, and InvocationNode is side Method call statement node, MethodNode are called method node;
The modification dependence edge collection CDEdge=DCDEdge ∪ ICDEdge ∪ DDDEdge ∪ IDDEdge, wherein, DCDEdge is direct control dependence edge collection, and ICDEdge is indirect control dependence edge collection, and DDDEdge is immediate data dependence edge Collection, IDDEdge is indirect data dependence edge collection;
The domain of EFAGM node of graph, including:
(1) ID domains:The ID marks on the node or the mark on side influenceed for modification of developing, node or side are unique;
(2) Position domains:The position of corresponding diagram node elements in a program;
(3) ParentNodeLink domains:The father node chain domain of present node, for linking the father node of present node, just Traveled through in the forward direction of EFAGM figures;If if present node variable uses be present and influenceed by multiple node variable definition or simultaneously by Influenceed to forward data and control, then ParentNodeLink is linked into multiple father nodes, otherwise only link a father node;When If variable uses be present and influenceed by multiple node variable definition or influenceed by forward data and control in front nodal point simultaneously, ParentNodeLink links multiple father nodes, otherwise links a node;
(4) ChildNodeLink domains:The child nodes chain domain of present node, for linking the child nodes of present node, It is easy to the backward traversal of EFAGM figures;For IfNode, SwitchNode, WhileNode, DoNode, ForNode, The ChildNodeLink domains of the condition judgment sentence of MethodNode types, if or present node variable-definition or fixed be present It is worth and influences the use of multiple nodes, then links multiple child nodes;Otherwise a child nodes are only linked;
(5) ChangeNum, AveDistance domain:Influence the number of the modification node of present node, with changing node Minimum range, make m1,m2...,mnFor n in the present node and program distance for changing node, then AveDistance=(m1+m2 +…+mn)/n;
(6) StaticWeight domains:The probability that the present node that static analysis is drawn breaks down, its calculation formula areWherein m represents to influence ActiveNode ChangeNum domains, i (i =1,2,3 ..., m) it is influence of the regulation conflict number to weight;When evolution modification causes failure, the failure of present node is general Rate follows:
A) nearer with modification nodal distance, the probability to break down is higher;
B) the modification interstitial content being affected is more, and the probability to break down is higher;
C) node is changed as the increase of number, its influence power are gradually reduced;
(7) DynamicWeight domains:The probability to be broken down for the present node that dynamic analysis are drawn, it calculates public Formula is:
Wherein, s is with foretelling afoul test number according to test history information, and k (k=1,2,3 ..., s) is regulation Influence of the number that conflicts to weight, t are according to the test history information test number consistent with foretelling, j (j=1,2,3 .., t) It is influence of the consistent number of regulation to weight, γ is regulatory factor;When evolution modification causes failure, the failure of present node is general Rate follows:
A) more by the failure testing use-case of present node, the probability to break down is higher;
B) more by the successful test case of present node, the probability to break down is smaller;
C) increasing with failure testing use-case number, the probability analysis that failure occurs failure testing use-case influence to get over It is small;
D) increasing with failure testing use-case number, the probability analysis that failure occurs success test case influence to get over It is small.
Further, a kind of software evolution process failure analysis methods of the invention, based on modification of developing in step 2, really Vertical key changes set of node:When initial, only included in EFAGM models n develop modification node cNode1 ..., cNoden;ID and Position thresholdings are set in EFAGM figures while a node is added, set while a line is created Put ParentNodeLink and ChildNodeLink thresholdings;When realizing, call method ast.creatAST (replace) is raw Into source program replace EFAGM_AST code trees, and return to root node.
Further, a kind of software evolution process failure analysis methods of the invention, structure modification successively described in step 2 The forward and backward of set of node influences node and path;Specially:
2.1) judge to develop based on cNode1.getNodeType () method and change node cNode1 node type, construction CNode1 forward direction control node, forward data node and related dependant side;The modification of present node, which can cause, controls its section The renewal of point, meanwhile, the variable modification that present node uses can cause the consistency check of variable-definition or definite value node;
2.2) structural evolution modification node cNode1 backward control node, backward back end and related dependant side;When For front nodal point if control node, its modification can influence the execution of all nodes in control block;If defined in present node or fixed Be worth variable, then it is all to concentrate the node of variable to be all affected using definition or definite value;
2.3) repeat 2.1)~2.2), creating other modifications node cNode2 to cNoden forward directions influences node and backward Influence node, and all nodes not being added in EFAGM be added thereto, create DCDEdge, ICDEdge, DDDEdge, IDDEdge。
Further, a kind of software evolution process failure analysis methods of the invention, step 3 are specially:
3.1) the ChangeNum domains and AveDistance domains of each node in EFAGM figures are updated;The present node is made to be ActiveNode, ChangeNum value are that ActiveNode is reachable according to ParentNodeLink domains or ChildNodeLink domains Change node number;AveDistance calculating is in two steps:First, ActiveNode is calculated to each up to modification node i (i =1,2,3 ..., m) minimum range mini, AveDistance is then calculated, calculation formula is Wherein, m is ChangeNum values;
3.2) StaticWeight of each node in EFAGM figures is calculated according to ChangeNum domains and AveDistance domains Value;It is ActiveNode to make present node, then calculation formula is:Wherein m Influence ActiveNode ChangeNum domains are represented, i (i=1,2,3 ..., m) is represented up to modification node, on EFAGM figures Show as it is positive or reverse reachable,Representing that the modification node of the influence to ActiveNode is more, then influence power is bigger, And increase with the modification node of influence, influence power gradually reduces,Represent that AveDistance is bigger, drill It is smaller on ActiveNode influences to change modification node, and because AveDistance is less than modification to ActiveNode influence powers The influence power of node number, AveDistance influence power is limited in (0,1] between, i.e., According to calculation formula, impacted modification interstitial content is more, then StaticWeight is bigger, impacted modification interstitial content It is identical, and distance is nearer, StaticWeight is bigger, when evolution modification causes failure, according to StaticWeight size Order is investigated to failure;
3.3) DynamicWeight is calculated according to test history information, if Test Oracle still have after modification of developing Effect, the probability of evolution failure is more accurately calculated by whether failing for test run, its calculation formula is:
Wherein, s is with foretelling afoul test number according to test history information, and k (k=1,2,3 ..., s) is regulation Influence of the number that conflicts to weight, t are according to the test history information test number consistent with foretelling, j (j=1,2,3 .., t) It is influence of the consistent number of regulation to weight, γ is regulatory factor;Represent k-th of conflict influence of the test number to weight because Son, with the increase of test number, test the influence to weight and constantly reduce,γ∈ [0,0.5] is regulatory factor, its size by Test case scale determines, as the larger (s+t of test case>10000) when, we, which give tacit consent to, takes γ=0.5, works as k>10000 When,Its influence to weight is ignored, as the small (s+t of test case<=10000) when, by test to power The influence of weight, which constantly reduces, ignores, even γ=0, so, all tests are 1 to the factor of influence of weight;
3.4) complete EFAGM structure, when failure occurs, according to EFAGM node elements relation and StaticWeight, DynamicWeight threshold levels determine the root of failure.
Further, a kind of software evolution process failure analysis methods of the invention, step 2.1) comprise the following steps that:
2.1.1) node cNode1 forerunner control node ParentVertex1 is changed in extraction evolution on EFAGM_AST, ParentVertex1 node type have IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, add in ParentVertex1 to EFAGM figures, update cNode1 ParentNodeLink domains, in order to EFAGM traversing operation, and create and directly control dependence edge DCDEdge (ParentVertex1, cNode1), cNode1's repaiies ParentVertex1 modification inspection can be caused by changing;
2.1.2 ParentVertex1 direct precursor control node ParentVertex2) is extracted, is added to EFAGM figures In, ParentVertex1 ParentNodeLink domains are set, and create indirect control dependence edge ICDEdge (ParentVertex2, ParentVertex1);If because node cNode1 modification causes the generation of failure, then section The cNode1 dubieties of point are greater than node ParentVertex1, the ParentVertex1 dubieties of node are greater than node ParentVertex2;
2.1.3 2.1.2) is repeated), create all indirect controls and rely on nodes and corresponding edge, continuous influence of fluctuations, until The node elements of correlation are included;
2.1.4 the expression formula in cNode1) is extracted according to cNode1.getExpression () method, and generates expression formula Variable uses collection v_use, based on EFAGM_AST, add direct precursor definition or the definite value node of all variables in v_use In Vertex3 to EFAGM, and create data dependence side DDDEdge (Vertex3, cNode1);
2.1.5 expression formula variables set v1 in Vertex3) is generated, based on EFAGM_AST, all variables is straight in addition v1 Connect in predecessor node Vertex4 to EFAGM, and create data dependence side IDDEdge (Vertex4, Vertex3);
2.1.6 2.1.5) is repeated), create all indirect datas and rely on node and corresponding edge, while need continuous logarithm According to type and data value synchronized update inspection, until the original definition of data type terminates;
2.1.7) if node type is WhileNode, DoNode, ForNode, the direct precursor data of these nodes Node and control node except the control variable definite value node among the node before natural order, in addition to node control block and Node is redirected, it is Vertex5 to make controlling variable definite value or redirecting node in WhileBlock, DoBlock, ForBlock, is added Enter in Vertex5 to EFAGM, and create dependence edge DCDEdge (Vertex5, cNode1);
2.1.8) if node type is MethodNode, its direct precursor node is the language for calling the MethodNode Literal point, MethodNode modification can cause corresponding CallVertex synchronized update, based on EFAGM_AST, add and adjust With node CallVertex, and create dependence edge DCDEdge (CallVertex, cNode1).
Further, a kind of software evolution process failure analysis methods of the invention, step 2.2) comprise the following steps that:
2.2.1) if the modification node cNode1 node types that develop be IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, the then modification of these nodes can cause whether the sequential node in statement block performs, point Chuan Jian not condition joint block IFBlock, branch node block SwitchCase, While cyclic node block WhileBlock, Do circulation Order under joint block DoBlock, For cyclic node block ForBlock, called method joint block MethodBlock statement blocks Node Vertex1, and create and directly control dependence edge DCDEdge (cNode1, Vertex1);
2.2.2) if Vertex1 node types be IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, be respectively created IFBlock, SwitchCase, WhileBlock, DoBlock, ForBlock, Sentence node Vertex2 under MethodBlock, and create indirect control dependence edge ICDEdge (Vertex1, Vertex2);
2.2.3 2.2.2) is repeated) all indirect controls dependence nodes and dependence edge are created, change and constantly propagate, until Untill common sentence node BlockNode;
2.2.4 the expression formula in cNode1) is extracted according to cNode1.getExpression () method, and generates expression formula Variable-definition collection v_def, based on EFAGM_AST, the immediate successor for adding all variables in v_def uses node Vertex3 Into EFAGM, and create data dependence side DDDEdge (cNode1, Vertex3);
2.2.5 expression formula variable-definition collection v_def1 in Vertex3) is generated, based on EFAGM_AST, is added in v_def1 In immediate successor reference node Vertex4 to the EFAGM of all variables, and create data dependence side IDDEdge (Vertex3, Vertex4);
2.2.6 2.2.5) is repeated), create all indirect datas and rely on node and corresponding edge, until not new variable Untill definite value and modification;
2.2.7) if node type is ReturnNode, this node control returns to method, travels through EFAGM_AST, The node Vertex5 of method where adding calling ReturnNode nodes, establishment data dependence side DDDEdge (cNode1, Vertex5);
2.2.8) if node type is BreakNode, EFAGM_AST is traveled through,
If the sentence node in WhileNode, DoNode, ForNode where cNode1 is Vertex6, BreakNode modification directly decides whether Vertex6 performs, and creates control dependence edge DCD (cNode1, Vertex6);Together When, the follow-up sentence of the BreakNode in WhileBlock, DoBlock, ForBlock also directly by BreakNode, ContinueNode control, EFAGM_AST is traveled through, it is Vertex7 to make follow-up sentence, adds Vertex7 nodes to EFAGM In, and create (cNode1, Vertex7);
It is next in cNode in BreakNode control statement blocks if the statement block where cNode1 is SwitchCase Sentence before BreakNode, EFAGM_AST is traveled through, make the follow-up sentence for the cNode1 that Vertex8 is place statement block arrive down Sentence before one BreakNode, create DCD (cNode1, Vertex8);
2.2.9) if node type is ContinueNode, EFAGM_AST is traveled through, if where cNode1 Sentence node in WhileNode, DoNode, ForNode is Vertex9, then ContinueNode modification directly decides Vertex9 execution is redirected, creates control dependence edge DCD (cNode1, Vertex9);Meanwhile WhileBlock, DoBlock, Whether the performing for follow-up sentence of ContinueNode in ForBlock is also controlled by ContinueNode, travels through EFAGM_ AST, it is Vertex10 to make follow-up sentence, adds Vertex10 nodes into EFAGM, and create (cNode1, Vertex10);
2.2.10) if node type is InvocationNode, EFAGM_AST is traveled through, makes the call method node be Vertex11, add Vertex11 to EFAGM in, and create control dependence edge and data dependence edge DCD (cNode1, Vertex11);
2.2.11) influence and control to influence node as new analysis node using cNode1 immediate data, create 2.2.7)~ 2.2.10 all indirect datas of cNode1) influence and control control influences node, and create side IDDEdge, ICDEdge, directly Untill not new node and side add.
The present invention uses above technical scheme, compared with prior art, has following technique effect:
The model of the present invention can carry out more effective more accurate point than traditional program graph model to the modification failure that develops Analysis.It is embodied in:(1), can be with when causing software fault due to the evolutions such as software upgrading, iterative development, defect correction modification The efficiently analysis model of structure evolution failure relevant portion, and reduce the scale of analysis;(2) by setting weight (to influence The factor) more efficient analysis is provided for failure relevant portion, even if when evolution modification causes Test oracles to fail, the present invention In static factor of influence can still provide for efficiently analyzing;(3) evolution fault analysis model EFAGM intuitively gives software event Hinder the relation between element, be advantageous to being analyzed to identify for fault rootstock.
Brief description of the drawings
Fig. 1 is EFAGM map generalization flows.
Fig. 2 is the forward direction control node of EFAGM figures and the product process on side.
Fig. 3 is the forward data node of EFAGM figures and the product process on side.
Fig. 4 is the backward control node of EFAGM figures and the product process on side.
Fig. 5 is the backward back end of EFAGM figures and the product process on side.
Fig. 6 is EFAGM instance graphs.
Embodiment
Technical scheme is further explained in detail below in conjunction with the accompanying drawings, those skilled in the art of the present technique can be with Understand, unless otherwise defined, all terms (including technical term and scientific terminology) used herein have and the present invention The general understanding identical meaning of those of ordinary skill in art.It is it should also be understood that fixed in such as general dictionary Those terms of justice should be understood that there is the meaning consistent with the meaning in the context of prior art, and unless as this In equally define, will not be explained with the implication of idealization or overly formal.
A kind of intermediate representations of the AST (Abstract Syntax Tree, abstract syntax tree) as program, in program The numerous areas such as analysis are widely used, and a variety of source program handling implements can be conveniently realized using abstract syntax tree.Take out As the syntax of the structure independent of original language of syntax tree, that is, context-free grammar used by the syntactic analysis phase, Syntactic analysis tree is independently constructed, a clearly interface is established for front and back ends.The structure base first of EFAGM models of the present invention Parsed in AST, generate the EFAGM_AST trees of Evolution Programs;Changed based on developing, establish crucial modification set of node;Then successively The forward and backward of structure modification set of node influences node and path, and generates static factor of influence and the dynamic effects factor.Such as Shown in Fig. 1.
First, EFAGM model definitions:
EFAGM is two tuples<CINode,CDEdge>.Wherein, CINode influences set of node for modification, and CDEdge is Change dependence edge collection.CINode sets of node include common node BlockNode, IfNode, SwitchNode, WhileNode, DoNode, ForNode, BreakNode, ContinueNode, ReturnNode, InvocationNode, MethodNode etc.. CDEdge=DCDEdge ∪ ICDEdge ∪ DDDEdge ∪ IDDEdge, wherein, DCDEdge is direct control dependence edge collection, ICDEdge is indirect control dependence edge collection, and DDDEdge is immediate data dependence edge collection, and IDDEdge is indirect data dependence edge Collection.Node of graph mainly includes<ID>、<Position>、<ParentNodeLink>、<ChildNodeLink>、<ChangeNum >、<AveDistance>、<StaticWeight>、<DynamicWeight>Deng domain, wherein,
(1) ID domains:The node or the mark on side that modification of developing influences.Node or the ID on side marks are unique.
(2) Position domains:The position of node of graph element in a program.
(3) ParentNodeLink domains:The father node chain domain of present node, links the father node of present node, is easy to The forward direction traversal of EFAGM figures.If there are variable uses and influenceed or simultaneously by preceding by multiple node variable definition in present node Influenceed to data and control, ParentNodeLink links multiple father nodes, otherwise links a node.
(4) ChildNodeLink domains:The child nodes chain domain of present node, links the child nodes of present node, is easy to The backward traversal of EFAGM figures.For IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode etc. The ChildNodeLink domains of condition judgment sentence link multiple child nodes;If there is variable-definition or definite value simultaneously in present node The use of multiple nodes is influenceed, ChildNodeLink domains also link multiple child nodes;Otherwise, ChildNodeLink domains chain Connect a child nodes.
(5) ChangeNum, AveDistance domain:Influence the number of the modification node of present node, with changing node Minimum range.Make m1,m2...,mnFor n in the present node and program distance for changing node, then AveDistance=(m1+m2 +…+mn)/n。
(6) StaticWeight domains:The probability that the present node that static analysis is drawn breaks down, its calculation formula areWherein m represents to influence ActiveNode ChangeNum domains, i (i =1,2,3 ..., m) represent up to modification node.When evolution modification causes failure, the probability of malfunction of present node follows:
A) nearer with modification nodal distance, the probability to break down is higher;
B) the modification interstitial content being affected is more, and the probability to break down is higher;
C) node is changed as the increase of number, its influence power are gradually reduced.
(7) DynamicWeight domains:The probability that the present node that dynamic analysis are drawn breaks down, its calculation formula areWherein, s is according to test history information and foretells afoul test number, K (k=1,2,3 ..., s) is influence of the regulation conflict number to weight, and t is according to the survey consistent with foretelling of test history information Number is tried, j (j=1,2,3 .., t) is influence of the consistent number of regulation to weight, and γ is regulatory factor.Evolution modification causes event During barrier, the probability of malfunction of present node follows:
A) more by the failure testing use-case of present node, the probability to break down is higher;
B) more by the successful test case of present node, the probability to break down is smaller;
C) increasing with failure testing use-case number, the probability analysis that failure occurs failure testing use-case influence to get over It is small;
D) increasing with failure testing use-case number, the probability analysis that failure occurs success test case influence to get over It is small.2nd, EFAGM model building methods
We combine an instantiation to illustrate EFAGM constitution step, example procedure source west gate subprogram below Open Source Code replace, its function are that pattern is replaced.
1) using the intermediate representation evolution accident analysis graph model EFAGM of AST analyzers structural evolution modification program Abstract syntax tree EFAGM_AST.When initial, only included in EFAGM models n develop modification node cNode1 ..., cNoden.ID and Position thresholdings are set in EFAGM figures while a node is added, set while a line is created Put ParentNodeLink and ChildNodeLink thresholdings.When realizing, call method ast.creatAST (replace) is raw Into source program replace EFAGM_AST code trees, and return to root node.For purposes of illustration only, it is following we respectively according to node Type changes node to set to develop.
2) judge to develop based on cNode1.getNodeType () method and change node cNode1 node type, construction CNode1 forward direction control node, forward data node and related dependant side.The modification of present node, which can cause, controls its section The renewal of point, meanwhile, the variable modification that present node uses can cause the consistency check of variable-definition or definite value node.Fig. 2 It is the preceding general construction flow to control node, Fig. 3 is the general construction flow of forward data node.Comprise the following steps that:
A), node cNode1 forerunner control node ParentVertex1 is changed in extraction evolution on EFAGM_AST, ParentVertex1 node type have IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode etc., add in ParentVertex1 to EFAGM figures, update cNode1 ParentNodeLink domains, in order to EFAGM traversal etc. operates, and adds and directly control dependence edge DCDEdge (ParentVertex1, cNode1).To keep one Cause property, cNode1 modification can cause ParentVertex1 modification inspection.If for example, be modified to sentence 13, that Grammer for holding program or uniformity semantically are, it is necessary to inspection of being modified to its in-line control statement 11.According to repairing Change sentence 13, EFAGM can find the related direct precursor control statement 13 of modification.
B), it is same a), extract ParentVertex1 direct precursor control node ParentVertex2, be added to EFAGM In figure, ParentVertex1 ParentNodeLink domains are set, and create indirect control dependence edge ICDEdge (ParentVertex2, ParentVertex1).Such as:A) in step, sentence 11 it is direct control predecessor node be 9, for protect Uniformity is held, the modification of node 13 causes the modification inspection of node 11, and the modification of node 11 checks and causes control node 9 Modification.Here, if because the modification of node 13 causes the generation of failure, then the dubiety of node 13 is greater than node 11.We are formulated to this below.
C), repeat b), to create all indirect controls and rely on node and corresponding edge.As above, node 13 arrives node 11, node 11 To the continuous influence of fluctuations of node 9 ..., EFAGM need to include the node elements of correlation.
D) expression formula in cNode1, is extracted according to cNode1.getExpression () method, and generates expression formula change Amount based on EFAGM_AST, adds direct precursor definition or the definite value node of all variables in v_use using collection v_use In Vertex3 to EFAGM, and create data dependence side DDDEdge (Vertex3, cNode1).For example, if modification node is Sentence 16, then expression formula is using integrating as v_use={ i }, and the direct precursor definite value node to variable i in v_use is sentence 8, language The modification of sentence 16 may cause the synchronized update of sentence 8, and therefore, EFAGM includes sentence 8 wherein, and establishes side (8,16).
E), same to d) to generate expression formula variables set v1 in Vertex3, based on EFAGM_AST, all variables is straight in addition v1 Connect in predecessor node Vertex4 to EFAGM, and create data dependence side IDDEdge (Vertex4, Vertex3).D) sentence 8 in Direct precursor be defined as sentence 6, the modification of sentence 8 can cause type definition of the sentence 6 to variable i, and therefore, EFAGM should be wrapped Sentence 6 is included, and establishes side (6,8).
F), repeat e), to create all indirect datas and rely on node and corresponding edge.In as above example, node statement 16 arrives Node statement 8, then needed to node statement 6 ... constantly to data type and data value synchronized update inspection, until data The original definition of type terminates.
G), if node type is WhileNode, DoNode, ForNode, the direct precursor data section of these nodes Point and control node are except the control variable definite value node among the node before natural order, in addition to node control block and jump Trochanterion (continue, break, the last item sentence of control block), makes in WhileBlock, DoBlock, ForBlock It is Vertex5 to control variable definite value or redirect node, is added in Vertex5 to EFAGM, and create dependence edge DCDEdge (Vertex5, cNode1).If for example, node 23 is modified, then its forward direction node is except the section of natural order Outside point 21,22, it should also include node 25, side (25,23) are both DDDEdge, and DCDEdge.
If h), node type is MethodNode, its direct precursor node is the sentence for calling the MethodNode Node, MethodNode modification can generally cause corresponding CallVertex synchronized update.Based on EFAGM_AST, add Enter to call node CallVertex, and create dependence edge DCDEdge (CallVertex, cNode1).If for example, to node 5 It is modified, then node 24 will be updated accordingly, with being consistent property.
3) cNode1 backward control node, backward back end and related dependant side is constructed.Present node is if control Node, its modification can influence the execution of all nodes in control block;If definition or definite value variable, own in present node The node of variable is concentrated all to be affected using definition or definite value.Fig. 4 is the general construction flow of backward control node, figure 5 be the general construction flow of backward back end.Comprise the following steps that:
If a), node type be IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, the then modification of these nodes can cause whether the sequential node in statement block performs, condition node are respectively created Block IFBlock, branch node block SwitchCase, While cyclic node block WhileBlock, Do cyclic node block DoBlock, Sequential node Vertex1 under For cyclic node blocks ForBlock, called method joint block MethodBlock statement blocks, and Create and directly control dependence edge DCDEdge (cNode1, Vertex1).For example, the modification to sentence 9, can cause 10,11,14 The change of execution, therefore EFAGM needs to add interdependent node 10,11,14, and create side (9,10), (9,11), (9,14).
If b), same to a) Vertex1 node types be IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, be respectively created IFBlock, SwitchCase, WhileBlock, DoBlock, ForBlock, Sentence node Vertex2 under MethodBlock, and create indirect control dependence edge ICDEdge (Vertex1, Vertex2). In a), the modification of sentence 9 can influence sentence 11, and sentence 11 is IfNode, influences the sentence node 12,13 under IfBlook, Therefore addition node 12 is needed, 13, and create side (11,12), (11,13).Instinctively, the original modified of sentence 9 is influenceed to language The influence of sentence 12,13 weakens.
C), repeat b) to create all indirect controls dependence nodes and dependence edge.By sentence 9 to sentence 11, by 11 to 12, 13, change and constantly propagate, untill common sentence node BlockNode.
D) expression formula in cNode1, is extracted according to cNode1.getExpression () method, and generates expression formula change Amount definition collection v_def, if the variable in v_def is changed, the subsequently reference to variable can all be affected.It is based on EFAGM_AST, the immediate successor for adding all variables in v_def is used in node Vertex3 to EFAGM, and creates data Dependence edge DDDEdge (cNode1, Vertex3).Sentence in example procedure 20, which is modified, can directly influence sentence 22, Therefore EFAGM adds sentence 22, and creates side (20,22).
E) it is, same to d) to generate expression formula variable-definition collection v_def1 in Vertex3, due to cNode1 modification, in v_def1 The definite values of all variables change.Based on EFAGM_AST, the immediate successor reference node of all variables in v_def1 is added In Vertex4 to EFAGM, and create data dependence side IDDEdge (Vertex3, Vertex4).D) in, by definite value in sentence 22 Node be result, result value is influenceed by variable line, it is necessary to which the sentence for quoting result nodes is added to In EFAGM, such as sentence 23, and side (22,23) is created.It should be noted that in this example, the modification of line variables is also right Formal parameter s has carried out definite value in getline functions, and the creation method on this side is illustrated in j) for we.
F), repeat e), to create all indirect datas and rely on node and corresponding edge.Variable is had influence on from the modification of sentence 20 Line definition, variable line definition and the modification of value have influence on the definite value of result in sentence 22, and result value influences Circulation to 23 performs ... and so on, untill the definite value of not new variable and modification.
If g), node type is ReturnNode, this node control returns to method, travels through EFAGM_AST, adds The node Vertex5 of method where calling ReturnNode nodes, establishment data dependence side DDDEdge (cNode1, Vertex5).For example, if modification element is sentence 4, sentence 4 returns to boolean's offset, and the method where sentence 4 is Getline, getline method change is called, by traveling through EFAGM_AST, find the sentence 25 for calling getline, language Return value has been assigned to result by sentence 25, therefore creates data dependence side (4,25).
If h), node type is that BreakNode travels through EFAGM_AST, if WhileNode where cNode1, Sentence node in DoNode, ForNode is Vertex6, then BreakNode modification directly decides whether Vertex6 holds OK, control dependence edge DCD (cNode1, Vertex6) is created.Meanwhile in WhileBlock, DoBlock, ForBlock BreakNode follow-up sentence is also directly controlled by BreakNode, ContinueNode, travels through EFAGM_AST, and order is follow-up Sentence is Vertex7, adds Vertex7 nodes into EFAGM, and create (cNode1, Vertex7).If where cNode1 Statement block is SwitchCase, then the sentence in BreakNode control statements block in cNode before next BreakNode, time EFAGM_AST is gone through, makes the language before the follow-up sentence to next BreakNode for the cNode1 that Vertex8 is place statement block Sentence, create DCD (cNode1, Vertex8).By taking WhileNode as an example, if we increase by one after example procedure sentence 13 Sentence 13 ' is " break;", if then 13 ' gone to, sentence 9 no longer will be performed, therefore 13 ' this increase modification influences Sentence 9, create DCD (13 ', 9), meanwhile, if 13 ' perform 14~18) sentence directly skips, therefore create DCD (13 ', 14)、DCD(13’,15)、DCD(13’,16)、DCD(13’,17)、DCD(13’,18)。
If i), node type is ContinueNode, it is similar h) in BreakNode, travel through EFAGM_AST, if Sentence node in WhileNode, DoNode, ForNode where cNode1 is Vertex9, then ContinueNode is repaiied Change and directly decide the execution for redirecting Vertex9, create control dependence edge DCD (cNode1, Vertex9).Meanwhile The execution of the follow-up sentence of ContinueNode in WhileBlock, DoBlock, ForBlock whether also by ContinueNode control, EFAGM_AST is traveled through, it is Vertex10 to make follow-up sentence, adds Vertex10 nodes to EFAGM In, and create (cNode1, Vertex10).Similar h) example, if increased 13 ' be " continue;", if then 13 ' held Row arrives, then jumps directly to sentence 9, therefore 13 ' this increase modification have impact on sentence 9, create DCD (13 ', 9), similarly, If 13 ' perform, 14~18) sentence this circulation no longer will be performed, thus establishment DCD (13 ', 14), DCD (13 ', 15), DCD(13’,16)、DCD(13’,17)、DCD(13’,18)。
If j), node type is InvocationNode, cNode1 not only controls the method node of calling, simultaneously meeting Data transfer is carried out to method node.This is that public side is shifted in a data transmission and control.Because not influenceing EVOLUTION ANALYSIS, we To control side DCDEdge to represent transitive relation.EFAGM_AST is traveled through, it is Vertex11 to make call method node, is added In Vertex11 to EFAGM, and create control dependence edge and data dependence edge DCD (cNode1, Vertex11).For example, to language The modification of sentence 25 influences whether that the method getline's of sentence 1 redirects transfer, and has influence on parameter * s and maxsize in sentence 1 Data transfer, add sentence 1 and arrive EFAGM, create control and rely on and the public side of data dependence (25,1).
K), similar to b), d), using cNode1 immediate data influence and influence node is controlled to be created g) as new analysis node ~j) all indirect datas of cNode1 influence and control control influences node, and side IDDEdge, ICDEdge are created, until not having Untill having new node and side addition.By taking the above-mentioned modification to 25 as an example, 25 modification influences whether sentence node 1, sentence section Point 1 can control influence 2, and 3,4, continuous Wave transmission (influenceing less and less), untill not new node and side add.
4) repeat 2)~3), create other modifications node cNode2 to cNoden forward direction synchronized update node and it is backward together Step influences node, and all nodes not being added in EFAGM is added thereto, create DCDEdge, ICDEdge, DDDEdge, IDDEdge。
5) the ChangeNum domains and AveDistance domains of each node in EFAGM figures are updated.The present node is made to be ActiveNode, ChangeNum value are that ActiveNode is reachable according to ParentNodeLink domains or ChildNodeLink domains Change node number.AveDistance calculating is in two steps:First, ActiveNode is calculated to each up to modification node i (i =1,2,3 ..., m) minimum range mini, because there may be mulitpath reaches modification node;Then calculate AveDistance, calculation formula areWherein, m is ChangeNum values, and i is regulation conflict number pair The influence of weight.For example, if modification node is 16 and 24, when prosthomere is 8, according to above-mentioned rule step, path 24 → 5 be present → 6 → 8,24 → 5 → 8,8 → 16,8 → 9 → 14 → 16.Because 8 pass through ParentNodeLink domains or ChildNodeLink domains Up to modification node 16,24, so ChangeNum=2.Two paths, shortest path 24 between present node 8 to 24 be present → 5 → 8, minimum range min1=2;Shortest path between node 8 to 16 is 8 → 16, minimum range min2=1, AveDistance=(2+1)/2=1.5.
6) StaticWeight of each node in EFAGM figures is calculated according to ChangeNum domains and AveDistance domains Value.It is ActiveNode to make present node, then calculation formula is:Wherein m Influence ActiveNode ChangeNum domains are represented, i (i=1,2,3 ..., m) is represented up to modification node, on EFAGM figures Show as positive or reverse reachable.Representing that the modification node of the influence to ActiveNode is more, then influence power is bigger, And increase with the modification node of influence, influence power gradually reduces,Represent that AveDistance is bigger, drill It is smaller on ActiveNode influences to change modification node, and because AveDistance is less than modification to ActiveNode influence powers The influence power of node number, we AveDistance influence power is limited in (0,1] between, i.e.,For example, same step 5), modification node is 16 and 24, when prosthomere is 8, according to the meter of step 5) Calculate, m=2, AveDistance=1.5, then StaticWeight=1+1/2+1/ (1.5+1)=1.9;If only one is repaiied Change node 16, present node is still 8, then according to above-mentioned computational methods, m=1, AveDistance=1, StaticWeight=1 + 1/ (1+1)=1.5;If only one modification node 24, present node is still 8, then StaticWeight=1+1/ (1+2) ≈1.33.Understand, impacted modification interstitial content is more, then StaticWeight is bigger, impacted modification interstitial content It is identical, and distance is nearer, StaticWeight is bigger, can be according to the big of StaticWeight when evolution modification causes failure Small order is investigated to failure.
7) DynamicWeight is calculated according to test history information.If Test Oracle still have after modification of developing Effect, the probability of evolution failure can be more accurately calculated by whether failing for test run.Its calculation formula is:
Wherein, s is with foretelling afoul test number according to test history information, and k (k=1,2,3 ..., s) is regulation Influence of the number that conflicts to weight, t are according to the test history information test number consistent with foretelling, j (j=1,2,3 .., t) It is influence of the consistent number of regulation to weight, γ is regulatory factor.Represent k-th of conflict influence of the test number to weight because Son, with the increase of test number, test the influence to weight and constantly reduce,γ∈ [0,0.5] is regulatory factor, its size by Test case scale determines, as the larger (s+t of test case>10000) when, we, which give tacit consent to, takes γ=0.5, works as k>10000 When,Its influence to weight is ignored, as the small (s+t of test case<=10000) when, we will survey Try the constantly reduction of the influence to weight to ignore, even γ=0, so, all tests are 1 to the factor of influence of weight.
For example, do not upgraded in time because the modification of sentence 9 result in sentence 16, so as to cause failure, and Test Oracle is not destroyed, and has following test information:
Cover history Prophesy
5,6,7,8,9 Unanimously
5,6,7,8,9,10,11,14,17,18 Unanimously
5,6,7,8,9,10,11,12,13,14,17,18 Unanimously
5,6,7,8,9,10,11,14,15,16 Conflict
5,6,7,8,9,10,11,12,13,14,15,16 Conflict
5,6,7,8,9,10,11,12,13,14,15,16 Conflict
Wherein, for convenience of description, we only show the sentence covering letter in the subline methods of test execution history Breath.Test case number is seldom, makes γ=0, and according to above-mentioned calculation formula, the DynamicWeight values of each sentence are as follows:
Sentence node 5,6,7,8,9 10,11,14 12,13 15,16 17,18
DynamicWeight 0.5 0.6 0.67 1 0
The DynamicWeight values of sentence 15,16 are maximum, can be faster when failure occurs navigate to sentence 16, And modification root can be traversed according to EFAGM.
8) EFAGM structure is completed.In order to intuitively represent EFAGM, we provide EFAGM caused by the modification of step 7 Figure, as shown in Figure 6.In figure, we intuitively illustrate modification node in example subline methods by EFAGM figures, influenceed Node and without artis and DCDEdge, ICDEdge, DDDEdge, IDDEdge, and give based on 6), 7) formula calculates StaticWeight and DynamicWeight thresholdings.When failure occurs, peopleware can according to StaticWeight and DynamicWeight threshold levels determine the root of failure.
Those skilled in the art of the present technique it is understood that discussed in the present invention various operations, method, flow In step, measure, scheme can be replaced, changed, combined or deleted.Further, have in the present invention and discussed Various operations, method, other steps in flow, measure, scheme can also be replaced, changed, being reset, being decomposed, being combined or Delete.Further, it is of the prior art have with the step in the various operations disclosed in the present invention, method, flow, arrange Apply, scheme can also be replaced, changed, reset, decompose, combines or be deleted.
Described above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (5)

1. a kind of software evolution process failure analysis methods, it is characterised in that comprise the following steps:
Step 1, use AST analyzers, the intermediate representation evolution accident analysis graph model EFAGM of structural evolution modification program Abstract syntax tree EFAGM_AST;
Wherein, the evolution accident analysis graph model EFAGM is two tuples<CINode,CDEdge>, wherein, CINode is Modification influences set of node, and CDEdge is modification dependence edge collection;
Step 2, changed based on developing, establish EFAGM crucial modification set of node;It is then based on the crucial modification node letters of EFAGM Breath, building the forward and backward of modification set of node successively influences node and path, is specially:
2.1) judge to develop based on cNode1.getNodeType () method and change node cNode1 node type, construction CNode1 forward direction control node, forward data node and related dependant side;The modification of present node, which can cause, controls its section The renewal of point, meanwhile, the variable modification that present node uses can cause the consistency check of variable-definition or definite value node;
2.2) structural evolution modification node cNode1 backward control node, backward back end and related dependant side;Work as prosthomere For point if control node, its modification can influence the execution of all nodes in control block;If definition or definite value in present node Variable, then it is all to concentrate the node of variable to be all affected using definition or definite value;
2.3) repeat 2.1)~2.2), creating other modification nodes cNode2 to cNoden forward direction influences node and influences backward Node, and all nodes not being added in EFAGM are added thereto, create DCDEdge, ICDEdge, DDDEdge, IDDEdge;
Step 3, the domain according to calculating EFAGM node of graph, EFAGM static factor of influence and the dynamic effects factor are generated, is completed Evolution accident analysis graph model EFAGM structure;When failure occurs, realized using EFAGM to caused by program evolution modification Accident analysis.
A kind of 2. software evolution process failure analysis methods according to claim 1, it is characterised in that
In step 1, the modification influence set of node CINode include common node BlockNode, IfNode, SwitchNode, WhileNode、DoNode、ForNode、BreakNode、ContinueNode、ReturnNode、InvocationNode、 MethodNode;
The modification dependence edge collection CDEdge=DCDEdge ∪ ICDEdge ∪ DDDEdge ∪ IDDEdge, wherein, DCDEdge is Dependence edge collection is directly controlled, ICDEdge is indirect control dependence edge collection, and DDDEdge is immediate data dependence edge collection, IDDEdge It is indirect data dependence edge collection;
The domain of EFAGM node of graph, including:
(1) ID domains:The ID marks on the node or the mark on side influenceed for modification of developing, node or side are unique;
(2) Position domains:The position of corresponding diagram node elements in a program;
(3) ParentNodeLink domains:The father node chain domain of present node, for linking the father node of present node, is easy to The forward direction traversal of EFAGM figures;If if present node variable uses be present and influenceed by multiple node variable definition or simultaneously by Forward data and control influence, then ParentNodeLink are linked into multiple father nodes, otherwise only link a father node;Currently If variable uses be present and influenceed by multiple node variable definition or influenceed by forward data and control in node simultaneously, ParentNodeLink links multiple father nodes, otherwise links a node;
(4) ChildNodeLink domains:The child nodes chain domain of present node, for linking the child nodes of present node, is easy to The backward traversal of EFAGM figures;For IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode class The ChildNodeLink domains of the condition judgment sentence of type, if or present node variable-definition or definite value be present and influence multiple The use of node, then link multiple child nodes;Otherwise a child nodes are only linked;
(5) ChangeNum, AveDistance domain:Influence the number of the modification node of present node, the minimum with modification node Distance, make m1,m2...,mnFor n in the present node and program distance for changing node, then AveDistance=(m1+m2+…+ mn)/n;
(6) StaticWeight domains:The probability that the present node that static analysis is drawn breaks down, its calculation formula areWherein m represents to influence ActiveNode ChangeNum domains, i= 1,2,3 ..., m is influence of the regulation conflict number to weight;When evolution modification causes failure, the probability of malfunction of present node Follow:
A) nearer with modification nodal distance, the probability to break down is higher;
B) the modification interstitial content being affected is more, and the probability to break down is higher;
C) node is changed as the increase of number, its influence power are gradually reduced;
(7) DynamicWeight domains:The probability to be broken down for the present node that dynamic analysis are drawn, its calculation formula are:
Wherein, s is with foretelling afoul test number according to test history information, and k=1,2,3 ..., s are regulation number of collisions Influence of the mesh to weight, t are that j=1,2,3 .., t are regulations one according to the test history information test number consistent with foretelling Influence of the number to weight is caused, γ is regulatory factor;When evolution modification causes failure, the probability of malfunction of present node follows:
A) more by the failure testing use-case of present node, the probability to break down is higher;
B) more by the successful test case of present node, the probability to break down is smaller;
C) increasing with failure testing use-case number, the probability analysis that failure occurs failure testing use-case influence smaller;
D) increasing with failure testing use-case number, the probability analysis that failure occurs success test case influence smaller.
3. a kind of software evolution process failure analysis methods according to claim 1, it is characterised in that be based in step 2 Develop and change, establishing crucial modification set of node is:When initial, the n modification node that develops is only included in EFAGM models cNode1,...,cNoden;ID and Position thresholdings are set in EFAGM figures while a node is added, are creating one ParentNodeLink and ChildNodeLink thresholdings are set while bar side;When realizing, call method ast.creatAST (replace) source program replace EFAGM_AST code trees are generated, and return to root node.
4. a kind of software evolution process failure analysis methods according to claim 1, it is characterised in that step 2.1) is specific Step is as follows:
2.1.1) node cNode1 forerunner control node ParentVertex1 is changed in extraction evolution on EFAGM_AST, ParentVertex1 node type have IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, add in ParentVertex1 to EFAGM figures, update cNode1 ParentNodeLink domains, in order to EFAGM traversing operation, and create and directly control dependence edge DCDEdge (ParentVertex1, cNode1), cNode1's repaiies ParentVertex1 modification inspection can be caused by changing;
2.1.2 ParentVertex1 direct precursor control node ParentVertex2) is extracted, is added in EFAGM figures, if Put ParentVertex1 ParentNodeLink domains, and create indirect control dependence edge ICDEdge (ParentVertex2, ParentVertex1);If because node cNode1 modification causes the generation of failure, then the cNode1 of node is suspicious Property is greater than node ParentVertex1, the ParentVertex1 dubieties of node are greater than node ParentVertex2;
2.1.3 2.1.2) is repeated), create all indirect controls and rely on nodes and corresponding edge, continuous influence of fluctuations, until by phase The node elements of pass are included;
2.1.4 the expression formula in cNode1) is extracted according to cNode1.getExpression () method, and generates expression formula variable Using collection v_use, based on EFAGM_AST, direct precursor definition or the definite value node of all variables in v_use are added In Vertex3 to EFAGM, and create data dependence side DDDEdge (Vertex3, cNode1);
2.1.5) generate expression formula variables set v1 in Vertex3, based on EFAGM_AST, add all variables in v1 it is direct before Drive in node Vertex4 to EFAGM, and create data dependence side IDDEdge (Vertex4, Vertex3);
2.1.6 2.1.5) is repeated), create all indirect datas and rely on node and corresponding edge, while need constantly to data class Type and data value synchronized update inspection, until the original definition of data type terminates;
2.1.7) if node type is WhileNode, DoNode, ForNode, the direct precursor back end of these nodes Except the control variable definite value node among the node before natural order, in addition to node control block and redirected with control node Node, it is Vertex5 to make controlling variable definite value or redirecting node in WhileBlock, DoBlock, ForBlock, is added In Vertex5 to EFAGM, and create dependence edge DCDEdge (Vertex5, cNode1);
2.1.8) if node type is MethodNode, its direct precursor node is the sentence section for calling the MethodNode Point, MethodNode modification can cause corresponding CallVertex synchronized update, based on EFAGM_AST, add and call section Point CallVertex, and create dependence edge DCDEdge (CallVertex, cNode1).
5. a kind of software evolution process failure analysis methods according to claim 1, it is characterised in that step 2.2) is specific Step is as follows:
2.2.1) if the modification node cNode1 node types that develop be IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, the then modification of these nodes can cause whether the sequential node in statement block performs, be respectively created Condition joint block IFBlock, branch node block SwitchCase, While cyclic node block WhileBlock, Do cyclic node block Sequential node under DoBlock, For cyclic node block ForBlock, called method joint block MethodBlock statement blocks Vertex1, and create and directly control dependence edge DCDEdge (cNode1, Vertex1);
2.2.2) if Vertex1 node types be IfNode, SwitchNode, WhileNode, DoNode, ForNode, MethodNode, IFBlock, SwitchCase, WhileBlock, DoBlock, ForBlock, MethodBlock is respectively created Under sentence node Vertex2, and create indirect control dependence edge ICDEdge (Vertex1, Vertex2);
2.2.3 2.2.2) is repeated) all indirect controls dependence nodes and dependence edge are created, change and constantly propagate, until common Sentence node BlockNode untill;
2.2.4 the expression formula in cNode1) is extracted according to cNode1.getExpression () method, and generates expression formula variable Definition collection v_def, based on EFAGM_AST, the immediate successor for adding all variables in v_def is arrived using node Vertex3 In EFAGM, and create data dependence side DDDEdge (cNode1, Vertex3);
2.2.5 expression formula variable-definition collection v_def1 in Vertex3) is generated, based on EFAGM_AST, adds in v_def1 and owns In immediate successor reference node Vertex4 to the EFAGM of variable, and create data dependence side IDDEdge (Vertex3, Vertex4);
2.2.6 2.2.5) is repeated), create all indirect datas and rely on node and corresponding edge, until the definite value of not new variable Untill modification;
2.2.7) if node type is ReturnNode, this node control returns to method, travels through EFAGM_AST, adds The node Vertex5 of method where calling ReturnNode nodes, establishment data dependence side DDDEdge (cNode1, Vertex5);
2.2.8) if node type is BreakNode, EFAGM_AST is traveled through,
If the sentence node in WhileNode, DoNode, ForNode where cNode1 is Vertex6, BreakNode's Modification directly decides whether Vertex6 performs, and creates control dependence edge DCD (cNode1, Vertex6);Meanwhile The follow-up sentence of BreakNode in WhileBlock, DoBlock, ForBlock also directly by BreakNode, ContinueNode control, EFAGM_AST is traveled through, it is Vertex7 to make follow-up sentence, adds Vertex7 nodes to EFAGM In, and create (cNode1, Vertex7);
It is next in cNode in BreakNode control statement blocks if the statement block where cNode1 is SwitchCase Sentence before BreakNode, EFAGM_AST is traveled through, make the follow-up sentence for the cNode1 that Vertex8 is place statement block arrive down Sentence before one BreakNode, create DCD (cNode1, Vertex8);
2.2.9) if node type is ContinueNode, EFAGM_AST is traveled through, if WhileNode where cNode1, Sentence node in DoNode, ForNode is Vertex9, then ContinueNode modification, which directly decides, redirects Vertex9 Execution, create control dependence edge DCD (cNode1, Vertex9);Meanwhile in WhileBlock, DoBlock, ForBlock ContinueNode whether performing for follow-up sentence is also controlled by ContinueNode, is traveled through EFAGM_AST, is made follow-up language Sentence is Vertex10, adds Vertex10 nodes into EFAGM, and create (cNode1, Vertex10);
2.2.10) if node type is InvocationNode, EFAGM_AST is traveled through, makes the call method node be Vertex11, add Vertex11 to EFAGM in, and create control dependence edge and data dependence edge DCD (cNode1, Vertex11);
2.2.11) influence and control to influence node as new analysis node using cNode1 immediate data, create 2.2.7)~ 2.2.10 all indirect datas of cNode1) influence and control control influences node, and create side IDDEdge, ICDEdge, directly Untill not new node and side add.
CN201410623526.5A 2014-11-08 2014-11-08 A kind of software evolution process failure analysis methods Expired - Fee Related CN104461867B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410623526.5A CN104461867B (en) 2014-11-08 2014-11-08 A kind of software evolution process failure analysis methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410623526.5A CN104461867B (en) 2014-11-08 2014-11-08 A kind of software evolution process failure analysis methods

Publications (2)

Publication Number Publication Date
CN104461867A CN104461867A (en) 2015-03-25
CN104461867B true CN104461867B (en) 2018-04-03

Family

ID=52907956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410623526.5A Expired - Fee Related CN104461867B (en) 2014-11-08 2014-11-08 A kind of software evolution process failure analysis methods

Country Status (1)

Country Link
CN (1) CN104461867B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105843614B (en) * 2016-03-22 2019-03-05 东南大学 A kind of code compatibility appraisal procedure that software-oriented develops
CN105893257B (en) * 2016-03-30 2018-05-29 东南大学 A kind of software architecture appraisal procedure based on evolution
CN108509338A (en) * 2018-03-17 2018-09-07 东南大学 A kind of Software Evolution assessment system and method based on multi-level analysis on altered project
CN115794196B (en) * 2023-02-13 2023-06-30 中科南京软件技术研究院 Method, device, equipment and storage medium for identifying key software of edge X

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6035377A (en) * 1997-12-17 2000-03-07 Ncr Corporation Method and apparatus for determining memory pages having greatest frequency of access in a non-uniform memory access computer system
CN1672362A (en) * 2002-07-30 2005-09-21 思科技术公司 Method and apparatus for outage measurement

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6035377A (en) * 1997-12-17 2000-03-07 Ncr Corporation Method and apparatus for determining memory pages having greatest frequency of access in a non-uniform memory access computer system
CN1672362A (en) * 2002-07-30 2005-09-21 思科技术公司 Method and apparatus for outage measurement

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于条件执行切片谱的多错误定位;文万志等;《计算机研究与发展》;20131231;第50卷(第5期);第1030-1043页 *

Also Published As

Publication number Publication date
CN104461867A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
CN104461867B (en) A kind of software evolution process failure analysis methods
Montanari et al. On propositional interval neighborhood temporal logics
Gruhn et al. What business process modelers can learn from programmers
Tsantalis et al. Identification of extract method refactoring opportunities
Yu et al. Maintaining invariant traceability through bidirectional transformations
CN102915271A (en) Method for optimizing unit regression test case set based on control flow diagram
Asztalos et al. Towards automated, formal verification of model transformations
EP0261845A2 (en) Data processing apparatus for extracting documentation text from a source code program
Aranega et al. Towards an automation of the mutation analysis dedicated to model transformation
CN110362310A (en) A kind of code syntax errors repair method based on incomplete abstract syntax tree
CN107193745A (en) Automated construction method of the PLC program to NuSMV input models
Domshlak et al. Symmetry breaking: Satisficing planning and landmark heuristics
Hu et al. DeepGraph: A PyCharm tool for visualizing and understanding deep learning models
CN105487983B (en) Sensitive spot approach method based on intelligent Route guiding
Cristea et al. The LAG grammar for authoring the adaptive web
CN105389434B (en) Reliability evaluation method for multi-fault-mode cloud computing platform
Leuschel et al. Coverability of reset Petri nets and other well-structured transition systems by partial deduction
Leroy Mechanized semantics for compiler verification
CN104216703A (en) Development method of embedded software system program
Anjorin et al. A static analysis of non-confluent triple graph grammars for efficient model transformation
Kim et al. Execution of natural language requirements using State Machines synthesised from Behavior Trees
Le Borgne et al. Formal requirements engineering for smart industries: toward a model-based graphical language
CN116431516A (en) Program statement selection method and system for mutation test
CN100451969C (en) Method for recognizing composite conditional branch structure
Leuştean et al. A many-sorted polyadic modal logic

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190704

Address after: Room 01, 1st Floor, 21 Building, Yuquan Huigu, No. 3 Minzhuang Road, Haidian District, Beijing, 100195

Patentee after: SPACE CQC ASSOCIATE SOFTWARE TESTING AND EVALUATING TECHNOLOGY (BEIJING) CO.,LTD.

Address before: 100080 Beijing Haidian District Haidian South Road A 21 Zhongguancun Intellectual Property Building A 5th floor 501

Patentee before: SUNSHINE INTELLECTUAL PROPERTY (GROUP) CO.,LTD.

Effective date of registration: 20190704

Address after: 100080 Beijing Haidian District Haidian South Road A 21 Zhongguancun Intellectual Property Building A 5th floor 501

Patentee after: SUNSHINE INTELLECTUAL PROPERTY (GROUP) CO.,LTD.

Address before: 226019 No. 9 Siyuan Road, Nantong City, Jiangsu Province

Patentee before: Nantong University

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

Granted publication date: 20180403

Termination date: 20191108