©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter 10 - 1 Software Development Software Life Cycle UML Diagrams.

Slides:



Advertisements
Similar presentations
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Four Defining Your Own Classes.
Advertisements

COMP 121 Week 7: Object-Oriented Design and Efficiency of Algorithms.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 2 Getting Started with Java Program development.
ITEC200 Week01 Introduction to Software Design.
Introduction To System Analysis and Design
Fall 2007CS 225 Introduction to Software Design Chapter 1.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 2 Getting Started with Java Structure of.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
COMPSCI 125 Spring 2005 ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Four: Defining Your Own Classes *Instantiable.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Chapter Chapter 1 Introduction to Object-Oriented Programming and Software Development.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
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.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Lecture 1 Introduction to Computers and Object-
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 4 Defining Your Own Classes.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1 Introduction to Object-Oriented Programming.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Spring 2009CS 225 Introduction to Software Design Chapter 1.
Chapter Four Defining Your Own Classes continued.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Engineering Software Development Process.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Introduction To System Analysis and design
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1: Introduction to Object-Oriented Programming.
BCS 2143 Introduction to Object Oriented and Software Development.
Understand Application Lifecycle Management
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
Introduction To System Analysis and Design
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Software Life Cycle Requirements and problem analysis. –What exactly is this system supposed to do? Design –How will the system solve the problem? Coding.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 4 Defining Your Own Classes.
1 Programming Paradigms Object Orientated Programming Paradigm (OOP)
CS 151: Object-Oriented Design September 5 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak
© 2000 McGraw-Hill Modified by C.W.Pang with author's permission Intro to OOP with Java--Wu Chapter Chapter 1 Introduction to Object-oriented Programming.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Data Structures Using C++ 2E
ITEC324 Principle of CS III Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
M1G Introduction to Programming 2 5. Completing the program.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Object-Oriented Design Now we can extend our discussion of the design of classes and objects Chapter 6 focuses on: software development activities determining.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
CMSC 2021 Software Development. CMSC 2022 Software Development Life Cycle Five phases: –Analysis –Design –Implementation –Testing –Maintenance.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
Notices Assn 2 is due tomorrow, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including today’s lecture: Big Topics are.
Chapter 5 – System Modeling Lecture 1 1Chapter 5 System modeling.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
بسم الله الرحمن الرحيم CPCS203: Programming II. ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display., Modifications by Dr.
Java Programming: Guided Learning with Early Objects
About the Presentations
Introduction to OOP with Java 4th Ed, C. Thomas Wu
Chapter 4 System Modeling.
Intro to OOP with Java, C. Thomas Wu
Presentation transcript:

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Development Software Life Cycle UML Diagrams Incremental Development

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Engineering Much like building a skyscraper, we need a disciplined approach in developing complex software applications. Software engineering is the application of a systematic and disciplined approach to the development, testing, and maintenance of a program. Many approaches have been used over the years –Step-wise refinement –Object-oriented programming is an approach that was developed for engineering better software.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Life Cycle The sequence of stages from conception to operation of a program is called software life cycle. Five stages are –Analysis –Design –Coding Implement the detailed design into an actual program. –Testing Operation and Maintenance Program is put into use. Software maintenance accounts for approximately 70% of the cost of the software.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Life Cycle Analysis phase: –Study the problem. –Determine if a solution is possible. –Develop a requirements specification describing the features of the program. Questions to be answered –What should the program do? –Who will use the program? –Is the problem solvable? The assignment is a form of requirements specification.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Life Cycle Design phase: –Turn the requirements specification into a detailed program design. Here is where you decide how to solve the problem –Fully define all classes and objects, including how they behave and communicate between themselves. Here is where you use the UML diagrams you have been learning about –Work out a plan for the order of implementation In order to design the program, you need to understand the specification. –At the beginning of this stage you should be asking questions about anything that you don't understand.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter UML Diagrams UML is a graphical language It can be used to model various aspects of a program –Use class diagrams to model the structure of the application –Use object diagrams to provide a snapshot of what is happening when a program runs –Other types of diagrams model requirements, program state, testing, … We'll use a subset of this language in this class. –Object diagrams –Class diagrams –State-of-memory diagrams are a variant of UML diagrams

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Class Diagram Used to –Show the details of one or more classes data, methods –Show how different classes are related within a program inheritance (is-a), aggregation (has-a), using –Illustrate an inheritance hierarchy Class diagrams are static Class diagrams illustrate the structure of an application

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Class Diagram Generic class diagram –name of class –list names of class and instance data values –list methods with parameters and return types Example class diagram Contact class represents a person with information needed in an address book

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter High-Level Class Diagram Use a box for each class Use lines to show relationships –Arrow for inheritance –Line with diamond for aggregation (has-a) –Dotted line for uses

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter UML Showing Inheritance Inheritance is a mechanism in OOP to design two or more entities that are different but share many common features. –Features common to all classes are defined in the superclass. –The classes that inherit common features from the superclass are called subclasses. Account Checking Savings Here are the superclass Account and its subclasses Savings and Checking.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Object Diagrams Used to illustrate the state of a program at different times while it is running We will use a kind of object diagrams called state-of- memory diagrams to illustrate how Java uses memory for storing information

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Object Diagrams One box for each object Each object may have data inside it Example of a Loan object

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Tools for UML Diagrams dia - a linux tool that allows you to draw many different kinds of diagrams –from the prompt type dia violet - a java program to create simple UML diagrams –copy violet.jar from ~tole/teaching/cs125/demo to a directory of your own –run the program using java -jar violet.jar

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Approaches to Development Top-down –Develop the top-level classes first –create minimal classes for service objects for testing Bottom-up –develop service classes first –write test classes or main methods in the service classes for testing

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Incremental Development Implement the program in small steps. –Each step needs to be independent of all steps that come after it. –Each step should be testable.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Steps in Incremental Development Read the problem statement –See if anything needs clarification –Identify major tasks Design the program –Decide how to implement each task Choose a development plan –Determine which tasks depend on other tasks Implement one task at a time –test after completing each task (unit testing) Test thoroughly after all tasks are complete

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter High-Level Steps Get the program input Compute the result Report the results Observation You can't test the input without doing some output Approaches Add extra output during development and remove it in the final version Consider programming the output first (or some of it) Interleave input/computation with output

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Intstantiable Classes Create a class skeleton with a main method You need to create an object to do anything –Write a constructor first –create a new object in main You need output to tell if anything is happening –write the toString method –print the object you created in main Each time you add a constructor/method to the class, add code to the main method to call it and print something to see you if it worked

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Stubs and Drivers Stub is basically a method with an empty body that replaces the finished method during early parts of the development –Methods that return values need to return a dummy value of appropriate type A driver is a program that is used to test a single class or a partial set of classes. –An instantiable class can have a main method to test itself

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Example Suppose we want to use our Student class in a program that manages a gradebook. Classes we need –Student –Roster - contains a collection of students for a course –ManageRoster - has a console menu for manipulating the roster Possible approaches –Bottom-up –Top-down –Mixed

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Bottom-up Write the independent class first and build up from there –You'll need some test code to make sure these classes work before you use them in other classes

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Top-Down Create a skeleton of the main class first –add methods (or stubs) to other classes as needed

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Javadoc comments Javadoc comments begin with /** and end with */. –put one at the top of each class –provide one for each public variable and method in the class Javadoc tags are special markers that begin For example: - provide one for each parameter of each method - describes the return value Tags should be on separate lines at the end of the appropriate javadoc comment

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Life Cycle Testing phase: –Run the program using different data sets to verify the program works properly. –Unit testing: Test classes and methods individually. –Integration testing: Test that the classes work together correctly.