CS 509 Design of Software Systems
description
Transcript of CS 509 Design of Software Systems
![Page 1: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/1.jpg)
Oct. 16, 2003 CS 509 - WPI 1
CS 509Design of Software Systems
Lecture #7Thursday, Oct. 16, 2003
![Page 2: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/2.jpg)
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
![Page 3: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/3.jpg)
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
![Page 4: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/4.jpg)
Oct. 16, 2003 CS 509 - WPI 4
Questions?
About Term ProjectFrom last week’s classFrom the readingAnything else?
![Page 5: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/5.jpg)
Oct. 16, 2003 CS 509 - WPI 5
Chapter 7
Object Design
![Page 6: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/6.jpg)
Oct. 16, 2003 CS 509 - WPI 6
Object Design
Focus: 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
![Page 7: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/7.jpg)
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
![Page 8: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/8.jpg)
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
![Page 9: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/9.jpg)
Oct. 16, 2003 CS 509 - WPI 9
Component Selection
Find, adapt and use off-the-shelf components
Class libraries & 3rd party packages Data structures Services
May need to adjust: Wrap with custom objects Refine using inheritance
Buy vs. build trade-offs
![Page 10: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/10.jpg)
Oct. 16, 2003 CS 509 - WPI 10
Restructuring
Manipulate 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
![Page 11: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/11.jpg)
Oct. 16, 2003 CS 509 - WPI 11
Optimization
Address 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
![Page 12: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/12.jpg)
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
![Page 13: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/13.jpg)
Oct. 16, 2003 CS 509 - WPI 13
Object Design Terminology
Application vs. Solution Domain Objects
Types & SignaturesVisibilityContracts, constraints:
Invariants, Preconditions, Postconditions
Exceptions
![Page 14: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/14.jpg)
Oct. 16, 2003 CS 509 - WPI 14
Example Object Design
Geographical Information
JEWEL Modeling System
![Page 15: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/15.jpg)
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
Layer
label
![Page 16: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/16.jpg)
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
*
![Page 17: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/17.jpg)
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).
Point
x, y
Point(x, y)includeInLevel(level)excludeFromLevel(level)
notInDetailLevels
* *
PolyLine
addPoint(point)getPoints(bbox)
Polygon
addPoint(point)getPoints(bbox)
inDetailLevels
* *
![Page 18: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/18.jpg)
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
1
1
*
1
polyline
![Page 19: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/19.jpg)
Oct. 16, 2003 CS 509 - WPI 19
Managing Object Design
Increased 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
![Page 20: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/20.jpg)
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.”
![Page 21: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/21.jpg)
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?)
![Page 22: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/22.jpg)
Oct. 16, 2003 CS 509 - WPI 22
Quality Assurance Techniques
Fault 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
![Page 23: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/23.jpg)
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
![Page 24: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/24.jpg)
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
![Page 25: CS 509 Design of Software Systems](https://reader035.fdocuments.net/reader035/viewer/2022062500/568150f1550346895dbf0bb1/html5/thumbnails/25.jpg)
Oct. 16, 2003 CS 509 - WPI 25
For Next Time
Chapter 9 – TestingPay special attention to
Stubs & Drivers