CSE 219 Computer Science III Program Design Principles.

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

ARCH-05 Application Prophecy UML 101 Peter Varhol Principal Product Manager.
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Department of Computer Science University of Maryland, College Park
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Fall 2007CS 2251 Software Engineering Intro. Fall 2007CS 2252 Topics Software challenge Life-cycle models Design Issues Documentation Abstraction.
1 Lecture 5 Introduction to Software Engineering Overview  What is Software Engineering  Software Engineering Issues  Waterfall Model  Waterfall Model.
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.
CSE 219 COMPUTER SCIENCE III PROPERTIES OF HIGH QUALITY SOFTWARE.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 1 Program Design
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Computer Science 240 Principles of Software Design.
Software Architecture in Practice (3rd Ed) Introduction
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
The Design Discipline.
1 Shawlands Academy Higher Computing Software Development Unit.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
An Introduction to Software Architecture
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Chapter 3 Developing an algorithm. Objectives To introduce methods of analysing a problem and developing a solution To develop simple algorithms using.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Software Development. Software Developers Refresher A person or organization that designs software and writes the programs. Software development is the.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Systems Analysis and Design in a Changing World, 3rd Edition
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
The Software Development Process
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Data Structures Using C++ 2E
© 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.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Chapter 2 Principles of Programming and Software Engineering.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
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.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
CSCE 240 – Intro to Software Engineering Lecture 3.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Design and Development Development Methodoligies Computing Science.
INTRODUCTION CSE 470 : Software Engineering. Goals of Software Engineering To produce software that is absolutely correct. To produce software with minimum.
Principles of Programming & Software Engineering
CSE 219 Final exam review.
Algorithms and Problem Solving
Principles of Programming and Software Engineering
About the Presentations
Programming Fundamentals (750113) Ch1. Problem Solving
Introduction To software engineering
Algorithms and Problem Solving
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
What Is Good Software(Program)?
Presentation transcript:

CSE 219 Computer Science III Program Design Principles

Why are we here? To learn a methodology for constructing software systems of high quality What properties make a software system high quality? –correctness –efficiency –ease of use (by other programmers in the case of frameworks) –reliability/robustness –maintainability –modifiability –extensibility ( also modifiable at run-time without recompiling ) –scalability –portability As programs get larger, these become much more difficult to achieve. Why? –program complexity –team complexity (more people are involved)

How can these properties be achieved? By using well proven, established processes –preferably while taking advantage of good tools Bottom Line: –don’t be a flying by the seat of your pants software engineer Requirements Analysis Design & Document CodeTest Debug Profile Deploy Evaluate Design

Software Jobs Not all of you are going to be programmers –but you should know how to design, program, test, debug software Other types of jobs: –Designer –Tester –Database, Network, Security Administrator –Project Leader –Manager –Researcher or Professor –etc … NOTE: designers & programmers on a project may not be the same people

Design, then develop Starting with HW 2, you should design all classes before development (coding) –not easy to do –UML is used for software design You cannot design a system unless you really understand the necessary technology –designs cannot be created without a little testing trying out different small-scale examples (HW 1)

Where to begin? Understand the problem –the point of a requirements analysis –What are system input & output? –How will users interact with the system? –What data must the system maintain? Generate a problem specification document –defines the problem –defines what needs to be done to solve the problem –for us, most of this has been done by HW descriptions (1-4)

Design Approaches Have other “similar” problems been solved? –Do design patterns exist to help? What are the “easy” and “hard” parts? –Why is this important? work measurement Employ: –data-driven design –top-down design

Data-driven Design From the problem specification, extract –nouns (objects, attributes of objects) –verbs (methods) Divide data into separate logical, manageable groupings –these groupings will form your objects Among these, note those that may need sophisticated data structures or algorithms –design your data management classes early on such that you abstract out complexity Ex: a deck of cards

Top-down class design Top-down class design strategy: –Decompose the main problem into sub-problems (large chunks). –Write skeletal classes for sub-problems. –Write skeletal methods for sub-problems. –Repeat for each sub-problem. If necessary, go back and redesign higher-level classes to improve: –modularity –information hiding –information flow –etc.

Designing Methods Decide method signatures –numbers and types of parameters and return values Write down what a method should do –use top-down design to decompose methods into helper methods Use javadoc comments to describe methods Continually review method specs during implementation

Results of Top-down class design UML Class Diagrams Skeletal Classes instance variables static variables class diagrams method headers with fully documented method descriptions

HWs HW1: Initial program for game of Life with a GUI and limited functionality. HW2: Design of fully functioning game of Life with a GUI and the use of a design pattern. HW3: Implementation of fully-functioning game of Life with a GUI and the use of a design pattern. HW4: Implementation of AI logic for computer based players and make a plugin. You will also use CVS during development.

Our project this semester Crucial design decisions: –Class relationships –Modularity –Functionality vs. Presentation –Choosing data structures

Class relationships Think data flow: –What HAS what? –What IS what? –What USES what? –Where should a particular piece of data be placed? –How will event handler X change data in class Y? –Static or non-static? Design patterns will help us make these decisions Bottom line: think modular –no 1000 line classes or 100 line methods NOTE: these numbers are somewhat arbitrary

Modularity How reusable are your classes? –can they be used for implementing the full version, or apply the old rules, etc.? Think of programmers, not just users Can individual classes be easily separated and re-used Data vs. Mechanics

Functionality vs. Presentation What’s the infrastructure? –general classes that do the work of running the game –a general engine Why separate the engine and the UI –So we can change the engine without changing the UI –So we can change the UI without changing the engine –So we can design several different UIs for an engine –Reuse code that is proven to work This is a common principle throughout GUI design –Even for Web sites –Different programmers for each task

Choosing Data Structures Internal data structures –What is the natural representation of the given data? game board data should be stored in its natural state (2D) –Setup vs. access speeds –Keep data ordered? Which access algorithms? E.g., player information –Ordered by what?

Evaluating the Design Periodic reviews are necessary –redesign is less costly during the design stage than during implementation Is the design correct? –according to the problem description Will it work efficiently? Are the classes independent? –Encapsulation – Do they manage & protect their own data? –Can they be tested individually? –Do they produce code reuse? Is there redundancy? Is it necessary? –Reduce redundancy wherever possible. Makes maintenance much easier Is data and control flow clear or complex?

Software Longevity The FORTRAN & COBOL programming languages are almost 50 years old Many mainframe systems still use code written in the 1960s Remember: software maintenance is more than ½ a project Moral of the story: the code you write may outlive you, so make it: –Easy to understand –Easy to modify & maintain Software must be ready to accommodate change

Software Maintenance What is software maintenance? Improving or extending existing software –incorporate new functionality –incorporate new data to be managed –incorporate new technologies –incorporate new algorithms –incorporate use with new tools –incorporate things we cannot think of now

Summary Always use data driven & top-down design: –identify and group system data –identify classes, their methods and method signatures, in that order –flesh out method bodies (what they should do), to identify helper methods Write down step by step algorithms inside methods to help you!!! –document each class, method and field –make explicit all conditions that need to be enforced or checked decide where to generate exceptions add to documentation –evaluate design, and repeat above process several times until all decisions are verified and implementation instructions are well-defined