80 likes | 204 Views
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)
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 (…)