Week 3-4 MondayTuesdayWednesdayThursdayFriday Design Reading II due Group meetings SRS due DesignUMLDesign Progress report due Lecture TBA Reading III.

Slides:



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

1 Software Design Introduction  The chapter will address the following questions:  How do you factor a program into manageable program modules that can.
Test Logging and Automated Failure Analysis Why Weak Automation Is Worse Than No Automation Geoff Staneff
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
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.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
CSCE 121, Sec 200, 507, 508 Software Engineering Fall 2010 Prof. Jennifer L. Welch.
Introduction To System Analysis and Design
Guide To UNIX Using Linux Third Edition
Use Case Analysis – continued
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
C++ fundamentals.
UNIT-V The MVC architecture and Struts Framework.
CASE Tools And Their Effect On Software Quality Peter Geddis – pxg07u.
Introduction To System Analysis and design
Chapter 7 Software Engineering Objectives Understand the software life cycle. Describe the development process models.. Understand the concept of modularity.
Systems Analysis and Design in a Changing World, Fifth Edition
INFO415 Approaches to System Development: Part 2
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.
Software Engineering 2003 Jyrki Nummenmaa 1 CASE Tools CASE = Computer-Aided Software Engineering A set of tools to (optimally) assist in each.
An Introduction to Software Architecture
Coupling and Cohesion Pfleeger, S., Software Engineering Theory and Practice. Prentice Hall, 2001.
Introduction To System Analysis and Design
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.
Software Design Deriving a solution which satisfies software requirements.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
SE: CHAPTER 7 Writing The Program
Week 4 MondayTuesdayWednesdayThursdayFriday Composition Reading III due Group meetings Phil Kimmey on using rover.com SDS++ due Midterm review –
Cohesion and Coupling CS 4311
Systems Analysis and Design in a Changing World, 3rd Edition
GRASP: Designing Objects with Responsibilities
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Coupling Cohesion Chandan R. Rupakheti Steve Chenoweth (Chapter 18)
Requirements Engineering Methods for Requirements Engineering Lecture-30.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
An Automatic Software Quality Measurement System.
1 CMPT 275 High Level Design Phase Modularization.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Java™ How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Jump to first page (C) 1998, Arun Lakhotia 1 Design Quality Metrics Arun Lakhotia University of Southwestern Louisiana Po Box Lafayette, LA 70504,
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?
Software Engineering Issues Software Engineering Concepts System Specifications Procedural Design Object-Oriented Design System Testing.
Refactoring Agile Development Project. Lecture roadmap Refactoring Some issues to address when coding.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Key Principles of Software Architecture and Design (II) adapted from Dave Penny’s.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
SOFTWARE DESIGN & SOFTWARE ENGINEERING Software design is a process in which data, program structure, interface and their details are represented by well.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
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.
1 Week 7 Software Engineering Spring Term 2016 Marymount University School of Business Administration Professor Suydam.
Introduction to OOAD and UML
Further Modularization, Cohesion, and Coupling. Simple Program Design, Fourth Edition Chapter 9 2 Objectives In this chapter you will be able to: Further.
CSE691 Software Models and Analysis.
Metrics of Software Quality
Software Testing Techniques
Coupling and Cohesion 1.
Software Design Mr. Manoj Kumar Kar.
Improving the Design “Can the design be better?”
Chapter 6 Methods: A Deeper Look
CS223: Software Engineering
Software Design Lecture : 9.
An Introduction to Software Architecture
Use Case Analysis – continued
Cohesion and Coupling.
Presentation transcript:

Week 3-4 MondayTuesdayWednesdayThursdayFriday Design Reading II due Group meetings SRS due DesignUMLDesign Progress report due Lecture TBA Reading III due Group meetings Phil Kimmey on using rover.com SDS++ due Midterm review – content, format Progress report due CSE403 ● Software engineering ● sp12

Today Cohesion and coupling – why software entities are organized together and how they interact Conceptual integrity – Brooks and others CSE403 Sp122

Cohesion Cohesion is the reason that elements are grouped together in a module An alternative view is that cohesion is the degree to which elements in a module are related to each other In general, “better” cohesion has a better reason to combine entities together and makes it easier to –understand modules, –maintain the software, and –reuse modules. CSE403 Sp123

NameDescription Contains the assert macro, used to assist with detecting logical errors …assert Defines set of functions used to classify characters by their types or to …set of functions For testing error codes reported by library functions. Defines localization functions.localization functions Defines common mathematical functions.common mathematical functions Defines signal handling functions.signal handling functions For querying and specifying the alignment of objects.alignment For accessing a varying number of arguments passed to functions. For atomic operations on data shared between threads.atomic operations Defines a boolean data type.a boolean data type Defines several useful types and macros.several useful types and macros Defines core input and output functionscore input and output functions Defines numeric conversion functions, pseudo-random numbers generation functions, memory allocation, process control functionsnumeric conversion functionspseudo-random numbers generation functionsmemory allocationprocess control functions Defines string handling functions.string handling functions Defines functions for managing multiple Threads as well as mutexes and …Threadsmutexes Defines date and time handling functionsdate and time handling functions stdlib.c stdlib.c Some removed

Java 7 JDK CSE403 Sp125 On what basis/bases were the stdlib.c and JDK cohesion decisions made? Extra credit

(Some) Kinds of cohesion Coincidental cohesion: grouped despite lack of relationship – e.g., “Utilities” Temporal cohesion: grouped together because of when they are processed – e.g., initialization code Communicational cohesion: grouped together because they use the same data (whether encapsulated or not) Functional cohesion: grouped because they share data and contribute to a well-defined task CSE403 Sp126

Metrics Categorization is not precise nor even totally ordered There are a number of attempts to quantify cohesion An example of an oft-cited one is LCOM (Lack of Cohesion Of Methods) based on how many reasons a class has to change –LCOM = 1 – (sum(mf)/M*F) M  #methods in the class F  #instance fields in the class mf  #methods of the class accessing field f –All methods in a highly cohesive class use all the instance fields in the class – that is, sum(mf) = M*F The objective of defining quantitative metrics for cohesion has, to me, been largely unsuccessful because (a) the connection of the metrics to our conceptual understanding is often weak and (b) the metrics rarely provide any “actionable” information CSE403 Sp127

Coupling Given a set of modules, coupling characterizes how their entities interact across module boundaries An alternative view is that coupling is the degree to which each module relies on the other modules In general, “better” (more “loosely”) coupling –reduces the ripple effect, where making a change in one module forces changes in other modules –simplifies building, testing and reuse It is usually the case that better cohesion and better coupling go hand-in-hand CSE403 Sp128

9

(Some) Kinds of coupling Content/pathological coupling is when modules are so interconnected that they should essentially be a single module Common coupling is when modules share the same global data Control coupling is when a module controls the flow of another module, for example by passing a parameter that drives the called module Data coupling is when modules share data through parameters Message coupling is where all interactions are through parameters and message passing No coupling is where modules do not communicate at all with one another CSE403 Sp1210

There are a large number of kinds of dependences –Control dependence – which module M 1 invokes which M 2 ? –Name dependence – which M 1 knows the name of which M 2 ? –Data-flow dependence – which data D 1 is needed to compute which data D 2 ? –Source file dependence – which file F 1 must be compiled before which F 2 ? –Global data dependence – which D 1 is referenced by which M 2 ? –… Of course, the devil is in the details – for example, control dependence –static (methods in M 1 can invoke methods in M 2 ) or dynamic (which methods in M 1 do invoke methods in M 2 and over what test suite)? –infrequency (if only one method in M 1 can invoke a method in M 2 at most once) or frequency (methods in M 1 invoke most of the methods in M 2 a lot of times) … and is that static or dynamic Essentially: what dependences? CSE403 Sp1211

So many dependences Every arrow in every UML diagram is a dependence Many dependences are implicit in the code and design – they can be determined by human inspection or, more commonly, automated analysis Which dependences matter the most? CSE403 Sp1212

Metrics Like cohesion, the earlier categorization is not precise nor even totally ordered There are a large number of attempts to quantify cohesion Here’s one very simple one C = 1 / (number of input parameters + number of output parameters + number of global variables used + number of modules called + number of modules calling) The objective of defining quantitative metrics for coupling has, in some sense, been worse than for cohesion because there are so many kinds of dependences, the metrics are often imprecise about dependences, and the tools to extract dependences have a set of complications as well CSE403 Sp1213

Tool complications: theoretical Example: Call graph (control dependence) –Undecidable if it must include only pairs where a calls b in some possible execution of a program –Conservative if it never excludes a pair if a could call b in some possible execution –Useless (although conservative and fast to compute) if it includes all pairs –Dynamic if it only includes a pair if a calls b in some actual execution CSE403 Sp1214

Tool complications: practical Reflection (like in Java) Events Hidden interactions (such as through the file system) C/C++ –What defines a project? A directory, a make file, etc.? –Before the preprocessor is run, or after? If before, over all possible definitions? CSE403 Sp1215

Perfect coupling and cohesion CSE403 Sp1216 But fails on complexity

Conceptual integrity Fred Brooks 1975: Conceptual integrity is the most important consideration in system design. It is better to have a system omit certain anomalous features and improvements, but to reflect one set of design ideas, than to have one that contains many good but independent and uncoordinated ideas. Brooks 1995: I am more convinced than ever. Conceptual integrity is central to product quality. Having a system architect is the most important single step toward conceptual integrity. CSE403 Sp1217

Conceptual integrity McConnell: “Good software architecture makes the rest of the project easy.” Hoare 1985: ““There are two ways of constructing a software design: –one way is to make it so simple that there are obviously no deficiencies; –the other is to make it so complicated that there are no obvious deficiencies.” Rechtin/Maier: “In architecting a new program, all the serious mistakes are made in the first day” CSE403 Sp1218

CSE403 ● Software engineering ● sp12 Week 3-4 MondayTuesdayWednesdayThursdayFriday Design Reading II due Group meetings SRS due DesignUMLDesign Progress report due Lecture TBA Reading III due Group meetings Phil Kimmey on using rover.com SDS++ due Midterm review – content, format Progress report due