在 Java 中可视化代码流的工具?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/153414/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tool to visualize code flow in Java?
提问by dacracot
回答by Joshua
IBM has an old (2004) structure analysis toolthat does some visualization of Java code.
IBM 有一个旧的(2004 年)结构分析工具,可以对 Java 代码进行一些可视化。
Netbeans'UML does a decent job reverse engineering the code too.
Netbeans 的UML 对代码进行逆向工程也做得不错。
回答by KarolDepka
Maybe Ctrl+ Alt+ Hin Eclipse / IntelliJ IDEA ? (albo present in NB somewhere) Or "data flow from/to" in IntelliJ IDEA?
也许Ctrl+ Alt+H在Eclipse / IntelliJ IDEA的?(albo 出现在 NB 某处)或者 IntelliJ IDEA 中的“数据流自/到”?
回答by Pascal Thivent
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.
在 UML 2 中有两种基本类别的图:结构图和行为图。每个 UML 图都属于这两个图类别之一。结构图的目的是显示被建模系统的静态结构。它们包括类、组件和/或对象图。另一方面,行为图显示系统中对象之间的动态行为,包括它们的方法、协作和活动等。示例行为图是活动图、用例图和序列图。
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.
在这里,我的理解是 OP 要求一种工具来可视化代码流(这是问题的标题),即动态行为。一个完美的图表是序列图。
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++).
但是,AFAIK,无论是 UML 逆向工程工具还是 Doxygen 都无法从来源中找出此类图表。这些工具知道如何生成结构图(例如类图),但不知道如何生成行为图(这需要执行)。所以这些工具不能回答这个问题(即使对于 C++)。
IMO, to visualize the code flow, you'll have to look at the call hierarchy as someone pointed out.
IMO,要可视化代码流,您必须查看有人指出的调用层次结构。
回答by Artur Zielazny
My favorite one was Creole. Unfortunately last update was made on August 10, 2007... but still it is worth trying.
我最喜欢的是克里奥尔语。不幸的是,最后一次更新是在 2007 年 8 月 10 日进行的……但仍然值得一试。
Another option, but more for the architecture visualization than code flow, is Structure101, which is a great tool and absolutely worth to check out.
另一种选择,但更多的是用于架构可视化而不是代码流,是 Structure101,这是一个很棒的工具,绝对值得一试。
回答by Fredy Bello
I have tested this and is AWESOME for automatic sequence diagram generation
我已经对此进行了测试,并且非常适合自动序列图生成
回答by kenglxn
HandyEdit has made a plugin that does exactly this: http://plugins.intellij.net/plugin/?id=3739
HandyEdit 制作了一个插件,可以做到这一点:http://plugins.intellij.net/plugin/?id=3739
回答by Raposo
http://code.google.com/p/jtracert/was discontinued. The link for new project is: https://github.com/bedrin/jsonde
http://code.google.com/p/jtracert/已停止使用。新项目的链接是:https: //github.com/bedrin/jsonde
回答by Nigel Hawkins
Source Navigator says it does Java, though I've only ever used it for C/C++ myself. http://developer.berlios.de/projects/sourcenav
Source Navigator 说它支持 Java,尽管我自己只将它用于 C/C++。 http://developer.berlios.de/projects/sourcenav