25
Oct. 16, 2003 CS 509 - WPI 1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 1: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

Oct. 16, 2003 CS 509 - WPI 1

CS 509Design of Software Systems

Lecture #7Thursday, Oct. 16, 2003

Page 2: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, 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

Page 3: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

Oct. 16, 2003 CS 509 - WPI 4

Questions?

About Term ProjectFrom last week’s classFrom the readingAnything else?

Page 5: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

Oct. 16, 2003 CS 509 - WPI 5

Chapter 7

Object Design

Page 6: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 7: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 10: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 11: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 12: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

Oct. 16, 2003 CS 509 - WPI 13

Object Design Terminology

Application vs. Solution Domain Objects

Types & SignaturesVisibilityContracts, constraints:

Invariants, Preconditions, Postconditions

Exceptions

Page 14: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

Oct. 16, 2003 CS 509 - WPI 14

Example Object Design

Geographical Information

JEWEL Modeling System

Page 15: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 16: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

* *

Page 18: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 19: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 20: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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

Page 23: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

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: Oct. 16, 2003CS 509 - WPI1 CS 509 Design of Software Systems Lecture #7 Thursday, Oct. 16, 2003

Oct. 16, 2003 CS 509 - WPI 25

For Next Time

Chapter 9 – TestingPay special attention to

Stubs & Drivers