Data Flow Diagram (DFD) in Software Engineering: Symbols, Levels & Examples

Chapter 12

Data Flow Diagram (DFD) in Software Engineering: Symbols, Levels & Examples

A Data Flow Diagram is one of the easiest ways to understand how information moves inside a software system. Instead of showing programming code or technical implementation, a DFD shows where data comes from, what happens to it, where it is stored and where it goes.

What is a Data Flow Diagram in Software Engineering?

A Data Flow Diagram (DFD) is a graphical representation used to show how data moves through a system. It represents the sources of data, processes that transform the data, places where data is stored and destinations where the data is sent.

In simple words, a DFD answers: “Where does the data come from, what happens to it, and where does it go?”

Why Do Students Find DFD Difficult?

Data Flow Diagram (DFD) in Software Engineering: Symbols, Levels & Examples

The basic definition of a Data Flow Diagram is simple. The confusion usually begins when students see terms such as process, data store, external entity, data flow, Level 0, Level 1, Level 2, context diagram and balancing together.

The easiest way to understand DFD is to stop thinking about software code for a moment. Imagine that you are only tracking the movement of information.

Think like this:

A student enters login details → the system checks the details → the information is compared with stored data → the system returns a login result.

This movement of information can be represented using a DFD.

Basic Idea Behind a Data Flow Diagram

Every software system receives some type of input, processes that input and produces an output.

During this activity, the software may also read information from a database or save new information into a database.

Basic Data Movement
User
Input Data
Software Process
Processed Data
Output

A DFD converts this movement into an easy visual form so developers, analysts, managers and users can understand the system without reading source code.

Purpose of Data Flow Diagram

The main purpose of a DFD is to show the movement and transformation of data inside a system.

1

Understand Data Movement

It shows where information enters the system and where it goes next.

2

Understand Processes

It shows which activities transform input data into useful output.

3

Identify Data Storage

It shows where important information is stored for future use.

4

Improve Communication

A diagram is easier to discuss with users and managers than programming code.

5

Analyse Requirements

Analysts can use DFDs to understand what information the proposed system needs.

6

Find Missing Logic

Incorrect or missing data flows may reveal gaps in system requirements.

Main Components of a Data Flow Diagram

A standard DFD mainly contains four important components:

  1. External Entity
  2. Process
  3. Data Flow
  4. Data Store

These four components are enough to represent the logical movement of data in most systems.

DFD Symbols Explained

Customer

1. External Entity

An external entity is a person, organisation, department or another system that sends data to the system or receives data from it.

It exists outside the system boundary.

Examples:
  • Customer
  • Student
  • Admin
  • Teacher
  • Bank
  • Payment Gateway
  • Another software system
Process Order

2. Process

A process represents an activity that receives some input data, performs an operation on it and produces output data.

A process should normally be named using an action or verb.

Good process names:
  • Verify Login
  • Process Payment
  • Register Student
  • Generate Report
  • Calculate Salary
Student Details

3. Data Flow

A data flow shows the movement of information between external entities, processes and data stores.

It is normally represented using an arrow.

Examples:
  • Login Details
  • Payment Information
  • Student Record
  • Order Details
  • Result Data
Student Database

4. Data Store

A data store represents a place where information is kept for later use.

In a real software system, this may represent a database, file or other persistent storage.

Examples:
  • Student Database
  • Customer Records
  • Product Database
  • Employee File
  • Order Database

Easy Memory Trick for DFD Components

E – P – F – S
Entity → Process → Flow → Store

You can remember that a DFD normally contains an Entity, Process, Data Flow and Data Store.

DFD Symbols at a Glance

Symbol Meaning Main Purpose Example
External Entity Person or system outside the main system Sends or receives data Student, Customer, Bank
Process Activity that transforms data Changes input into output Verify Login
Data Flow Movement of information Connects DFD components Login Details
Data Store Stored information Keeps data for future use Student Database

Simple DFD Example: Student Login System

Suppose a student wants to log in to a college portal.

The student enters a username and password. The system checks these details against the stored student data and returns a login result.

Student Login DFD
Student
Login Details
Verify Login
Request Record
Student Database
What is happening here?
  1. The student provides login details.
  2. The Verify Login process receives those details.
  3. The process checks the student database.
  4. The database provides the required record.
  5. The process decides whether login should be allowed.
  6. The student receives the login result.

Levels of Data Flow Diagram

A large software system can become difficult to understand if everything is shown in a single diagram.

Therefore, DFDs are divided into different levels.

Level 0 Shows the complete system as one process.
→
Level 1 Breaks the main system into major processes.
→
Level 2 Breaks one Level 1 process into smaller sub-processes.
→
Further Levels More detail can be added when necessary.

Level 0 DFD or Context Diagram

A Level 0 DFD gives the highest-level view of a system. It normally represents the whole system as a single process.

Level 0 is also commonly called a Context Diagram.

Important:

In Level 0, we are not interested in internal details. We only want to know who interacts with the system and what data enters or leaves it.

Example: Online Shopping System Level 0 DFD

Context Diagram
Customer
Order Details
Online Shopping System
Payment Request
Payment Gateway

Here the complete online shopping application is shown as only one process.

We can see that the customer sends information to the system and that the system interacts with the payment gateway.

We still do not know what internal processes are happening.

Level 1 DFD

A Level 1 DFD expands the single process shown in Level 0 into major internal processes.

This gives a clearer understanding of how the system actually handles information.

Online Shopping System Level 1 Processes

  • 1.0 Manage Customer
  • 2.0 Browse Products
  • 3.0 Process Order
  • 4.0 Process Payment
  • 5.0 Update Inventory
Simplified Level 1 DFD
Customer
Order Details
3.0
Process Order
Save Order
Order Database

Level 1 therefore provides more detail than Level 0.

Level 2 DFD

A Level 2 DFD expands one of the major processes from Level 1 into smaller sub-processes.

Suppose Level 1 contains: 3.0 Process Order.

At Level 2, this process may be divided into:

  • 3.1 Receive Order
  • 3.2 Validate Order
  • 3.3 Check Product Availability
  • 3.4 Calculate Total
  • 3.5 Confirm Order
Easy way to understand:

Level 0 tells you what the whole system does.

Level 1 tells you what major parts exist inside the system.

Level 2 tells you how one major part works in more detail.

Difference Between Level 0, Level 1 and Level 2 DFD

Basis Level 0 Level 1 Level 2
Detail Very high level Moderate detail More detailed
System View Whole system Major processes Sub-processes
Main Purpose Show system boundary Show internal functions Explain one function deeply
Processes Usually one main process Several major processes Detailed sub-processes
Other Name Context Diagram First-level decomposition Detailed decomposition

What is Decomposition in DFD?

Decomposition means breaking a large process into smaller and more understandable processes.

DFD levels are created using decomposition.

Example:

Level 0: Library Management System

Level 1:

  • Manage Member
  • Search Book
  • Issue Book
  • Return Book
  • Calculate Fine

Level 2 of “Issue Book”:

  • Check Member
  • Check Book Availability
  • Create Issue Record
  • Update Book Status

This makes a complex system easier to understand without showing everything at once.

What is Balancing in DFD?

Balancing means that the input and output data flows shown at a higher DFD level should remain consistent when that process is expanded at the next level.

This is one of the most important DFD rules.

Simple meaning:

If Level 0 shows that Customer sends Order Details to the system, then when the system is expanded in Level 1, those Order Details should still enter one of the internal processes.

They should not suddenly disappear.

Example of Balanced DFD

Suppose Level 0 contains:

Customer → Order Details → Shopping System

Level 1 should contain something like:

Customer → Order Details → Process Order

Because the input data still exists, the diagram remains balanced.

Rules for Drawing a Data Flow Diagram

A DFD should follow some basic rules so that the diagram remains logically correct.

Rule 1

Every process should normally have at least one input and one output.

Rule 2

Data should not normally flow directly from one external entity to another through the DFD system.

Rule 3

An external entity should not directly access a data store. A process should normally exist between them.

Rule 4

Data should not normally move directly from one data store to another. A process should transform or control the movement.

Rule 5

Every data flow should have a meaningful name.

Rule 6

Processes should be named using clear action words such as Verify, Calculate, Process, Generate or Update.

Rule 7

The same external entity may appear more than once in a large diagram if this improves readability.

Rule 8

DFD levels should remain balanced.

Connections You Should Avoid in a DFD

External Entity → External Entity

A DFD focuses on the system being analysed. Direct communication between two outside entities is generally not represented as internal system processing.

External Entity → Data Store

An external user should normally interact with a process, and that process accesses the data store.

Data Store → Data Store

Information moving between two data stores should normally pass through a process.

Common DFD Process Errors

Three important DFD errors are often asked in exams:

1. Black Hole

A Black Hole happens when a process receives input but produces no output.

Example:

Student sends registration details to “Register Student” process, but the process does not produce or store any result.

2. Miracle

A Miracle happens when a process produces output without receiving enough input.

Example:

A process generates a complete salary report even though no employee or salary data has entered the process.

3. Grey Hole

A Grey Hole happens when the available input is not sufficient to logically produce the shown output.

Example:

A process receives only a student ID but somehow produces the student's complete medical history, financial record and academic report without reading any data store.

Logical DFD and Physical DFD

DFDs can also be classified as Logical DFD and Physical DFD.

Logical DFD

A Logical DFD focuses on what the system does.

It shows business activities and the logical movement of information without focusing on the technology used to implement them.

Example:

Receive Application → Verify Application → Approve Application

Physical DFD

A Physical DFD focuses more on how the system is implemented.

It may include actual people, software, files, devices or implementation-specific details.

Basis Logical DFD Physical DFD
Focus What the system does How the system works
Implementation Less implementation detail More implementation detail
Technology Technology independent May include actual technology
Use Requirement and business analysis Implementation planning

How to Draw a Data Flow Diagram Step by Step

Understand the System

First understand what the software is supposed to do. Do not start drawing immediately.

Identify the system's purpose, major users and main activities.

Identify External Entities

Find people or external systems that send information to the system or receive information from it.

Examples may include Customer, Student, Admin, Teacher, Bank or Supplier.

Identify Main Inputs and Outputs

Determine what information enters and leaves the system.

Examples include Login Details, Order Details, Payment Result, Student Record and Report.

Create the Context Diagram

Represent the entire system as one process and connect it with external entities.

Identify Major Processes

Break the system into major functions.

These processes will become part of Level 1.

Identify Data Stores

Find the places where important information needs to be stored.

Examples include Student Database, Product Database and Order Database.

Connect the Data Flows

Use arrows to show how information moves from one component to another.

Label Everything Clearly

Give meaningful names to processes, flows, entities and data stores.

Check Balancing

Compare Level 0 and Level 1 to make sure important inputs and outputs have not disappeared or appeared without explanation.

Review the Diagram

Check for incorrect connections, black holes, miracles, missing flows and unnecessary details.

Complete DFD Example: Library Management System

Now let us understand DFD using a complete example.

Suppose a college library wants software for managing members, books, book issue, returns and fines.

External Entities

  • Student
  • Librarian

Main Processes

  • Manage Member
  • Search Book
  • Issue Book
  • Return Book
  • Calculate Fine

Data Stores

  • Member Database
  • Book Database
  • Issue Records

Library Management System – Level 0

Student
Book Request
Library Management System
Book Status
Librarian

The context diagram treats the complete library system as one process.

Library Management System – Level 1

Now we break the main system into major processes.

Process Input Main Activity Output
1.0 Manage Member Student details Create or update member record Member information
2.0 Search Book Book query Search book records Book availability
3.0 Issue Book Issue request Verify member and book Issue confirmation
4.0 Return Book Return details Update issue record Return confirmation
5.0 Calculate Fine Issue and return dates Calculate late fee Fine amount

Level 2 of Process 3.0 – Issue Book

The Issue Book process can be decomposed into smaller processes:

  1. 3.1 Receive Issue Request
  2. 3.2 Verify Member
  3. 3.3 Check Book Availability
  4. 3.4 Create Issue Record
  5. 3.5 Update Book Status
  6. 3.6 Send Confirmation
Notice the pattern:

We started with one big system at Level 0.

Then we divided it into major processes at Level 1.

Finally, we opened one of those processes and studied it in detail at Level 2.

DFD vs Flowchart

Students frequently confuse a Data Flow Diagram with a flowchart. Both are diagrams, but they describe different things.

Basis DFD Flowchart
Full Form Data Flow Diagram Flowchart
Main Focus Movement of data Sequence of steps or control logic
Shows Decision Logic Usually not its main purpose Yes
Data Store Important component Not always central
Use System analysis Algorithm and process logic
Main Question Where does data go? What step happens next?
Remember:

DFD = Data movement

Flowchart = Step-by-step control flow

DFD vs ER Diagram

A DFD should also not be confused with an Entity Relationship Diagram.

Basis DFD ER Diagram
Focus Flow of data Structure and relationships of data
Main Elements Process, flow, store, external entity Entity, attribute, relationship
Main Purpose Understand system functions Design database structure
Question Answered How does information move? How is information related?

DFD vs Use Case Diagram

Basis DFD Use Case Diagram
Focus Movement and processing of data User interaction with system functions
User Representation External entity Actor
Internal Data Can show data stores and flows Usually does not show detailed data movement
Main Use Process and data analysis Functional requirement modelling

How Should DFD Components Be Named?

Process Names

Process names should usually describe an action.

Good:
  • Verify Student
  • Process Payment
  • Generate Result
  • Calculate Fine
  • Update Inventory
Weak or unclear:
  • Student
  • Payment
  • Data
  • System

Data Flow Names

Data flows should describe the information being transferred.

  • Student Details
  • Payment Details
  • Order Request
  • Login Credentials
  • Result Information

Data Store Names

Data store names should tell the reader what type of information is stored.

  • Student Database
  • Employee Records
  • Product Database
  • Order Records

Process Numbering in DFD

Processes are often numbered to make different levels easier to understand.

Level 1:

  • 1.0 Manage User
  • 2.0 Manage Product
  • 3.0 Process Order

Level 2 decomposition of Process 3.0:

  • 3.1 Receive Order
  • 3.2 Validate Order
  • 3.3 Calculate Total
  • 3.4 Confirm Order

The numbering helps show which sub-process belongs to which parent process.

Advantages of Data Flow Diagram

Easy to Understand

Visual representation is easier than reading technical documentation.

Improves Communication

Developers and non-technical users can discuss the same system model.

Shows Data Movement

It clearly explains how information travels through the system.

Supports Requirement Analysis

Missing inputs, outputs and processes can become easier to identify.

Handles Complexity

Levels allow a complex system to be studied gradually.

Useful Documentation

DFDs provide a useful visual reference during system analysis and design.

Limitations of Data Flow Diagram

  • A DFD does not show detailed program logic.
  • It does not normally show the exact sequence in which operations are executed.
  • Complex systems may require many DFD levels.
  • A poorly designed DFD can become confusing.
  • It does not replace database design diagrams.
  • It does not clearly represent timing and control behaviour.
  • Different notation styles may sometimes confuse beginners.

Common Mistakes Students Make While Drawing DFD

Mistake 1: Treating DFD Like a Flowchart

A DFD should show data movement, not every decision and control step.

Mistake 2: Drawing Direct Entity-to-Database Connection

A process should normally exist between an external entity and a data store.

Mistake 3: Using Unclear Flow Names

Do not write only “Data”. Write something meaningful such as “Student Details” or “Payment Information”.

Mistake 4: Forgetting Balancing

Important input or output flows should not disappear when moving from Level 0 to Level 1.

Mistake 5: Putting Too Much Detail in Level 0

Level 0 should remain simple and show the complete system at a high level.

Mistake 6: Using Nouns for Process Names

A process should normally describe an activity, such as “Generate Report” instead of simply “Report”.

Exam-Oriented Definition of DFD

A Data Flow Diagram (DFD) is a graphical representation of the flow of data through an information system. It shows external entities, processes, data flows and data stores, and helps in understanding how information enters, is processed, stored and leaves a system.

2 Marks Question: What is DFD?

A Data Flow Diagram is a graphical model that represents how data moves through a system. It uses symbols for external entities, processes, data stores and data flows.

5 Marks Question: Explain Symbols of DFD

The four main DFD symbols are:

  1. External Entity: Represents a person or external system that sends or receives data.
  2. Process: Represents an activity that transforms input data into output.
  3. Data Flow: Represents movement of information and is shown using arrows.
  4. Data Store: Represents information stored for later use.

5 Marks Question: Explain Levels of DFD

DFDs are divided into levels to reduce complexity.

  • Level 0: Shows the complete system as one process and is also called a Context Diagram.
  • Level 1: Breaks the system into major processes.
  • Level 2: Breaks a Level 1 process into smaller sub-processes.

10 Marks Question: Explain DFD with Symbols and Levels

For a long-answer question, use this sequence:

  1. Write the definition of DFD.
  2. Explain its purpose.
  3. Draw and explain the four symbols.
  4. Explain Level 0.
  5. Explain Level 1.
  6. Explain Level 2.
  7. Write the concept of decomposition and balancing.
  8. Draw one example such as Library Management System.
  9. Write advantages.
  10. End with a short conclusion.

Fast Memory Trick for DFD Levels

0 → 1 → 2

Whole System → Major Processes → Detailed Sub-processes

Quick Revision Notes

  • DFD stands for Data Flow Diagram.
  • It represents the movement of data through a software system.
  • The four main components are External Entity, Process, Data Flow and Data Store.
  • External Entity represents a source or destination outside the system.
  • Process transforms input data into output data.
  • Data Flow represents movement of information.
  • Data Store represents stored information.
  • Level 0 is also called a Context Diagram.
  • Level 1 breaks the system into major processes.
  • Level 2 breaks a major process into smaller sub-processes.
  • Breaking a process into smaller processes is called decomposition.
  • Inputs and outputs should remain consistent between DFD levels. This is called balancing.
  • A Black Hole has input but no output.
  • A Miracle has output without proper input.
  • A Grey Hole produces output that cannot logically be created from the available input.
  • Logical DFD explains what the system does.
  • Physical DFD explains how the system is implemented.
  • DFD focuses on data movement, while a flowchart focuses on process sequence and control flow.

Frequently Asked Questions

What is DFD in software engineering?

A Data Flow Diagram is a graphical model that shows how data enters a system, moves between processes, is stored and finally produces output.

What are the four main symbols of DFD?

The four main DFD symbols are External Entity, Process, Data Flow and Data Store.

What is Level 0 DFD?

Level 0 DFD shows the complete system as one main process and its interaction with external entities. It is commonly called a Context Diagram.

What is Level 1 DFD?

Level 1 DFD expands the main system into its major internal processes and may also show data stores and detailed data flows.

What is Level 2 DFD?

Level 2 DFD provides additional detail by decomposing one of the Level 1 processes into smaller sub-processes.

What is balancing in DFD?

Balancing means that the important input and output data flows of a process should remain consistent when the process is expanded to the next DFD level.

What is decomposition in DFD?

Decomposition is the process of breaking one large DFD process into smaller and more detailed sub-processes.

What is the difference between DFD and flowchart?

A DFD mainly shows how data moves through a system, while a flowchart mainly shows the sequence and control logic of steps in a process or algorithm.

What is a logical DFD?

A logical DFD focuses on what activities the system performs without focusing heavily on implementation technology.

What is a physical DFD?

A physical DFD describes how the system may actually be implemented using people, software, files, devices and other physical components.

What is a Black Hole in DFD?

A Black Hole is a process that receives data but does not produce any meaningful output.

What is a Miracle in DFD?

A Miracle is a process that produces output even though it has no sufficient input to generate that output.

Conclusion

A Data Flow Diagram is one of the most useful tools for understanding a software system during analysis and design. Instead of focusing on programming language or technical code, it focuses on the movement of information.

The four basic components of a DFD are External Entity, Process, Data Flow and Data Store. Once these four symbols are clear, understanding DFD becomes much easier.

Large systems are represented using different levels. Level 0 gives a high-level view of the complete system, Level 1 shows major processes and Level 2 provides more detailed sub-processes.

Students should also remember important concepts such as decomposition, balancing, logical DFD, physical DFD, Black Hole, Miracle and Grey Hole, because these are frequently connected with DFD questions in software engineering examinations.

The easiest way to remember the entire topic is:

DFD = Who sends the data → What process handles it → Where the data is stored → Where the result goes.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Join Telegram Exam updates and free resources