llmhyy / microbat

A feedback-based debugger for interactively recommending suspicious step in buggy program execution.
54 stars 15 forks source link
debugger-visualizer feedback time-travelling

Microbat Debugger

A feedback-based debugger for interactively recommending suspicious step in buggy program execution.

Snapshot of Microbat

Microbat is a feedback-based debugger which aims to locate bugs by interactively recommending suspicious program steps with developers' feedback. Given a buggy program, Microbat records its execution trace and allow developers to make light-weight feedback on trace steps, such as correct-step, wrong-variable-value, wrong-path, and unclear. Microbat reasons and analyzes the feedback along with program information to recommend a suspicious step for further inspection and feedback. Such a debugging process continues until the bug is found. A short demonstration of Microbat is available in http://linyun.info/microbat/index.html.

Feedback Type

We support four types of feedback, i.e., correct-step, wrong-variable-value, wrong-path, and unclear. Based on these types of feedback, we iteratively and interactively recommend suspicious steps on recoreded trace.

Evaluation

Our evaluation on Microbat shows promising results. The detailed evaluation results can be checked at http://linyun.info/microbat/index.html

Citation

If you need to reference our technique, please use the following citations:

Installation

Our debugger can be divided into two parts: trace collector and the bug inference engine. Two parts are presented in terms of an Eclipse plugin.

  1. After you clone the git repository, you need to load the microbat repository into eclipse (as the tool is manifested by Eclipse plugin). We recommend that the user should import the project through "Git perspective".

  2. Given our trace collector is implemented through Java instrumentation technique, the user need to run microbat.tools.JarPackageTool. Please modify the DEPLOY_DIR by your $eclipse_root_folder\dropins\junit_lib. After running the code, you will generate an instrumentator.jar under the DEPLOY_DIR folder. More details can be refer to https://github.com/llmhyy/microbat/wiki/Compile-Runtime-Agent.

  3. Remember to replace the instrumentaor.jar in the lib folder under microbat project.

  4. You may run the code as an Eclipse Application then.

Run with Java main() method

Run with test method

Alternatively, we also support users (i.e., programmers) to run Microbat with JUnit4, JUnit5 and TestNG test cases. In this case, we need to package the project of "microbat_test_runner" and export it as a jar file "testrunner.jar". Moreover, we provide five jar files, i.e., junit.jar, org.hamcrest.core.jar, junit-platform-console-standalone-1.0.0.jar, testng-6.0.jar and junit-platform-runner-1.0.0.jar.

Place the testrunner.jar, the five jar files in junit_lib mentioned above into the path eclipse_root_folder\dropins\junit_lib\

We can use the following configuration to have the trace of a test method.