Upload
emil-woods
View
215
Download
0
Embed Size (px)
DESCRIPTION
Oct. 16, 2003CS WPI3 MC Project & Quiz #3 §Turn in Phase 3 (Design) document §Hand out Phase 4 Assignment §Return Quiz #3 l Solutions available on course web site
Citation preview
Oct. 16, 2003 CS 509 - WPI 1
CS 509Design of Software Systems
Lecture #7Thursday, Oct. 16, 2003
Oct. 16, 2003 CS 509 - WPI 2
Term Project administrationReturn Quiz #3QuestionsReview of Chapter 7Preview of Chapter 9Get Student Feedback:
How is this course going so far?
Class Format for Today
Oct. 16, 2003 CS 509 - WPI 3
MC Project & Quiz #3
Turn in Phase 3 (Design) document
Hand out Phase 4 Assignment
Return Quiz #3 Solutions available on course web
site
Oct. 16, 2003 CS 509 - WPI 4
Questions?
About Term ProjectFrom last week’s classFrom the readingAnything else?
Oct. 16, 2003 CS 509 - WPI 5
Chapter 7
Object Design
Oct. 16, 2003 CS 509 - WPI 6
Object DesignFocus:
Individual objects & hierarchies Interfaces
Challenges: Increasing reuse wherever possible Eliminating as many dependencies as
possible Optimizations to address performance
criteria such as response time or memory usage
Oct. 16, 2003 CS 509 - WPI 7
Object Design Activities
Refine analysis & system design models
Identify new objectsClose the gap between application
objects and off-the-shelf components: Identify custom objects Adjust of off-the-shelf components Specify interfaces between classes
Oct. 16, 2003 CS 509 - WPI 8
Service Specification
Specify subsystem services identified during system design: Class interfaces Operations, arguments Type signatures Exceptions
Find missing operations and objects
Oct. 16, 2003 CS 509 - WPI 9
Component SelectionFind, adapt and use off-the-shelf
componentsClass libraries & 3rd party packages
Data structures Services
May need to adjust: Wrap with custom objects Refine using inheritance
Buy vs. build trade-offs
Oct. 16, 2003 CS 509 - WPI 10
RestructuringManipulate system model to increase
code reuse or meet other design goals Maintainability, readability,
understandabilityMerge similar classesCollapse simple classes into attributesSplit complex classes into simpler onesRearrange classes & operations to
increase inheritance relationships
Oct. 16, 2003 CS 509 - WPI 11
OptimizationAddress performance requirements:
Algorithms to improve speed or memory usage
Reduce multiplicity to speed up queries Add redundancy for efficiency Add derived attributes to improve access
time Rearrange execution order Open up a “closed” architecture for
performance improvements
Oct. 16, 2003 CS 509 - WPI 12
Figure 7-2. Activities of object design (UML activity diagram).
Identifying components
Adjusting components
Specifying constraints
Collapsing classes
Specifying types &
Identifying missingattributes & operations
Specifying visibility
Specification
signatures
Optimization
Specifying exceptions
Restructuring
Realizingassociations
Revisitinginheritance
Optimizing accesspaths
Caching complexcomputations
Delaying complexcomputations
Component selection
Oct. 16, 2003 CS 509 - WPI 13
Object Design Terminology
Application vs. Solution Domain Objects
Types & SignaturesVisibilityContracts, constraints:
Invariants, Preconditions, Postconditions
Exceptions
Oct. 16, 2003 CS 509 - WPI 14
Example Object Design
Geographical Information
JEWEL Modeling System
Oct. 16, 2003 CS 509 - WPI 15
Figure 7-7. Object model for the GIS of JEWEL (UML class diagram).
* *
**
* *
**
* *
* *
PoliticalLayerWaterLayerRoadLayer
Highway SecondaryRoad
River Lake
State County
PolyLine Polygon
Layerlabel
Oct. 16, 2003 CS 509 - WPI 16
Figure 7-12. Adding operations to the object model of the JEWEL GIS to realize zooming and clipping (UML class diagram).
Layer
getOutline(bbox, detail)
LayerElement
label
Political LayerWater LayerRoad Layer
label
Highway Secondary road
River Lake
State County
LayerElement(polyline)LayerElement(polygon)
getOutline(bbox, detail)
elements*
Oct. 16, 2003 CS 509 - WPI 17
Figure 7-14. Additional attributes and methods for the Point class to support intelligent point selection and zooming (UML class diagram).
Pointx, y
Point(x, y)includeInLevel(level)excludeFromLevel(level)
notInDetailLevels
* *
PolyLine
addPoint(point)getPoints(bbox)
Polygon
addPoint(point)getPoints(bbox)
inDetailLevels
* *
Oct. 16, 2003 CS 509 - WPI 18
Figure 7-15. Adding type information to the object model of the GIS (UML class diagram). Only selected classes shown for brevity.
Layer
LayerElement+label:String
+label:String
Point
+Point(x, y:double)+includeInLevel(level:double)+excludeFromLevel(level:double)
+LayerElement(polyline:PolyLine)+getOutline(bbox:Rectangle2D,
detail:double):Enumeration
+Layer(label:String)
detail:double):Enumeration+getOutline(bbox:Rectangle2D, *
points*
elements
+x, y:double
+notInDetailLevels:Set+inDetailLevels:Set
PolyLine+label:String+PolyLine()+getPoints():Enumeration
11
*
1
polyline
Oct. 16, 2003 CS 509 - WPI 19
Managing Object DesignIncreased communication complexity
Result of collaboration among many people Scope of project grows
Consistency with prior information Revisit analysis & system design decisions Keep project & design goals in mind Maintain change history Ensure documents reflect current state
Oct. 16, 2003 CS 509 - WPI 20
Preview of Chapter 9
Testing“The software is done.
We are just trying to get it to work.”
Oct. 16, 2003 CS 509 - WPI 21
Opposing Goals of Testing
To ensure/demonstrate proper functioning
To “break” the system, find defects
What constitutes success/failure in each of the above approaches?
Which approach is easier? (Possible?)
Oct. 16, 2003 CS 509 - WPI 22
Quality Assurance TechniquesFault Avoidance
Development processes & methodologies Throughout analysis, design &
implementationFault Detection
Testing & debugging After code has been written
Fault Tolerance Recovery from failures Post-delivery, run-time activities
Oct. 16, 2003 CS 509 - WPI 23
Types of tests – Part 1
Unit tests Find faults in an individual object
Integration tests Find faults in a subsystem Multiple objects working together
System tests Further integration, all components
together
Oct. 16, 2003 CS 509 - WPI 24
Types of tests – Part 2
Functional testing Conformance to functional requirements
Performance testing Conformance to non-functional
requirementsAcceptance & installation testing
Done by client, with support by developers
Oct. 16, 2003 CS 509 - WPI 25
For Next Time
Chapter 9 – TestingPay special attention to
Stubs & Drivers