135

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

0

10 Answers 10

84

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 - https://www.bouml.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

13
  • 2
    See similar questions here and here and here.
    – Keshava GN
    May 30, 2013 at 10:04
  • 8
    BoUML is not free!
    – deepdive
    Jan 21, 2014 at 8:17
  • 6
    StarUML failed super hard to produce anything helpful whatsoever.
    – bitmask
    Jul 6, 2017 at 9:02
  • 1
    BoUML is not the greatest tool. Very dated UI and struggles hard with new C++ syntax or dependencies it doesn't know.
    – user643011
    Oct 13, 2017 at 23:16
  • 1
    As far as I can find, umbrello does not generate UML diagrams.
    – DanielLC
    Feb 14, 2020 at 4:21
56

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

2
  • 2
    I just got complete class hierarchy on a +300K LOC project with Doxygen, it really does a pretty well job!
    – HFSDev
    May 7, 2013 at 14:32
  • 1
    Not exactly. For example: 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 2, 2022 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.

1
  • 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 7, 2013 at 11:43
15

I believe Enterprise Architect can do that.

2
  • 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. Jan 5, 2009 at 22:45
  • I didn't try Rational Rose, though, since it's well above my acceptable price range. Jan 5, 2009 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.

5

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

1
  • You can run it in free (restricted) mode under Wine.
    – SChepurin
    Sep 2, 2015 at 13:07
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

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

1

Whoever wants UML deserves Rational Rose :)

4
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.

2
  • 1
    StarUML have not produced good diagrams for me strange import. @Rhubbarb, it works under Linux and Mac as well. May 7, 2017 at 13:39
  • Latest release now is Aug 2018, so it has been picked up again
    – bart s
    Jan 16, 2019 at 12:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.