Introduction SWE 619. Why Is Building Good Software Hard? Large software systems enormously complex  Millions of “moving parts” People expect software.

Slides:



Advertisements
Similar presentations
EECE 310: Software Engineering Modular Decomposition, Abstraction and Specifications.
Advertisements

COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
New Mexico Computer Science For All Decomposition in Computer Programming Maureen Psaila-Dombrowski.
Software Engineering and Design Principles Chapter 1.
1 CMSC 132: Object-Oriented Programming II Software Development II Department of Computer Science University of Maryland, College Park.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Knowledge Acquisitioning. Definition The transfer and transformation of potential problem solving expertise from some knowledge source to a program.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Department of Computer Science University of Maryland, College Park
Introduction to Systems CSCI102 - Systems ITCS905 - Systems MCS Systems.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Chapter 1 Principles of Programming and Software Engineering.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Computer Science 240 Principles of Software Design.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Cs205: engineering software university of virginia fall 2006 Semantics and Specifying Procedures David Evans
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
CSCI-383 Object-Oriented Programming & Design Lecture 4.
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
Introduction Ellen Walker CPSC 201 Data Structures Hiram College.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
University of Toronto Department of Computer Science CSC444 Lec05- 1 Lecture 5: Decomposition and Abstraction Decomposition When to decompose Identifying.
Computer Science 240 © Ken Rodham 2006 Principles of 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.
1 C++ Plus Data Structures Nell Dale Chapter 1 Software Engineering Principles Modified from the Slides made by Sylvia Sorkin, Community College of Baltimore.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Design Concepts and Principles Instructor: Dr. Jerry Gao.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Lecture 11 Data Structures, Algorithms & Complexity Introduction Dr Kevin Casey BSc, MSc, PhD GRIFFITH COLLEGE DUBLIN.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
Introduction to Design (and Zen) CpSc 372: Introduction to Software Engineering Jason O. Hallstrom Authorship Disclaimer. These.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
1-1 Software Development Objectives: Discuss the goals of software development Identify various aspects of software quality Examine two development life.
Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes,
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Chapter 1 Data Abstraction: The Walls CS Data Structures Mehmet H Gunes Modified from authors’ slides.
Copyright 2006 Oxford Consulting, Ltd1 January Introduction to C++ Programming is taking A problem Find the area of a rectangle A set of data.
1 Introduction 1. Why Data Structures? 2. What AreData Structure? 3. Phases of Software Development 4. Precondition and Postcondition 5. Examples.
Chapter 2 Principles of Programming and Software Engineering.
Chapter 1 The Phases of Software Development. Software Development Phases ● Specification of the task ● Design of a solution ● Implementation of solution.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Copyright 2006 Pearson Addison-Wesley, 2008, 2012 Joey Paquet 1 Concordia University Department of Computer Science and Software Engineering SOEN6441 –
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 requirements 1 what is a requirement? “a property [or behavior] that must be exhibited.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Principles of Programming & Software Engineering
Advanced Algorithms Analysis and Design
Software Design.
CompSci 280 S Introduction to Software Development
C++ Plus Data Structures
Data Abstraction: The Walls
Chapter 1 Data Abstraction: The Walls
Principles of Programming and Software Engineering
About the Presentations
Introduction SWE 619.
Objective of This Course
Chapter 0 : Introduction to Object Oriented Design
Presentation transcript:

Introduction SWE 619

Why Is Building Good Software Hard? Large software systems enormously complex  Millions of “moving parts” People expect software to be malleable  After all, it’s “only software” We are always trying to do new things with software  Relevant experience often missing Software engineering is about:  Managing complexity  Managing change  Coping with potential defects Customers, developers, environment, software

Decomposition and Abstraction Decomposition – divide and conquer Abstraction helps to decompose productively Abstraction changes the level of details to be considered  A many-to-one mapping  “abstracts” from “irrelevant” details

Decomposition and Abstraction Decomposition  When to decompose  Identifying components  Modeling components Abstraction  Abstraction by parameterization  Abstraction by specification  Pre-conditions and Post-conditions University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Decomposition Separable subproblems  Each subproblem is at the same level of detail  Each subproblem can be solved independently  The solutions to the subproblems can be combined to solve the original problem  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Decomposition Large problems can be tackled with “divide and conquer” Decompose the problem so that:  Each subproblem is at (roughly) the same level of detail  Each subproblem can be solved independently  The solutions to the subproblems can be combined to solve the original problem Advantages  Different people can work on different subproblems  Parallelization may be possible  Maintenance is easier Disadvantages  The solutions to the subproblems might not combine to solve the original problem  Poorly understood problems are hard to decompose  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

How to Decompose Step 1: Identify Components  a good decomposition minimizes dependencies between components coupling - a measure of inter-component connectivity cohesion - a measure of how well the contents of a component go together  information hiding having modules keep their data private provide limited access procedures this reduces coupling Step 2: Model the components  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Abstraction Abstraction is the main tool used in reasoning about software Why? It allows you to:  ignore inconvenient detail  treat different entities as though they are the same  simplify many types of analysis  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Using Abstraction Abstraction can help with Decomposition  e.g. To manage the economy, try focusing on some abstracted features such as inflation, growth, GDP, etc.  Abstraction allows us to ignore inconvenient details In programming:  Abstraction is the process of naming compound objects and dealing with them as single entities (i.e. ignoring their details) Abstraction doesn’t solve problems…  …but it allows us to simplify them  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Abstraction mechanisms Two abstraction mechanisms:  Abstraction by parameterization abstracts from the identity of the data by replacing them with parameters. It generalizes modules so that they can be used in more situation  Abstraction by specification abstracts from the implementation details (how the module is implemented) to the behavior users can depend on (what the module does). It isolates modules from one another’s implementations.

Abstraction by Parameterization The program fragment:  x * x - y * y  computes the difference of the squares of two specific variables, x and y. The abstraction:  int squares (int x, int y) {  return(x * x - y * y);  } describes a set of computations which act on any two (integer) variables tocompute the difference of their squares Note: locally the variables are called x and y for convenience The specific computation:  result = squares (big, small); uses the abstraction ‘squares’ on two specific variables (‘big’ and ‘small’)  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Abstraction by parameterization…  …allows us to express infinitely many computations  …but does not tell us about the intention of those computations We need to capture the intention  e.g. consider what is true before and after a computation We can abstract away from a computation (or a plan, program, function, etc) by talking about what it achieves Specification: this function can be used whenever we have an array. After it is applied, the array will be sorted into ascending order  University of Toronto Department of Computer Science © 2001, Steve Easterbrook Abstraction by Specification Before Unsorted Array Function for Sorting arrays After Sorted array

Pre-conditions and Post-conditions The two forms of abstraction are complementary  parameterization allows us to perform a computation on any arbitrary variables (values)  specification allows us to ignore how it is done Unfortunately…  only abstraction by parameterization is built into our programming languages as function (procedure) definitions We can overcome this using comments: int strlen (char s[]) { /* precondition: s must contain a character array delimited by the null character; postcondition: returns the length of s as an integer; */ int length = 0; while (s[length]) length++; return(length); }  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Kinds of Abstractions Procedural abstraction allows us to introduce new operations Data abstraction allows us to introduce new types of data objects Iteration abstraction allows us to iterate over items in a collection without revealing details of how the items are obtained Type hierarchy allows us to abstract from individual data types to families of related types

Summary 1 Decomposition allows us to simplify difficult design tasks A good decomposition  minimizes coupling between components  maximizes cohesion within components  permits information hiding Methods provide…  … techniques for decomposing problems  … notations for describing the components Abstraction allows us to ignore detail  by parameterization: allows us to describe and name sets of computations  by specification: allows us to ignore how the computation is done  University of Toronto Department of Computer Science © 2001, Steve Easterbrook

Summary 2 Program decomposition based on abstraction Procedural and iteration abstractions are valuable Data abstraction provides the primary organizational tool in the programming process Goal for various abstractions:  What they are?  How to specify their behavior?  How to implement them in Java?