Tool to visualize code flow in Java? [closed]

2019-03-08 14:54发布

问题:

I'm inspired by the C/C++ question for a code flow visualization tool.

Is there such a thing for Java servlets or applications?

回答1:

Maybe Ctrl + Alt + H in Eclipse / IntelliJ IDEA ? (albo present in NB somewhere) Or "data flow from/to" in IntelliJ IDEA?



回答2:

http://code.google.com/p/jtracert/ was discontinued. The link for new project is: https://github.com/bedrin/jsonde



回答3:

If found that doxygen works for Java also.



回答4:

Source Navigator says it does Java, though I've only ever used it for C/C++ myself. http://developer.berlios.de/projects/sourcenav



回答5:

JBuilder's UML view goes some of the way



回答6:

IBM has an old (2004) structure analysis tool that does some visualization of Java code.

Netbeans' UML does a decent job reverse engineering the code too.



回答7:

HandyEdit has made a plugin that does exactly this: http://plugins.intellij.net/plugin/?id=3739



回答8:

You mean something like Jeliot and jGrasp?



回答9:

I have tested this and is AWESOME for automatic sequence diagram generation

https://github.com/bedrin/jsonde



回答10:

In UML 2 there are two basic categories of diagrams: structure diagrams and behavior diagrams. Every UML diagram belongs to one these two diagram categories. The purpose of structure diagrams is to show the static structure of the system being modeled. They include the class, component, and or object diagrams. Behavioral diagrams, on the other hand, show the dynamic behavior between the objects in the system, including things like their methods, collaborations, and activities. Example behavior diagrams are activity, use case, and sequence diagrams.

Here, my understanding is that the OP is asking for a tool to visualize code flow (this is the title of the question), i.e. dynamic behavior. A perfect diagram for this would be the sequence diagram.

But, AFAIK, neither UML reverse engineering tools nor Doxygen can figure out such diagrams from sources. These tools know how to generate structure diagrams (e.g. class diagram), but not behavior diagrams (this would require execution). So these tools doesn't answer the question (even for C++).

IMO, to visualize the code flow, you'll have to look at the call hierarchy as someone pointed out.



回答11:

My favorite one was Creole. Unfortunately last update was made on August 10, 2007... but still it is worth trying.

Another option, but more for the architecture visualization than code flow, is Structure101, which is a great tool and absolutely worth to check out.



回答12:

Check out Onyem JTracer The tool automatically generates execution flow diagrams by analysis of your java program. I have used it with a relatively large codebase as well.



回答13:

Heatlamp will visualize running Java code. It can also visualize Java stack traces.



回答14:

I think Zeta Code seeks to do this.