Debugging - llmhyy/evosuite-plus-plus GitHub Wiki
Timeout for Executing a Test
Properties.TIMEOUT allows us to debug the instrumented code, otherwise, eclipse debugger will stuck. We can set breakpoints in org.evosuite.testcase.execution.ExecutionTracer to check running details.
Decompiling Java Bytecode Methods and Testing Tests
In our experiment, SF100 dataset only provides Java bytecode (FYI, the authors of Evosuite do provide the source code, however, we observe that sometimes the provided source code cannot well match the bytecode). Fortunately, the techniques to decompile Java bytecode grow more mature than ever. Here, we recommend a practice to investigate the bytecode information via a set of Eclipse plugin.
Given a latest Eclipse version (e.g., 2020-06 (4.16.0)), we can open its Eclipse Market and search "Java decompiler". Usually, I will use the first option, i.e., "Enhanced Class Decompiler 3.1.1", which integrates four decompilers, namely, JD, Jad, FernFlower, CFR, and Procyon. Any decompiler can do the trick.
After installing the Eclipse plugin, you can import a Jar file into an Eclipse project. Then, you can observe and search the Java bytecode class in the project.
Permission of SUT (Software under Test)
Some functions of the SUT are about GUI and audio. Evosuite (and Evosuite++) does not allow the SUT to have such permission by setting MSecurityManager
. We can modify the code in MSecurityManager
to allow more permissions for SUT.
You can set up the preference
option in eclipse to choose which decompiler to use, when you need to show the line number, etc.
It would be very convenient.
Good luck!