CS223: Software Engineering Lecture 11: Software Design
Recap UML Diagram Sequence Diagram Activity Diagram
Objective After completing this lecture students will be able to Model software design using Data Flow Diagram
Structure and Architecture Software design Design Fundamentals Concepts Context Process Principles Key Issues Concurrency Events Data Components Errors and Exceptions Interaction Security Structure and Architecture Structure View-point DP Programs UI Design Issues Modality Presentation Localization Metaphor Modeling QA Attributes Measure Strategies FO OO DS CBD Notations Static view Dynamic view Tools
Introduction Definition: The process of defining the architecture, components, interfaces, and other characteristics of a system or component The result of [that] process Creates the blueprint of the solution to be implemented
Standards Architectural design Detailed design Software design Software life cycle process standard: ISO/IEC/IEEE Std. 12207 Top-level structure and organization Specify components in sufficient detail
Data Flow Modeling Widely used; focuses on functions performed in the system Views a system as a network of data transforms through which the data flows Uses data flow diagrams (DFDs) and functional decomposition in modeling The SSAD methodology uses DFD to organize information, and guide analysis
Data flow diagrams A DFD shows flow of data through the system Views system as transforming inputs to outputs Transformation done through transforms DFD captures how transformation occurs from input to output as data moves through the transforms Not limited to software
Data flow diagrams… DFD Transforms represented by named circles/bubbles Bubbles connected by arrows on which named data travels A rectangle represents a source or sink and is originator/ consumer of data (often outside the system)
DFDs: Graphical Notation Symbols to represent external entities i
DFDs: Graphical Notation Data flow: A path of a particular type of data
DFDs: Graphical Notation Functions/Processes: Transform an input data flow to an output data flow
DFDs: Graphical Notation Data store: Data/information store
DFD Example
DFD Conventions External files shown as labeled straight lines Need for multiple data flows by a process represented by * (means and) OR relationship represented by + All processes and arrows should be named Processes should represent transforms Arrows should represent some data
Data flow diagrams Focus on what transforms happen , how they are done is not important Usually major inputs/outputs shown, minor are ignored in this modeling No loops , conditional thinking , … DFD is NOT a control chart, no algorithmic design/ thinking Sink/ Source , external files
Drawing a DFD for a system Identify inputs, outputs, sources, sinks for the system Work your way consistently from inputs to outputs, and identify a few high-level transforms to capture full transformation If get stuck, reverse direction When high-level transforms defined, then refine each transform with more detailed transformations
Drawing a DFD for a system.. Never show control logic; if thinking in terms of loops/decisions, stop & restart Label each arrows and bubbles; carefully identify inputs and outputs of each transform Make use of + & * Try drawing alternate DFDs
Leveled DFDs DFD of a system may be very large Can organize it hierarchically Start with a top level DFD with a few bubbles Then draw DFD for each bubble Preserve I/O when “ exploding” a bubble so consistency preserved Makes drawing the leveled DFD a top-down refinement process, and allows modeling of large and complex systems
DFDs: Levels DFDs can be drawn at multiple levels: Topmost level of DFD is called the Context diagram. Context diagram: Level 1 DFD:
DFDs: Levels Level 2 DFD: Each process in a Level 2 DFD can be further exploded to form a Level 3 DFD and so on.. Top-down expansion: Usually not advisable to go beyond Level 3 DFD.
Data Dictionary In a DFD arrows are labeled with data items Data dictionary defines data flows in a DFD Shows structure of data; structure becomes more visible when exploding Can use regular expressions to express the structure of data
DFD drawing – common errors Unlabeled data flows Missing data flows Extraneous data flows Consistency not maintained during refinement Missing processes Too detailed or too abstract Contains some control information
DFD: Course Registration System Consider a course registration system. When a student provides a prioritized list of courses and other information to the system, this information is transformed into a list of preferences. The list of preferences is used to verify the eligibility of the students using the student records and the course prerequisites. If the student is eligible to register for the courses he/she desires, then the student is enrolled in those courses, and the class schedule is communicated back to the student. In addition, the system also compiles the list of students enrolled in each class using the registration information for each student. This list is then given to the faculty. The list is also forwarded to the registrar so that a classroom of an appropriate capacity can be allocated depending on the number of students enrolled.
DFD: Course Registration System Consider a course registration system. When a student provides a prioritized list of courses and other information to the system, this information is transformed into a list of preferences. The list of preferences is used to verify the eligibility of the students using the student records and the course prerequisites. If the student is eligible to register for the courses he/she desires, then the student is enrolled in those courses, and the class schedule is communicated back to the student. In addition, the system also compiles the list of students enrolled in each class using the registration information for each student. This list is then given to the faculty. The list is also forwarded to the registrar so that a classroom of an appropriate capacity can be allocated depending on the number of students enrolled.
DFD: Course Registration System Context Diagram for Course Registration System Courses & other info. Faculty Students Registration Process Class schedule Class list Registrar
DFD: Course Registration System Level 1 DFD Students Individual Course Registration Information Courses & Other info. 2. Compile & Distribute Information 1. Enroll Students Registrar Schedules Class Lists Students Faculty Note: External entity Students is replicated to avoid crossing lines
DFD: Course Registration System Level 2 DFD Courses & Other info. Student Records Course Prereqs 1.1 Obtain Student Preferences 1.2 Check Eligibility List of Preferences Eligible Students 1.3 Enroll Students in Classes Individual course registration information
Structured Analysis Method Structured system analysis and design (SSAD) – we will focus only on analysis Was used a lot when automating existing manual systems Main steps Draw a context diagram Draw DFD of the existing system Draw DFD of the proposed system and identify the man- machine boundary
Context Diagram Views the entire system as a transform and identifies the context Is a DFD with one transform (system), with all inputs, outputs, sources, sinks for the system identified
DFD of the current system The current system is modeled as-is as a DFD to understand the working The context diagram is refined Each bubble represents a logical transformation of some data Leveled DFD may be used Generally obtained after understanding and interaction with users Validate the DFD by walking through with users
Modeling the Proposed System No general rules for drawing the DFD of the future system Use existing system understanding DFD should model the entire proposed system - process may be automated or manual Validate with the user Then establish man-machine boundary what processes will be automated and which remains manual Show clearly interaction between automated and manual processes
Example – context diagram
Example – DFD of existing sys
Example – DFD of proposed system
Thank you Next Lecture: System Modeling