Code Visualization Tool? (UML or otherwise)

Discussion in 'Game Development (Technical)' started by Abscissa, Jun 30, 2005.

  1. Abscissa

    Original Member

    Joined:
    Nov 27, 2004
    Messages:
    677
    Likes Received:
    0
    Does anyone know of any sort of tool that can parse source files and present a graphical representation of it? Possibly a code -> UML thing, but I don't care if it's real UML or not. Preferably something that accepts C/C++, but I'd be interested in anything for any other C-style-syntax language too (Or heck, any language for that matter).

    I hope there's something like that, it would be a very useful tool for learning new code and APIs (Or your own ancient code ;) ).
     
  2. mahlzeit

    Original Member

    Joined:
    Sep 26, 2004
    Messages:
    852
    Likes Received:
    1
    There is Understand for C++, although I don't think it generates UML. It's not a very user-friendly app but it does create graphs, etc. There is at least one other tool, but I forget its name. They are pretty expensive though, but at least Understand has a trial available. (Don't have the URL handy.)

    For years I have hoped this kind of functionality would become part of the IDE; maybe something like this is already available for an advanced IDE like Eclipse? (Because Eclipse already "understands" the structure of the code, unlike lesser IDEs, so it shouldn't be too hard to generate graphs on the fly.)
     
  3. Kai Backman

    Original Member Indie Author IGF Finalist

    Joined:
    Jul 28, 2004
    Messages:
    297
    Likes Received:
    0
    In my former life I used to work at a place that had rountrip tools (Rational Rose) for generating UML. We also used UML extensively in the design phase. Generating UML for the purpose you describe will probably never work. A UML diagram is not a 1-1 mapping to some piece of code. For every piece of code there is an almost unlimited number of valid diagrams, in the strict sense of the diagram describing the program correctly. Only a handful of those make any real sense to a human user. And only a few are really good. Doing a good visualisation of a program is like writing a good piece of documentation, it requires talent and a lot of hard decision making of what is more important and what is less. More important for humans that is .. :)
     
  4. mahlzeit

    Original Member

    Joined:
    Sep 26, 2004
    Messages:
    852
    Likes Received:
    1
    For example, I would love to be able to see realtime in my IDE:
    - which other functions a particular function calls
    - which other functions call that particular function
    - which functions use which globals
    - a flowchart representation of a function's innards

    There are tools that do the latter, such as Visustin.

    All of this helps to clarify what a certain piece of code does, how all the bits and pieces fit together, and how you can change things (refactoring) without breaking anything. It's good to have many different views and representations of the code. It just would be so much easier if the IDE did all of this instead of needing to use separate tools, because refactoring happens a lot. Anyway.

    Here is the link to Understand for C++.
     
  5. mwtb

    Original Member

    Joined:
    May 26, 2005
    Messages:
    107
    Likes Received:
    0
    Enterprise Architect

    Does reverse engineering of C++ to UML as well as Java and some other things. Usable, useful and much, much cheaper than the alternatives from the likes of Rational.

    I'm sure there are other options out there, but I haven't really investigated the C/C++ tools. Java is much better supported in this arena.
     
  6. Vectrex

    Original Member

    Joined:
    Aug 22, 2004
    Messages:
    205
    Likes Received:
    0
    a simple and cheap one would be ClassViz
    http://www.toolsfactory.com/classviz.html
    I've been begging the VisualAssist guys for something like this :) Unfortunatly classviz has no integration at all, at least it'd be cool if it launched the file if you double click it. Ah well

    here's a simple diagram from it
    http://www.users.on.net/~edan/temp/basicUML.GIF
    http://www.users.on.net/~edan/temp/basicUML2.GIF

    and here's some more complex one's
    http://www.users.on.net/~edan/misc/cegui_classviz.gif

    and an intense one from the OGRE engine :)
    http://www.users.on.net/~edan/misc/ogre_classviz_nodeps.gif
     
  7. Abscissa

    Original Member

    Joined:
    Nov 27, 2004
    Messages:
    677
    Likes Received:
    0
    Thanks for the links! That ClassViz is nice, I'll probably get some use out of that (Although it doesn't like my white-on-black color scheme). I don't think I'm going to worry about the pricier ones ;)

    Is there anything that can give me a graph of which functions directly call which other functions? I know I can get that info from Visual Studio, but it doesn't put it in graph form (not that I'm aware of, anyway).

    Also, are there any good (as in: relatively easy-to-use) graph-drawing APIs? I'd imagine there are probably some in the Linux scene, but I'm not aware of any personally.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer