SlideShare una empresa de Scribd logo
1 de 25
1 
CHAPTER 13 
Specifying Operations 
Software System 
Engineering (260CT)
In This Lecture You Will Learn: 
 About the role of operation specifications 
 What is meant by “Contracts” 
 About algorithmic and non-algorithmic 
techniques, and how they differ 
 How to use: 
• Decision Tables 
• Pre- and Post-condition Pairs 
• Structured English 
• Activity Diagrams 
• Object Constraint Language 
2
Why We Specify Operations 
From analysis perspective: 
• Ensure users’ needs are understood 
From design perspective: 
• Guide programmer to an appropriate 
3 
implementation (i.e. method) 
From test perspective: 
• Verify that the method does what was 
originally intended
Types of Operation and Their 
Effects 
 Operations with side-effects may: 
• Create or destroy object instances 
• Set attribute values 
• Form or break links with other objects 
• Carry out calculations 
• Send messages or events to other objects 
• Any combination of these 
 Operations without side-effects are pure 
queries 
• Request data but do not change anything 
4
5 
Services Among Objects 
When objects collaborate, one object 
typically provides a service to another 
Examples: 
• A Client object might ask a Campaign 
object for its details 
• The same Client object might then ask a 
boundary object to display its related 
Campaign details to the user
Contracts: an Approach to 
Defining Services 
A service can be defined as a contract 
between the participating objects 
Contracts focus on inputs and outputs 
Intervening process is seen as a black 
box 
Irrelevant details are hidden 
This emphasizes service delivery, and 
ignores implementation 
6
Contract-Style Operation 
Specification 
 Intent or purpose of the operation 
 Operation signature, including return type 
 Description of the logic 
 Other operations called 
 Events transmitted to other objects 
 Any attributes set 
 Response to exceptions (e.g. an invalid 
parameter) 
 Non-functional requirements 
(adapted from Larman, 1998 and Allen and Frost, 1998) 
7
Types of Logic Specification 
Logic description is probably the most 
important element 
Two main categories: 
Algorithmic types are white box—they 
focus on how the operation might work 
Non-algorithmic types are black box— 
they focus on what the operation should 
achieve 
8
Non-Algorithmic Techniques 
 Appropriate where correct result matters more 
than method to arrive at it 
 Decision tree: complex decisions, multiple 
criteria and steps (not described further here) 
 Decision table: similar applications to decision 
tree 
 Pre- and Post-condition pairs: suitable where 
precise logic is unimportant or uncertain 
9
Conditions and actions Rule 1 Rule 2 Rule 3 
Conditions 
Is budget likely to be overspent? N Y Y 
Is overspend likely to exceed 2%? - N Y 
Actions 
No action X 
Send letter X X 
Set up meeting X 
10 
Example Decision Table
Pre- and Post-condition Pair 
pre-conditions: 
creativeStaffObject is valid 
gradeObject is valid 
gradeChangeDate is a valid date 
post-conditions: 
a new staffGradeObject exists 
new staffGradeObject linked to creativeStaffObject 
new staffGradeObject linked to previous 
value of previous staffGradeObject.gradeFinishDate 
set equal to gradeChangeDate 
11
12 
Algorithmic Techniques 
Suitable where users understand the 
procedure for arriving at a result 
Can be constructed top-down, to handle 
arbitrarily complex functionality 
Examples: 
• Structured English 
• Activity Diagrams
13 
Structured English 
Commonly used, easy to learn 
Three types of control structure, derived 
from structured programming: 
• Sequences of instructions 
• Selection of alternative instructions (or groups 
of instructions) 
• Iteration (repetition) of instructions (or groups 
of instructions)
Sequence in Structured English 
Each instruction executed in turn, one after 
another 
get client contact name 
sale cost = item cost * ( 1 - discount rate ) 
calculate total bonus 
description = new description 
14
Selection in Structured English 
One or other alternative course is 
followed, depending on result of a test: 
if client contact is ’Sushila’ 
set discount rate to 5% 
else 
set discount rate to 2% 
end if 
15
Iteration in Structured English 
Instruction or block of instructions is 
repeated 
• Can be a set number of repeats 
• Or until some test is satisfied, for example: 
do while there are more staff in the list 
16 
calculate staff bonus 
store bonus amount 
end do
Activity Diagrams 
Are part of UML notation set 
Can be used for operation logic 
specification, among many other uses 
Are easy to learn and understand 
Have the immediacy of graphical 
notation 
Bear some resemblance to old-fashioned 
flowchart technique 
17
18 
Simple Activity Diagram 
Link to 
CreativeStaff 
Create new 
StaffGrade 
Link to previous 
StaffGrade 
Set previous 
StaffGrade 
gradeFinishDate
Activity Diagram with Selection 
19 
Check approval 
for grade change 
[approved by 
Director] 
[not approved 
by Director] Print approval 
request 
Link to 
CreativeStaff 
Create new 
StaffGrade 
Link to previous 
StaffGrade 
Set previous 
StaffGrade 
gradeFinishDate
Activity Diagram with Selection 
and Iteration 
20 
Calculate bonus 
[bonus > £250] 
Add to list 
[more StaffMembers] 
[no more StaffMembers] 
Format list 
Add to ‘star’ list 
Create 
warning 
letter 
[bonus < £25] 
[bonus >= £25 AND 
bonus <= £250]
Object Constraint Language 
 Most OCL statements consist of: 
• Context, Property and Operation 
 Context 
• Defines domain within which expression is valid 
• Instance of a type, e.g. object in class diagram 
• Link (association instance) may be a context 
 A property of that instance 
• Often an attribute, association-end or query operation 
21
OCL operation is applied to the property 
Operations include 
• Arithmetical operators *, +, - and / 
• Set operators such as size, isEmpty and 
select 
• Type operators such as oclIsTypeOf 
22
23 
OCL expression Interpretation 
Person 
self.gender 
In the context of a specific person, the 
value of the property ‘gender’ of that 
person—i.e. a person’s gender. 
Person 
self.savings >= 500 
The property ‘savings’ of the person 
under consideration must be greater 
than or equal to 500. 
Person 
self.husband->notEmpty implies 
self.husband.gender = male 
If the set ‘husband’ associated with a 
person is not empty, then the value of 
the property ‘gender’ of the husband 
must be male. Boldface denotes OCL 
keyword, but has no semantic import. 
Company 
self.CEO->size <= 1 
The size of the set of the property ‘CEO’ 
of a company must be less than or 
equal to 1. That is, a company cannot 
have more than 1 Chief Executive 
Officer. 
Company 
self.employee->select (age < 60) 
The set of employees of a company 
whose age is less than 60.
24 
OCL Used for Pre-and 
Post-conditions 
context CreativeStaff::changeGrade 
(grade:Grade, gradeChangeDate:Date) 
pre: 
grade oclIsTypeOf(Grade) 
gradeChangeDate >= today 
post: 
self.staffGrade[grade]->exists 
self.staffGrade[previous]->notEmpty 
self.staffGrade.gradeStartDate = gradeChangeDate 
self.staffGrade.previous.gradeFinishDate = 
gradeChangeDate
Summary 
In this lecture you have learned about: 
 The role of operation specifications 
 What is meant by “Contracts” 
 Algorithmic and non-algorithmic techniques, 
and how they differ 
 How to use: 
• Decision Tables, Pre- and Post-condition Pairs, 
Structured English, Activity Diagrams and Object 
Constraint Language 
25

Más contenido relacionado

La actualidad más candente

Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented DesignSharath g
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisMahesh Bhalerao
 
Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2wahab13
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologiesnaina-rani
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering Bilal Hassan
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsDang Tuan
 
Elaboration and domain model
Elaboration and domain modelElaboration and domain model
Elaboration and domain modelVignesh Saravanan
 
CMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDDCMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDDHamesKellor
 
Unit three Advanced State Modelling
Unit three Advanced State ModellingUnit three Advanced State Modelling
Unit three Advanced State ModellingDr Chetan Shelke
 
Generic exam
Generic examGeneric exam
Generic examriyadhar
 
Quality of design patterns
Quality of design patternsQuality of design patterns
Quality of design patternsMorris Zheng
 
Restructuring functions with low cohesion
Restructuring functions with low cohesionRestructuring functions with low cohesion
Restructuring functions with low cohesionAditya Kumar Ghosh
 
Modelling System Requirements: Events & Things
Modelling System Requirements: Events & ThingsModelling System Requirements: Events & Things
Modelling System Requirements: Events & Thingswmomoni
 

La actualidad más candente (19)

Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented Design
 
1 introduction of OOAD
1 introduction of OOAD1 introduction of OOAD
1 introduction of OOAD
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Design Pattern in Software Engineering
Design Pattern in Software Engineering Design Pattern in Software Engineering
Design Pattern in Software Engineering
 
M03 2 Behavioral Diagrams
M03 2 Behavioral DiagramsM03 2 Behavioral Diagrams
M03 2 Behavioral Diagrams
 
Elaboration and domain model
Elaboration and domain modelElaboration and domain model
Elaboration and domain model
 
Uml intro
Uml introUml intro
Uml intro
 
CMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDDCMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDD
 
Unit three Advanced State Modelling
Unit three Advanced State ModellingUnit three Advanced State Modelling
Unit three Advanced State Modelling
 
Generic exam
Generic examGeneric exam
Generic exam
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
Use case Diagram
Use case DiagramUse case Diagram
Use case Diagram
 
Quality of design patterns
Quality of design patternsQuality of design patterns
Quality of design patterns
 
Restructuring functions with low cohesion
Restructuring functions with low cohesionRestructuring functions with low cohesion
Restructuring functions with low cohesion
 
Activity diag
Activity diagActivity diag
Activity diag
 
Modelling System Requirements: Events & Things
Modelling System Requirements: Events & ThingsModelling System Requirements: Events & Things
Modelling System Requirements: Events & Things
 

Destacado

Software System Engineering - Chapter 15
Software System Engineering - Chapter 15Software System Engineering - Chapter 15
Software System Engineering - Chapter 15Fadhil Ismail
 
Data dictionary, domain modelling and making things easy
Data dictionary, domain modelling and making things easyData dictionary, domain modelling and making things easy
Data dictionary, domain modelling and making things easyLockheed-Martin
 
Common Law Presentation (22034)
Common Law Presentation (22034)Common Law Presentation (22034)
Common Law Presentation (22034)Fadhil Ismail
 
Contoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik PoligamiContoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik PoligamiFadhil Ismail
 
Isu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - PoligamiIsu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - PoligamiFadhil Ismail
 
Hubungan Etnik Bab 3
Hubungan Etnik Bab 3Hubungan Etnik Bab 3
Hubungan Etnik Bab 3Fadhil Ismail
 
Frontpage vs dreamweaver
Frontpage vs dreamweaverFrontpage vs dreamweaver
Frontpage vs dreamweaverFadhil Ismail
 
Chapter09 logic modeling
Chapter09 logic modelingChapter09 logic modeling
Chapter09 logic modelingDhani Ahmad
 
06 si(systems analysis and design )
06 si(systems analysis and design )06 si(systems analysis and design )
06 si(systems analysis and design )Nurdin Al-Azies
 
Introduction to dictionary
Introduction to dictionaryIntroduction to dictionary
Introduction to dictionaryMaaz Campus
 
Word and lexemes dedi
Word and lexemes dediWord and lexemes dedi
Word and lexemes dedidedikaliang
 
L7 decision tree & table
L7 decision tree & tableL7 decision tree & table
L7 decision tree & tableNeha Gupta
 
Systems Analyst and Design - Data Dictionary
Systems Analyst and Design -  Data DictionarySystems Analyst and Design -  Data Dictionary
Systems Analyst and Design - Data DictionaryKimberly Coquilla
 
Words and lexemes ppt
Words and lexemes pptWords and lexemes ppt
Words and lexemes pptAngeline-dbz
 
Morphology. words and lexemes
Morphology. words and lexemesMorphology. words and lexemes
Morphology. words and lexemes云珍 邓
 

Destacado (20)

Kertas Kerja Tenis
Kertas Kerja TenisKertas Kerja Tenis
Kertas Kerja Tenis
 
Software System Engineering - Chapter 15
Software System Engineering - Chapter 15Software System Engineering - Chapter 15
Software System Engineering - Chapter 15
 
Data dictionary, domain modelling and making things easy
Data dictionary, domain modelling and making things easyData dictionary, domain modelling and making things easy
Data dictionary, domain modelling and making things easy
 
Common Law Presentation (22034)
Common Law Presentation (22034)Common Law Presentation (22034)
Common Law Presentation (22034)
 
Contoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik PoligamiContoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik Poligami
 
Isu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - PoligamiIsu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - Poligami
 
Hubungan Etnik Bab 3
Hubungan Etnik Bab 3Hubungan Etnik Bab 3
Hubungan Etnik Bab 3
 
Frontpage vs dreamweaver
Frontpage vs dreamweaverFrontpage vs dreamweaver
Frontpage vs dreamweaver
 
Chapter09 logic modeling
Chapter09 logic modelingChapter09 logic modeling
Chapter09 logic modeling
 
06 si(systems analysis and design )
06 si(systems analysis and design )06 si(systems analysis and design )
06 si(systems analysis and design )
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
Introduction to dictionary
Introduction to dictionaryIntroduction to dictionary
Introduction to dictionary
 
Data dictionary
Data dictionaryData dictionary
Data dictionary
 
What is a DATA DICTIONARY?
What is a DATA DICTIONARY?What is a DATA DICTIONARY?
What is a DATA DICTIONARY?
 
Word and lexemes dedi
Word and lexemes dediWord and lexemes dedi
Word and lexemes dedi
 
Dictionaries
DictionariesDictionaries
Dictionaries
 
L7 decision tree & table
L7 decision tree & tableL7 decision tree & table
L7 decision tree & table
 
Systems Analyst and Design - Data Dictionary
Systems Analyst and Design -  Data DictionarySystems Analyst and Design -  Data Dictionary
Systems Analyst and Design - Data Dictionary
 
Words and lexemes ppt
Words and lexemes pptWords and lexemes ppt
Words and lexemes ppt
 
Morphology. words and lexemes
Morphology. words and lexemesMorphology. words and lexemes
Morphology. words and lexemes
 

Similar a Software System Engineering - Chapter 13

Programming Building Blocks for Admins
Programming Building Blocks for Admins Programming Building Blocks for Admins
Programming Building Blocks for Admins Salesforce Admins
 
From Use case to User Story
From Use case to User StoryFrom Use case to User Story
From Use case to User StoryKunta Hutabarat
 
Applying UML and Patterns (CH1, 6, 9, 10)
Applying UML and Patterns (CH1, 6, 9, 10)Applying UML and Patterns (CH1, 6, 9, 10)
Applying UML and Patterns (CH1, 6, 9, 10)Jamie (Taka) Wang
 
5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)randhirlpu
 
Requirements Are Optional, Right?
Requirements Are Optional, Right?Requirements Are Optional, Right?
Requirements Are Optional, Right?thomstrat
 
Requirements Gathering Best Practice Pack
Requirements Gathering Best Practice PackRequirements Gathering Best Practice Pack
Requirements Gathering Best Practice PackAmy Slater
 
Modeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and FunctionalModeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and FunctionalRajani Bhandari
 
Object Oriented Analysis and Design with UML2 part1
Object Oriented Analysis and Design with UML2 part1Object Oriented Analysis and Design with UML2 part1
Object Oriented Analysis and Design with UML2 part1Haitham Raik
 
27 pso business_requirements
27 pso business_requirements27 pso business_requirements
27 pso business_requirementsMarcelo Mesti
 
People Management Templates
People Management TemplatesPeople Management Templates
People Management Templatesseanwfielding
 
Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modelingShahid Riaz
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbmsmaryeem
 
Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2Haitham Raik
 
Non-functional requirements
Non-functional requirements Non-functional requirements
Non-functional requirements Rohela Raouf
 
Ch 3 -continued.pptx
Ch 3 -continued.pptxCh 3 -continued.pptx
Ch 3 -continued.pptxbalewayalew
 
OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptxanguraju1
 

Similar a Software System Engineering - Chapter 13 (20)

Programming Building Blocks for Admins
Programming Building Blocks for Admins Programming Building Blocks for Admins
Programming Building Blocks for Admins
 
From Use case to User Story
From Use case to User StoryFrom Use case to User Story
From Use case to User Story
 
Applying UML and Patterns (CH1, 6, 9, 10)
Applying UML and Patterns (CH1, 6, 9, 10)Applying UML and Patterns (CH1, 6, 9, 10)
Applying UML and Patterns (CH1, 6, 9, 10)
 
5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)5(re dfd-erd-data dictionay)
5(re dfd-erd-data dictionay)
 
Software Design principales
Software Design principalesSoftware Design principales
Software Design principales
 
Requirements Are Optional, Right?
Requirements Are Optional, Right?Requirements Are Optional, Right?
Requirements Are Optional, Right?
 
Requirements Gathering Best Practice Pack
Requirements Gathering Best Practice PackRequirements Gathering Best Practice Pack
Requirements Gathering Best Practice Pack
 
Modeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and FunctionalModeling- Object, Dynamic and Functional
Modeling- Object, Dynamic and Functional
 
Object Oriented Analysis and Design with UML2 part1
Object Oriented Analysis and Design with UML2 part1Object Oriented Analysis and Design with UML2 part1
Object Oriented Analysis and Design with UML2 part1
 
27 pso business_requirements
27 pso business_requirements27 pso business_requirements
27 pso business_requirements
 
People Management Templates
People Management TemplatesPeople Management Templates
People Management Templates
 
KAOS
KAOSKAOS
KAOS
 
Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modeling
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
 
Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2Object Oriented Analysis and Design with UML2 part2
Object Oriented Analysis and Design with UML2 part2
 
Non-functional requirements
Non-functional requirements Non-functional requirements
Non-functional requirements
 
algo 1.ppt
algo 1.pptalgo 1.ppt
algo 1.ppt
 
Ch 3 -continued.pptx
Ch 3 -continued.pptxCh 3 -continued.pptx
Ch 3 -continued.pptx
 
OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptx
 
ER modeling
ER modelingER modeling
ER modeling
 

Más de Fadhil Ismail

Software System Engineering - Chapter 10
Software System Engineering - Chapter 10Software System Engineering - Chapter 10
Software System Engineering - Chapter 10Fadhil Ismail
 
Software System Engineering - Chapter 9
Software System Engineering - Chapter 9Software System Engineering - Chapter 9
Software System Engineering - Chapter 9Fadhil Ismail
 
Software System Engineering - Chapter 8
Software System Engineering - Chapter 8Software System Engineering - Chapter 8
Software System Engineering - Chapter 8Fadhil Ismail
 
Software System Engineering - Chapter 7
Software System Engineering - Chapter 7Software System Engineering - Chapter 7
Software System Engineering - Chapter 7Fadhil Ismail
 
Software System Engineering - Chapter 6
Software System Engineering - Chapter 6Software System Engineering - Chapter 6
Software System Engineering - Chapter 6Fadhil Ismail
 
Software System Engineering - Chapter 5
Software System Engineering - Chapter 5Software System Engineering - Chapter 5
Software System Engineering - Chapter 5Fadhil Ismail
 
Software System Engineering - Chapter 4
Software System Engineering - Chapter 4Software System Engineering - Chapter 4
Software System Engineering - Chapter 4Fadhil Ismail
 
Software System Engineering - Chapter 3
Software System Engineering - Chapter 3Software System Engineering - Chapter 3
Software System Engineering - Chapter 3Fadhil Ismail
 
Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Fadhil Ismail
 
Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Fadhil Ismail
 
Hubungan Etnik Bab-5
Hubungan Etnik Bab-5Hubungan Etnik Bab-5
Hubungan Etnik Bab-5Fadhil Ismail
 
Hubungan Etnik Bab-6
Hubungan Etnik Bab-6Hubungan Etnik Bab-6
Hubungan Etnik Bab-6Fadhil Ismail
 
Hubungan Etnik Bab-1
Hubungan Etnik Bab-1Hubungan Etnik Bab-1
Hubungan Etnik Bab-1Fadhil Ismail
 
Hubungan Etnik Bab-2
Hubungan Etnik Bab-2Hubungan Etnik Bab-2
Hubungan Etnik Bab-2Fadhil Ismail
 
Hubungan Etnik Bab-4
Hubungan Etnik Bab-4Hubungan Etnik Bab-4
Hubungan Etnik Bab-4Fadhil Ismail
 
Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh Fadhil Ismail
 
(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sortingFadhil Ismail
 
Nota pengajian islam mpw 1143 t12
Nota pengajian islam mpw 1143 t12Nota pengajian islam mpw 1143 t12
Nota pengajian islam mpw 1143 t12Fadhil Ismail
 
Nota pengajian islam mpw 1143 t11
Nota pengajian islam mpw 1143 t11Nota pengajian islam mpw 1143 t11
Nota pengajian islam mpw 1143 t11Fadhil Ismail
 
Nota pengajian islam mpw 1143 t10
Nota pengajian islam mpw 1143 t10Nota pengajian islam mpw 1143 t10
Nota pengajian islam mpw 1143 t10Fadhil Ismail
 

Más de Fadhil Ismail (20)

Software System Engineering - Chapter 10
Software System Engineering - Chapter 10Software System Engineering - Chapter 10
Software System Engineering - Chapter 10
 
Software System Engineering - Chapter 9
Software System Engineering - Chapter 9Software System Engineering - Chapter 9
Software System Engineering - Chapter 9
 
Software System Engineering - Chapter 8
Software System Engineering - Chapter 8Software System Engineering - Chapter 8
Software System Engineering - Chapter 8
 
Software System Engineering - Chapter 7
Software System Engineering - Chapter 7Software System Engineering - Chapter 7
Software System Engineering - Chapter 7
 
Software System Engineering - Chapter 6
Software System Engineering - Chapter 6Software System Engineering - Chapter 6
Software System Engineering - Chapter 6
 
Software System Engineering - Chapter 5
Software System Engineering - Chapter 5Software System Engineering - Chapter 5
Software System Engineering - Chapter 5
 
Software System Engineering - Chapter 4
Software System Engineering - Chapter 4Software System Engineering - Chapter 4
Software System Engineering - Chapter 4
 
Software System Engineering - Chapter 3
Software System Engineering - Chapter 3Software System Engineering - Chapter 3
Software System Engineering - Chapter 3
 
Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Software System Engineering - Chapter 2
Software System Engineering - Chapter 2
 
Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Software System Engineering - Chapter 1
Software System Engineering - Chapter 1
 
Hubungan Etnik Bab-5
Hubungan Etnik Bab-5Hubungan Etnik Bab-5
Hubungan Etnik Bab-5
 
Hubungan Etnik Bab-6
Hubungan Etnik Bab-6Hubungan Etnik Bab-6
Hubungan Etnik Bab-6
 
Hubungan Etnik Bab-1
Hubungan Etnik Bab-1Hubungan Etnik Bab-1
Hubungan Etnik Bab-1
 
Hubungan Etnik Bab-2
Hubungan Etnik Bab-2Hubungan Etnik Bab-2
Hubungan Etnik Bab-2
 
Hubungan Etnik Bab-4
Hubungan Etnik Bab-4Hubungan Etnik Bab-4
Hubungan Etnik Bab-4
 
Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh
 
(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting
 
Nota pengajian islam mpw 1143 t12
Nota pengajian islam mpw 1143 t12Nota pengajian islam mpw 1143 t12
Nota pengajian islam mpw 1143 t12
 
Nota pengajian islam mpw 1143 t11
Nota pengajian islam mpw 1143 t11Nota pengajian islam mpw 1143 t11
Nota pengajian islam mpw 1143 t11
 
Nota pengajian islam mpw 1143 t10
Nota pengajian islam mpw 1143 t10Nota pengajian islam mpw 1143 t10
Nota pengajian islam mpw 1143 t10
 

Último

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Último (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

Software System Engineering - Chapter 13

  • 1. 1 CHAPTER 13 Specifying Operations Software System Engineering (260CT)
  • 2. In This Lecture You Will Learn:  About the role of operation specifications  What is meant by “Contracts”  About algorithmic and non-algorithmic techniques, and how they differ  How to use: • Decision Tables • Pre- and Post-condition Pairs • Structured English • Activity Diagrams • Object Constraint Language 2
  • 3. Why We Specify Operations From analysis perspective: • Ensure users’ needs are understood From design perspective: • Guide programmer to an appropriate 3 implementation (i.e. method) From test perspective: • Verify that the method does what was originally intended
  • 4. Types of Operation and Their Effects  Operations with side-effects may: • Create or destroy object instances • Set attribute values • Form or break links with other objects • Carry out calculations • Send messages or events to other objects • Any combination of these  Operations without side-effects are pure queries • Request data but do not change anything 4
  • 5. 5 Services Among Objects When objects collaborate, one object typically provides a service to another Examples: • A Client object might ask a Campaign object for its details • The same Client object might then ask a boundary object to display its related Campaign details to the user
  • 6. Contracts: an Approach to Defining Services A service can be defined as a contract between the participating objects Contracts focus on inputs and outputs Intervening process is seen as a black box Irrelevant details are hidden This emphasizes service delivery, and ignores implementation 6
  • 7. Contract-Style Operation Specification  Intent or purpose of the operation  Operation signature, including return type  Description of the logic  Other operations called  Events transmitted to other objects  Any attributes set  Response to exceptions (e.g. an invalid parameter)  Non-functional requirements (adapted from Larman, 1998 and Allen and Frost, 1998) 7
  • 8. Types of Logic Specification Logic description is probably the most important element Two main categories: Algorithmic types are white box—they focus on how the operation might work Non-algorithmic types are black box— they focus on what the operation should achieve 8
  • 9. Non-Algorithmic Techniques  Appropriate where correct result matters more than method to arrive at it  Decision tree: complex decisions, multiple criteria and steps (not described further here)  Decision table: similar applications to decision tree  Pre- and Post-condition pairs: suitable where precise logic is unimportant or uncertain 9
  • 10. Conditions and actions Rule 1 Rule 2 Rule 3 Conditions Is budget likely to be overspent? N Y Y Is overspend likely to exceed 2%? - N Y Actions No action X Send letter X X Set up meeting X 10 Example Decision Table
  • 11. Pre- and Post-condition Pair pre-conditions: creativeStaffObject is valid gradeObject is valid gradeChangeDate is a valid date post-conditions: a new staffGradeObject exists new staffGradeObject linked to creativeStaffObject new staffGradeObject linked to previous value of previous staffGradeObject.gradeFinishDate set equal to gradeChangeDate 11
  • 12. 12 Algorithmic Techniques Suitable where users understand the procedure for arriving at a result Can be constructed top-down, to handle arbitrarily complex functionality Examples: • Structured English • Activity Diagrams
  • 13. 13 Structured English Commonly used, easy to learn Three types of control structure, derived from structured programming: • Sequences of instructions • Selection of alternative instructions (or groups of instructions) • Iteration (repetition) of instructions (or groups of instructions)
  • 14. Sequence in Structured English Each instruction executed in turn, one after another get client contact name sale cost = item cost * ( 1 - discount rate ) calculate total bonus description = new description 14
  • 15. Selection in Structured English One or other alternative course is followed, depending on result of a test: if client contact is ’Sushila’ set discount rate to 5% else set discount rate to 2% end if 15
  • 16. Iteration in Structured English Instruction or block of instructions is repeated • Can be a set number of repeats • Or until some test is satisfied, for example: do while there are more staff in the list 16 calculate staff bonus store bonus amount end do
  • 17. Activity Diagrams Are part of UML notation set Can be used for operation logic specification, among many other uses Are easy to learn and understand Have the immediacy of graphical notation Bear some resemblance to old-fashioned flowchart technique 17
  • 18. 18 Simple Activity Diagram Link to CreativeStaff Create new StaffGrade Link to previous StaffGrade Set previous StaffGrade gradeFinishDate
  • 19. Activity Diagram with Selection 19 Check approval for grade change [approved by Director] [not approved by Director] Print approval request Link to CreativeStaff Create new StaffGrade Link to previous StaffGrade Set previous StaffGrade gradeFinishDate
  • 20. Activity Diagram with Selection and Iteration 20 Calculate bonus [bonus > £250] Add to list [more StaffMembers] [no more StaffMembers] Format list Add to ‘star’ list Create warning letter [bonus < £25] [bonus >= £25 AND bonus <= £250]
  • 21. Object Constraint Language  Most OCL statements consist of: • Context, Property and Operation  Context • Defines domain within which expression is valid • Instance of a type, e.g. object in class diagram • Link (association instance) may be a context  A property of that instance • Often an attribute, association-end or query operation 21
  • 22. OCL operation is applied to the property Operations include • Arithmetical operators *, +, - and / • Set operators such as size, isEmpty and select • Type operators such as oclIsTypeOf 22
  • 23. 23 OCL expression Interpretation Person self.gender In the context of a specific person, the value of the property ‘gender’ of that person—i.e. a person’s gender. Person self.savings >= 500 The property ‘savings’ of the person under consideration must be greater than or equal to 500. Person self.husband->notEmpty implies self.husband.gender = male If the set ‘husband’ associated with a person is not empty, then the value of the property ‘gender’ of the husband must be male. Boldface denotes OCL keyword, but has no semantic import. Company self.CEO->size <= 1 The size of the set of the property ‘CEO’ of a company must be less than or equal to 1. That is, a company cannot have more than 1 Chief Executive Officer. Company self.employee->select (age < 60) The set of employees of a company whose age is less than 60.
  • 24. 24 OCL Used for Pre-and Post-conditions context CreativeStaff::changeGrade (grade:Grade, gradeChangeDate:Date) pre: grade oclIsTypeOf(Grade) gradeChangeDate >= today post: self.staffGrade[grade]->exists self.staffGrade[previous]->notEmpty self.staffGrade.gradeStartDate = gradeChangeDate self.staffGrade.previous.gradeFinishDate = gradeChangeDate
  • 25. Summary In this lecture you have learned about:  The role of operation specifications  What is meant by “Contracts”  Algorithmic and non-algorithmic techniques, and how they differ  How to use: • Decision Tables, Pre- and Post-condition Pairs, Structured English, Activity Diagrams and Object Constraint Language 25

Notas del editor

  1. Figure 10.1 A decision table with two conditions and three actions, yielding three distinct rules.
  2. Figure 10.2 An activity diagram showing the main steps for the operation CreativeStaff.changeGrade().
  3. Figure 10.3 A more complex activity diagram for CreativeStaff.changeGrade(), with an initial selection to check that approval has been given.
  4. Figure 10.4 Activity diagram for Prepare bonus list(), showing selection and iteration structures. Compare this with the Structured English example given earlier.