4

Trying to see if there is a tool to capture flow within a single Java method in a diagram.

Consider for example

public void getXXX(String y, String z) {
   if (y.equals("proceed")) {
      ....
   }
   else {
     if (z.equals("proceed")) {
       ....
     }
     else {
      ....
     }
      ----do some processing
   }

}

I am looking for tool that would convert the flow within this method getXXX to a diagram.

A) I am not familiar with UML, normally we use flowcharts. Is there an equivalent diagram in UML. - activity?

B) Based on the results given by A) - is it possible in Eclipse to generate that diagram from CODE. C) If it is not possible to generate using Eclipse, are there any tools that will take the CODE and generate the specified diagram

3 Answers 3

0

Take a look at these two tools:
1. Code Rocket For Eclipse
2. codeswat.com

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for the reply. Which diagram in UML gives the flow within a method.
Activity Diagrams in UML provide similar notations to flowcharts and are preferred over them as they have more standard notation.
0

The fUML spec from the OMG maps activities to Java. I think it also goes the other direction. There is an open source reference implementation available. Activity diagrams are what you are looking for. Moreover, you may want to look into ALF, which is a more powerful language that is isomorphic with UML activities. With ALF, you must go out of your way to serialize control flow in your program. That's pretty cool. It also has an open source reference implementation.

Comments

0

I think you can look for a tool to visualize the Cyclomatic Complexity or Static code analyzers.

Checkout Eclipse Source Code Analyzers like ModelGoon UML4Java.

And here is another similar question: Static analysis of Java call graph.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.