Generate design documentation from your code¶
Hand-drawn architecture diagrams and flowcharts are stale the moment the code changes, and keeping them current competes with real work. Understand generates the same artifacts from the code itself, so a control-flow diagram or call tree always reflects what the software actually does — and you can regenerate the whole set after every change. This is one of the oldest reasons teams adopt Understand: turning "we should document this" into a repeatable export.
This page maps the goal — produce documentation an audience can use — onto the concrete how-tos.
Pick the artifact for the audience¶
| You need to show… | Use… |
|---|---|
| How one routine behaves (logic, branches) | Control-flow graph |
| How functions call each other | Call / Butterfly tree |
| How classes relate | UML class diagram |
| How files/components depend on each other | Dependency graph |
| A custom report on a project, architecture, or entity | Interactive Report (plugin) |
See which graph should I use? if this quick list doesn't cover your case. An Interactive Report is a plugin script that reports exactly what you choose about its target — several ship with Understand, and tutorial 6 walks through writing your own.
Produce and export it¶
- Open a graph, then tune it — collapse detail, show decisions only, or color by a metric — so it communicates to its audience rather than overwhelming them.
- Export, print & script a graph to PNG/SVG/PDF for a design package, or copy it into a review deck.
- What is a report & how do I run one? for the structured, cross-linked HTML overview — useful when the audience needs to click through interfaces and call trees rather than read one picture.
Keep it current — and hands-off¶
Because the artifacts come from the code, regenerating them is the whole maintenance story. Script the export so documentation refreshes on demand or in CI:
- Headless workflow — create → analyze → report from the command line.
- Pair it with architectures so the diagrams follow your intended subsystem structure, not just the directory layout.
Document interfaces, not everything
For code you hand off, an overview plus interface/call diagrams is usually more useful — and safer to circulate — than an exhaustive dump. Build an architecture at the level you want to expose and export from there.
Where to next¶
- Graph catalog and export a graph.
- Push metrics to leadership dashboards — share numbers, not just pictures.
- IEC 62304 medical-device software documentation — when the docs are a regulatory deliverable.