Design (Concepts and Principles)

Slides:



Advertisements
Similar presentations
Software Design Fundamentals
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Quality of a Class Abstraction: Coupling & Cohesion Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Design Concepts and Principles
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part II)
Chapter 13 Design Concepts and Principles
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Design Concepts And Principles Software Design -- An iterative process transforming requirements into a “blueprint” for constructing the software.
Slide 7A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
UHD::CS3320::CHAP61 INTRODUCTION TO OBJECTS Chapter 6.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Component-Level Design
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)
CS-499G 8/17/ Design Concepts and Principles.
Design Concepts "You can use an eraser on the drafting table or a sledge hammer on the construction site." Frank Lloyd Wright.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
CSE 303 – Software Design and Architecture
Chapter 9 Design Engineering
 2004 by SEC Chapter 4 Software Design. 2  2004 by SEC Chapter 4 Software Design 4.1 Design Fundamentals 4.2 Design Method 4.3 Architecture Design
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
SOFTWARE DESIGN.
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.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Chapter : Design Engineering. Design Engineering It covers the set of principles, concepts, and practices that lead to the development of a high quality.
Cohesion and Coupling CS 4311
Design Concepts and Principles Instructor: Dr. Jerry Gao.
Chapter 13 Design Concepts and Principles Software Engineering: A Practitioner's Approach, 5/e.
1 Chapter 9 Design Engineering. 2 Analysis Model -> Design Model.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Design Concepts By Deepika Chaudhary.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Developed by Reneta Barneva, SUNY Fredonia Software Design and Software Engineering.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 9: Design Engineering Software Engineering: A Practitioner’s Approach, 6/e Chapter.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Key Principles of Software Architecture and Design (II) adapted from Dave Penny’s.
February 19, February 19, 2016February 19, 2016February 19, 2016 Azusa, CA Sheldon X. Liang Ph. D. Software Engineering in CS at APU Azusa Pacific.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
DESIGN PROCESS AND CONCEPTS. Design process s/w design is an iterative process through which requirements are translated into a “blueprint” for constructing.
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.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Design Concepts ch-8
7. Modular and structured design
CompSci 280 S Introduction to Software Development
Coupling and Cohesion Rajni Bhalla.
Software Design Principles
Coupling and Cohesion 1.
Design engineering Prepared By:Jay A.Dave..
which satisfies software requirements
Software Engineering: A Practitioner’s Approach, 6/e Chapter 9 Design Engineering copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc. For.
Lecture 9- Design Concepts and Principles
Software Design Mr. Manoj Kumar Kar.
Software Engineering: A Practitioner’s Approach, 6/e Chapter 11 Component-Level Design copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
Software Quality Engineering
CIS 375 Bruce R. Maxim UM-Dearborn
Component-Level Design
Component-Level Design
Chapter 16 Component-Level Design
CS223: Software Engineering
Lecture 9- Design Concepts and Principles
Chapter 9 Design Engineering
Software Design Lecture : 9.
Design Engineering.
Cohesion and Coupling.
DESIGN CONCEPTS AND PRINCIPLES
Presentation transcript:

Design (Concepts and Principles) Software Engineering Design (Concepts and Principles) James Gain (jgain@cs.uct.ac.za) http://people.cs.uct.ac.za/~jgain/courses/SoftEng/

Objectives Outline the concepts and principles underpinning design Abstraction and Refinement Modularity Cohesion and Coupling Information Hiding Present some criteria for good design analysis design code code test test

Overview of Design What is it? A meaningful engineering representation of something that is to be built. Who does it? Software engineers with a variety of skills, ranging from human ergonomics to computer architecture Why is it important? A house would never be built without a blueprint. Why should software? Without design the system may fail with small changes, is difficult to test and cannot be assessed for quality What is the work product? A design specification

Designing Quality Software Design is the stage where quality is instilled Design is assessed by formal review or walkthrough Characteristics of a good design: Must implement explicit requirements and accommodate implicit requirements Must be a readable and understandable guide for coding and testing Should provide a complete picture of the software from an implementation perspective

Generic Design Process The design process involves: Diversification (acquisition of alternatives) Followed By Convergence (elimination of all but one particular configuration) All design methods have the following characteristics: A mechanism for the translation of the analysis model into a design representation A notation for representing functional components and their interfaces Heuristics for refinement and partitioning Guidelines for quality assessment

Where Do We Begin? modelling Prototype Spec Design

Design Principles The Design process and spec should: Avoid ‘tunnel vision’ Be traceable back to analysis Not reinvent the wheel “Minimize the intellectual distance” between the problem and the solution Exhibit uniformity and integration (look like the work of a single designer) Accommodate change Degrade gently Be assessed for quality as it is being created, not after the fact Not miss the forest (not focus too much on minutiae) Recognize that design is not coding, coding is not design

Abstraction and Refinement “Abstraction permits one to concentrate on a problem at some level of generalization without regard to irrelevant low level details..” Software Engineering is a process of refining abstractions Modern programming languages allow for abstraction, e.g. abstract data types Types: data, procedural and control Stepwise refinement gradual top-down elaboration of detail Abstraction and refinement are complementary. Abstraction suppresses low-level detail while refinement gradually reveals it.

Data Abstraction A named collection of data that describes a data object door manufacturer model number type swing direction inserts lights type number weight opening mechanism implemented as a data structure

Procedural Abstraction A named sequence of instructions with a specific and limited function open details of enter algorithm implemented with a "knowledge" of the object that is associated with enter

Stepwise Refinement open Process of elaboration, proposed by Niklaus Wirth, that decomposes a high-level statement of function until low-level programming language statements are reached open walk to door; reach for knob; repeat until door opens turn knob clockwise; open door; if knob doesn't turn, then take key out; walk through; find correct key; close door. insert in lock; endif pull/push door move out of way; end repeat

Modularity Beware the Monolith Software should be split into separately named and addressable components A Module is “a lexically contiguous sequence of program statements, bounded by boundary elements, having an aggregate identifier” [Yourdon and Constantine 1979] Procedures, functions and objects are all modules

Benefits of Modularity Easier to build; easier to change; easier to fix “Modularity is the single attribute of software that allows a program to be intellectually manageable” Don’t overdo it. Too many modules makes integration complicated Sometimes the code must be monolithic (e.g. real-time and embedded software) but the design still shouldn’t be Effective modular design is achieved by developing “single minded” (highly cohesive) modules with an “aversion” to excessive interaction (low coupling)

Modularity: Trade-offs What is the "right" number of modules for a specific software design ? module development cost cost of software module integration cost optimal number number of modules of modules

Modularity Support A design method supports effective modularity if it evidences: Decomposability - a systematic mechanism for decomposing the problem Composability - able to reuse modules in a new system Understandability - the module can be understood as a standalone unit Continuity - minimizes change-induced side effects Protection - minimizes error-induced side effects

Cohesion Def: the degree of interaction within a module A measure of functional strength; strive for high cohesion Terminology: Action = the behaviour of a module (e.g. compute square root) Logic = how the module performs its action (e.g. using Newton’s method) Context = specific usage of the module (e.g. find square root of a double precision integer)

Types of Cohesion Worst to Best Coincidental Cohesion Logical Cohesion “Scatter-brained” Worst to Best Coincidental Cohesion Performs multiple unrelated actions Can happen if an organization enforces rigid rules on module size - modules are hacked apart and glued together Worse than no modularity at all Logical Cohesion Module tasks related logically Example: an object that performs all input and output Interface can be difficult to understand (e.g. printf) and code for several actions may be intertwined Temporal Cohesion Tasks executed within the same span of time Example: initialization of data structures Low Moderate

More Types of Cohesion Procedural Communication Actions are related and must be executed in a certain order Communication Actions are performed in series and on the same data Example: CalculateTrajectoryAndPrint Damages Reusability Functional or informational cohesion Performs exactly one action OR Performs a number of actions, with separate entry points, all performed on the same data structure Equivalent to a well-designed abstract data type or object Moderate High “Single-minded”

Coupling Def: the degree of interaction between modules A measure of relative interdependence; strive for low coupling since this reduces the “ripple effect” Types of Coupling (Worst to Best): Content Coupling One module directly references the internals of another Example: module p branches to a local label of module q Almost any change in one requires a change in the other Common Coupling Both modules have access to the same global data area Example: module p and q have read and write access to the same database element Suffers from all the disadvantages of global variables High Coupling Moderate Coupling

Types of Coupling Control Coupling Stamp Coupling Data Coupling Element of control is transferred between modules Example: Module q not only passes information but also informs module p as to what action to take These kinds of modules often have logical cohesion Stamp Coupling Whole data structures (records, arrays, object) transferred BUT the called module only operates on part of the data structure Security Risk: allows uncontrolled data access Data Coupling Every argument is either a simple type or a data structure AND all elements are used by the called module Maintenance is easier because regression faults less likely Moderate Coupling High Coupling

Exercise: Classify the Couplings Number In Out 1 Aircraft type Status flag 2 List of parts - 3 Function code 4 5 Part number Part manu-facturer 6 Part name 1 2 q 3 4 r s 5 6 t u p, t, u access the same database in update mode

Information Hiding module clients • algorithm controlled interface • data structure • details of external interface • resource allocation policy clients "secret" a specific design decision

Benefits of Information Hiding A more accurate term would be “details hiding” Supported by public and private specifiers in C++ Benefits of Information Hiding: Leads to low coupling Reduces the likelihood of “side effects” Limits the global impact of local design decisions Emphasizes communication through controlled interfaces Discourages the use of global data Results in higher quality software

Summary of Design Concepts Abstraction: Enables a problem to be addressed at a high-level of generalization without worrying about low-level details. Refinement: Process of gradual top-down elaboration of detail. Abstraction and refinement are complementary. Modularity: Software subdivided into separately named and addressable components. Coupling: The degree to which a module is connected to other modules in the system. Cohesion: The degree to which a module performs one and only one function. Information Hiding: Portions of the internal structure of a component are hidden and inaccessible from outside.