october 5, 2010coms w41561 coms w4156: advanced software engineering prof. gail kaiser...

66
October 5, 2010 COMS W4156 1 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser [email protected] http://bank.cs.columbia.edu/ classes/cs4156/

Upload: jordan-murphy

Post on 02-Jan-2016

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 1

COMS W4156: Advanced Software Engineering

Prof. Gail Kaiser

[email protected]

http://bank.cs.columbia.edu/classes/cs4156/

Page 2: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 2

Topics covered in this lecture

• Software requirements

• System models (introduction to the Unified Modeling Language – UML will be covered in more depth later in the course)

Page 3: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 3

Software Requirements

Page 4: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 4

What is a requirement?• What is the (future) software system supposed to

“do”?• Each requirement is a service or feature that the

customer needs from a system and/or a constraint under which it must be developed and operated.

• May range from a high-level abstract statement to a detailed mathematical specification.

• Requirements serve a dual function– May be the basis for a bid for a contract - therefore must

be open to interpretation;– May be the basis for the contract itself - therefore must be

defined in detail.

Page 5: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 5

User requirements

• Should describe functional and non-functional requirements in such a way that they are understandable by (future) system users who may have little technical knowledge.

• User requirements are defined using natural language, tables and diagrams as these can be understood by all users.

• Usage scenarios, user stories, use cases, …

Page 6: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 6

System requirements

• More detailed specifications of system functions, services and constraints than user requirements.

• They are intended to be a basis for developers to design the system.

• They may be incorporated into the system contract.

Page 7: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 7

Functional requirements

• Statements of services and features the system should provide, how the system should react to particular inputs and how the system should behave in particular situations.

• Functional user requirements may be high-level statements of what the system should do but functional system requirements must describe the system services in detail.

Page 8: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 8

Example

• The Auction House application includes two types of subsystems:– AuctionHouse: sells Items to Customers. – Customers: submit bids to the AuctionHouse for a given Item.

• There shall be only one Auction House, but an arbitrary number of Customers.

• The Auction House and its Customers shall not be able to "share" files or databases.

• The Auction House application shall support:– Initialization of the AuctionHouse with a certain inventory.– Informing the Customers which Items are currently available for purchase. – Accepting bids on Items from multiple Customers simultaneously connected to the

AuctionHouse. – Informing a Customer when their bid "wins" an Item, and correspondingly reducing

inventory.

Page 9: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 9

Examples of functional requirements

• The Auction House application shall support:– Initialization of the AuctionHouse with a certain inventory.– Informing the Customers which Items are currently

available for purchase. – Accepting bids on Items from multiple Customers

simultaneously connected to the AuctionHouse. – Informing a Customer when their bid "wins" an Item, and

correspondingly reducing inventory.

Page 10: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 10

Requirements imprecision

• Problems arise when requirements are not precisely stated.

• Ambiguous requirements may be interpreted in different ways by developers and users.

• Consider the phrase “accepting bids”– User intention – Customers can see other

customers’ bids and decide to bid higher (or not);– Developer interpretation – Customer can not see

other customers’ bids (sealed bids).

Page 11: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 11

Non-functional requirements• Define system properties and constraints, e.g.,

reliability, response time, storage requirements, device capability, etc.

• Process requirements may also be specified, mandating a particular IDE (Integrated Development Environment), programming language or development method.

• Non-functional requirements may be more critical than functional requirements. If these are not met, the system is useless.

Page 12: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 12

Non-functional classifications• Product requirements

– Requirements that specify that the delivered product must behave in a particular way, e.g., resource utilization, mean time to recovery, etc.

• Organizational requirements– Requirements that are a consequence of organizational

policies and procedures, e.g., process standards used, platform restrictions, etc.

• External requirements– Requirements that arise from factors that are external to the

system and its development process, e.g., interoperability requirements, legislative requirements, etc.

Page 13: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 13

Examples of non-functional requirements

• Product requirement: There shall be only one Auction House, but an arbitrary number of Customers. The Auction House and its Customers shall not be able to "share" files or databases.

• Organizational requirement: Develop (using any programming language supported by CORBA).  Deploy and run your AH application on the supplied ORB.

• External requirement: It is acceptable for this specific assignment to obtain "help" from other people, who may be other students in the class but need not be.  However, the submitted documents must be written individually in your own words and every student must submit separately with no "copying".

Page 14: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 14

Goals vs. requirements

• Non-functional requirements may be very difficult to state precisely and imprecise requirements may be difficult to verify.

• Goal– A general intention of the user such as ease of use.

• Verifiable non-functional requirement– A statement based on some measure that can be

objectively tested.

• Goals are helpful to developers as they convey the intentions of the system users.

Page 15: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 15

Examples

• A system goal: There shall be only one Auction House, but an arbitrary number of Customers.

• A verifiable non-functional requirement: There shall be only one Auction House and 0 to 64 simultaneously connected Customers.

Page 16: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 16

Requirements interaction• Conflicts between different non-functional

requirements are common in complex systems.• Spacecraft system example:

– To minimize weight, the number of separate chips in the system should be minimized.

– To minimize power consumption, lower power chips should be used.

– However, using low power chips may mean that more chips have to be used. Which is the most important requirement?

Page 17: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 17

Requirements completeness and consistency

• In principle, requirements should be both complete and consistent.

• Complete: Should include descriptions of all facilities required.

• Consistent: Should be no conflicts or contradictions in the descriptions of the system facilities.

• In practice, it may be impossible to produce a complete and consistent requirements document.

Page 18: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 18

Domain requirements

• Derived from the application domain and describe system characteristics and features that reflect the domain.

• Domain requirements may be new functional requirements, constraints on existing requirements or define specific computations.

• If domain requirements are not satisfied, the system may be unworkable.

Page 19: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 19

Auction House domain requirements

• Bids are represented in terms of some currency (e.g., dollars).

• Competing bids for the same individual item must occur within some reasonable time-frame (e.g., minutes).

Page 20: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 20

Domain requirements problems• Understandability

– Requirements are expressed in the language of the application domain;

– This jargon may not be understood by the software engineers developing the system (e.g., English vs. Dutch auction).

• Implicitness– Domain specialists understand the area so well that

they may not think of making the domain requirements explicit.

Page 21: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 21

Problems with natural language

• Lack of clarity – Precision is difficult without making the document

hard to read.

• Requirements confusion– Functional and non-functional requirements tend

to be mixed together.

• Requirements amalgamation– Several different requirements may be expressed

together.

Page 22: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 22

Example requirement problems

• There shall be only one Auction House, but an arbitrary number of Customers. The Auction House and its Customers shall not be able to "share" files or databases, and shall communicate solely via the ORB.

• This requirements statement includes both conceptual and detailed information– Describes (obliquely) the client-server concept. – Restricts implementation to CORBA – which might not be

the best platform.

Page 23: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 23

Guidelines for writing requirements

• Invent a standard format and use it for all requirements.

• Use language in a consistent way. Use shall for mandatory requirements, should for desirable requirements.

• Use text highlighting to identify key parts of the requirement.

• Avoid the use of computer jargon.

Page 24: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 24

Requirements vs. design• In principle, requirements should state what the

system should do and the design should describe how it does this.

• In practice, requirements and design are inseparable– A system architecture may be designed to structure

the requirements;– The system may inter-operate with other systems that

generate design requirements;– The use of a specific design may be a domain

requirement.

Page 25: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 25

System Models

Page 26: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 26

Use cases

• Use cases are a scenario-based modeling technique that identify the actors in an interaction and describe the interaction itself.

• A set of use cases should describe all possible interactions with the system.

• Sequence diagrams may be used to add detail to use cases by showing the sequence of event processing in the system.

Page 27: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

LIBSYS Example

• A library system that provides a single interface to a number of databases of articles in different libraries.

• Users can search for, download and print these articles for personal study.

October 5, 2010 COMS W4156 27

Page 28: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 28

LIBSYS use cases

Article printing

Article search

User administration

Supplier Catalogue services

LibraryUser

LibraryStaff

Page 29: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 29

Article printing use case

Article printing

Page 30: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 30

Print article sequence

User

item:Article

copyrightForm:Form

request

complete

myWorkspace:Workspace

myPrinter:Printer

request

return

copyright OK

deliver

article OK

print send

confirminform

delete

Page 31: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 31

System modeling• System modeling helps the analyst to understand the

functionality of the system, and models are also used to communicate with customers.

• Different models present the system from different perspectives– External perspective showing the system’s context or

environment;– Behavioral perspective showing the behavior of the system;– Structural perspective showing the system or data

architecture.

Page 32: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 32

Model types

• Data processing model showing how the data is processed at different stages.

• Composition model showing how entities are composed of other entities.

• Architectural model showing principal sub-systems.• Classification model showing how entities have

common characteristics.• Stimulus/response model showing the system’s

reaction to events.

Page 33: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 33

Context models

• Context models are used to illustrate the operational context of a system - they show what lies outside the system boundaries.

• Social and organizational concerns may affect the decision on where to position system boundaries.

• Architectural models show the system and its relationship with other systems.

Page 34: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 34

The context of an ATM system

Auto-tellersystem

Securitysystem

Maintenancesystem

Accountdatabase

Usagedatabase

Branchaccounting

system

Branchcountersystem

Page 35: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 35

Process models

• Process models show the overall process and the processes that are supported by the system.

• Data flow models may be used to show the processes and the flow of information from one process to another.

Page 36: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 36

Equipment procurement process

Get costestimates

Acceptdelivery ofequipment

Checkdelivered

items

Validatespecification

Specifyequipmentrequired

Choosesupplier

Placeequipment

order

Installequipment

Findsuppliers

Supplierdatabase

Acceptdelivered

equipment

Equipmentdatabase

Equipmentspec.

Checkedspec.

Deliverynote

Deliverynote

Ordernotification

Installationinstructions

Installationacceptance

Equipmentdetails

Checked andsigned order form

Orderdetails plusblank order

form

Spec. +supplier +estimate

Supplier listEquipment

spec.

Page 37: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 37

Behavioral models

• Behavioral models are used to describe the overall behavior of a system.

• Two types of behavioral model are:– Data processing models that show how data is

processed as it moves through the system;– State machine models that show the system’s

response to events.

• These models show different perspectives so both of them are needed to describe the system’s behavior.

Page 38: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 38

Data-processing models• Data flow diagrams (DFDs) may be used to

model the system’s data processing.• These show the processing steps as data

flows through a system.• DFDs are an intrinsic part of many analysis

methods.• Simple and intuitive notation that customers

can understand.• Show end-to-end processing of data.

Page 39: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 39

Order processing DFD

Completeorder form

Orderdetails +

blankorder form

Validateorder

Recordorder

Send tosupplier

Adjustavailablebudget

Budgetfile

Ordersfile

Completedorder form

Signedorder form

Signedorder form

Checked andsigned order

+ ordernotification

Orderamount

+ accountdetails

Signedorder form

Orderdetails

Page 40: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 40

Data flow diagrams

• DFDs model the system from a functional perspective.

• Tracking and documenting the data associated with a process is helpful to develop an overall understanding of the system.

• Data flow diagrams may also be used in showing the data exchange between a system and other systems in its environment.

Page 41: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 41

Insulin pump DFD

Insulinrequirementcomputation

Blood sugaranalysis

Blood sugarsensor

Insulindelivery

controller

Insulinpump

Blood

Bloodparameters

Blood sugarlevel

Insulin

Pump controlcommands Insulin

requirement

Page 42: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 42

State machine models

• Model the behavior of the system in response to external and internal events.

• Show the system’s responses to stimuli, so are often used for modeling real-time systems.

• State machine models show system states as nodes and events as arrows between these nodes. When an event occurs, the system moves from one state to another.

Page 43: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 43

Statecharts

• Allow the decomposition of a model into sub-models.

• A brief description of the actions is included following the ‘do’ in each state.

• Can be complemented by tables describing the states and the stimuli.

Page 44: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 44

Microwave oven model

Full power

Enabled

do: operateoven

Fullpower

Halfpower

Halfpower

Fullpower

Number

Dooropen

Doorclosed

Doorclosed

Dooropen

Start

do: set power= 600

Half powerdo: set power

= 300

Set time

do: get numberexit: set time

Disabled

Operation

Cancel

Waiting

do: displaytime

Waiting

do: displaytime

do: display 'Ready'

do: display'Waiting'

Timer

Timer

Page 45: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 45

Microwave oven state description

State Description

Waiting The oven is waiting for input. The display shows the current time.

Half power The oven power is set to 300 watts. The display shows ‘Half power’.

Full power The oven power is set to 600 watts. The display shows ‘Full power’.

Set time The cooking time is set to the user’s input value. The display shows the cooking time selected and is updated as the time is set.

Disabled Oven operation is disabled for safety. Interior oven light is on. Display shows ‘Not ready’.

Enabled Oven operation is enabled. Interior oven light is off. Display shows ‘Ready to cook’.

Operation Oven in operation. Interior oven light is on. Display shows the timer countdown. On completion of cooking, the buzzer is sounded for 5 seconds. Oven light is on. Display shows ‘Cooking complete’ while buzzer is sounding.

Page 46: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 46

Microwave oven stimuli

Page 47: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 47

Microwave oven operation

Cookdo: run

generator

Done

do: buzzer onfor 5 secs.

Waiting

Alarm

do: displayevent

do: checkstatus

Checking

Turntablefault

Emitterfault

Disabled

OK

Timeout

Time

Door open Cancel

Operation

Page 48: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 48

Semantic data models• Used to describe the logical structure of data

processed by the system.• An entity-relationship-attribute (ERA) model sets out

the entities in the system, the relationships between these entities and the entity attributes

• Widely used in database design. Can readily be implemented using relational databases.

Page 49: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 49

LIBSYS semantic model

Source

titlepublisherissuedatepages

1

Article

titleauthorspdf filefee

has-links

1

Buyer

nameaddresse-mailbilling info

places

fee-payable-to

n

1

n

published-in

delivers in

m n

1

1

1

CopyrightAgencynameaddress

Country

copyright formtax rate

1

Order

order numbertotal paymentdatetax status

in

1

Page 50: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 50

Data dictionaries

• Data dictionaries are lists of all of the names used in the system models. Descriptions of the entities, relationships and attributes are also included.

• Advantages– Support name management and avoid duplication;– Store of organizational knowledge linking analysis, design

and implementation;

• Many IDEs support data dictionaries.

Page 51: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 51

Data dictionary entries

Page 52: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 52

Object models• Object models describe the system in terms of object

classes and their associations.• An object class is an abstraction over a set of objects

with common attributes and the services (operations) provided by each object. (Not necessarily to be implemented directly as programming language classes.)

• Various object models may be produced– Inheritance models;– Aggregation models;– Interaction models.

Page 53: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 53

Object models• Natural ways of reflecting the real-world

entities manipulated by the system• Abstract entities are more difficult to model

using this approach• Object class identification is recognized as a

difficult process requiring a deep understanding of the application domain

• Object classes reflecting domain entities are often reusable across systems

Page 54: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 54

Inheritance models• Organize the domain object classes into a hierarchy.• Classes at the top of the hierarchy reflect the

common features of all classes.• Object classes inherit their attributes and services

from one or more super-classes (base classes). These may then be specialized as necessary.

• It is sometimes difficult to avoid duplication in different branches of a class hierarchy design.

Page 55: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 55

Object models and UML• UML (Unified Modeling Language) is a representation

devised by the developers of widely used object-oriented analysis and design methods.

• It has become an effective standard for object-oriented modeling.

• Notation– Object classes are rectangles with the name at the top, attributes

in the middle section and operations in the bottom section;– Relationships between object classes (known as associations)

are shown as lines linking objects;– Inheritance is referred to as generalization and is shown

‘upwards’ rather than ‘downwards’ in a hierarchy.

Page 56: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 56

Example class hierarchy

Catalogue numberAcquisition dateCostTypeStatusNumber of copies

Library item

Acquire ()Catalogue ()Dispose ()Issue ()Return ()

AuthorEditionPublication dateISBN

Book

YearIssue

Magazine

DirectorDate of releaseDistributor

Film

VersionPlatform

Computerprogram

TitlePublisher

Published item

TitleMedium

Recorded item

Page 57: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 57

Another example class hierarchy

NameAddressPhoneRegistration #

Library user

Register ()De-register ()

Affiliation

Reader

Items on loanMax. loans

Borrower

DepartmentDepartment phone

Staff

Major subjectHome address

Student

Page 58: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 58

Multiple inheritance• Rather than inheriting the attributes and services from a

single parent class, a modeling system that supports multiple inheritance allows object classes to inherit from several super-classes. (Multiple inheritance may or may not be supported by the implementation programming language.)

• This can lead to semantic conflicts where attributes/services with the same name in different super-classes have different semantics.

• Multiple inheritance makes class hierarchy reorganization more complex.

Page 59: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 59

Example multiple inheritance

# Tapes

Talking book

AuthorEditionPublication dateISBN

Book

SpeakerDurationRecording date

Voice recording

Page 60: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 60

Object aggregation• An aggregation model shows how classes that

are collections are composed of other classes.

• Aggregation models are similar to the part-of relationship in semantic data models.

Page 61: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 61

Example object aggregation

Videotape

Tape ids.

Lecturenotes

Text

OHP slides

Slides

Assignment

Credits

Solutions

TextDiagrams

Exercises

#ProblemsDescription

Course titleNumberYearInstructor

Study pack

Page 62: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 62

Object behavior modeling

• A behavioral model shows the interactions between objects to produce some particular system behavior that is specified as a use case.

• Sequence diagrams (or collaboration diagrams) in the UML are used to model interaction between objects.

Page 63: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

October 5, 2010 COMS W4156 63

Issue of electronic library items

:Library User

Ecat:Catalog

Lookup

Issue

Display

:Library ItemLib1:NetServer

Issue licence

Accept licence

Compress

Deliver

Page 64: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

Upcoming Assignments

October 5, 2010 COMS W4156 64

Page 65: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

Upcoming Assignments

• First Iteration Plan due Tuesday 19 October.• First Iteration Progress Report due Tuesday 26

October. • First Iteration Demo Wednesday 3 November –

Thursday 11 November.• First Iteration Final Report due Friday 12

November.

October 5, 2010 COMS W4156 65

Page 66: October 5, 2010COMS W41561 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu

COMS W4156: Advanced Software Engineering

Prof. Gail [email protected]

http://bank.cs.columbia.edu/classes/cs4156/

October 5, 2010 COMS W4156 66