Developing DFD Model of System
Data Flow Diagram (DFD) of a system represents how input data is converted to output data graphically. Level 0 also called context level represents most fundamental and abstract view of the system. Subsequently other lower levels can be decomposed from it. DFD model of a system contains multiple DFDs but there is a single data dictionary for entire DFD model. Data dictionary comprises definitions of data items used in DFD. Context diagram : It demonstrates entire data flow of a system in a single process/ bubble. Bubble is annotated with ‘Noun’ representing whole system. This is only bubble in DFD where a noun, (in the form of name of a system) is used. It is named since purpose of context diagram is to grab the context of system and not functionality. All other bubbles have a verb according to main function performed by it. Context diagram shows three main things : users, data flow to system and from system. It captures various external entities interacting with system, data to and from system as incoming and outgoing arrows. Context diagram requires analysis of SRS document. Data flow is represented with data names on top of arrow. Construction of Level 1 and other lower level diagrams : Level 1 DFD contains 3 to 7 bubbles representing functions. There are processes that can be broken down into sub – process each representing a bubble. Every Bubble has a verb demonstrating functionality of that process. To create level1/level 2 or other level DFDs, a bubble is broken into sub-parts containing 3-7 functionalities. If there are more than 7 sub process then some related information can be combines together. If there are less than 3 sub-process, it can be further decomposed to create more bubbles. Decomposition : Bubbles are decomposed into sub functions at successive levels of DFD level. Decomposition is called exploding/factoring a bubble. Each bubble at any level can be broken to anything between 3 and 7 bubbles. But a bubble should not be decomposed further once it is found to represent simple set of instructions. Too many bubbles at any level makes dfd hard to understand. Very less bubble makes decomposition redundant and trivial. Numbering : Each process symbol must utilize a unique reference number to differentiate from one other. When a bubble x is decomposed, its children are numbered as x.1, x.2 and so on. It can help determine its ancestors, successors, and precisely its level. For example level 0 DFD is numbered as 0. Level 1 are numbered as 0.1, 0.2, 0.3 or 1, 2, 3 and so on. Level 2 are marked as 1.1, 1.2, 1.3 etc. Balancing DFD : Parent dfd having inflow and out flow of data should match data flow at next child level. This is known as balancing a DFD. Concept is illustrated in figure :
In Level 1 DFD, data items D1 flow out of bubble 2 and item D2 flows into bubble 2. In next level, bubble 2 is decomposed into three sub process(2.1, 2.2, 2.3). It has data item D1 flowing out and D2 flowing in. So DFD is balanced here. A bubble representing a process should have minimum one input and one output flow. When a bubble has input flow without any output flow, it is known as “black hole”. When a process has output flows but no input flows, it is called a “miracle”. A processing step may have outputs that are greater than sum of its inputs is called Grey holes. Common mistakes to avoid while constructing DFDs :
- DFDs should always represent data flow and there should be no control flow.
- All external entities should be represented at context level.
- All functionality of system must be captured in dfd and none should be overlooked. Also, only those functions specified in SRS should be represented.
- Arrows connecting to data store need not be annotated with any data name.
- DFDs should always be balanced at all levels. Dataflow in and out of parent process must be present in child diagram.
- Context level bubble always contains name of entire system in form of noun and no verb can be used in its representation. Whereas all other levels only have verb in bubble representation.
- There should not be any database in level 0. Level 0 contains only one bubble and external entities.
- No cluttering should be depicted in DFD. When too many data flowing occurs in and out of DFD, combine these data item into high level item.
- All bubbles having unique process in DFDs should be connected to another process or to a data store. It cannot exist by itself, unconnected to rest of system.