Download presentation
Presentation is loading. Please wait.
Published byMartha Robinson Modified over 9 years ago
1
CSC 480 Software Engineering PSP Project 2 August 27, 2004
2
CSC 480 - Software Engineering2 8/27/2004 Topics PSP Project 1 – postmortem Estimating program size OOAD essentials PSP Project 2 – the problem
3
CSC 480 - Software Engineering3 8/27/2004 Project 1 Postmortem Sample data Planned and actual times Planned and actual LOC Defects (actual and planned, optional) LOC/minutes Time in phases (percent) Comments
4
CSC 480 - Software Engineering4 8/27/2004 Size Estimation Need historical data Good correlation between Estimated and actual times Actual LOC and actual time spent Function point method
5
CSC 480 - Software Engineering5 8/27/2004 Estimated v.s. Actual LOC 25 C++ programs
6
CSC 480 - Software Engineering6 8/27/2004 Estimated LOC v.s. Actual Hours 25 C++ programs
7
CSC 480 - Software Engineering7 8/27/2004 Sizes In LOC Per Method
8
CSC 480 - Software Engineering8 8/27/2004 Analysis & Design Roadmap Find the objects (classes of objects) Determine their responsibilities Determine collaborations Use UML diagrams and other diagrams to present your design
9
CSC 480 - Software Engineering9 8/27/2004 Printing Invoices – a sample application An invoice describes the charges for a set of products in certain quantities. (We omit complexities such as dates, taxes, and invoice and customer numbers.) The program simply prints the billing address, all line items, and the amount due. Each line item contains the description and unit price of a product, the quantity ordered, and the total price.
10
CSC 480 - Software Engineering10 8/27/2004 A Sample Invoice INVOICE Sam’s Small Appliances 100 Main Street Anytown, CA 98765 DescriptionPrice Qty Total Toaster29.95 3 89.85 Hair dryer24.95 1 24.95 Car vacuum19.99 2 39.98 AMOUNT DUE: $154.78
11
CSC 480 - Software Engineering11 8/27/2004 Identify Objects Classes correspond to nouns in the problem description Invoice Address Item Product Description Price Quantity Total Amount Due Invoice Address Item Product Class candidates Classes elimination
12
CSC 480 - Software Engineering12 8/27/2004 Determine Responsibilities Responsibilities include two key items The knowledge an object maintains, and The actions an object can perform Assigning responsibilities to classes Evenly distribute system intelligence Keep behavior with related information Keep info about one thing in one place
13
CSC 480 - Software Engineering13 8/27/2004 Class Or Attribute A class has the potential to be used in multiple places in an application usually has multiple attributes Example A Product object has two attributes Description Price
14
CSC 480 - Software Engineering14 8/27/2004 Class Diagram Invoice -billingAddress:Address -items:ArrayList +add(aProd:Product, qtty:int) +format():String +getAmountDue():double Class name Attributes Operations var:type -private +public ~package #protected
15
CSC 480 - Software Engineering15 8/27/2004 Class Stub Code public class Invoice { /** Adds a charge for a product to this invoice. @param aProd the product that the user ordered @param quantity the quantity of the product */ public void add(Product aProd, int quantity) { } /** Formats the invoice @return the formatted invoice */ public String format() { } }
16
CSC 480 - Software Engineering16 8/27/2004 Examine Relationships Important relationships Inheritance – aka the is-a relationship Congregation – aka the has-a relationship Dependency – similar to uses Visibility Cardinality
17
CSC 480 - Software Engineering17 8/27/2004 The Invoice Classes Invoice Item Address Product
18
CSC 480 - Software Engineering18 8/27/2004 Collaborations Ways for an object to fulfill its responsibilities Performing computation by itself Collaborating with other objects A collaboration is the embodiment of the contract between a client and a server client contract server request
19
CSC 480 - Software Engineering19 8/27/2004 CRC Card Class-Responsibility-Collaboration Cards Used to record collaborations Collaborations are associated with responsibilities Class: Item Format item Product Get total price Class: Product Get description Get price responsibilities collaborations
20
CSC 480 - Software Engineering20 8/27/2004 Unit Test Cases It’s critical to ensure an object can fulfill its responsibilities correctly before integration OOP requires frequent integration due to collaborations among objects Write a test case for each non-trivial public method with know input and expected output
21
CSC 480 - Software Engineering21 8/27/2004 Acceptance Test Functional walk-through Plan testing based on use cases Print invoice system
22
CSC 480 - Software Engineering22 8/27/2004 Project 2 – The Problem Two options to choose from: A simple email messaging system A personal appointment book See the assignment doc file under course folder Due by next Friday, September 3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.