-
Notifications
You must be signed in to change notification settings - Fork 15
Debuggin On Belief Propagation
Debugging a program using Belief Propagation does not rely on other passing/failing runs. It aims to couple human-like reasoning with program semantics based analysis. This technique model the debugging processs as a probabilitistic inference problem. For more detials, please refer to the paper
The following are the step by step guileline on how to debug using Belief Propagation
- Ensure that there is a trace in the
Trace View
, because Microbat will only analize the trace in theTrace View
.
-
Since our belief propagation is implemented using python, you need to start the python server.
- Open
microbat\microbat\Python_Server\BeliefPropagation_Server\BP_Server.ipynb
usingJupyter Notebook
- Run every cell in
BP_Server.ipynb
, make sure that thestartServer()
function is running:
- Open
-
Provide the information of the input and output variables.
- Input variables are the variable that you sure that is correct.
- Output variable are the variable that you sure that is wrong.
- For example, for the assertion such as
assertEquals(0, function(x))
, the input variable will bex
and the output variable will be the return value offunction(x)
- Enter the trace node that contain the input variables
- Check all the variable that you think is correct in the
Debug Feedback View
- Click the
Inputs
button to submit the selection
- Enter the trace node that contain the output variables
- Check all the variable that you think is wrong in the
Debug Feedback View
- Click the
Outputs
button to submit the selection
- There is a
IO
button inDebug Feedback View
and it will print out the selected input and output variables in console after you click it.
- There is a
Clear IO
button inDebug Feedback View
. If you select the variable mistakenly, you need to erase all the variable by clicking this button and select again.
-
After selecting the input and output variable, you may click the green button on toolbar to run the belief propagation:
-
After getting result from the python server, Microbat will jump to the node that belief propagation think is the most posible node to be the root cause. Please give the feedback accordingly:
-
Correct
: If the node is correct, please check theyes
button and click theBaseline
button to submit the feedback. -
Wrong Path
: If the node is in the wrong flow, please check theWrong-Flow
button and click theBaseline
button to submit the feedback. -
Wrong Variable
: If the node contain wrong variable, please check out those wrong variable inVariable List
and also check theWrong-Var
button. Finally, please click theBaseline
button to submit the feedback -
Root Cause Found
: If the node turned out to be the root cause that cause the error, please click theRoot Cause
button to end the debugging process.
-
If you are trying to re-run the Beleif Propagation, please make sure to generate the trace again, instead of clicking the green button again. Since the implementation of Beleif Propagation may change the details of trace node, running it twice continuously may cause error.
- Xu, Zhaogui, et al. "Debugging with intelligence via probabilistic inference." Proceedings of the 40th International Conference on Software Engineering. 2018.
- Our implementation of belief propagation is based on krashkov