/dynamic_code_analyzer

Dynamic code analyzer for Java Language

Primary LanguageHTML

Dynamic code analyzer for Java Language

This project to build a dynamic code analyzer for Java Language to generate statement and branches code coverage reports.


To build the dynamic code analyzer we followed the following steps:


Step 1: Take a java file as an input for program by defining the path of the file.

path: test_examples/HelloWorld.java

step 1 demo


Step 2: Output a modified intermediate java file (augmented code).

path: augmented_files/HelloWorldAugmented

step 2 demo


Step 3: Run the modified augmented java file to know which blocks of the code are visited then store the visited block at text file.

path: visited_blocks/HelloWorldAugmentedVisitedBlocks.java

step 3 demo

Note:

  • Green lines are highlighted for visited lines.
  • Orange lines are highlighted for branches (if/else/for/while) if the boolean expression has more than one condition, like a || b, and the first condition always evaluate to true, this means that the second condition b never executed.
  • Red lines are highlighted for not visited lines.

Step 4: Use the text file from the previous step to generate an HTML file with highlighted red, green and orange lines as program output.

step 4 demo


Team members