fault localization using bayesian belief network(bbn)_new

Post on 11-Dec-2015

239 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

presentation on

TRANSCRIPT

Prediction Of Residual defects in a Software Using Bayesian Belief Network(BBN)

Bayesian Belief Network(BBN)

Definition

• Bayesian Belief Network(BBN) : BBN is a composition of Directed Acyclic Graph(DAG) and Conditional Probability Distribution(CPD).• DAG(Directed Acyclic Graph): DAG is a graphical structure

of BBN.• Nodes: Nodes are Random variables which may discrete

or continuous.• Arcs: Arcs represents probabilistic dependencies

between random random variables or nodes.

Definition

• Conditional Probability distribution(CPD):

- CPDs are a parameters of BBN. - At each dependent node conditional probability is

calculated and store it in a table called Conditional Probability Table(CPT).

P() is CPD of where is set of parents of .

- At each independent node CPD is calculated just using prior

probability of that node. here P() = P() .

•  

Some Concepts On Probability

• Probability distribution P(X|x)

X is a random variable- Discrete- Continuous

x is background state of information

Discrete Random Variables

• Finite set of possible outcomes

If X binary:

0)( ixP

1)(1

n

iixP

1)()( xPxP

nxxxxX ,...,,, 321

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

X1 X2 X3 X4

Continuous Random Variable

• Probability distribution (density function) over continuous values

5     7

10

0

1)( dxxP

10,0X 0)( xP

7

5

)()75( dxxPxP

)(xP

x

More Probabilities

• Joint probability

• Probability that both X=x and Y=y

• Conditional probability

• Probability that X=x given we know that Y=y

)(),( yYxXPyxP

)|()|( yYxXPyxP

Bayesian Approach To Probability

• Bayesian Probability : A person’s degree of belief in event X. Personal probability.

• Unlike classical probability, Bayesian probabilities benefit from but do not require repeated trials - only focus on next event.

Bayes Rule

• All classification methods can be seen as estimates of Bayes’ Rule, with different techniques to estimate P(evidence|Class).

Product Rule:

Equating Sides:

i.e.

P A B P A B P B

P A B P B A P A

|

|

P B AP A B P B

P A|

( | ) ( )

( )

P Class evidenceP evidence Class P Class

P evidence|

( | ) ( )

( )

Belief Computation

• Two types. Both are NP-Hard problem.• Belief Revision•Model explanatory/diagnostic tasks• Given evidence, what is the most likely hypothesis to explain the evidence?

• Belief Updating• Queries• Given evidence, what is the probability of some other random variable occurring?

Belief Revision

• Given some evidence variables, find the state of all other variables that maximize the probability.

Belief Updating: Inference• The probability computation of a desirable node or query variable given a model is known or evidence as probabilistic inference

Find P(Q=q|E= e)• Q the query variable• E set of evidence variables

X1,…, Xn are network variables except Q, EP(q | e) =

P(q, e)P(e)

P(q, e) =S     P(q, e, x1,…, xn) x1,…, xn

Types Of Inference

• Causal Inferences

• Diagnostic Inferences

• Inter-causal Inferences

• Mixed Inferences

Q E

Q

E

E EQ

E Q

Example Of BBN

Burglary Alarm Example

Burglary Earthquake

Alarm

John Calls Mary Calls

P(B)0.001

P(E)0.002

B  E P(A)T  T 0.95T  F 0.94F  T 0.29F  F 0.001

A P(J)T 0.90F 0.05

A P(M)T 0.70F 0.01

Causal InferencesInference from cause to effect. E.g. Given a burglary, what is P(J|B)?

P(M|B)=0.67 via similar calculations

Burglary Earthquake

Alarm

John Calls Mary Calls

P(B)0.001

P(E)0.002

B  E P(A)T  T 0.95T  F 0.94F  T 0.29F  F 0.001

A P(J)T 0.90F 0.05

A P(M)T 0.70F 0.01

85.0

)05.0)(06.0()9.0)(94.0()|(

)05.0)(()9.0)(()|(

94.0)|(

)95.0)(002.0(1)94.0)(998.0(1)|(

)95.0)(()()94.0)(()()|(

?)|(

BJP

APAPBJP

BAP

BAP

EPBPEPBPBAP

BJP

Diagnostic InferencesFrom effect to cause. E.g. Given that John calls, what is the P(burglary)?

What is P(J)?  Need P(A) first:

Many false positives.

)(

)()|()|(

JP

BPBJPJBP

002517.0)(

)001.0)(999.0)(998.0()94.0)(998.0)(001.0(

)29.0)(002.0)(999.0()95.0)(002.0)(001.0()(

)001.0)(()()94.0)(()(

)29.0)(()()95.0)(()()(

AP

AP

EPBPEPBP

EPBPEPBPAP

052.0)(

)05.0)(9975.0()9.0)(002517.0()(

)05.0)(()9.0)(()(

JP

JP

APAPJP 016.0)052.0(

)001.0)(85.0()|( JBP

Inter-causal InferencesExplaining Away Inferences.

Given an alarm, P(B|A)=0.37. But if we add the evidence thatearthquake is true, then P(B|A^E)=0.003.

Even though B and E are independent, the presence ofone may make the other more/less likely.

Mixed Inferences

Simultaneous inter-causal and diagnostic inference.

E.g., if John calls and Earthquake is false:

Computing these values exactly is somewhat complicated.

017.0)^|(

03.0)^|(

EJBP

EJAP

Other Query(Inference) Methods• Exact Algorithms

• Enumeration• Belief propagation in poly-trees• Variable elimination• Clustering / join tree algorithms

• Approximate Algorithms

• Stochastic simulation / sampling methods• Markov chain Monte Carlo methods• Genetic algorithms• Neural networks• Simulated annealing• Mean field theory

Applications Of BBN

•Medical expert systems• Pathfinder• Parenting MSN• Fault diagnosis• Ricoh FIXIT • Decision-theoretic troubleshooting• Vista• Collaborative filtering

Approach

Find fault probability of each method in the class

Find fault probability of each class due to invocation of faulty methods and 

Construct BBN 

Find failure probability of each use case from BBN  

Rank all use case in decreasing order according to failure probability

1 2

34

Find fault probability of each method in the class

• Find fault probability of each method using various test metrics.

Find fault probability of each class due to invocation of faulty methods and Construct BBN • Find fault probability of each class due to invocation of faulty methods using conditional probability.

• Then construct the Bayesian belief network between classes.

Find failure probability of each use case from BBN

• Now find the failure probability of each use case using Bayesian Probability Theory

Rank all use case in decreasing order according to failure probability

• Now Rank failure probability of all use case in decreasing order.

• Then make test effort plan.

top related