131

Is there a tool that can parse C++ files within a project and generate UML from it?

Geert Bellekens
  • 12,788
  • 2
  • 23
  • 50
gak
  • 32,061
  • 28
  • 119
  • 154

10 Answers10

83

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

mpliax
  • 49
  • 1
  • 8
jwpfox
  • 5,124
  • 11
  • 45
  • 42
56

If its just diagrams that you want, doxygen does a pretty good job.

Sergio Basurco
  • 3,488
  • 2
  • 22
  • 40
user48956
  • 14,850
  • 19
  • 93
  • 154
  • 2
    I 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
16

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.

Oktalist
  • 14,336
  • 3
  • 43
  • 63
  • 2
    Very 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
15

I believe Enterprise Architect can do that.

cschol
  • 12,799
  • 11
  • 66
  • 80
  • 2
    Indeed 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
8

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.

Rhubbarb
  • 4,248
  • 6
  • 36
  • 40
5

UML Studio does this quite well in my experience, and will run in "freeware mode" for small projects.

Patrick Johnmeyer
  • 31,462
  • 2
  • 26
  • 24
3

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

Aleksey Kontsevich
  • 4,671
  • 4
  • 46
  • 101
2

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++ !

Shan
  • 5,054
  • 12
  • 44
  • 58
1

Whoever wants UML deserves Rational Rose :)

obecalp
  • 1,721
  • 1
  • 12
  • 15
1

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.

graham.reeds
  • 16,230
  • 17
  • 74
  • 137