Is there a tool that can parse C++ files within a project and generate UML from it?
10 Answers
Here are a few options:
Step-by-Step Guide to Reverse Engineering Code into UML Diagrams with Microsoft Visio 2000 - http://msdn.microsoft.com/en-us/library/aa140255(office.10).aspx
BoUML - http://bouml.free.fr/features.html
StarUML - https://staruml.io/
Reverse engineering of the UML class diagram from C++ code in presence of weakly typed containers (2001) - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.27.9064
Umbrello UML Modeller - https://apps.kde.org/umbrello/
A list of other tools to look at - http://plg.uwaterloo.ca/~migod/uml.html
-
Reaccepted to the more thorough answer. – gak May 01 '12 at 22:59
-
Umbrello seems to be for Linux/KDE only. – Rhubbarb Jul 18 '12 at 12:06
-
2See similar questions [**here**](http://stackoverflow.com/questions/6203015/automatically-generate-a-uml-diagram-of-my-c-code) and [**here**](http://stackoverflow.com/questions/1407948/c-to-uml-reverse-engineer-round-trip-engineering) and [**here**](http://stackoverflow.com/questions/577489/c-uml-class-diagram-autogeneration). – Keshava GN May 30 '13 at 10:04
-
8BoUML is not free! – deepdive Jan 21 '14 at 08:17
-
StarUML does the job – dannymo May 25 '16 at 18:43
-
5StarUML failed super hard to produce anything helpful whatsoever. – bitmask Jul 06 '17 at 09:02
-
BoUML is free again! – CodingFeles Jul 28 '17 at 07:27
-
1BoUML is not the greatest tool. Very dated UI and struggles hard with new C++ syntax or dependencies it doesn't know. – user643011 Oct 13 '17 at 23:16
-
BoUML is now free again!!! – Tedi Jan 28 '18 at 09:04
-
Modelio does the job – Feb 05 '18 at 10:17
-
umbrello didn't create and gave error opening a file as if it didn't have permission whilethe file had world wide permissions. – nurp Sep 30 '19 at 07:30
-
1As far as I can find, umbrello does not generate UML diagrams. – DanielLC Feb 14 '20 at 04:21
-
@dannymo StarUML doesn't do the job. It only imports classes, which was also broken in my case. It doesn't create class diagrams(dependencies between classes). – KulaGGin Dec 02 '22 at 14:47
If its just diagrams that you want, doxygen does a pretty good job.

- 3,488
- 2
- 22
- 40

- 14,850
- 19
- 93
- 154
-
2I just got complete class hierarchy on a +300K LOC project with Doxygen, it really does a pretty well job! – HFSDev May 07 '13 at 14:32
-
Not exactly. For example: https://www.doxygen.nl/manual/diagrams.html . Doesn't generate the dependencies of the class, only what classes it inherited from. On the page to the example, there is class B that depends on class A but the output image doesn't show it, it only shows inheritance. – KulaGGin Dec 02 '22 at 14:30
I've developed a tool called Doxygraph which can parse the XML generated by Doxygen and turn it into an interactive UML class diagram which you can view in a web browser or import into any software that can read Graphviz "dot" files.

- 14,336
- 3
- 43
- 63
-
2Very nice application! Apart from the fact that it depends on quite a lot of libs I didn't have (downloaded later from cpan), the entire thing works perfectly. Thanks! – Rubens Oct 07 '13 at 11:43
I believe Enterprise Architect can do that.

- 12,799
- 11
- 66
- 80
-
2Indeed it does, and does well. I've been using it for years, and to me it's by far the best price/performance tool for it (among those I used). I've tried StarUML and Together also - the first has potential, but is still incomplete. The second is painfully slow. – Fabio Ceconello Jan 05 '09 at 22:45
-
I didn't try Rational Rose, though, since it's well above my acceptable price range. – Fabio Ceconello Jan 05 '09 at 22:46
I find that Wikipedia can be a great source of information about such tools, especially for comparison tables. There's a page on UML tools. See in particular the reverse engineered languages column.

- 4,248
- 6
- 36
- 40
UML Studio does this quite well in my experience, and will run in "freeware mode" for small projects.

- 31,462
- 2
- 26
- 24
Seems Umbrello produces best UML from C++ code (suggest to use latest version >= 2.22) comparing to command-line autodia for Dia and other tools.
StarUML have not produced good diagrams for me: strange import, not usable, does not work for many people: https://github.com/staruml/Cpp/issues

- 4,671
- 4
- 46
- 101
I have used Rational Rose and Rational Rhapsody for reverse engineering large projects. I would prefer Rational Rhapsody for getting the UML class files for C++ !

- 5,054
- 12
- 44
- 58
Whoever wants UML deserves Rational Rose :)

- 1,721
- 1
- 12
- 15
-
2
-
The link in this answer is out of date. The current link is http://www-01.ibm.com/software/rational/products/swarchitect/cpp/ – Dan Nissenbaum Sep 14 '12 at 13:13
-
1Both the original link and the one in the comments are out of date. Don't know where to find the current version. – Bruno Alexandre Rosa Feb 13 '19 at 13:05
-
StarUML does just that and it is free. Unfortunately it hasn't been updated for a while. There were a couple of offshoot projects (as the project admins wouldn't allow it to be taken over) but they too have died a death.

- 16,230
- 17
- 74
- 137
-
1StarUML have not produced good diagrams for me strange import. @Rhubbarb, it works under Linux and Mac as well. – Aleksey Kontsevich May 07 '17 at 13:39
-