Version 17, last updated by Thiago Mata at January 22, 2010 17:23 UTC

sequence diagram exampleThe Sequence Diagram is probably the must intuitive way to understand a code execution.

It can be  also used to create other diagrams, like the test diagram and the use cases, for example.

Another common use of the Sequence Diagram is to plan how a peace of software will behaive describing how it's parts should interact. The problem is: as the development evolves the diagrams will losing the link with the reality. The diagram used to describe how the software should work will getting more and more distant from how it actually work.

This is a well known problem in development: how to keep the diagrams updated during software development. There are several softwares to create diagrams for software and many of them do some kind of reverse engineering to keep the diagram updated, but almos none of them do it with the Sequence Diagram. The particular thing about the Sequence Diagram is that it is related to a certain code execution. It cannot be generated only besed in the existing software Classes.

So we are trying do exactly that! To generate a Sequence Diagram based on a PHP code execution.  How is it done? By sniffing a code executing using code instrumentation. Using this information a diagram in HTML format is created.

To trigger the code sniffing you just have to add a single line of code in the point you want to start "recording".  If you want more flexibility you can also configure some parameter of the diagram generation.

 

One small component was created during the software development that can be used separately. It is tthe possiblility of generating the Sequence Diagram a XML. This application can be tested here where you can change the XML  used as an example.

The goal of this project is to make possible the generation of a sequence diagram from each test method.

You can see the actual version running here.

You can download the last version of this project just downloading from it's SVN.

While still not fully working on Internet Explorer, the generator already makes life easier for those responsible in maintaining this kind of diagrams. We welcome anyone with the patience and desire to make the CSS changes need for it to work on IE.

Also, fully compliance with UML 2.0 is still under development. Anyone interested in working in these fields is more than welcome to join the team. And if you have a patch on add-on to send, feel free to do so.And remember, this is free software, and as such, I can give you no warranty. Use it at your own risk. It's not for the faint of heart.

Check the How_To_Use guide more more information.

 

Rererence:

About Sequence Diagrams: 

About Code Instrumentation