1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part II)

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
Design Concepts and Principles
1 Software Design Introduction  The chapter will address the following questions:  How do you factor a program into manageable program modules that can.
Chapter 13 Design Concepts and Principles
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.
1 STRUCTURE CHARTS Elements and Definitions. 2 Software System Design translates SRS into a ===> software system architecture: –system’s static structure.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
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)
Jump to first page 1 System Design (Finalizing Design Specifications) Chapter 3d.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
1 TRANSFORM ANALYSIS Heuristics and Rules. 2 DFD with Transform Flow Characteristics input-driven output-driven center of transformation.
Systems Analysis and Design
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
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 (SWD) Instructor: Dr. Hany H. Ammar
1 Software Design Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13, 5 th edition and Ch. 10, 6 th edition.
SOFTWARE DESIGN Design Concepts Design is a meaningful engineering representation of something that is to be built It can be traced to a customer’s requirements.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
SE: CHAPTER 7 Writing The Program
Criteria Based Software Product Integration Architecture F. Tsui Southern Polytechnic State University.
Cohesion and Coupling CS 4311
Systems analysis and design, 6th edition Dennis, wixom, and roth
System Implementation
Coupling & Cohesion CMSC 201- Fall '11. Vocabulary Routine- A programming unit that performs a task, such as a function, procedure, method, or main class.
Chapter 13 Design Concepts and Principles Software Engineering: A Practitioner's Approach, 5/e.
SIM3302 SOFTWARE DESIGN & TESTING
Coupling Cohesion Chandan R. Rupakheti Steve Chenoweth (Chapter 18)
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
Criteria Based Software Product Integration Architecture (2007) F. Tsui Kennesaw State University (Southern Polytechnic State University)
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.
Jump to first page (C) 1998, Arun Lakhotia 1 Design Quality Metrics Arun Lakhotia University of Southwestern Louisiana Po Box Lafayette, LA 70504,
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
Design and Planning Or: What’s the next thing we should do for our project?
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
11 Software Design CSCU 411 Software Engineering.
Refactoring Agile Development Project. Lecture roadmap Refactoring Some issues to address when coding.
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.
Slide 1 Good Methods. Slide 2 Cohesion and Coupling l For structured design These software metrics were used extensively Proven to be effective l For.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
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.
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.
Lecture 9- Design Concepts and Principles
Software Design Mr. Manoj Kumar Kar.
Not what first comes to mind
Coupling and Cohesion By Bonnie Ngu.
Software Modules in Software Design
Cohesion and Coupling Chapter 5, Pfleeger 01/01/10.
CIS 375 Bruce R. Maxim UM-Dearborn
CS223: Software Engineering
Software Design CMSC 345, Version 1/11.
Lecture 9- Design Concepts and Principles
Software Design Lecture : 9.
Communication between modules, cohesion and coupling
Design Module view What module should the system and which have to be developed . It determines the module structure of components.
Cohesion and Coupling.
Presentation transcript:

1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part II)

2 Quality Characteristics for Modules independent modules –avoid aggregation of multiple tasks per module –single-minded function ===> high COHESION –minimal interaction with other modules –simple interface ===> low COUPLING [Steven, Myers, Constantine]

3 Module COUPLING quality of interaction between modules based on module interfaces and types and number of connections coupling should be low types of coupling (high to low):

4 Content Coupling characteristics: –direct reference into another module –modification of called module at run-time example(s): –at calling time: jump to an address entry point –change local data of another module problems: –modules rely on each others internal structure –no clear interface - side effects –high degree of interdependency

5 Common Coupling characteristics: –sharing of a common, external data area –data area is unstructured example(s): –FORTRAN “COMMON” –C external data types problems: –M modules and N data elements: M x (M - 1) x N possible connections –high degree of (potential) interdependency

6 External Coupling characteristics: –sharing of a common, external data area –data area is structured example(s): –global data structures (variables) –communication to external tools and devices problems: –high potential for side effects –missing access control –modules are “bound” to the global structure

7 Control Coupling characteristics: –one module controls the execution path of another module via control flow (flag) example(s): –control parameter selects from a set of functions –error-checking decides on further execution problems: –the controlling module must have a minimum of knowledge about the controlled module –cohesion of the controlled module? (logical, procedural)

8 read & check registration reg_i 1 read registration 1.1 check registration 1.2 error-handler registration 1.3 reg_i reg_flag error_reason Control Coupling - control inversion

9 Stamp (Data) Coupling characteristics: –parameter passing of a complete data structure –only portions of the data structure are used example(s): –global, imported data structure declarations –copying real life limitations into your system problems: –change of data structure => change of module –module has to handle irrelevant information –module’s cohesion? (communicational, sequential,...)

10 Data Coupling characteristics: –parameter passing of (atomic) data elements –no unnecessary information –no control parameters –no external, shared data structures –independent and reusable –execute one single-minded function (good cohesion) problems: –cannot always be achieved

11 A good system design exhibits HIGH COHESION and LOW COUPLING

12 Cohesion & Coupling many times, high cohesion and low coupling complement and cause each other sometimes, high cohesion and low coupling contradict each other ===> the designer decides on the trade-offs

13 Cohesion & Coupling heuristics (sanitized experience) relative measures non-linear scale

14 Beyond Cohesion & Coupling Module size – objective: “understood without flipping the pages” – guideline: module size < statements on a page Fan-out (span of control): – objective : ”boss” modules should control a reasonable number of workers; – guideline: number of modules controlled by a “boss” < 7 Fan-in – objective: maximize fan-in, create generalized modules – guideline: modules must have strong or moderate cohesion (3) (4)

15 End of Section 4b