News:

Happy New Year!

Main Menu

UML Sequence Diagram from C code

Started by FredDibnahsWorldOfSteam, November 14, 2024, 01:36:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wapperdude

#15
@ OP:  Please verify if my following comments correctly capture your intent.  Add any additional info to correct or clarify what Ive put forth.

@Nikolay, Yacine:  at original post, the OP indicates possibility of using StarUML.  Check it out.  The diagram he subsequently provides looks identical to starUML diagram.  I watched it build an ATM interaction diagram...well, not the full 12 min.  Very interesting.  Very helpful insight.

Here is my take. 
  > He has a large repository of C code.  He is trying to create starUML diagrams to document code flow.  What is not clear, does the document show the flow within each piece of code (seems likely) or between the different pieces of code to create a "system"?

  > He is considering using Visio because of its flexibility, and being shape (object) oriented.

  > I believe he wants to have a means in place to automatically search thru each C code file, looking for keywords, and then create his diagram to back annotate/document the code.  While starUML has good features, it is manual input and not amenable to automation.  Thus, the database documentation effort represents a huge amount of time.

  > He is not necessarily looking to build this project using C.

Visio 2019 Pro

wapperdude

#16
To use Visio seems like an extraordinarily involved task...especially an automated task.
1) create a collection of baseline symbols for this effort.  Already exists.
2) create a User interface.  Stencil exists.
3) define how each file is to be found, selected.  This could be done from either outside of Visio, via powershell, or from inside Visio.  Bottom line, a file in the database is either manually selected or there is an automated selection  with reject/proceed option.
4) setup parameters that are key to reading, searching selected file
5) go thru the file, and send info to Visio
6) setup rules for Visio to determine how to structure the diagram...shape placement, sizing, text, any interactive requirements.

That is a rough idea as to the depth necessary to automate this...at least from my perspective.

Edit Update:
*** Well, turns out Visio does have UML sequence shapes.  Here's useful link: https://support.microsoft.com/en-us/office/create-a-uml-sequence-diagram-c61c371b-b150-4958-b128-902000133b26

This link discusses using Visio to create sequence diagrams and best practices:  https://wireblueprint.com/visio-uml-sequence-diagram-template

And finally, for now, as far as I'm concerned, here's link that links to various types of UML diagrams:  https://support.microsoft.com/en-us/office/uml-diagrams-in-visio-ca4e3ae9-d413-4c94-8a7a-38dac30cbed6
Visio 2019 Pro

Yacine

@Wayne,
it's your last point (" 6) setup rules for Visio to determine how to structure the diagram...shape placement, sizing, text, any interactive requirements. ") that is so challenging. The logics involved require high modelling skills.

But the quintessence of your two posts is that it mustn't be sequence diagrams, other types can be used.

Lazy as usual, I asked chat GPT and it looks like there several tools available both commercial and open source.
https://chatgpt.com/share/67399208-1f2c-8008-92b6-00cc1da3cdb0

Funny enough, for the question about using Python and Visio the AI did not answer how to parse the C code, but only how to draw in Visio using Python. And LOL my tool visiopy is listed as solution.
And as the OP has no time to experiment, he can at least check the tools listed in the chat.
Yacine

wapperdude

#18
@Yacine:  When Python was 1st mentioned, I immediately thought of you.  I initially missed the English text of your post by failing to scroll far enough.  Lot of info there!  Interestingly, chattyAI mentions both UML class and sequence diagrams.  Examples of both are provided in the last link of my last, previous reply. 
Visio 2019 Pro

FredDibnahsWorldOfSteam

Hi All, thanks for the replies!  Plenty to think about.  I will go through the tools list suggested but it will take me a while to conclude this exercise. 

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 237 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1097KB.
Tokens: post-login.
Cache hits: 13: 0.00119s for 26,587 bytes (show)
Cache misses: 3: (show)
Queries used: 17.

[Show Queries]