80 likes | 213 Views
In software development, effective planning and documentation are crucial. Two fundamental tools to aid this process are Data Flow Diagrams (DFDs) and Control Flow Diagrams (CFDs). DFDs provide an abstract representation of the system's functionality, illustrating how tasks are partitioned and what information flows between them. CFDs, created after DFDs, depict the sequencing of operations, similar to flowcharts. Although they may seem complex, especially for functions with multi-way branching, they are essential for thorough planning, ensuring clarity and efficiency in software design.
E N D
Software Models How to plan your SW development
SW Models • There are many types of SW models that can be used for planning and documentation • Unified Modeling Language (UML) is one example • Some can be quite complex and onerous • We will only be using two • Data Flow Diagrams (DFDs) • Control Flow Diagrams (CFDs)
Data Flow Diagrams • The DFD is done first and illustrates two important aspects of the design • How is the SW functionality (tasks) partitioned • What information is passed between partitions • Early in development may be quite abstract • Partitions may not correspond to specific C functions and information may not represent specific C variables • Intended to aid in planning
Sample DFD Does not show the order in which modules are called from main()
Control Flow Diagram • Only done after DFD • Illustrates the “sequencing” of operations or functions, just like a flowchart • May not be needed for simple functions • Can be painful for documenting multi-way branching (e.g., nested if statements or switch-case statements)
Sample CFD • Four modules called from within main() • Infinite loop • Fixed sequence • read inputs • compute • generate outputs • Executes at the speed of the loop
If-then Statements • Early in development may only identify a “condition”, rather than a specific variable • Final version should identify the variable and the two choices
Switch-Case Statements • More efficient (and comprehensible!) than nested if-then statements • For elaborate decision trees, may want to illustrate one or two complete paths and then indicate symmetry with ellipses (…)