Data Flow Diagram in Software Engineering

Data-Flow-Diagram-in-Software-Engineering-Featured-image.jpg

A data flow diagram is one of the most important and powerful tools that is used to represent how the data moves through a system. In today’s world of system design and analysis, whether you are designing a new software application or analyzing an existing business process, DFDs help you to break down complex systems into clear and manageable components by showing the flow of data or information. This article will help you understand the definition, characteristics, rules, levels, advantages, and disadvantages of the data flow diagrams (DFDs).

Table of Contents:

What is a Data Flow Diagram (DFD)?

A data flow diagram (DFD) is basically a graphical representation of how the data moves through a system. It shows the flow of data or information between processes. It provides the representation for both the incoming and outgoing data flow.

DFD illustrates the inputs, outputs, data stores, and processes within a system. It is commonly used in system analysis and design to visualize and understand the flow of data in a system. A data flow diagram can typically be formed at different levels, such as Level 0, which shows the context diagram, Level 1, and more detailed diagrams. The data flow diagram helps to manage complex systems by dividing them into simpler and more manageable parts. 

Characteristics of Data Flow Diagram (DFD)

Here are a few characteristics of the data flow diagram (DFD) that will help you to understand why DFD is important in software development.

  • Graphical Representation: A data flow diagram (DFD) uses various types of symbols, such as circles, arrows, rectangles, and open-ended rectangles, to represent the flow of data and system components visually.
  • Data Movement Focus: It shows how the data moves through the system rather than how the system works internally.
  • Hierarchy Levels: DFD is developed in different levels, such as Level 0, Level 1, etc., to break down the processes into more manageable parts.
  • Problem Analysis: A data flow diagram (DFD) is a valuable tool for understanding and analyzing systems, especially to find any problems in the early stages of software development.

Components of Data Flow Diagram (DFD)

There are four main components of the data flow diagram (DFD) that work together to show how the data flows within the system. 

1. External Entity 

The external entity is the object outside the system that interacts with the system by providing input data or receiving output data. These external entities are also known as sources or sinks.

The important things that you should keep in mind about the external entities are:

  • The external entity is represented by the rectangles in a data flow diagram (DFD).
  • It initiates data flow into the system or receives the information from it.
  • It should be labeled clearly with descriptive names.

Example: In an online shopping system, a “Customer” who places orders would be an external entity.

Professional Certification Program in Software Development Engineering Course
Get Certified by IIT Roorkee & Microsoft - Join Today!
quiz-icon

2. Process

The process is the function that changes the input data into the output data in the system. 

The important things that you should keep in mind about the processes are:

  • A process is represented by the circles or rounded rectangles in the data flow diagram.
  • It shows how the data is processed, including calculations, validations, or decisions.
  • Every process must have at least one input and one output data flow.
  • Always use the verb-noun format to write the name of the function.
  • Also, the high-level processes can be decomposed or broken down into sub-processes for more detail in lower DFD levels.

Example: In a library system, a process like “Issue Book” would take data from a user and then update the records in the data store.

3. Data Store

Data store represents the places where the data is stored for processing when it is needed. It can be databases, files, or any form of data storage. 

The important things that you should keep in mind about the data stores are:

  • A data store is represented by an open-ended rectangle or sometimes two parallel horizontal lines in the data flow diagram.
  • The data stores allow the data to be stored and retrieved by the processes when it is needed.
  • Only processes can read from and write to data stores, and the external entities do not directly access them.
  • The data stores should be named using the noun-based labels.
  • Arrows are used to show the data flow to a data store. An arrow to a data store means data is being written, and an arrow from a data store means data is being retrieved.

Example: In a hospital management system, a data store like “Patient Records” stores the patient details for use in various treatment processes.

4. Data Flow

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

The important things that you should keep in mind about the data flows are:

  • The data flow is represented by the arrows labeled with the name of the data being moved.
  • The direction of the arrows shows the flow of the data from the source to the destination.
  • Data flows link processes, external entities, and data stores together to show the interactions between them.
  • Always use noun-based labels that describe the data content for the naming of the data flow.

Example: In an ATM system, a data flow labeled “PIN Entry” might go from the “User” to the “Validate PIN” process.

Rules for Creating a Data Flow Diagram (DFD)

Here are a few rules that you must follow while creating a data flow diagram:

  • Every process must have at least one input and one output in a data flow diagram.
  • The external entities cannot exchange data directly with each other; thus, data must pass through a process.
  • Data stores must connect only to processes, not directly to other data stores or entities.
  • Do not include the control flow or decision logic; only focus on the data movement.
  • Maintain the consistency between DFD levels, so that the data flows match them.

Levels of Data Flow Diagram (DFD)

DFDs (data flow diagrams) in software engineering are used to show the systems at different degrees of abstraction. The levels of the data flow diagrams are numbered as 0, 1, 2, and higher. Here are the three main levels of the data flow diagram (DFD) that we will discuss briefly:

0-Level DFD (Context Diagram)

A DFD at the 0-level is also known as the context diagram. It represents the entire system as a single process. The diagram at this level shows the interaction of the system with the external entities. A 0-level DFD shows all the input and output data flows between the system and the external entities. At this level, no data stores are included in the data flow diagram. It provides a high-level overview of the system without going into the internal processes. Also, it helps the stakeholders to understand the system boundaries and data exchanges by viewing it once.

0-Level DFD (Context Diagram)

Let’s understand the above 0-level data flow diagram in detail.

System: Online Bookstore

Components:

The three main components in this data flow diagram (DFD) are;

  • External Entities:
    • Customer
    • Bank
  • Single Process:
    • Online Bookstore System
  • Data Flows:
    • From Customer to System: Order Details, Payment Info
    • From System to Customer: Order Confirmation, Receipt
    • From System to Bank: Payment Request
    • From Bank to System: Payment Confirmation

Get 100% Hike!

Master Most in Demand Skills Now!

1-Level DFD

A 1-level data flow diagram breaks down the single process from the context diagram into multiple sub-processes. This diagram shows how the data moves between internal processes, data stores, and external entities. It includes data stores that were not present in the context diagram. At this level, each process is labeled and represents a specific function or operation within the system in the data flow diagram. It shows the detailed data flows of connecting sub-processes, data stores, and external entities. It provides a better understanding of how the particular function works within the system. The data flow diagram at this level helps the analysts to identify the key processes and how they interact with data inputs and outputs.

1-Level DFD

Let’s understand the above 1-level data flow diagram in detail.

System: Online Bookstore

This level breaks down the main process (from Level 0) into sub-processes for more detail.

Processes:

  • 1.0 Browse/Search Books
  • 2.0 Place Order
  • 3.0 Process Payment
  • 4.0 Send Confirmation

Data Stores:

  • D1: Book Database
  • D2: Order Records
  • D3: Payment Info

External Entities:

  • Customer
  • Bank

2-Level DFD

A level 2 data flow diagram is a diagram that is further decomposed into one or more processes from the level 1 DFD into more detailed sub-processes. This DFD provides a more detailed and granular view of how data flows within a specific part of the system. It maintains the same data stores and external entities from level 1, where the data seems relevant. 

In a 2-level DFD, each sub-process is labeled hierarchically, such as 1.1, 1.2, etc. This data flow diagram shows the additional data flows between the new sub-processes and the existing data stores or entities. It highlights the internal logic and functions that make up the single-level process. The 2-level DFD helps the developers and system designers to understand exactly how the individual components behave and interact.

2-Level DFD

Let’s understand the above 2-level data flow diagram in detail.

System: Online Bookstore – Process 2.0 “Place Order” Breakdown

At Level 2, we decompose Process 2.0 “Place Order” from the Level 1 DFD into more detailed sub-processes.

Processes:

  • 2.1 Validate Book Availability
  • 2.2 Create Order Record
  • 2.3 Confirm Stock Update
  • 2.4 Forward Payment Info

Data Stores:

  • D1: Book Inventory
  • D2: Order Records
  • D3: Payment Info

External Entities:

  • Customer
  • Bank

Advantages of Data Flow Diagram (DFD)

  1. The data flow diagram (DFD) is a visual representation of the flow of data in the system that allows you to see the entire flow of input and output data in the system.
  2. A DFD makes it easier to identify the system boundaries, sources, sinks, and data stores.
  3. One of the most helpful aspects of the data flow diagram is that it forms a bridge between the technologists and the non-technologists.
  4. The DFD is very helpful in gathering the requirements and in the analysis of the system, because it makes the processes much more understandable since they are looked at in smaller pieces.
  5. The DFD helps to find the redundancies, inefficiencies, or missing processes in the design, and it provides this capability early in the design process.
  6. The data flow diagram essentially keeps the design modular by breaking the system into smaller sub-processes.
  7. The DFD is useful for documentation or as a reference as you move through the system development life cycle.

Disadvantages of Data Flow Diagram (DFD)

  1. A DFD can become more complex and difficult to manage for large systems with many processes. 
  2. It needs a deep understanding of the system to create accurate diagrams.
  3. It is not suitable for modeling system behavior over time.
  4. A data flow diagram lacks the ability to represent the conditions, loops, or decision logic clearly.
  5. It is so time-consuming when there is a need to update the frequent changes. 
  6. It does not represent user interface elements or physical components of a system.

Conclusion

DFD is a powerful tool for modeling and analyzing the flow of information within the system. It helps to break down the complex systems into simple, clear, and understandable visuals. From high-level overviews (Level 0) to the detailed sub-processes (Level 2 and beyond), a data flow diagram supports system design, improves communication, and enhances documentation. Despite the limitations, they remain an important part of the structured system analysis and software engineering practices.

Data Flow Diagram in Software Engineering – FAQs

Q1. What does a data flow diagram (DFD) do?

A data flow diagram (DFD) is a visual representation of the asynchronous flow of data through a system, and makes the purpose of the system easier to comprehend and analyze.

Q2. What are the four main components of a data flow diagram (DFD)?

A data flow diagram (DFD) has four components, which are external entities, processes, data stores, and data flows.

Q3. What is the difference between Level 0 and Level 1 DFD?

Level 0 (Context Diagram) has a single representation of the full system processes, while Level 1 is a Level 0 DFD that breaks the system up into sub-processes that include data stores.

Q4. Can DFDs show decision or conditional control?

No, DFDs only represent data movement, and not conditions or control flow.

Q5. Are DFDs only used in software engineering?

DFDs are primarily used in software and systems analysis; however, data flow diagrams can be beneficial in any domain that includes some type of data-informed processes.

About the Author

Senior Consultant Analytics & Data Science, Eli Lilly and Company

Sahil Mattoo, a Senior Software Engineer at Eli Lilly and Company, is an accomplished professional with 14 years of experience in languages such as Java, Python, and JavaScript. Sahil has a strong foundation in system architecture, database management, and API integration. 

fullstack