I am currently working on a project in which I need to run JUnit test cases and then extract information from the Target Class (class being tested). To extract the statements covered I have used eclEmma, but using this tool I am only able to extract the line numbers which were executed in the Target after running the test class.
I want to extract the Boolean values of branch decisions in the if-statements to derive which conditions are verified when covering a specific true/false branch of the Target Class.
I know that I can parse the Java file using JavaParser and then extract the following information, but I am not sure how to extract the boolean value of the branch decision.
public void visit(IfStmt stmt, Void arg)
{
System.out.println(stmt.getCondition());
System.out.println(stmt.getElseStmt());
System.out.println(stmt.getThenStmt());
super.visit(stmt, null);
}