Software Design Quality

Slides:



Advertisements
Similar presentations
1 Software Design Introduction  The chapter will address the following questions:  How do you factor a program into manageable program modules that can.
Advertisements

Software Engineering and Design Principles Chapter 1.
R&D SDM 1 Metrics How to measure and assess software engineering? 2009 Theo Schouten.
1 Objectives To introduces the concept of software Design. To introduce the concept of Object- Oriented Design (OOD). To Define various aspects about object.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Non-Functional Requirements
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec12 1 Lecture 12: Software Design Quality What is software quality?
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.
Chapter 7 Software Engineering Objectives Understand the software life cycle. Describe the development process models.. Understand the concept of modularity.
CSE 303 – Software Design and Architecture
1 Software Quality CIS 375 Bruce R. Maxim UM-Dearborn.
Coupling and Cohesion Pfleeger, S., Software Engineering Theory and Practice. Prentice Hall, 2001.
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.
Question To know that quality has improved, it would be helpful to be able to measure quality. How can we measure quality?
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
Concepts of Software Quality Yonglei Tao 1. Software Quality Attributes  Reliability  correctness, completeness, consistency, robustness  Testability.
Cohesion and Coupling CS 4311
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
Quality Factors Chapter Three. Question To know that quality has improved, it would be helpful to be able to measure quality. How can we measure quality?
The Software Development Process
Lecture 2 Quality as the motivation for Software Design References:Braude, Chapters 0 and 1 My 2001 lecture notes on Quality Budgen Software Design Meyer.
CSE 303 – Software Design and Architecture
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.
Metrics "A science is as mature as its measurement tools."
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Chapter 10 Software quality. This chapter discusses n Some important properties we want our system to have, specifically correctness and maintainability.
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.
Further Modularization, Cohesion, and Coupling. Simple Program Design, Fourth Edition Chapter 9 2 Objectives In this chapter you will be able to: Further.
Principles of Programming & Software Engineering
7. Modular and structured design
Coupling and Cohesion Rajni Bhalla.
Introduction Edited by Enas Naffar using the following textbooks: - A concise introduction to Software Engineering - Software Engineering for students-
Rekayasa Perangkat Lunak Part-10
Non Functional Requirements (NFRs)
Rekayasa Perangkat Lunak
Coupling and Cohesion 1.
Software Quality Assurance Software Quality Factor
System Design and Modeling
Lecture 15: Technical Metrics
Principles of Programming and Software Engineering
Software Quality Engineering
Hierarchical Architecture
Lecture 2 of Computer Science II
Introduction Edited by Enas Naffar using the following textbooks: - A concise introduction to Software Engineering - Software Engineering for students-
مقدمه اي بر مهندسي نيازمنديها
Rekayasa Perangkat Lunak
Improving the Design “Can the design be better?”
CS223: Software Engineering
Thursday’s Lecture Chemistry Building Musspratt Lecture Theatre,
Software Design CMSC 345, Version 1/11.
Software Metrics “How do we measure the software?”
Chapter 1 Introduction(1.1)
Programming Logic and Design Fourth Edition, Comprehensive
Software Design Lecture : 9.
Software Requirements Specification (SRS) Template.
What Is Good Software(Program)?
Communication between modules, cohesion and coupling
System calls….. C-program->POSIX call
Basic Concepts of Algorithm
Design Module view What module should the system and which have to be developed . It determines the module structure of components.
Cohesion and Coupling.
Presented by KARRI GOVINDA RAO ,
DESIGN CONCEPTS AND PRINCIPLES
Presentation transcript:

Software Design Quality What is software quality? How can it be measured? How can it be measured before the software is delivered? Some key quality factors Some measurable indicators of software quality

Quality Think of an everyday object e.g. a chair How would you measure it’s “quality”? construction quality? (e.g. strength of the joints,…) aesthetic value? (e.g. elegance,…) fit for purpose? (e.g. comfortable,…) All quality measures are relative there is no absolute scale we can say A is better than B but it is usually hard to say how much better For software: construction quality? software is not manufactured aesthetic value? but most of the software is invisible aesthetic value matters for the user interface, but is only a marginal concern fit for purpose? Need to understand the purpose

Source: Budgen, 1994, pp58-9 Fitness Design quality is all about fitness to purpose does it do what is needed? does it do it in the way that its users need it to? does it do it reliably enough? fast enough? safely enough? securely enough? will it be affordable? will it be ready when its users need it? can it be changed as the needs change? But this means quality is not a measure of software in isolation it is a measure of the relationship between software and its application domain might not be able to measure this until you place the software into its environment… …and the quality will be different in different environments! during design, we need to be able to predict how well the software will fit its purpose we need to understand that purpose (requirements analysis) we need to look for quality predictors

Can you measure quality from the representation? image courtesy of www.jsbach.net

Measurable Quantities Design Representations Measuring Quality Source: Budgen, 1994, pp60-1 We have to turn our vague ideas about quality into measurables examples... The Quality Concepts (abstract notions of quality properties) reliability complexity usability information flow between modules? time taken to learn how to use? Measurable Quantities (define some metrics) mean time to failure? minutes taken for some user task??? Counts taken from Design Representations (realization of the metrics) run it and count crashes per hour??? count procedure calls???

Four Key Quality Concepts Source: Budgen, 1994, pp65-7 Reliability designer must be able to predict how the system will behave: completeness - does it do everything it is supposed to do? (e.g. handle all possible inputs) consistency - does it always behave as expected? (e.g. repeatability) robustness - does it behave well under abnormal conditions? (e.g. resource failure) Efficiency Use of resources such as processor time, memory, network bandwidth This is less important than reliability in most cases Maintainability How easy will it be to modify in the future? perfective, adaptive, corrective Usability How easy is it to use?

robustness/integrity self-descriptiveness Boehm’s NFR list device-independence Source: See Blum, 1992, p176 self-containedness portability accuracy completeness reliability robustness/integrity consistency General utility efficiency As-is utility accountability device efficiency usability accessibility communicativeness testability self-descriptiveness structuredness Maintainability understandability conciseness modifiability legibility augmentability

Self-descriptiveness s/w system independence McCall’s NFR list operability training Source: See van Vliet 2000, pp111-3 usability communicatativeness I/O volume integrity I/O rate Access control efficiency Access audit Product operation Storage efficiency execution efficiency correctness traceability completeness reliability accuracy error tolerance maintainability consistency Product revision simplicity testability conciseness instrumentation flexibility expandability generality reusability Self-descriptiveness modularity Product transition portability machine independence s/w system independence comms. commonality interoperability data commonality

Measurable Predictors of Quality Source: Budgen, 1994, pp68-74 Simplicity the design meets its objectives and has no extra embellishments can be measured by looking for its converse, complexity: control flow complexity (number of paths through the program) information flow complexity (number of data items shared) name space complexity (number of different identifiers and operators) Modularity different concerns within the design have been separated can be measured by looking at: cohesion (how well components of a module go together) coupling (how much different modules have to communicate)

Source: See van Vliet 2000, pp301-2 Coupling Source: See van Vliet 2000, pp301-2 Given two units (e.g. methods, classes, modules, …), A and B: form data coupling stamp coupling control coupling (activating) (switching) common environment coupling content features A & B communicate by simple data only A & B use a common type of data A transfers control to B by procedure call A passes a flag to B to tell it how to behave A & B make use of a shared data area (global variables) A changes B’s data, or passes control to the middle of B desirability High (uses parameter passing, only pass necessary info) OK (but should they be grouped in a data abstraction?) Necessary Undesirable (why should A interfere like this?) Undesirable (if you change the shared data, you have to change both A and B) Extremely foolish (almost impossible to debug!)

Source: van Vliet 1999, pp299-300 (after Yourdon & Constantine) How well do the contents of a procedure (module, package,…) go together? Cohesion form data cohesion functional cohesion sequential cohesion communicational cohesion procedural cohesion temporal cohesion logical cohesion coincidental cohesion features all part of a well-defined data abstraction all part of a single problem-solving task outputs of one part form inputs to the next operations that use the same input or output data a set of operations that must be executed in a particular order elements must be active around the same time (e.g. start up) elements perform logically similar operations (e.g. printing things) elements have no conceptual link other than repeated code desirability very high high Okay moderate low no way!! Source: van Vliet 1999, pp299-300 (after Yourdon & Constantine)

Typical cohesion problems Syntactic structure cohesion is all about program semantics if you use syntactic measures to decide how to design procedures… e.g. length, no of loops, etc …your design will lack coherence Hand optimization removing repeated code is often counter-productive it makes the program harder to modify unless the repeated code represents an abstraction Complicated explanations if the only way to explain a procedure is to describe its internals… …it is probably incoherent look for simple abstractions that can be described succinctly Naming problems if it is hard to think of a simple descriptive name for a procedure…

How to spot incoherent designs Source: Liskov & Guttag 2000, chapter 14. An abstraction’s effects clause is full of ‘and’s e.g. Unless there is a strong functional link, use separate procedures temporal cohesion (bad) logical cohesion (very bad) An effects clause contains ‘or’s, ‘if…then…else’s, etc. These should be separate procedures control coupling by switching (bad) coincidental cohesion (very bad) effects: initialize the data structures and initialize the screen display and initialize the history stack and initialize the layout defaults and display an introductory text effects: if x=0 then returns size(a[]) else if x=1 then returns sum(a[]) else if x=2 then returns mean(a[]) else if x=3 then returns median(a[])

Summary Software quality generally means fitness for purpose need to know what that purpose is… …what functions must it perform …what other properties must it have (e.g. modifiability, reliability, usability…) Not all quality attributes can be measured during design because quality is not an attribute of software in isolation but we can look for predictors Reliability, efficiency, maintainability, usability are usually the four most important quality factors …although different authors give different lists Modularity is often a good predictor of quality measure it by looking at cohesion and coupling

References van Vliet, H. “Software Engineering: Principles and Practice (2nd Edition)” Wiley, 1999. Chjapter 6 introduces the key ideas about software quality. Section 11.1 covers design considerations such as modularity, coupling and cohesion. Budgen, D. “Software Design”, 1994. The neat book is one of the best introductions to the idea of “quality” software design that I’ve come across. Chapters 4 and 6 give a good overview of software design quality Liskov, B. and Guttag, J., “Program Development in Java: Abstraction, Specification and Object-Oriented Design”, 2000, Addison-Wesley. chapter 14 is a nice summary of how to assess the quality of a piece of software. Pirsig, R. M., “Zen and the Art of Motorcycle Maintenance : An Inquiry into Values”, 1974, William Morrow & Company. This is a novel about one man’s quest to understand what “quality” is really all about. Great bedtime reading!