CMPT Data and Program Organization

Similar documents
Software Testing. Overview

Spring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques

Concepts of Programming Languages

CHAPTER 5 GENERAL OOP CONCEPTS

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation

Programming Languages 2nd edition Tucker and Noonan"

Introduction to Java and OOP. Hendrik Speleers

Lecture 16: Object Programming Languages

Appendix A - Glossary(of OO software term s)

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Final Exam. Final Exam Review. Ch 1: Introduction: Object-oriented analysis, design, implementation. Exam Format

What is Software Architecture

Lecture 7: Data Abstractions

Lecturer: William W.Y. Hsu. Programming Languages

Object-Oriented Languages and Object-Oriented Design. Ghezzi&Jazayeri: OO Languages 1

Object-Oriented Software Engineering Practical Software Development using UML and Java

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

CompuScholar, Inc. Alignment to Nevada "Computer Science" Course Standards

Objects as Session-Typed Processes

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1

Object Oriented Paradigm

COURSE 2 DESIGN PATTERNS

Concepts of Programming Languages

Advanced Database Applications. Object Oriented Database Management Chapter 13 10/29/2016. Object DBMSs

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

Systems I: Programming Abstractions

Object-Oriented Concepts and Design Principles

CSc 520. Course Outline (Subject to change) Course Outline (Subject to change)... Principles of Programming Languages. Christian Collberg

Object-Oriented Design

Modelling with Classes. CITS1220 Software Engineering

Basic Principles of OO. Example: Ice/Water Dispenser. Systems Thinking. Interfaces: Describing Behavior. People's Roles wrt Systems

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software

3D Graphics Programming Mira Costa High School - Class Syllabus,

Chapter 2: Java OOP I

Object Oriented Programming

Chapter 13 Object Oriented Programming. Copyright 2006 The McGraw-Hill Companies, Inc.

Unit-3 Software Design (Lecture Notes)

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

C++ Important Questions with Answers

Structured Programming

Object Oriented Programming

Big Java Late Objects

Anatomy of a Compiler. Overview of Semantic Analysis. The Compiler So Far. Why a Separate Semantic Analysis?

1. Write two major differences between Object-oriented programming and procedural programming?

Introduction to Object-Oriented Programming

Inheritance and Interfaces

Review sheet for Final Exam (List of objectives for this course)

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

CS11 Introduction to C++ Fall Lecture 7

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

Frames and Inheritance. Winston, Chapter 9

PC204. Lecture 5 Programming Methodologies. Copyright 2000 by Conrad Huang and the Regents of the University of California. All rights reserved.

CPS 506 Comparative Programming Languages. Programming Language

Organization of User Interface Software

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Object Oriented Issues in VDM++

Object Relationships

Java: Just Another Version of Ada an overview of Ada 2005

Introduction to OOP. Procedural Programming sequence of statements to solve a problem.

Chapter 6 Introduction to Defining Classes

Data Abstraction. Hwansoo Han

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

CSE 12 Abstract Syntax Trees

What are the characteristics of Object Oriented programming language?

Information System Design (IT60105)

Lecture 18: Structure-based Testing

Lecture 7: Type Systems and Symbol Tables. CS 540 George Mason University

CS 15 Design Section. Design

Modularity!! Guidelines for design! in any programming language!

Programming Paradigms

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9)

Goals of the Lecture OO Programming Principles

Programmazione. Prof. Marco Bertini

1: Introduction to Object (1)

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017

Thanks! Review. Course Goals. General Themes in this Course. There are many programming languages. Teaching Assistants. John Mitchell.

Chapter 9 :: Data Abstraction and Object Orientation

Chapter 13. Object Oriented Programming

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003

LECTURE 3: SOFTWARE DESIGN. Software Engineering Mike Wooldridge

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Introduction. Object-Oriented Programming Spring 2015

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

Programming Languages FILS Andrei Vasilateanu

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright

Programming Languages 2nd edition Tucker and Noonan"

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Classes, Objects, and OOP in Java. June 16, 2017

ADMINISTRATIVE MANAGEMENT COLLEGE

Object Oriented Software Development CIS Today: Object Oriented Analysis

Data Structures (list, dictionary, tuples, sets, strings)

Java Object Oriented Design. CSC207 Fall 2014

Frustrated by all the hype?

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming)

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Modularity Guidelines for design in any programming language

Software Architectures. Lecture 6 (part 1)

Transcription:

CMPT-201 - Data and Program Organization Professor: Bill Havens Office: APSC-10828 Lectures: MWF 2:30pm - 3:20pm Venue: C-9002 WWW: http://www.cs.sfu.ca/coursecentral/201 Office Hours: Monday @3:30pm January 5, 2004 Copyright 2003 by Bill Havens 1 of 17

from CMPT-201 Home Page... Course Details TAs Expectations for Assignments Assignment Marking Scheme Class Notes Homework Assignment Schedule GradeBook JavaDoc Online Resources Administrivia January 5, 2004 Copyright 2003 by Bill Havens 2 of 17

Software Engineering and Computer Science Comparison Close relationship Practical vs. Theoretical Computer Science Study of the natural laws of computation. Computer Scientists develop theories of computation (mathematics) programming languages (formal linguistics) communication (networks) data structures (information representation) algorithms (manipulating information) January 5, 2004 Copyright 2003 by Bill Havens 3 of 17

Software Engineering Real engineering! Concerned with Design of large software systems Implementation and integration Reliability and maintenance Concerns of the Computer Scientist theory abstraction Concerns of the Software Engineer design Data Structures in here January 5, 2004 Copyright 2003 by Bill Havens 4 of 17

Disclaimers This course is NOT about Software Engineering We will not consider software life cycles, design specifications, code reviews, quality assurance, maintenance, etc. This course is NOT theoretical Computer Science We will not consider theory of computation, programming language design or logic. Course Goals Learn to think recursively and abstractly Develop a vocabulary of program structures (both data and procedural) Think about the structure of the problem instead of the syntax. Understand the power of encapsulation (abstraction of data and behaviour) January 5, 2004 Copyright 2003 by Bill Havens 5 of 17

Course Topics Data Structures (the vocabulary of programming) Examples: strings, sets, stacks, queues, lists, hash tables, trees graphs. Abstract datatypes, modularization and reuse. Top-Down design process Object programming, extensible systems, public interfaces. Pointers and References (getting under the hood in Java) Garbage Collection (recycling used bits) January 5, 2004 Copyright 2003 by Bill Havens 6 of 17

Why Java? Other candidates: Assembler, C, Modula, Smalltalk, Lisp, C++ Uniform language for multiple courses Portable across all Operating Systems Sophisticated programming environment (eg- Swing, J2EE) January 5, 2004 Copyright 2003 by Bill Havens 7 of 17

Disclaimer about Programming Languages They are all bad! (so far) At best, a programming language is a vehicle for expressing computation (both structure and algorithm). Learn to think independently of any particular language. Learn to think 1. Recursively 2. Hierarchically 3. Abstractly January 5, 2004 Copyright 2003 by Bill Havens 8 of 17

Object Oriented Design (OOD) Basic Idea: use the Problem Description to discover the abstract objects in the problem. Describe the abstract objects formally Assign behaviour to the objects (anthropomorphism) to implement the desired system. Abstract classes of related objects from the abstraction Implement the classes in some OO language (e.g. Java) Example: Simulating a naval battle at sea Objects: ships, planes, guns, shells, missiles, etc. Behaviour particular to each class of object Many instances of each class Programming involves interaction of multiple instances January 5, 2004 Copyright 2003 by Bill Havens 9 of 17

Principles of OOD 1) Encapsulation: Objects combine data and behaviour Message passing semantics (from SmallTalk by Alan Kay) Objects respond to messages requesting information or behaviour Internal state of any object is not observable (and unimportant) Only external behaviour counts The message protocol of a class specifies the behaviour of every instance of the class Example: class Ship protocol heading(angle) speed(int) destination() January 5, 2004 Copyright 2003 by Bill Havens 10 of 17

2) Inheritance: Classes can inherit behaviour from other classes Complex behaviour can be inherited from other classes Extending a class by defining additional data and behaviour Parent class is called the superclass and the child class is called the subclass Example: BattleShip is a subclass of Ship class Ship protocol includes basic behaviour common to large boats class Battleship extends Ship by including war fighting behaviour class Battleship could be further subclassed as necessary January 5, 2004 Copyright 2003 by Bill Havens 11 of 17

3) Polymorphism: Objects determine their own behaviour Very powerful feature of OO Programming Sending a message elicits the behaviour of the receiving object Different objects will respond according to their own semantics Example: message destination(losangeles) has a very different meaning when sent to a Boat versus a Missile object January 5, 2004 Copyright 2003 by Bill Havens 12 of 17

4) Composition: Classes combine the data and behaviour of their component parts Complex systems are made of parts Recursive decomposition into a hierarchy of components Essence of TopDown Design Decompose complex systems into simpler components until each individual component can be adequately modelled and programmed. Example: class BattleShip Composed of many subsystems hull, steering, propulsion, armaments, airconditioning,... Each recursively composed of simpler components January 5, 2004 Copyright 2003 by Bill Havens 13 of 17

Style Basic Requirements 1. Well defined message protocol for each class 2. Hiding of internal private data fields 3. Extensive error detection and handling 4. Well layed out and readable code 5. Proper documentation (using JavaDoc) see Carrano&Prichard (p.33) see example java src file and javadoc (Havens) January 5, 2004 Copyright 2003 by Bill Havens 14 of 17

Software Testing Overview Important issue (both in industry and class) Goal: to find as many software errors as possible before release. Types of errors: 1. Syntax errors: detected usually by compiler (ex: pioneer spacecraft counter example) 2. Logic errors: program computes something different than specs. 3. Verification errors: mistake (or imprecision) in requirements spec. 4. RunTime errors: bad assumptions about the environment (hardware+software) 5. Maintenance errors: somebody doesnt understand your code. January 5, 2004 Copyright 2003 by Bill Havens 15 of 17

Testing Approaches Two basic approaches 1. Black Box: All viable inputs and expected outputs are tested. Useful for algorithms with predictable and tractable I/O. Expensive with large datasets Difficult with real-time or interactive systems. 2. Glass Box: All sections of the code are exercised. Design of code coverage testing plans. Unit testing of each module/object OOD relevant. January 5, 2004 Copyright 2003 by Bill Havens 16 of 17

Test Plans Three levels of testing 1. Unit Testing (as above) 2. Functional Testing (after system build) 3. Beta Testing (with help of clients) Test Plans Formal document describing procedures for validating software 1. Typical cases: run expected situations first 2. Extreme cases: try limits of intended function 3. Invalid cases: see what happens on nonsense cases (brittleness) We will only be concerned with Unit Testing and Functional Testing January 5, 2004 Copyright 2003 by Bill Havens 17 of 17