250 likes | 390 Views
CS 509 Design of Software Systems. Lecture #7 Thursday, Oct. 16, 2003. Class Format for Today. Term Project administration Return Quiz #3 Questions Review of Chapter 7 Preview of Chapter 9 Get Student Feedback: How is this course going so far?. MC Project & Quiz #3.
E N D
CS 509Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003 CS 509 - WPI
Class Format for Today • Term Project administration • Return Quiz #3 • Questions • Review of Chapter 7 • Preview of Chapter 9 • Get Student Feedback: • How is this course going so far? CS 509 - WPI
MC Project & Quiz #3 • Turn in Phase 3 (Design) document • Hand out Phase 4 Assignment • Return Quiz #3 • Solutions available on course web site CS 509 - WPI
Questions? • About Term Project • From last week’s class • From the reading • Anything else? CS 509 - WPI
Chapter 7 Object Design CS 509 - WPI
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 CS 509 - WPI
Object Design Activities • Refine analysis & system design models • Identify new objects • Close the gap between application objects and off-the-shelf components: • Identify custom objects • Adjust of off-the-shelf components • Specify interfaces between classes CS 509 - WPI
Service Specification • Specify subsystem services identified during system design: • Class interfaces • Operations, arguments • Type signatures • Exceptions • Find missing operations and objects CS 509 - WPI
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 CS 509 - WPI
Restructuring • Manipulate system model to increase code reuse or meet other design goals • Maintainability, readability, understandability • Merge similar classes • Collapse simple classes into attributes • Split complex classes into simpler ones • Rearrange classes & operations to increase inheritance relationships CS 509 - WPI
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 CS 509 - WPI
Figure 7-2. Activities of object design (UML activity diagram). CS 509 - WPI
Object Design Terminology • Application vs. Solution Domain Objects • Types & Signatures • Visibility • Contracts, constraints: • Invariants, Preconditions, Postconditions • Exceptions CS 509 - WPI
Example Object Design Geographical Information JEWEL Modeling System CS 509 - WPI
Layer label WaterLayer RoadLayer PoliticalLayer * * * * Highway SecondaryRoad State County * * River Lake * * * * * * PolyLine Polygon Figure 7-7. Object model for the GIS of JEWEL (UML class diagram). CS 509 - WPI
Layer label getOutline(bbox, detail) Water Layer Road Layer Political Layer elements LayerElement * label LayerElement(polyline) LayerElement(polygon) getOutline(bbox, detail) Highway Secondary road State County River Lake Figure 7-12. Adding operations to the object model of the JEWEL GIS to realize zooming and clipping (UML class diagram). CS 509 - WPI
PolyLine Polygon addPoint(point) addPoint(point) getPoints(bbox) getPoints(bbox) * * Point * * x, y inDetailLevels notInDetailLevels Point(x, y) includeInLevel(level) excludeFromLevel(level) Figure 7-14. Additional attributes and methods for the Point class to support intelligent point selection and zooming (UML class diagram). CS 509 - WPI
Layer +label:String LayerElement +label:String +LayerElement(polyline:PolyLine) +getOutline(bbox:Rectangle2D, detail:double):Enumeration PolyLine +label:String +PolyLine() +getPoints():Enumeration +x, y:double +inDetailLevels:Set +notInDetailLevels:Set +Point(x, y:double) +includeInLevel(level:double) +excludeFromLevel(level:double) 1 +Layer(label:String) elements * +getOutline(bbox:Rectangle2D, detail:double):Enumeration 1 polyline 1 Point * points * Figure 7-15. Adding type information to the object model of the GIS (UML class diagram). Only selected classes shown for brevity. CS 509 - WPI
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 CS 509 - WPI
Preview of Chapter 9 Testing “The software is done. We are just trying to get it to work.” CS 509 - WPI
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?) CS 509 - WPI
Quality Assurance Techniques • Fault Avoidance • Development processes & methodologies • Throughout analysis, design & implementation • Fault Detection • Testing & debugging • After code has been written • Fault Tolerance • Recovery from failures • Post-delivery, run-time activities CS 509 - WPI
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 CS 509 - WPI
Types of tests – Part 2 • Functional testing • Conformance to functional requirements • Performance testing • Conformance to non-functional requirements • Acceptance & installation testing • Done by client, with support by developers CS 509 - WPI
For Next Time Chapter 9 – Testing Pay special attention to Stubs & Drivers CS 509 - WPI