A program design structure chart is a top-down diagram that decomposes a program into modules, drawn as rectangles connected by lines, with labeled arrows showing parameters and data passed between them. You make one by starting from a single top-level module, splitting work into cohesive child modules, and repeating the split until each leaf is small enough to code and test on its own. The key condition is that the chart should express what each module does and what it exchanges with its caller, not the internal logic or the order in which statements run.
That distinction trips up a lot of people. A structure chart looks vaguely like a flowchart, but it answers a different question. A flowchart traces control flow inside a routine—decisions, loops, sequence. A structure chart maps the call hierarchy and the data that moves along each call. Once you internalize that, the drawing rules become much easier to apply consistently.
This guide walks through preparing inputs, deriving modules, laying out the hierarchy, labeling data couples and flags, and checking the result. It also covers the trade-offs that decide whether your chart helps or just decorates a design document.
What a structure chart actually represents, and what it deliberately leaves out
Structured design, popularized by Ed Yourdon and Larry Constantine in the 1970s and later folded into Tom DeMarco's and others' systems-analysis practice, treats a structure chart as the architectural companion to a data-flow diagram. The data-flow diagram shows what transformations the system performs and what stores it touches. The structure chart shows how you plan to package those transformations into callable modules and how those modules communicate.
Standard notation is small and worth memorizing before you draw anything:
A rectangle is a module. The name goes inside; it should be a verb-object phrase such as "Validate Order" or "Compute Tax," not "Order Stuff." A straight line connecting a parent above to a child below means the parent calls the child. Position implies the call direction, so an arrowhead is optional and often omitted. A small filled circle with an arrow pointing downward along the call line is a data couple: a data item passed from caller to called module. A small hollow circle with an arrow pointing upward is a data couple returned to the caller. A filled or hollow arrow with a short flag (often drawn as a small diamond or a labeled arrow marked "flag") is a control couple: a signal such as a boolean, an error code, or a switch that tells a module which path to take. A curved arrow from one module to another, or a small loop symbol on a module, indicates iteration—one module repeatedly invoking another. A diamond at a module's corner sometimes marks a "decision" module that chooses among children, though many teams drop this and just let the parent contain the selection logic.
What the chart does not show: statement order, loop bounds, local variables, error-handling text, or database schemas. It also should not show every function in a library you call. The unit of interest is your own design, decomposed into modules you intend to write or assemble.
There's a useful sanity rule. If a reader can't tell from the chart what data enters and leaves each module, the chart is under-specified. If the chart includes the steps inside a module, it's over-specified and has drifted into flowchart territory.
Prerequisites: inputs and decisions to settle before drawing
You'll get a cleaner chart if you finish some analysis first. Trying to invent the hierarchy while still discovering requirements produces a diagram you'll redraw three times.
Gather these before you start:
1: A data-flow diagram or equivalent process description. Even a rough one—external entities, processes, data stores, flows—gives you the transformations that must be assigned to modules. If your project is small, a structured list of inputs, outputs, and processing steps works. 2: A transaction/transform analysis split. Decide which parts of the system are transform-centered (input → processing → output pipelines) and which are transaction-centered (a dispatcher routes different request types to different handlers). This choice drives the top of the chart. 3: The data dictionary or at least a field list. You need concrete names for the data couples. "Order record," "validated flag," "tax amount" beat "data" and "result." 4: Nonfunctional constraints that affect packaging. Language and framework conventions, team boundaries, deployment units, and any performance-critical paths all influence how finely you decompose. 5: A naming convention. Agree on verb-object module names and consistent data names before drawing, because renaming mid-chart creates a mess of crossed-out labels.
One decision deserves separate attention: how deep to go. Depth is a design choice, not a law of nature. A common heuristic is the "single-page rule"—the whole chart should fit one page (or one screen) at a readable size, and modules should be decomposed until each is roughly a page of code, testable in isolation, and describable in one sentence. Some teams use seven-plus-or-minus-two as a target for children per parent; treat that as a guideline from human-factors research on short-term memory, not a hard limit.
Deriving the hierarchy: top-down decomposition in practice
This is the core procedure. Work top-down, and resist the urge to jump into leaf details early.
Step 1: Define the root module. Name it after the whole program's job, for example "Process Payroll Run" or "Render Report." Everything below exists to serve this module.
Step 2: Identify first-level children. Two established derivations exist:
Transform analysis. If the system is a pipeline, identify the incoming data flow (afferent), the central transform, and the outgoing flow (efferent). Create an "Get Input," a "Process" (or several central-transform modules), and an "Output Results" child. Transaction analysis. If the system dispatches on request type, create a "Dispatch" or "Route Request" child plus one child per transaction type, such as "Handle New Order," "Handle Cancellation," "Handle Refund."
Step 3: Attach data couples. For each parent-child link, ask: what exact data does the child need to do its job, and what does it hand back? Write those names on the arrows. If a child needs nothing, that's a warning sign—maybe it belongs higher, or maybe the parent is doing too little.
Step 4: Recurse on each child. Apply the same transform-or-transaction question to every child until you reach modules you're willing to write as single units. At each level, prefer factoring—pulling a repeated sub-computation into a shared child—over duplicating it.
Step 5: Review cohesion and coupling at every parent. Ask whether each child represents one well-defined job (functional cohesion) and whether the parent-child links carry minimal, explicit data (loose coupling). Restructure where they don't.
Step 6: Draw it, then redraw once. Most first drafts reveal misplaced modules: a child that belongs as a sibling, a parent that should be split, a data couple that reveals a hidden dependency between two unrelated subtrees.
To make this concrete, imagine a small command-line utility that converts a CSV of sales rows into a formatted monthly summary PDF. The root is "Generate Sales Summary." First-level children might be "Read CSV File," "Validate Rows," "Aggregate by Month," and "Render PDF." "Aggregate by Month" might decompose into "Group Rows by Month," "Sum Revenue," and "Sum Units." "Render PDF" might decompose into "Build Section per Month," "Format Currency," and "Write File." Notice each leaf is a sentence-sized job, and the arrows carry named data: file path downward, row list returned, validated rows returned, and so on. That's the shape you're after.
Laying out the diagram so it communicates
Layout is not cosmetic. A poorly arranged chart hides coupling problems that a clean layout exposes.
Use a strict top-down tree. Root at the top, siblings left to right, children directly beneath their parent. Draw the call lines vertical where possible; elbow connectors are acceptable when the tree is wide but add visual noise. Keep uniform box sizes and align siblings on a horizontal baseline—this makes it easy to scan for unbalanced subtrees. If a module has many children, consider grouping them into an intermediate "controller" only if that grouping corresponds to a real module you'll write; don't invent grouping boxes just to tidy the picture.
Numbering helps when the chart spans pages or when you reference modules in design reviews. A hierarchical scheme such as 1, 1.1, 1.2, 1.2.1 lets reviewers say "module 1.2.3" without ambiguity. Many textbooks also show span of control—the number of direct children—in a small margin note, though this is optional.
Data couples and flags deserve particular care in layout. Draw them along the call line, perpendicular to it, so it's obvious which call carries which data. Label them with the same names used in your data dictionary. When a module both accepts input and returns output on the same call, show two arrows—one down, one up—or a single bidirectional pair with distinct labels. Consistency matters more than which convention you pick.
A small but high-value addition: mark modules you intend to reuse with a tag (say, "R") or draw them with a double border. Reused modules often sit awkwardly in a single tree because they serve multiple parents; labeling them flags the reuse and invites you to consider whether they should be paired with a separate "library" section of the chart.
Labeling data and control couples without turning the chart into spaghetti
The fastest way to ruin a structure chart is to let every module pass large blobs of data. Aim for explicit, narrow interfaces.
Name values precisely. "Order ID" and "Customer ID" are couples; "order data" is not a couple, it's a confession that you haven't designed the interface. For returned values, be equally specific: "total tax," "error code," "rendered page count."
Prefer data couples over control couples. A control couple such as a boolean "isValid" passed to a child means the child is making a decision the parent already made—usually you should either move the decision into the child (and pass it the data needed to decide) or keep the decision in the parent and call a child that always does one thing. Control couples are legitimate for things like "retry requested," "cancel signal," or an enumerated mode that genuinely alters a module's behavior, but they're a smell when they express branching logic.
Watch for pathological coupling, where child modules share a global variable or communicate through an external store instead of the explicit couples on the chart. The chart can't prevent it, but a review that traces each arrow's data will often surface it. Also watch for stamp coupling—passing a whole record when a child needs two fields—because it creates hidden dependencies and makes the interface harder to test.
Keep the number of couples per call modest. If a parent-child link carries eight items, ask whether the child is really two modules or whether the data represents a domain object that deserves its own name and construction.
A worked mini-example with numbers and a success check
Suppose a billing service computes an invoice total. A simple module hierarchy might be:
Root: Process Invoice 1.1 Load Invoice Data(invoice ID → invoice record) 1.2 Apply Discounts(invoice record, customer tier → discounted line items) 1.3 Compute Totals(discounted line items → subtotal, tax, grand total) 1.4 Persist Invoice(invoice record, totals → saved flag)
Before drawing, sanity-check with illustrative numbers. Say an invoice has three line items: 40.00, 25.00, and 35.00, subtotal 100.00. Customer tier gives a 10 percent discount, so discounted subtotal is 90.00. Tax at 8 percent is 7.20, grand total 97.20. Now trace the couples: 1.3 receives discounted line items and returns three numbers. Does it need the customer tier? No—discounting already happened in 1.2. Does 1.4 need the line items? Only if the persistence schema stores them, so the couple should list "invoice record, totals, saved flag" and not line items unless the design says so.
This trace is the arithmetic equivalent of a design review, and it's reproducible: write the inputs, write the outputs, write the formula, check the units. If a module's returns can't be derived from its inputs by a mental formula, the module boundary is probably wrong. The check costs a minute and catches a surprising share of interface errors.
A success check for the whole chart follows from the same idea. For every module, you should be able to state in one sentence: given these inputs, it produces these outputs. For every parent, you should be able to say why this set of children, in this order, completes the parent's job. And for every leaf, you should be able to name a test that exercises it without the rest of the program. If any answer is "sort of" or "it depends," revisit that node.
Common failure modes and how to correct them
Structure charts fail in recognizable patterns. Knowing them saves a redraw cycle.
The flowchart masquerade. The diagram shows decisions and loops inside boxes. Fix: move branching into explicit child modules, or keep the branching in the parent and call children that each do one branch's work.
The star parent. One module calls twenty children with no grouping. Fix: introduce genuinely cohesive intermediate modules—"Input Handling," "Processing," "Output"—only where they correspond to real code you'd write.
The orphan leaf. A module receives no meaningful input or returns nothing anyone uses. Fix: delete it, merge it upward, or discover the missing couple you forgot to draw.
The hidden global. Two subtrees appear independent but both mutate shared state. Fix: surface the shared data as an explicit couple, often by moving the shared store's access into a single child plus a data couple.
Coupling creep. Children pass many small scalars where one named record would do, or pass a huge record where two fields suffice. Fix: right-size the interface; the chart should name the smallest complete data the child needs.
Depth without purpose. Five levels for a 300-line script. Fix: cap depth based on module size and reuse needs. Decomposition exists to make code testable and understandable, not to fill a page.
Forgetting returned values. Arrows go down but not up, so the chart implies results appear from nowhere. Fix: audit every parent that uses a child's result and draw the upward couple.
Variants, tools, and when a structure chart is the wrong artifact
The classic notation above is the most portable, but you'll encounter variants. Structured design texts sometimes show modules with an inward-curl symbol for predefined or reused routines. Some teams use UML package or component diagrams to express the same hierarchy with standardized syntax; a component diagram is a reasonable modern substitute when your team already lives in UML, though it's heavier for a quick design conversation. Data-flow-diagram-to-structure-chart transformation steps appear in Yourdon-Constantine-style methodology, and many university software-engineering courses still teach the transform/transaction derivation.
For tools, anything that draws boxes and arrows works: a diagram editor, a whiteboard, or even a text-based diagram description rendered to an image. The chart is conceptual; it does not need to be generated from code. If you want it to stay accurate, a rough rule is to update the chart when module boundaries change, not when internal code changes.
When is the structure chart the wrong choice? If you're documenting microservice interactions across a network, a component or sequence diagram is clearer. If you're designing object-oriented code, class diagrams and collaboration diagrams capture inheritance and polymorphism that a call hierarchy doesn't. If the program is a few functions long, a chart is overhead—a short list of modules and their interfaces is enough. The structure chart earns its keep when the program is large enough that you need a shared map of decomposition and interfaces before code exists.
Frequently asked questions
How is a structure chart different from a flowchart? A flowchart shows control flow—the order of statements, decisions, and loops inside one procedure or program. A structure chart shows the call hierarchy and the data exchanged between modules, deliberately omitting statement order. You can't reconstruct a program's logic from a structure chart, and you can't see its module decomposition from a flowchart.
Should every function in my program appear as a module? No. Chart the modules that represent your design decisions—the units you're packaging, testing, and potentially reusing. Library calls, trivial getters, and language-runtime functions usually stay implicit. Including every helper bloats the chart and buries the architecture.
How deep should decomposition go? Until each leaf is small enough to describe in one sentence, implement in roughly a page of code, and test in isolation. Stop earlier if reuse or team boundaries don't demand more depth. Depth is a judgment call tied to your project's size and risk, not a fixed number of levels.
Can I generate the chart from source code? Call-graph generators produce a similar hierarchy automatically, but they include every call, including library code, and they reflect the code as written rather than the intended design. Use a generator for documentation or analysis; use the manual procedure in this guide when you're designing before code exists.
Design is iterative, and so is the chart. Draw a first version early, review it with someone who will implement the modules, and expect the data couples to change as the interfaces sharpen. A structure chart that survives a review without revisions is rare; one that gets revised into clarity is the whole point.