CSC 205: Software Engineering I
description
Transcript of CSC 205: Software Engineering I
© 2000 Franz Kurfess System Design Methods 1
CSC 205: Software Engineering ICSC 205: Software Engineering I
Dr. Franz J. Kurfess
Computer Science Department
Cal Poly
© 2000 Franz Kurfess System Design Methods 2
Course OverviewCourse Overview Introduction Requirements Engineering
Requirements Elicitation Requirements Management
Project Management System Design Methods
and Notations
Design Models and Object-Oriented Design
Design Analysis and Formal Specification
Design Analysis and Verification
Conclusions
© 2000 Franz Kurfess System Design Methods 3
Chapter OverviewSystem Design Methods and Notations
Chapter OverviewSystem Design Methods and Notations Motivation Objectives Context Models Behavioral Models Data Models Object Models
CASE workbenches Important Concepts and
Terms Chapter Summary
© 2000 Franz Kurfess System Design Methods 4
LogisticsLogistics
Midterm Friday, February 16
Project Presentations probably Friday, Feb. 9 with Lori Fisher
© 2000 Franz Kurfess System Design Methods 7
MotivationMotivation
it is helpful to consider a system from different perspectives in order to get a better understanding
various methods concentrate on specific aspects components functions data flow data structures
tools affiliated with these methods help with the capturing of system information
© 2000 Franz Kurfess System Design Methods 8
Objectives
to explain why the context of a system should be modeled as part of the re process
to describe behavioral modeling, data modeling and object modeling
to introduce some of the notations used in the Unified Modeling Language (UML)
to show how CASE workbenches support system modeling
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 10[Sommerville 01]
System ModelsSystem Models
abstract descriptions of systems whose requirements are being analyzed
© 2000 Franz Kurfess System Design Methods 11
System Modeling
helps the analyst to understand the functionality of the system
models can be used to communicate with customersdifferent models present the system from different
perspectives external perspective
the system’s context or environment
behavioral perspective the behavior of the system
structural perspective the system or data architecture
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 12
Structured MethodsStructured Methods
incorporate system modeling as an inherent part of the method
these methods define a set of models a process for deriving these models and rules guidelines that should apply to the models
CASE tools support system modeling as part of a structured method
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 13
Structured Method WeaknessesStructured Method Weaknesses
do not model non-functional system requirementsdo not usually include information about whether a
method is appropriate for a given problemmay produce too much documentationthe system models are sometimes too detailed and
difficult for users to understand
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 14[Sommerville 01]
Model TypesModel Types
data processing model how the data is processed at different stages
composition model how entities are composed of other entities
architectural model principal sub-systems
classification model entities with common characteristics
stimulus/response model the system’s reaction to external or internal events
© 2000 Franz Kurfess System Design Methods 15
Context ModelsContext Models
used to illustrate the boundaries of a systemsocial and organizational concerns may affect the
decision on where to position system boundariesarchitectural models
show the system and its relationship with other systems
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 16
ATM System Context ATM System Context
[Sommerville 01]
AutomatedTeller
SecuritySystem
AccountData Base
UsageData Base
MaintenanceSystem
Branch CounterSystem
Branch Accounting
System
© 2000 Franz Kurfess System Design Methods 17
Process ModelsProcess 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
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 18
Equipment Procurement Process
Get costestimatesAcceptdelivery ofequipment CheckdelivereditemsValidatespecificationSpecifyequipmentrequired Choosesupplier Placeequipmentorder InstallequipmentFindsuppliersSupplierdatabase AcceptdeliveredequipmentEquipmentdatabase
Equipmentspec. Checkedspec. DeliverynoteDeliverynoteOrdernotification InstallationinstructionsInstallationacceptanceEquipmentdetailsChecked andsigned order form
Orderdetails +Blank orderformSpec. +supplier +estimateSupplier listEquipmentspec.
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 19
Behavioral ModelsBehavioral Models
behavioral models are used to describe the overall behavior of a system
two types of behavioral model are shown here data processing models
show how data is processed as it moves through the system
state machine models show how the system responds to events
both of these models are required for a description of the system’s behavior
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 20
Data-processing Models
data flow diagrams used to model the system’s data processing show the processing steps as data flows through a system intrinsic part of many analysis methods simple and intuitive notation that customers can
understand show end-to-end processing of data
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 21
Order Processing DFD
Completeorder formOrderdetails +blankorder form ValidateorderRecordorderSend tosupplierAdjustavailablebudgetBudgetfileOrdersfileCompletedorder formSignedorder formSignedorder formChecked andsigned order+ ordernotificationOrderamount+ accountdetailsSignedorder formOrderdetails
[Sommerville 01]
slightly different notation from examples in the previous chapter [FJK]
© 2000 Franz Kurfess System Design Methods 22
Data Flow DiagramsData Flow Diagrams
DFDs model the system from a functional perspective
tracking and documenting how 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
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 23
CASE Toolset DFD
Designeditor Designcross checkerDesignanalyserReportgeneratorDesigndatabase Code skeletongenerator DesigndatabaseInputdesignValiddesignCheckeddesignDesignanalysisUserreportandReferenceddesignsCheckeddesign Outputcode
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 24
State Machine ModelsState Machine Models
model the behavior of the system in response to external and internal events
show the system’s responses to stimuli often used for modeling real-time systems
notation system states as nodes events as arcs between these nodes
when an event occurs, the system moves from one state to another
state charts are an integral part of the UML
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 25
Microwave Oven ModelMicrowave Oven ModelFull powerEnableddo: operateoven
FullpowerHalfpower HalfpowerFullpower NumberTimerDooropenDoorclosedDoorclosed DooropenStart
do: set power = 600Half powerdo: set power = 300
Set timedo: get numberexit: set timeDisabled
OperationTimerCancelWaitingdo: display time
Waitingdo: display timedo: display 'Ready'do: display 'Waiting'
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 26
Microwave Oven State DescriptionMicrowave Oven State Description
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 27
Microwave Oven StimuliMicrowave Oven Stimuli
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 28
State ChartsState Charts
allow the decomposition of a model into sub-modelsa brief description of the actions is included
following the ‘do’ in each state
can be complemented by tables describing the states and the stimuli
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 29
Microwave Oven OperationMicrowave Oven Operation
Cookdo: run generatorDonedo: buzzer on for 5 secs.WaitingAlarmdo: display eventdo: checkstatusCheckingTurntablefaultEmitterfaultDisabled
OKTimeoutTimeOperationDooropen Cancel
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 30
Semantic Data Models
describe the logical structure of data processed by the system
entity-relation-attribute model entities in the system relationships between these entities entity attributes
widely used in database design can readily be implemented using relational databases
no specific notation provided in the UML objects and associations can be used
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 31
Software Design Semantic ModelDesignnamedescriptionC-dateM-dateLinknametypeNodenametype linkshas-links121 n
Labelnametexticon has-labelshas-labels 1n1nhas-linkshas-nodesis-a1n
1n11
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 32
Data DictionariesData Dictionaries
lists of all of the names used in the system models also includes descriptions of the entities, relationships and
attributes
advantages support name management and avoid duplication store of organizational knowledge linking analysis, design
and implementation
many CASE workbenches support data dictionaries
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 33
Data Dictionary EntriesData Dictionary Entries
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 34
Object Models
describe the system in terms of object classesan object class is an abstraction over a set of objects
common attributes services (operations) provided by each object
various object models may be produced inheritance models aggregation models interaction models
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 35
Object Models
natural ways of reflecting the real-world entities manipulated by the system
more abstract entities are more difficult to modelobject class identification is a difficult process
requires a deep understanding of the application domain
object classes reflecting domain entities may be reusable across systems
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 36
Inheritance Models
organize the domain object classes into a hierarchyclasses at the top of the hierarchy reflect the
common features of all classesobject classes inherit their attributes and services
from one or more super-classes may then be specialized as necessary
class hierarchy design is a difficult process duplication in different branches should be avoided
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 37
The Unified Modeling LanguageThe Unified Modeling Language
devised by the developers of widely used object-oriented analysis and design methods the “three amigos” Booch, Jacobson, Rumbaugh
has become an effective standard for object-oriented modeling
can be used at different levels of abstraction conceptual level specification level implementation level
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 38
UML ModelsUML Models
functional model use case diagrams
object model class diagram objects, attributes, associations, operations
dynamic model sequence diagrams state chart diagrams activity diagrams
© 2000 Franz Kurfess System Design Methods 39
UML NotationUML Notation
object classes rectangles with the name at the top, attributes in the
middle section and operations in the bottom section
associations relationships between object classes shown as lines linking objects
inheritance is referred to as generalization shown ‘upwards’ rather than ‘downwards’ in a hierarchy
Library Class
Hierarchy
Catalogue numberAcquisition dateCostTypeStatusNumber of copiesLibrary itemAcquire ()Catalogue ()Dispose ()Issue ()Return ()AuthorEditionPublication dateISBNBookYearIssueMagazineDirectorDate of releaseDistributorFilmVersionPlatformComputerprogramTitlePublisherPublished itemTitleMediumRecorded item
[Sommerville 01]
NameAddressPhoneRegistration #Library userRegister ()De-register ()AffiliationReader Items on loanMax. loansBorrowerDepartmentDepartment phoneStaffMajor subjectHome addressStudent[Sommerville 01]
User Class HierarchyUser Class Hierarchy
© 2000 Franz Kurfess System Design Methods 42
Multiple Inheritance
allows object classes to inherit from several super-classes rather than inheriting the attributes and services from a
single parent class
can lead to semantic conflicts attributes/services with the same name in different super-
classes have different semantics
can simplify specifications of objects substantiallymay make class hierarchy reorganization more
complex
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 43
Multiple Inheritance
# TapesTalking bookAuthorEditionPublication dateISBNBookSpeakerDurationRecording dateVoice recording
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 44
Object Aggregation
aggregation model shows how classes which are collections are composed of
other classes similar to the part-of relationship in semantic data models
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 45
Object Aggregation
VideotapeTape ids.LecturenotesTextOHP slidesSlidesAssignmentCreditsSolutionsTextDiagramsExercises#Problems Description
Course titleNumberYearInstructorStudy pack
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 46
Object Behavior ModelingObject Behavior Modeling
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
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 47
Issue of Electronic ItemsIssue of Electronic Items
:Library UserEcat:CatalogLookupIssueDisplay:Library ItemLib1:NetServer
Issue licenceAccept licence CompressDeliver[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 48
CASE WorkbenchesCASE Workbenches
coherent set of tools designed to support related software process activities such as analysis, design or testing
analysis and design workbenches support system modeling during both requirements
engineering and system design
these workbenches may support a specific design method or may provide support for a creating several different types of system model
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 49
An Analysis and Design Workbench
CentralinformationrepositoryCodegenerator QuerylanguagefacilitiesStructureddiagrammingtoolsDatadictionary ReportgenerationfacilitiesDesign, analysisand checkingtoolsFormscreationtools Import/exportfacilities
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 50
Analysis Workbench Components
diagram editorsmodel analysis and checking toolsrepository and associated query languagedata dictionaryreport definition and generation toolsforms definition toolsimport/export translatorscode generation tools
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 53
Important Concepts and TermsImportant Concepts and Terms inheritance model interaction model multiple inheritance object object class object model process model requirements sequence diagram stimulus-response model state chart/diagram state machine model system model Unified Modeling Language (UML) use case diagram
activity diagram aggregation model architectural model association behavioral model CASE workbench classification model component composition model context model data dictionary data flow data flow diagram data model data structure entity-relation-attribute model entity-relationship diagram
© 2000 Franz Kurfess System Design Methods 54
Chapter SummaryChapter Summary
© 2000 Franz Kurfess System Design Methods 55
Chapter Summary
a model is an abstract system view complementary types of model provide different system
informationcontext models show the position of a system in its
environment together with other systems and processes
data flow models may be used to model the data processing in a system
state machine models describe the system’s behavior in response to internal or external events
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 56
Chapter Summary (cont.)
semantic data models describe the logical structure of data items
object models describe the logical system entities and their classification and aggregation
CASE workbenches support the development of system models
[Sommerville 01]
© 2000 Franz Kurfess System Design Methods 57