1 CMSC 132: Object-Oriented Programming II Software Development II Department of Computer Science University of Maryland, College Park.

Slides:



Advertisements
Similar presentations
4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
Advertisements

1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Overview of Computers & Programming Languages Chapter 1.
6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
Problem Solving and Algorithm Design
Chapter 6 Problem Solving and Algorithm Design. 6-2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
Object-Oriented Design & Programming Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Fall 2007CS 225 Introduction to Software Design Chapter 1.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving
Modern Software Development Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Department of Computer Science University of Maryland, College Park
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 CMSC 132: Object-Oriented Programming II Software Development IV Department of Computer Science University of Maryland, College Park.
Chapter 6 Problem Solving and Algorithm Design Nell Dale John Lewis.
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.
Chapter 1 Software Engineering. Homework ► Read Section 2.2 (pages 79-98) ► Answer questions: ► 7, 8, 11, 12, & 13 on page 134. ► Answer on paper, hand.
Software Engineering Principles and C++ Classes
© 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.
C++ fundamentals.
Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Introduction SWE 619. Why Is Building Good Software Hard? Large software systems enormously complex  Millions of “moving parts” People expect software.
Chapter 9 High-Level Programming Languages: C++. Chapter Goals Describe the expectations of high level languages Distinguish between functional design.
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
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.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
OBJECT ORIENTED SYSTEM ANALYSIS AND DESIGN. COURSE OUTLINE The world of the Information Systems Analyst Approaches to System Development The Analyst as.
Modern Software Development Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 C++ Plus Data Structures Nell Dale Chapter 1 Software Engineering Principles Modified from the Slides made by Sylvia Sorkin, Community College of Baltimore.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.

Lecture 13: 10/10/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
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.
Learners Support Publications Object Oriented Programming.
© 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.
Subroutines. Harder Problems  Examples so far: sum, sum between, minimum –straightforward computation –small number of intermediate variables –single.
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.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
Chapter 2 Principles of Programming and Software Engineering.
Chapter 1 Software Development Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Chapter 1 The Phases of Software Development. Software Development Phases ● Specification of the task ● Design of a solution ● Implementation of solution.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Testing It is much better to have a plan when testing your programs than it is to just randomly try values in a haphazard fashion. Testing Strategies:
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Advanced Data Structures Lecture 1
C++ Plus Data Structures
About the Presentations
Algorithms and Problem Solving
Introduction Coding represents 15 to 20 percent of time to develop production software Strategies for writing small programs are not effective for large.
Chapter 6: Methods CS1: Java Programming Colorado State University
Presentation transcript:

1 CMSC 132: Object-Oriented Programming II Software Development II Department of Computer Science University of Maryland, College Park

2 Overview Problem Specification Program Design Design – How To Divide Work Design – Interface & Conditions

3 Problem Specification Goal Create complete, accurate, and unambiguous statement of problem to be solved Problems Description may not be accurate Description may change over time Difficult to specify behavior for all inputs Natural language description is imprecise Formal specification languages limited and difficult to understand

4 Problem Specification Example Specification of input & output for program

5 Problem Specification Problems Description may not be accurate Problem not understood by customer Description may change over time Customer changes their mind Difficult to specify behavior for all inputs Usually only covers common cases Hard to consider all inputs (may be impossible) Example Bart Miller was able to crash most UNIX utilities with randomly generated inputs

6 Problem Specification Problems Description may be ambiguous Natural language description is imprecise Why lawyers use legalese for contracts Formal specification languages are limited and may be difficult to understand Examples Find sum of all values in N-element list L between 1 and 100  L i  (L i  1)  (L i  100) Difficult to write specifications that are both readable and precise i = 0 N-1

7 Program Design Goal Break software into integrated set of components that work together to solve problem specification Problems Methods for decomposing problem How to divide work What work to divide How components work together

8 Design – How To Divide Work Decomposing problem Break large problem into many smaller problems Cannot solve large problems directly Divide and conquer 1. Break problem up into simpler sub-problems 2. Repeat for each sub-problem 3. Stop when sub-problem can be solved easily

9 Design – How To Divide Work Functional approach Treat problem as a collection of functions Techniques Top-down design Successively split problem into smaller problems Bottom-up design Start from small tasks and combine

10 Design – Decomposition Example Top-down design of banking simulator

11 Design – How To Divide Work Object-oriented approach Treat problem as a collection of data objects Objects Entities that exist that exist in problem Contain data Perform actions associated with data

12 Design – Comparison Example Bank simulation Functional programming Arrivals, departures, transactions Object-oriented programming Customers, lines, tellers, transactions

13 Design – Comparing Approaches Functional approach Treat problem as a collection of functions Functions perform actions Think of functions as verbs Object-oriented approach Treat problem as a collection of data objects Objects are entities that exist in problem Think of objects as nouns

14 Design – Comparing Approaches Advantages to object-oriented approach Helps to abstract problem Simpler high-level view Helps to encapsulate data Hides details of internals of objects Centralizes and protects all accesses to data Seems to scale better for larger projects In practice Tend to use a combination of all approaches

15 Design – Components Components must work together easily Each component requires Interface Specifies how component is accessed & used Specifies what functions (methods) are available A contract between designer & programmer Pre-conditions What conditions must be true before invocation Post-conditions What conditions will be true after invocation

16 Design – Interface & Conditions Function positivePower() Calculate x n for positive values of x & n Interface public static float positivePower(float x, int n) Pre-conditions x has positive floating point value > 0.0 n has positive integer value  0 Post-conditions Returns x n if preconditions are met Returns –1.0 otherwise