Tutorial :Sequence Diagram Reverse Engineering


I'm looking for a tool that will reverse engineer Java into a sequence diagram BUT also provides the ability to filter out calls to certain libraries.

For example, the Netbeans IDE does a fantastic job of this but it includes all calls to String or Integer which clutter up the diagram to the point it is unusable.

Any help is greatly appreciated!!!!!!!


I think jtracert is what you are looking for. It generates a sequence diagram from a running Java program. Also, because its output is a text description of the diagram (in the formats of several popular SD tools), you can use grep to filter for only the classes you are interested in.


I believe the perfect tool to solve your problem is Diver: Dynamic Interactive Views For Reverse Engineering. It provides both static and dynamic sequence diagrams and looks to solve all your requirements from your question.

It is a plugin for Eclipse and lets you:

  • Easily trace your Java programs
  • Visualize your program’s runtime functionality
  • Filter your traces to make them more compact
  • Filter your IDE based on what occurs at runtime
  • See what code ran in your source code editors

It's on Github and there is also a project web site

Full Disclosure: I am the current project lead for Diver


Try MaintainJ. MaintainJ generates sequence diagrams at runtime for a use case. It provides multiple ways to filter out unwanted calls. Yes, filtering out unwanted calls is the most important feature needed in sequence diagram generating tools. Besides, MaintainJ provides a neat interface to explore the diagram and search for calls in one use case or across use cases.

Check the demo video to get a quick overview.

I am the author of MaintainJ, by the way.


JTracert is now discontinued. In place, they recommend http://www.jsonde.com/


I have a tool that meets your requirements exactly. Check it out


In addition to being a reverse engineering tool for java it is also very lightweight. You can control the what you want to record from your java program.


Enterprise architect from Sparx claims to be able to reverse engineer java code including generating sequence diagrams - see this section of the user guide

It looks like it can record a debugging session and then you generate the sequence diagram from that

I've not tried it (though have used EA as a modelling tool) so ymmv!

There is a free 30day evaluation download available


Take a look at http://www.maintainj.com

It don't know, whether it can filter library calls, but it has a reasonable graphical front end and seems to trace even very large applications.


Heatlamp (http://www.jmolly.com/heatlamp/) was designed for exactly this purpose.

It generates interactive (and printable) diagrams from running Java code. You can specify filters to describe which classes, packages, and methods to trace. You can also search, filter, and collapse invocations after the diagram is rendered to further reduce the sequence diagram.

Disclaimer: I'm the author of Heatlamp.


MaintainJ is really wonderful tool, Recently i was started to use with MaintainJ with my application it is giving more comfort with my entire usage to understand my system based on Maintainj sequence & UML diagrams.

I am sure for the above question MaintainJ is will give better idea. Thanks, Krishna MM


I have just started using the sequence diagram recording feature in Sparx Systems Enterprise Architect. It works very well for C#. You can create filters by class and by method. I'm actually trying to find out if it's possible to filter out an entire package. There is a checkbox for automatically excluding external modules (like the .NET Framework) which aids in declutter. YMMV for Java, but I think their support (and documentation) for Java is generally better (more examples) than for .NET.


Here's and add-on to Asgeir's answer. Here's the link that I found.


Run from the command line ... "java -jar sequence.jar" ... this is a Java application with a GUI.

The help section says: SEQUENCE is a program for producing UML Sequence Diagrams. In contrast to most similar programs you don't actually draw the diagram. Instead you write a textual description of the method calls you want to diagram and the layout is calculated and drawn automatically.

So this tool doesn't reverse engineer anything, but I can see how it might be helpful if you wanted to quickly diagram things from scratch. Looks like it was built in 2002 and I think there are probably better tools out there now.

Here's another similar tool here: http://sdedit.sourceforge.net/example/index.html


This looks like a really nice tool: http://www.architexa.com/learn-more/sequence-diagrams

But it looks like it's only free for a year, then its $250 a year. Bummer.

I found the ModelGoon plugin to be helpful. It's a bit limited because you choose a single method as the starting point for the sequence diagram, and it only shows the calls that method makes (so to go a level deeper you need to generate another diagram.)



JIVE (www.cse.buffalo.edu/jive) will construct a sequence diagram from the execution of a Java program. It has an Exclusion Filter capability will allow you to exclude objects belonging to designated classes or packages. JIVE can draw sequence diagrams for multi-threaded Java program execution. It also has the ability compact large diagrams in both the horizontal and vertical dimension, under user guidance.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »