04 - Structured DesignCSC4071 Structured Design –Fundamentals of a Discipline of Computer Program and Systems Design Edward Yourdon / Larry L. Constantine.

Slides:



Advertisements
Similar presentations
Quality of a Class Abstraction: Coupling & Cohesion Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Advertisements

Structured Design. 2 Design Quality – Simplicity “There are two ways of constructing a software design: One is to make it so simple that there are obviously.
Communication between modules, cohesion and coupling
1 Software Design Introduction  The chapter will address the following questions:  How do you factor a program into manageable program modules that can.
Slide 7A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
What is Software Design?  Introduction  Software design consists of two components, modular design and packaging.  Modular design is the decomposition.
Copyright Irwin/McGraw-Hill Software Design Prepared by Kevin C. Dittman for Systems Analysis & Design Methods 4ed by J. L. Whitten & L. D. Bentley.
Software Design Deriving a solution which satisfies software requirements.
UHD::CS3320::CHAP61 INTRODUCTION TO OBJECTS Chapter 6.
© Copyright 2011 John Wiley & Sons, Inc.
Copyright W. Howden1 Lecture 6: Design Evaluation and Intro to OO Design Patterns.
Module: Definition ● A logical collection of related program entities ● Not necessarily a physical concept, e.g., file, function, class, package ● Often.
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part I)
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
Jump to first page 1 System Design (Finalizing Design Specifications) Chapter 3d.
Criteria for good design. aim to appreciate the proper and improper uses of inheritance and appreciate the concepts of coupling and cohesion.
Chapter 1 Program Design
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Chapter 9 Moving to Design. The Structured Approach To Designing The Application Architecture Module-an identifiable component of a computer program that.
INTRODUCTION TO PROGRAMMING STRUCTURE Chapter 4 1.
Coupling and Cohesion Pfleeger, S., Software Engineering Theory and Practice. Prentice Hall, 2001.
Coupling and Cohesion Source:
Program Design Simple Program Design Third Edition A Step-by-Step Approach 9.
Software Design Designing the overall structure (architecture) of a software system Designing small pieces of computation Designing non-automated processes.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
SOFTWARE DESIGN.
Cohesion and Coupling CS 4311
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Systems analysis and design, 6th edition Dennis, wixom, and roth
Coupling & Cohesion CMSC 201- Fall '11. Vocabulary Routine- A programming unit that performs a task, such as a function, procedure, method, or main class.
Programming Logic and Design Using Methods. 2 Objectives Review how to use a simple method with local variables and constants Create a method that requires.
Coupling Cohesion Chandan R. Rupakheti Steve Chenoweth (Chapter 18)
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
Design. Software Design Design activity begins with a set of requirements, and maybe an architecture Design done before the system is implemented Design.
CCSB223/SAD/CHAPTER131 Chapter 13 Designing the System Internals.
CS540 Software Design Lecture 3 & 4 1 Lecture 3 & 4: Modularity, Coupling, Cohesion and Abstraction Anita S. Malik Adapted from Schach.
Structured design - 1 © Minder Chen, Produce Paycheck Retrieve Employee Record Global Data Store Offpage Calling Module Called Module System.
1 CSE1301 Computer Programming Lecture 24: Software Engineering.
Software Engineering Issues Software Engineering Concepts System Specifications Procedural Design Object-Oriented Design System Testing.
Systems Design.  Application Design  User Interface Design  Database Design.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Key Principles of Software Architecture and Design (II) adapted from Dave Penny’s.
Design. Software Design Design activity begins with a set of requirements, and maybe an architecture Design done before the system is implemented Design.
System Development And Analysis. MOVING FROM LOGICAL TO PHYSICAL PROCESS MODELS Analysis phase – focus on logical processes and data flows Design phase.
Systems Development Lifecycle
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Programming Logic and Design Fifth Edition, Comprehensive Chapter 7 Using Methods.
SOFTWARE DESIGN & SOFTWARE ENGINEERING Software design is a process in which data, program structure, interface and their details are represented by well.
Coupling and Cohesion Schach, S, R. Object-Oriented and Classical Software Engineering. McGraw-Hill, 2002.
Coupling and Cohesion Pfleeger, S., Software Engineering Theory and Practice. Prentice Hall, 2001.
Systems Analysis and Design in a Changing World, Fourth Edition
Further Modularization, Cohesion, and Coupling. Simple Program Design, Fourth Edition Chapter 9 2 Objectives In this chapter you will be able to: Further.
7. Modular and structured design
Coupling and Cohesion Rajni Bhalla.
Coupling and Cohesion 1.
Systems Analysis and Design
Lecture 17 Software Metrics
Software Modules in Software Design
Cohesion and Coupling Chapter 5, Pfleeger 01/01/10.
Software Design Designing the overall structure (architecture) of a software system Designing small pieces of computation Designing non-automated processes.
Improving the Design “Can the design be better?”
CS223: Software Engineering
Software Design CMSC 345, Version 1/11.
Software Design Lecture : 9.
Paper by D.L Parnas And D.P.Siewiorek Prepared by Xi Chen May 16,2003
Cohesion and Coupling.
DESIGN CONCEPTS AND PRINCIPLES
Presentation transcript:

04 - Structured DesignCSC4071 Structured Design –Fundamentals of a Discipline of Computer Program and Systems Design Edward Yourdon / Larry L. Constantine –Prentice-Hall, 1979 Purpose –Make methodical the process of designing software systems Mainly business systems Approach –Defines properties of a good procedural design –Defines a step-by-step method for transforming a data flow graph into a procedural design N.B. calls “procedures” (possibly with associated static data) “modules”, which differs from Parnas’ use of the term as a grouping of multiple procedures and related data

04 - Structured DesignCSC4072 Structured Design Significance Very popular in business circles. Never caught on in academic circles –Ideas are somewhat half-baked “theorems” with silly or no proofs Ill-described concepts (no firm definitions) –At a time when predicate logic to describe programming semantics was in vogue Nonetheless, full of useful concepts. Somewhat dated, as it applies best to data-flow oriented software (not interactive, real-time, or database oriented) –E.g., read update records from tape, merge them into a master file, and print a report.

04 - Structured DesignCSC4073 Modules and Connections Module –A lexically contiguous sequence of program statements, bounded by boundary elements, having an aggregate identifier. i.e., a “function” or “procedure” or ? “method” ? normal pathological Connections

04 - Structured DesignCSC4074 Limitations on Dealing with Complexity Errors: 7 ± 2 rule –Based on work of psychologist George Miller Now questioned in the HCI community

04 - Structured DesignCSC4075 Total Errors in a System Two opposing forces: –Intra-module complexity : Complexity within one module –Inter-module complexity: Complexity of modules interacting with one another Inter-module effect grows as the number of modules grow Intra-module effect decrease as the modules become smaller Total errors is a combination Errors # of modules

04 - Structured DesignCSC4076 Overall Cost The cost of developing most systems –≈ cost of debugging them ( + cost of changing them nowadays) These costs are directly related to the overall complexity –Complexity injects more errors and makes them harder to fix –Complexity requires more changes and makes them harder to effect. Complexity can be decreased by breaking the problem into smaller pieces –So long as those pieces are relatively independent of one another Eventually, the process of breaking pieces into smaller pieces creates more complexity than it eliminates. –1970s: Happens later than most designers would like to believe. –2000s: Happens sooner than most designers would like to believe.

04 - Structured DesignCSC4077 Design Approach Therefore, there is some optimal level of sub-division that minimizes complexity –Use your judgment Once you know the right level, then must choose how to sub-divide: –Minimize coupling between modules Reduces the complexities of interaction –Maximize cohesion within modules Keeps changes from propagating –Duals of one another.

04 - Structured DesignCSC4078 Coupling Two modules are independent if each can function completely without the presence of the other. –They are decoupled or uncoupled. Highly coupled modules are joined by many interconnections/dependencies Loosely coupled modules are joined by few interconnections/dependencies Wish to minimize coupling between modules in a system –Coupling = probability that in coding/modifying/debugging module A we will have to take into account something about module B

04 - Structured DesignCSC4079 Influences on Coupling Type of connection –Minimally connected: parameters to a subroutine –Pathologically connected: non-parameter data references Interface complexity –Number of parameters/returns –Difficulty of usage. e.g., A = sqrt(x,y,z) Information flow –Data flow Passing a of data to be acted upon in a uniform fashion –Control flow Passing of flags that govern how other data is processed Binding time –More static = more complex e.g., literal ’80’ versus pervasive constant N_STUDENTS, versus execution-time parameter.

04 - Structured DesignCSC40710 Common-Environment Coupling A module writes into global data A different module reads from it (data or, worse, control). Q RS T U V W X

04 - Structured DesignCSC40711 Coupling Example 1 Alternate interfaces: –void getChar(bool& eof, char& c) –char getChar(bool& eof); –char getChar(); Either way: –1 data coupling –1 control coupling main() getChar()

04 - Structured DesignCSC40712 Coupling Example 2 main() getLine() getChar() parseCmd()execCmd()

04 - Structured DesignCSC40713 Interfaces void getChar(char& c, bool& eof); void getLine(char* &line, bool& eof); void parseCmd(char* line, Command& cmd); void execCmd(Command cmd); 3 data couplings, 4 command couplings

04 - Structured DesignCSC40714 Example Go to your tutorial! I will give you a similar question on the exam.

04 - Structured DesignCSC40715 Cohesion While minimizing coupling, we must also maximize cohesion. –How well a particular module “holds together”. –The cement that holds a module together –Answers the questions: Does this make sense as a distinct module? Do these things belong together? –Best cohesion is when the cohesion comes from the problem space, not the solution space Echoed years later in OOA/OOD

04 - Structured DesignCSC40716 Elements of Processing A module is composed of processing elements. –ill-defined –roughly corresponds to flowchart steps Cohesion is a measure of how well the processing elements hang together as a module Cohesion of a module is –approximately the highest level of cohesion which is applicable to all elements of processing in the module

04 - Structured DesignCSC40717 Levels of Lack of Cohesion Coincidental –No rhyme or reason for doing 2 things in the same sub- routine void computeAndRead(double x, double& sqrtX, char& c); Logical –Similar class of things char input(bool fromFile, bool fromStdin); Temporal –Things that happen one after the other void initSimulationAndPrepareFirst()

04 - Structured DesignCSC40718 Levels of Lack of Cohesion (cont’d) Procedural –Operation are together because they are in the same loop or decision process (but no higher cohesion exists) –typeDecide(m) Decide type of plant being simulated and perform simulation part 1. Communicational –All operations are on the same set of input data, or produce the same set of output data void printReport(data x, data y, data z) Sequential –A sequence of steps that take the output of the previous step and process it into input for the next step. string compile(String program) { parse, semantic analysis, code generation }

04 - Structured DesignCSC40719 Cohesion (cont’d) Functional –That which is none of the above double sqrt(double x); –Does one and only one conceptual thing. –Equivalent to Information Hiding

04 - Structured DesignCSC40720 Implementation and Cohesion Consider module FG that does two things: F and G When doing these things in the same module, chances are there is some common code than can be shared. If F and G have high cohesion, that's ok. Otherwise it becomes difficult to work with G F G F

04 - Structured DesignCSC40721 Data Flow Diagrams (DFDs) Check Skill Validity Summarize department skill summary employee skill records valid employee skill records bogus skills

04 - Structured DesignCSC40722 Structured Design Methodology Transform Analysis –Restate the problem as a data flow graph –Identify Afferent and Efferent data elements afferent: high-level input data, furthest removed from the physical input, which are still considered inputs efferent: high-level output data, furthest removed from the physical output, which are still considered outputs –Factor Afferent, Efferent, and Transform branches