system models » abstract descriptions of systems whose
TRANSCRIPT
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1
System models
λ Abstract descriptions ofsystems whose requirementsare being analysed
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 2
Objectives
λ To explain why the context of a system should bemodelled as part of the RE process
λ To describe behavioural modelling, datamodelling and object modelling
λ To introduce some of the notations used in theUnified Modeling Language (UML)
λ To show how CASE workbenches supportsystem modelling
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 3
Topics covered
λ Context models
λ Behavioural models
λ Data models
λ Object models
λ CASE workbenches
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 4
System modelling
λ System modelling helps the analyst to understandthe functionality of the system and models areused to communicate with customers
λ Different models present the system fromdifferent perspectives• External perspective showing the system’s context or
environment
• Behavioural perspective showing the behaviour of the system
• Structural perspective showing the system or data architecture
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 5
Structured methods
λ Structured methods incorporate system modellingas an inherent part of the method
λ Methods define a set of models, a process forderiving these models and rules and guidelinesthat should apply to the models
λ CASE tools support system modelling as part of astructured method
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 6
Method weaknesses
λ They do not model non-functional systemrequirements
λ They do not usually include information aboutwhether a method is appropriate for a givenproblem
λ The may produce too much documentation
λ The system models are sometimes too detailedand difficult for users to understand
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 7
Model typesλ Data processing model showing how the data is
processed at different stages
λ Composition model showing how entities arecomposed of other entities
λ Architectural model showing principal sub-systems
λ Classification model showing how entities havecommon characteristics
λ Stimulus/response model showing the system’sreaction to events
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 8
Context models
λ Context models are used to illustrate theboundaries of a system
λ Social and organisational concerns may affect thedecision on where to position system boundaries
λ Architectural models show the a system and itsrelationship with other systems
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 9
The context of an ATM system
Auto-tellersystem
Securitysystem
Maintenancesystem
Accountdatabase
Usagedatabase
Branchaccounting
system
Branchcountersystem
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 10
Process models
λ Process models show the overall process and theprocesses that are supported by the system
λ Data flow models may be used to show theprocesses and the flow of information from oneprocess to another
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 11
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 +
Blank orderform
Spec. +supplier +estimate
Supplier listEquipment
spec.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 12
Behavioural models
λ Behavioural models are used to describe theoverall behaviour of a system
λ Two types of behavioural model are shown here• Data processing models that show how data is processed as it
moves through the system
• State machine models that show the systems response to events
λ Both of these models are required for adescription of the system’s behaviour
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 13
Data-processing models
λ Data flow diagrams are used to model thesystem’s data processing
λ These show the processing steps as data flowsthrough a system
λ Intrinsic part of many analysis methods
λ Simple and intuitive notation that customers canunderstand
λ Show end-to-end processing of data
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 14
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
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 15
Data flow diagrams
λ DFDs model the system from a functionalperspective
λ Tracking and documenting how the dataassociated with a process is helpful to develop anoverall understanding of the system
λ Data flow diagrams may also be used in showingthe data exchange between a system and othersystems in its environment
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 16
CASE toolset DFD
Designeditor
Designcross checker
Designanalyser
Reportgenerator
Designdatabase
Code skeletongenerator
Designdatabase
Inputdesign
Validdesign
Checkeddesign
Designanalysis
Userreport
and
Referenceddesigns
Checkeddesign Output
code
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 17
State machine models
λ These model the behaviour of the system inresponse to external and internal events
λ They show the system’s responses to stimuli soare often used for modelling real-time systems
λ State machine models show system states asnodes and events as arcs between these nodes.When an event occurs, the system moves fromone state to another
λ Statecharts are an integral part of the UML
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 18
Microwave oven modelFull power
Enabled
do: operateoven
Fullpower
Halfpower
Halfpower
Fullpower
Number
TimerDooropen
Doorclosed
Doorclosed
Dooropen
Start
do: set power = 600
Half powerdo: set power = 300
Set time
do: get numberexit: set time
Disabled
Operation
Timer
Cancel
Waiting
do: display time
Waiting
do: display time
do: display 'Ready'
do: display 'Waiting'
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 19
Microwave oven state descriptionState 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 issounded for 5 seconds. Oven light is on. Display shows ‘Cookingcomplete’ while buzzer is sounding.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 20
Microwave oven stimuli
Stimulus DescriptionHalf power The user has pressed the half power buttonFull power The user has pressed the full power buttonTimer The user has pressed one of the timer buttonsNumber The user has pressed a numeric keyDoor open The oven door switch is not closedDoor closed The oven door switch is closedStart The user has pressed the start buttonCancel The user has pressed the cancel button
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 21
Statecharts
λ Allow the decomposition of a model into sub-models (see following slide)
λ A brief description of the actions is includedfollowing the ‘do’ in each state
λ Can be complemented by tables describing thestates and the stimuli
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 22
Microwave oven operation
Cookdo: run generator
Done
do: buzzer on for 5 secs.
Waiting
Alarm
do: display event
do: checkstatus
Checking
Turntablefault
Emitterfault
Disabled
OK
Timeout
TimeOperation
Dooropen Cancel
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 23
Semantic data models
λ Used to describe the logical structure of dataprocessed by the system
λ Entity-relation-attribute model sets out theentities in the system, the relationships betweenthese entities and the entity attributes
λ Widely used in database design. Can readily beimplemented using relational databases
λ No specific notation provided in the UML butobjects and associations can be used
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 24
Software design semantic modelDesign
namedescriptionC-dateM-date
Link
nametype
Node
nametype
links
has-links
12
1 n
Label
nametexticon
has-labelshas-labels
1
n
1
n
has-linkshas-nodes is-a
1
n
1
n1
1
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 25
Data dictionaries
λ Data dictionaries are lists of all of the names usedin the system models. Descriptions of the entities,relationships and attributes are also included
λ Advantages• Support name management and avoid duplication
• Store of organisational knowledge linking analysis, design andimplementation
λ Many CASE workbenches support datadictionaries
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 26
Data dictionary entries
Name Description Type Date
has-labels1:N relation between entities of typeNode or Link and entities of typeLabel.
Relation 5.10.1998
LabelHolds structured or unstructuredinformation about nodes or links.Labels are represented by an icon(which can be a transparent box) andassociated text.
Entity 8.12.1998
LinkA 1:1 relation between designentities represented as nodes. Linksare typed and may be named.
Relation 8.12.1998
name(label)
Each label has a name whichidentifies the type of label. The namemust be unique within the set of labeltypes used in a design.
Attribute 8.12.1998
name(node)
Each node has a name which must beunique within a design. The namemay be up to 64 characters long.
Attribute 15.11.1998
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 27
Object models
λ Object models describe the system in terms ofobject classes
λ An object class is an abstraction over a set ofobjects with common attributes and the services(operations) provided by each object
λ Various object models may be produced• Inheritance models
• Aggregation models
• Interaction models
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 28
Object models
λ Natural ways of reflecting the real-world entitiesmanipulated by the system
λ More abstract entities are more difficult to modelusing this approach
λ Object class identification is recognised as adifficult process requiring a deep understandingof the application domain
λ Object classes reflecting domain entities arereusable across systems
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 29
Inheritance models
λ Organise the domain object classes into ahierarchy
λ Classes at the top of the hierarchy reflect thecommon features of all classes
λ Object classes inherit their attributes and servicesfrom one or more super-classes. these may thenbe specialised as necessary
λ Class hierarchy design is a difficult process ifduplication in different branches is to be avoided
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 30
The Unified Modeling Language
λ Devised by the developers of widely used object-oriented analysis and design methods
λ Has become an effective standard for object-oriented modelling
λ 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 generalisation and is shown‘upwards’ rather than ‘downwards’ in a hierarchy
Library class hierarchyCatalogue 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
User class hierarchyNameAddressPhoneRegistration #
Library user
Register ()De-register ()
Affiliation
Reader
Items on loanMax. loans
Borrower
DepartmentDepartment phone
Staff
Major subjectHome address
Student
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 33
Multiple inheritance
λ Rather than inheriting the attributes and servicesfrom a single parent class, a system whichsupports multiple inheritance allows objectclasses to inherit from several super-classes
λ Can lead to semantic conflicts whereattributes/services with the same name indifferent super-classes have different semantics
λ Makes class hierarchy reorganisation morecomplex
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 34
Multiple inheritance
# Tapes
Talking book
AuthorEditionPublication dateISBN
Book
SpeakerDurationRecording date
Voice recording
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 35
Object aggregation
λ Aggregation model shows how classes which arecollections are composed of other classes
λ Similar to the part-of relationship in semanticdata models
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 36
Object aggregation
Videotape
Tape ids.
Lecturenotes
Text
OHP slides
Slides
Assignment
Credits
Solutions
TextDiagrams
Exercises
#Problems Description
Course titleNumberYearInstructor
Study pack
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 37
Object behaviour modelling
λ A behavioural model shows the interactionsbetween objects to produce some particularsystem behaviour that is specified as a use-case
λ Sequence diagrams (or collaboration diagrams) inthe UML are used to model interaction betweenobjects
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 38
Issue of electronic items
:Library User
Ecat:Catalog
Lookup
Issue
Display
:Library Item Lib1:NetServer
Issue licence
Accept licence
Compress
Deliver
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 39
CASE workbenches
λ A coherent set of tools that is designed to supportrelated software process activities such asanalysis, design or testing
λ Analysis and design workbenches support systemmodelling during both requirements engineeringand system design
λ These workbenches may support a specific designmethod or may provide support for a creatingseveral different types of system model
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 40
An analysis and design workbench
Centralinformationrepository
Codegenerator
Querylanguagefacilities
Structureddiagramming
tools
Datadictionary
Reportgenerationfacilities
Design, analysisand checking
tools
Formscreation
tools
Import/exportfacilities
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 41
Analysis workbench components
λ Diagram editors
λ Model analysis and checking tools
λ Repository and associated query language
λ Data dictionary
λ Report definition and generation tools
λ Forms definition tools
λ Import/export translators
λ Code generation tools
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 42
Key points
λ A model is an abstract system view.Complementary types of model provide differentsystem information
λ Context models show the position of a system inits environment with other systems and processes
λ Data flow models may be used to model the dataprocessing in a system
λ State machine models model the system’sbehaviour in response to internal or externalevents
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 43
Key points
λ Semantic data models describe the logicalstructure of data which is imported to or exportedby the systems
λ Object models describe logical system entities,their classification and aggregation
λ Object models describe the logical system entitiesand their classification and aggregation
λ CASE workbenches support the development ofsystem models