- You should have Java installed, We used Intelj to devolp this project and we used Antlr4 and commons-io-2.11.0.
Just input the path for the Java code that needed to be analyzed, and you'll get a html page and a text file where you can find the follwing:
- For every block that's excted we write the no.of the block into the output.text file.
- If the HTML page, the excuted code will be colered in green and the blocks that weren't excuted (uncalled function for example) will be in pink.
- If there were a branch coverage case it will be colored orange in the HTML page.
You can see an example in the images bellow bellow:
INPUT
As Input shown, IF function contains another IF which have an Print function. Our Purpose is to put \blocknumber + "number of this block" in each new statment, as shown in the output.
OUTPUT
In our main file: main.java We use:
1- We use Walker to know how to walk through the tree and point to specific position to write before or after this position:
2- We use 2 Rewritter to write in the out.java and new.html, the out.java is a augmented code that writes the style.css, which adds the right colors to the HTML page that shows as an output of our program.
3- we run the out.java directly from our main, and out.java directly run the HTML page on the default browser of your device.