Mapping Data and Control Flow: DFDs and Control Flow Diagrams Compared and Applied

UPI Study › Courses › Software Engineering › Free lessons › Lesson 6.9 Free with a free account

Mapping Data and Control Flow: DFDs and Control Flow Diagrams Compared and Applied

Software Engineering · Chapter 6: Requirements Engineering and PrototypingSection 6.9 · lesson 46 of 1038 min · free with a free account

← Drawing Interactions: UML Use Case Diagrams in ActionNext lesson: Documenting Use Cases: Diagrams, Templates, and Best Practices →

Earn 3 college credits for Software EngineeringRecommended for credit by NCCRS · Computer Science 301 · self-paced · one payment, lifetime access

In this lesson

Data flow diagrams and control flow diagrams, compared and applied.

  • Define a DFD, and identify its 4 notation elements
  • Explain leveling, and why a system is decomposed across levels
  • Define a CFD, and distinguish what it models from a DFD
  • Explain when to use each - and why teams use both

Transcript

Everything said in the video, section by section (1,057 words). Read along, or search it.

Requirements Engineering and Prototyping

Mapping Data and Control Flow

Some diagrams show where data goes. Others show the order and conditions under which work happens. This section covers one of each. The data flow diagram, and the control flow diagram. It explains what each shows, how data flow diagrams are leveled, and why teams usually use both.

2 Questions, 1 Tangle

Separate the Questions

An analyst tries to capture an order-processing system in a single diagram. It shows where the data comes from and where it goes, along with the exact sequence and conditions under which each step runs. The result is a tangle nobody can read. Data arrows cross sequence arrows, and decision diamonds sit among data stores. Two much clearer diagrams emerge once the two questions are separated. A data flow diagram answers, where does the data move? A control flow diagram answers, in what order, and under what conditions?

Data Flow Diagrams

Where Data Comes From, and Goes

A data flow diagram, or D F D, models how data moves through a system. It shows where data originates, what processes transform it, where it is stored, and where it ultimately goes. And it does that without any timing, sequence, or decision logic. That helps a team and its stakeholders agree on what data exists and how it flows, before deciding how to build the system. D F Ds come from an older tradition called structured analysis, which predates U M L. They remain the right tool for their specific question.

Table 1

4 DFD Notation Elements

A D F D is built from four elements. A process, drawn as a circle, transforms incoming data into outgoing data. For example, validate order. A data flow, drawn as a labeled arrow, carries data between the other elements. For example, the validated order. A data store, drawn as an open-ended rectangle, represents data at rest, like a file or a database table. And an external entity, drawn as a closed rectangle, is a source or sink of data outside the system, like a customer.

Figure 1

A Level 1 DFD for Order Processing

Here is a level one D F D for order processing. The customer sends order details to the first process, validate order. It records the order in the order records store, and passes the validated order on. Process two, process payment, exchanges a payment request and a confirmation with an outside payment processor. It then sends the order total to process three, update inventory, which writes a stock update to the inventory store. Notice that nothing here says when, or in what order, under what conditions. Only where the data goes.

Leveling

Zooming In, Level by Level

A single D F D of an entire system would be overwhelming, so D F Ds are leveled. A level zero diagram, the context diagram, shows the whole system as one process, with only its external entities and boundary flows. It establishes scope. Level one breaks that process into its major sub-processes, connected by more detailed flows and stores. Any process still complex enough can be broken down again, into its own level two diagram, and so on. One rule holds at every level. The data flowing into and out of a process, must match the data in and out of its sub-diagram. No data flow should appear or disappear, just because a diagram zoomed in.

Control Flow Diagrams

When, and Under What Conditions

A control flow diagram, or C F D, models something different. It shows the sequence and logic that control when, and under what conditions, processing steps run. Decisions, branches, loops, and order. Its notation is a small set of shapes. A rounded shape marks where the flow starts and ends. A rectangle is one processing step. A diamond is a decision point, with each outgoing path labeled by its condition. And arrows show the order of steps and decisions, including loops back to an earlier step.

Figure 3

Inside "Process Payment"

In the D F D, process payment is just a bubble. A C F D can zoom in and show how it actually unfolds. First, check the card details. Then a decision. Are they valid? If not, the order is rejected. If they are valid, charge the card. Then another decision. Was the charge approved? If not, the payment is declined. Only when both decisions say yes does the flow reach its end, and confirm the payment.

Table 4

DFD vs. CFD

Here are the two diagrams side by side. A D F D models where data originates, moves, and ends up. A C F D models the order and conditions under which steps run. A D F D ignores timing, sequence, and decisions. A C F D ignores the data being carried. A D F D is most useful for scoping a system, and agreeing on its data. A C F D is most useful for one process's internal decision logic. So they are complementary. A leveled D F D gives the big picture, and a few C F Ds elaborate the processes whose logic is complex.

Apply It

Account Check at Login

Let's apply that. A stakeholder says, first check whether the customer already has an account. If they do, log them in. If not, create one before continuing. That belongs in a C F D. It is entirely about sequence, and a condition. A D F D could only show that account data is checked, and possibly created. It has no notation for the branch itself. And remember, both diagrams describe the system at the level of analysis. Turning that into an actual architecture is a separate, later step.

Key Terms

The Vocabulary of This Section

Let's lock in the key terms. A data flow diagram models how data moves through a system, independent of timing or decision logic. A control flow diagram models the sequence and conditions under which steps execute. A process is a circle that transforms data, and a data store is an open-ended rectangle holding data at rest. An external entity is a closed rectangle, a source or sink of data outside the system's boundary. Leveling organizes D F Ds hierarchically, and the context diagram, at level zero, shows the whole system as a single process.

Key Takeaways

What to Carry Forward

To pull this together. A D F D shows where data moves, using processes, data flows, data stores, and external entities. Leveling zooms from a context diagram down into detail, with the data kept balanced across levels. A C F D shows order and conditions, using start and end shapes, steps, decision diamonds, and arrows. A D F D ignores decision logic, and a C F D ignores the data. Each answers one question. Most projects use both, and both stay at the level of analysis.

About Software Engineering at UPI Study

Software Engineering (Computer Science 301) is a self-paced online course of 103 video lessons in 15 chapters, from process models and agile to requirements, design, user interfaces, reliability, security and project management. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Software Engineering vs Systems Analysis

Why take it here

Why students take Software Engineering with UPI Study

How professional software gets builtSoftware Engineering covers how teams turn requirements into working, maintainable software: process models, agile, requirements, design, testing, reliability and project management. It is a core course in computer science and software degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Software Engineering carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Mapping Data and Control Flow: DFDs and Control Flow Diagrams Compared and Applied

What is a data flow diagram (DFD)?
A data flow diagram models how data moves through a system: where it originates, which processes transform it, where it is stored, and where it ends up. It deliberately shows no timing, sequence, or decision logic. DFDs come from structured analysis, a tradition older than UML, and help teams agree on what data exists before deciding how to build the system.
What are the four symbols used in a data flow diagram?
A DFD uses four elements. A process, drawn as a circle, transforms incoming data into outgoing data, such as validate order. A data flow, drawn as a labeled arrow, carries data between elements. A data store, drawn as an open-ended rectangle, holds data at rest, such as a database table. An external entity, drawn as a closed rectangle, is a source or sink outside the system.
What does leveling mean in data flow diagrams?
Leveling organizes DFDs hierarchically so a system is not shown in one overwhelming diagram. Level 0 shows the whole system as one process, level 1 breaks it into major sub-processes, and complex processes can be broken down further into level 2 and beyond. At every level, the data flowing into and out of a process must match its sub-diagram.
What is the difference between a data flow diagram and a control flow diagram?
A data flow diagram shows where data originates, moves, and ends up, but ignores timing and decisions. A control flow diagram shows the order and conditions under which steps run, using start and end shapes, steps, decision diamonds, and arrows, but ignores the data carried. Teams often use a leveled DFD for the big picture and CFDs for processes with complex logic.

About the Software Engineering course

How many college credits is Software Engineering?
Software Engineering (Computer Science 301) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Software Engineering cost and what is included?
$250, paid once, with lifetime access: all 103 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Software Engineering take?
It is self-paced with no deadlines. The 103 lessons total about 11 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Software Engineering.

103 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Software Engineering
3 credits · NCCRS
Enroll →