Any good tool to generate dependency diagram?
Input: any simple format (not always source code) to describe dependency relation of several items. E.g. A depends on B, C; C depends on D, E ...
Output: nicely organized dependency diagram.
Any good tool to generate dependency diagram?
Input: any simple format (not always source code) to describe dependency relation of several items. E.g. A depends on B, C; C depends on D, E ...
Output: nicely organized dependency diagram.
Doesn't Doxygen generate dependency diagrams (if you have Graphviz as well)? I always thought it did; it does various other diagrams to be sure.
Graphviz is what you need. (examples: click on each picture to see the code in DOT grammar that was used to generate the graph). It can handle directed and undirected graphs.
(BTW: doxygen uses graphiz to generate its graphs output)
If you can make your input conform to XMI format then most UML programs should do what you want. I've done it myself using ArgoUML.
Example of XMI:
<?xml version = '1.0' encoding = 'UTF-8' ?>
<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Fri Feb 15 16:08:20 EST 2008'>
<XMI.header> <XMI.documentation>
<XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
<XMI.exporterVersion>0.24(5) revised on $Date: 2006-11-06 19:55:22 +0100 (Mon, 06 Nov 2006) $ </XMI.exporterVersion>
</XMI.documentation>
<XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>
<XMI.content>
<UML:Model xmi.id = '-112--125--96-50--66baa94d:1181b7c0451:-8000:000000000000077B'>
<UML:Namespace.ownedElement>
<UML:Class xmi.id = '-112--125--96-50--66baa94d:1181b7c0451:-8000:000000000000077E'/>
<UML:Class xmi.id = '-112--125--96-50--66baa94d:1181b7c0451:-8000:0000000000000780'/>
<UML:Association xmi.id = '-112--125--96-50--66baa94d:1181b7c0451:-8000:0000000000000782'>
<UML:Association.connection>
<UML:AssociationEnd xmi.id = '-112--125--96-50--66baa94d:1181b7c0451:-8000:0000000000000783'>
<UML:AssociationEnd.participant>
<UML:Class xmi.idref = '-112--125--96-50--66baa94d:1181b7c0451:-8000:000000000000077E'/>
</UML:AssociationEnd.participant>
</UML:AssociationEnd>
<UML:AssociationEnd xmi.id = '-112--125--96-50--66baa94d:1181b7c0451:-8000:0000000000000786' isNavigable = 'true'>
<UML:AssociationEnd.participant>
<UML:Class xmi.idref = '-112--125--96-50--66baa94d:1181b7c0451:-8000:0000000000000780'/>
</UML:AssociationEnd.participant>
</UML:AssociationEnd>
</UML:Association.connection>
</UML:Association>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
</XMI>
I don't have names specified in here but from memory they're quite simple.
Graphviz. Took me like 20mins of learning to visualize my first graph.
You would probably want to try graphviz as what other said. To test-drive graphviz, you may visit this site Ajax/Graphviz.
You can copy and paste this simple code to the site and see the generated graph
digraph {
a->b;
b->c;
c->d;
c->e;
}
There are more things that can be played around, try search for a tutorial, i got mine in pdf format titled Drawing graphs with dot (Emden Gansner and Eleftherios Koutsofios and Stephen North) dated January 26, 2006.. which is very detailed.
This is just another example to show a FSM-variant
digraph {
rankdir=TD;
node [shape=ellipse style=filled fillcolor=skyblue];
// States
0 [ label = "NEW", peripheries = 2 ];
00 [ label = "DELETED", peripheries = 2 ];
draft [ label = "draft (1)\n(authenticated user, editor)" ];
submitted [ label = "submitted (2)\n(authenticated user, editor)" ];
published [ label = "published (3)\n(authenticated user, editor)", peripheries=2 ];
rejected [ label = "rejected (4)\n(authenticated user, editor)" ];
// Transitions
0 -> draft [ label = "write_draft (write draft) (1)\n(authenticated user)" ];
draft -> submitted [ label = "submit_draft (submit draft) (2)\n(authenticated user)" ];
submitted -> published [ label = "publish_submission (published submitted) (3)\n(editor)" ];
submitted -> rejected [ label = "reject_submission (reject_submission) (4)\n(editor)" ];
rejected -> 00 [ label = "delete (Delete the article) (5)\n(editor)" ];
}
As others said, Graphiz is really good way to go. However, you may want to have some automatic tools that generates such kind of information from your source code. It is possible. For Python there is an existing tool, for others I don't know. Just a tip.
NDepend comes with a dependency graph coupled with a dependency matrix. You can try NDepend straight on your code thanks to a Free Trial Edition. See screenshoots extracted from this blog post: Interactive Code Dependencies Graph
Visual Studio 2010 Ultimate supports creating dependency graphs from .NET code:
How to: Generate Graph Documents from Code: http://msdn.microsoft.com/en-us/library/dd409453%28VS.100%29.aspx#SeeSpecificSource
You can use Visual Studio Ultimate to explore the relationships and organization in existing code by generating directed graph documents. These graphs represent code elements and their relationships as a set of nodes that are connected by links, or edges. You can use these graphs to help you visualize, explore, and analyze code.
How to: Find Code Using Architecture Explorer: http://msdn.microsoft.com/en-us/library/dd409431%28VS.100%29.aspx
You can select vertical sections or "slices" of code that you want to visualize by using Architecture Explorer. You can explore source code in a Visual Studio solution or compiled managed code in .dll files or .exe files. You can use Architecture Explorer to browse other domains by installing additional providers. When you find the code that you want to visualize, you can generate graphs to explore the relationships in that code.
RC download: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=457bab91-5eb2-4b36-b0f4-d6f34683c62a.
Visual Studio 2010 Architectural Discovery & Modeling Tools forum: http://social.msdn.microsoft.com/Forums/en-US/vsarch/threads
Lately I have been using yuml.me, which has some nice features including several diagram types and short URLs.
For example, this URL: http://yuml.me/diagram/scruffy/class/[A]->[B], [B]->[C]
.