SlideShare a Scribd company logo
1 of 26
1 
CHAPTER 14 
Specifying Control 
Software System 
Engineering (260CT)
In This Lecture You Will Learn: 
 How to identify requirements for control in an 
application 
 How to model object life cycles using 
statecharts 
 How to develop statechart diagrams from 
interaction diagrams 
 How to model concurrent behaviour in an 
object 
 How to ensure consistency with other UML 
models 
2
3 
State 
The current state of an object is 
determined by the current value of the 
object’s attributes and the links that it 
has with other objects 
For example the class StaffMember 
has an attribute startDate which 
determines whether a StaffMember 
object is in the probationary state
State 
 ‘A state is a condition during the life of an 
object or an interaction during which it satisfies 
some condition, performs some action or waits 
for some event.... 
Conceptually, an object remains in a state for 
an interval of time. However, the semantics 
allow for modelling "flow-through" states which 
are instantaneous as well as transitions that 
are not instantaneous.’ 
4 
(OMG, 2001)
5 
Statechart 
The current state of a GradeRate object 
can be determined by the two attributes 
rateStartDate and 
rateFinishDate 
An enumerated state variable may be 
used to hold the object state, possible 
values would be Pending, Active or 
Lapsed
Statechart 
6 
Pending 
Active 
Lapsed 
Initial state 
Transition 
between 
states 
when [rateStartDate <= 
currentDate] 
when [rateFinishDate <= 
currentDate] 
after [1 year] 
Final state 
Change 
event 
GradeRate() 
Elapsed-time 
event 
Statechart for 
the class 
GradeRate. 
Movement 
from one 
state to 
another is 
dependent 
upon 
events that 
occur with 
the 
passage of 
time.
Types of Event 
 A change event occurs when a condition 
becomes true 
 A call event occurs when an object receives a 
call to one of its operations either from another 
object or from itself 
 A signal event occurs when an object receives 
a signal (an asynchronous communication) 
 An elapsed-time event is caused by the 
passage of a designated period of time after a 
specified event (frequently the entry to the 
current state) 
7
This event must correspond to an 
operation in the Campaign class 
8 
Events 
Commissioned 
Active 
authorized(authorizationCode) [contract Signed] 
/setCampaignActive( )
9 
Actions and Activities 
State Name 
entry / action expression 
exit/ action expression 
do / activity 
include / submachine 
Name 
compartment 
A state may 
include a sub-statechart 
Internal 
transition 
compartmen 
t 
Internal actions and 
activities for a state
10 
Statechart for 
the class 
Campaign 
/assignManager(); 
assignStaff() 
Commissioned 
authorized(authorizationCode) 
[contract signed] 
/setCampaignActive() 
Active 
campaignCompleted() 
/prepareFinalStatement() 
Completed 
Paid 
paymentReceived(payment) 
[paymentDue - payment > zero] 
paymentReceived(payment) 
[paymentDue – payment <= zero] 
archiveCampaign() 
/unassignStaff(); 
unassignManager() 
Action-expression 
assigning manager 
and staff on object 
creation 
Guard condition 
ensuring complete 
payment before 
entering Paid 
Recursive transition 
models any payment 
event that does not 
reduce the amount due 
to zero or beyond
campaignCompleted() 
/prepareFinalStatement() 
11 
A revised 
statechart for the 
class Campaign 
/assignManager(); 
assignStaff() 
Commissioned 
authorized(authorizationCode) 
[contract signed] 
/setCampaignActive() 
Active 
paymentReceived(payment) 
[paymentDue - payment < zero] 
Completed 
Paid 
paymentReceived(payment) 
[paymentDue – payment > zero] 
If the user /generateRefund() 
paymentReceived(payment) 
[paymentDue - payment = zero] 
archiveCampaign() 
/unassignStaff(); 
unassignManager() 
requirements were 
to change, so that 
an overpayment is 
now to result in the 
automatic 
generation of a 
refund, a new 
transition is added
advertsApproved() 
/authorize() 
12 
The Active State with 
Concurrent Substates 
Active 
Advert Preparation 
extendCampaign() 
/modify Budget() 
Running Adverts confirmSchedule() Scheduling 
Survey 
surveyComplete() 
Evaluation 
runSurvey() 
Running 
Monitoring 
campaignCompleted() 
/prepareFinalStatement()
13 
Concurrent States 
 A transition to a complex state is equivalent to 
a simultaneous transition to the initial states of 
each concurrent statechart 
 An initial state must be specified in both nested 
statecharts in order to avoid ambiguity about 
which substate should first be entered in each 
concurrent region 
 A transition to the Active state means that the 
Campaign object simultaneously enters the 
Advert Preparation and Survey states
14 
Concurrent States 
Once the composite states is entered a 
transition may occur within either 
concurrent region without having any 
effect on the state in the other concurrent 
region 
A transition out of the Active state 
applies to all its substates (no matter 
how deeply nested)
15 
Preparing Statecharts 
Two approaches may be used: 
• Behavioural approach 
• Life cycle approach 
Allen and Frost (1998)
Behavioural Approach 
1. Examine all interaction diagrams that involve 
each class that has heavy messaging. 
2. Identify the incoming messages on each 
interaction diagram that may correspond to 
events. Also identify the possible resulting 
states. 
3. Document these events and states on a 
16 
statechart. 
4. Elaborate the statechart as necessary to cater 
for additional interactions as these become 
evident, and add any exceptions.
Behavioural Approach 
5. Develop any nested statecharts (unless this 
has already been done in an earlier step). 
6. Review the statechart to ensure consistency 
with use cases. In particular, check that any 
constraints that are implied by the statechart 
are appropriate. 
7. Iterate steps 4, 5 and 6 until the statechart 
captures the necessary level of detail. 
8. Check the consistency of the statechart with 
the class diagram, with interaction diagrams 
and with any other statecharts and models. 
17
Sequence Diagram with Implicit 
States 
Sequence diagram for use case 
Set Campaign Completed 
18 
Campaign 
Manager 
startInterface() *getClient() 
listCampaigns() 
*getCampaignDetails() 
:CompleteCampaignUI 
:CompleteCampaign :Client :Campaign 
showClientCampaigns() selectClient() 
completeCampaign() 
completeCampaign() campaignCompleted() 
Active state 
Completed state
extendCampaign() 
/modify Budget() 
Running Adverts confirmSchedule() Scheduling 
19 
Initial statechart 
for the Campaign 
class—a 
behavioural 
approach 
Commissioned 
authorized(authorizationCode) 
[contract signed] 
/setCampaignActive() 
/assignManager(); 
assignStaff() 
Advert Preparation 
campaignCompleted() 
/prepareFinalStatement() 
paymentReceived(payment) 
[paymentDue - payment < zero] 
/generateRefund() 
Completed 
Paid 
paymentReceived(payment) 
[paymentDue – payment > zero] 
paymentReceived(payment) 
[paymentDue - payment = zero] 
archiveCampaign() 
/unassignStaff(); 
unassignManager() 
advertsApproved() 
/authorize()
Life Cycle Approach 
 Consider the life cycles for objects of each 
class 
 Events and states are identified directly from 
use cases and from any other requirements 
documentation that happens to be available 
 First, the main system events are listed 
 Each event is then examined in order to 
determine which objects are likely to have a 
state dependent response to it 
20
21 
Life Cycle Approach Steps 
1. Identify major system events. 
2. Identify each class that is likely to have a 
state dependent response to these events. 
3. For each of these classes produce a first-cut 
statechart by considering the typical life cycle 
of an instance of the class. 
4. Examine the statechart and elaborate to 
encompass more detailed event behaviour.
Life Cycle Approach Steps 
5. Enhance the statechart to include alternative 
22 
scenarios. 
6. Review the statechart to ensure that is 
consistent with the use cases. In particular, 
check that the constraints that the statechart 
implies are appropriate. 
7. Iterate through steps 4, 5 and 6 until the 
statechart captures the necessary level of 
detail. 
8. Ensure consistency with class diagram and 
interaction diagrams and other statecharts.
23 
Life Cycle Approach 
Less formal than the behavioural 
approach in its initial identification of 
events and relevant classes 
Often helpful to use a combination of the 
two, since each provides checks on the 
other
24 
Consistency Checking 
 Every event should appear as an incoming message for 
the appropriate object on an interaction diagram 
 Every action should correspond to the execution of an 
operation on the appropriate class, and perhaps also to 
the despatch of a message to another object 
 Every event should correspond to an operation on the 
appropriate class (but note that not all operations 
correspond to events) 
 Every outgoing message sent from a statechart must 
correspond to an operation on another class
25 
Consistency Checking 
Consistency checking is an important 
task in the preparation of a complete set 
of models 
Highlights omissions and errors, and 
encourages the clarification of any 
ambiguity or incompleteness in the 
requirements
Summary 
In this lecture you have learned about: 
 How to identify requirements for control in an 
application 
 How to model object life cycles using state charts 
 How to develop statechart diagrams from 
interaction diagrams 
 How to model concurrent behaviour in an object 
 How to ensure consistency with other UML models 
26

More Related Content

What's hot

Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction ModelingHemant Sharma
 
OO Development 5 - Analysis
OO Development 5 - AnalysisOO Development 5 - Analysis
OO Development 5 - AnalysisRandy Connolly
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modelingramyaaswin
 
Activity diagram model
Activity diagram modelActivity diagram model
Activity diagram modelahmed zewita
 
Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented DesignSharath g
 
Data and functional modeling
Data and functional modelingData and functional modeling
Data and functional modelingSlideshare
 
Lecture#08 sequence diagrams
Lecture#08 sequence diagramsLecture#08 sequence diagrams
Lecture#08 sequence diagramsbabak danyal
 
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsSE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsAmr E. Mohamed
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsAmr E. Mohamed
 
Forecasting warranty returns with Wiebull Fit
Forecasting warranty returns with Wiebull FitForecasting warranty returns with Wiebull Fit
Forecasting warranty returns with Wiebull FitTonda MacLeod
 

What's hot (17)

Interaction Modeling
Interaction ModelingInteraction Modeling
Interaction Modeling
 
OO Development 5 - Analysis
OO Development 5 - AnalysisOO Development 5 - Analysis
OO Development 5 - Analysis
 
Activity diagram
Activity diagramActivity diagram
Activity diagram
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lecture
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
Activity diagram model
Activity diagram modelActivity diagram model
Activity diagram model
 
Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented Design
 
Data and functional modeling
Data and functional modelingData and functional modeling
Data and functional modeling
 
Blackbox
BlackboxBlackbox
Blackbox
 
Lecture#08 sequence diagrams
Lecture#08 sequence diagramsLecture#08 sequence diagrams
Lecture#08 sequence diagrams
 
Sequence diagrame
Sequence diagrameSequence diagrame
Sequence diagrame
 
Chapter7
Chapter7Chapter7
Chapter7
 
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction DiagramsSE18_Lec 10_ UML Behaviour and Interaction Diagrams
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
 
SE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour DiagramsSE_Lec 09_ UML Behaviour Diagrams
SE_Lec 09_ UML Behaviour Diagrams
 
Ch09
Ch09Ch09
Ch09
 
Activity diagrams
Activity diagramsActivity diagrams
Activity diagrams
 
Forecasting warranty returns with Wiebull Fit
Forecasting warranty returns with Wiebull FitForecasting warranty returns with Wiebull Fit
Forecasting warranty returns with Wiebull Fit
 

Viewers also liked

Software System Engineering - Chapter 15
Software System Engineering - Chapter 15Software System Engineering - Chapter 15
Software System Engineering - Chapter 15Fadhil Ismail
 
Common Law Presentation (22034)
Common Law Presentation (22034)Common Law Presentation (22034)
Common Law Presentation (22034)Fadhil Ismail
 
Hubungan Etnik Bab 3
Hubungan Etnik Bab 3Hubungan Etnik Bab 3
Hubungan Etnik Bab 3Fadhil Ismail
 
Isu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - PoligamiIsu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - PoligamiFadhil Ismail
 
Frontpage vs dreamweaver
Frontpage vs dreamweaverFrontpage vs dreamweaver
Frontpage vs dreamweaverFadhil 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-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
 
Hubungan Etnik Bab-1
Hubungan Etnik Bab-1Hubungan Etnik Bab-1
Hubungan Etnik Bab-1Fadhil Ismail
 
Contoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik PoligamiContoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik PoligamiFadhil Ismail
 
Bab 8 pemerkasaan pendidkan ke arah kesepaduan sosial
Bab 8   pemerkasaan pendidkan ke arah kesepaduan sosialBab 8   pemerkasaan pendidkan ke arah kesepaduan sosial
Bab 8 pemerkasaan pendidkan ke arah kesepaduan sosialMaizatul Akmal
 
Software System Engineering - Chapter 5
Software System Engineering - Chapter 5Software System Engineering - Chapter 5
Software System Engineering - Chapter 5Fadhil Ismail
 
(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sortingFadhil Ismail
 
Bab 1 malaysia dalam kepelbagaian edit
Bab 1  malaysia dalam kepelbagaian editBab 1  malaysia dalam kepelbagaian edit
Bab 1 malaysia dalam kepelbagaian editMaizatul Akmal
 
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
 
Bab 7 dari segregasi ke integrasi
Bab 7   dari segregasi ke integrasiBab 7   dari segregasi ke integrasi
Bab 7 dari segregasi ke integrasiMaizatul Akmal
 

Viewers also liked (20)

Software System Engineering - Chapter 15
Software System Engineering - Chapter 15Software System Engineering - Chapter 15
Software System Engineering - Chapter 15
 
Common Law Presentation (22034)
Common Law Presentation (22034)Common Law Presentation (22034)
Common Law Presentation (22034)
 
Hubungan Etnik Bab 3
Hubungan Etnik Bab 3Hubungan Etnik Bab 3
Hubungan Etnik Bab 3
 
Isu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - PoligamiIsu-isu Kekeluargaan - Poligami
Isu-isu Kekeluargaan - Poligami
 
Frontpage vs dreamweaver
Frontpage vs dreamweaverFrontpage vs dreamweaver
Frontpage vs dreamweaver
 
Kertas Kerja Tenis
Kertas Kerja TenisKertas Kerja Tenis
Kertas Kerja Tenis
 
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-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
 
Hubungan Etnik Bab-1
Hubungan Etnik Bab-1Hubungan Etnik Bab-1
Hubungan Etnik Bab-1
 
Contoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik PoligamiContoh Borang Soal Selidik Poligami
Contoh Borang Soal Selidik Poligami
 
Bab 8 pemerkasaan pendidkan ke arah kesepaduan sosial
Bab 8   pemerkasaan pendidkan ke arah kesepaduan sosialBab 8   pemerkasaan pendidkan ke arah kesepaduan sosial
Bab 8 pemerkasaan pendidkan ke arah kesepaduan sosial
 
Software System Engineering - Chapter 5
Software System Engineering - Chapter 5Software System Engineering - Chapter 5
Software System Engineering - Chapter 5
 
(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting(Data Structure) Chapter11 searching & sorting
(Data Structure) Chapter11 searching & sorting
 
Bab 1 malaysia dalam kepelbagaian edit
Bab 1  malaysia dalam kepelbagaian editBab 1  malaysia dalam kepelbagaian edit
Bab 1 malaysia dalam kepelbagaian edit
 
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
 
Bab 7 dari segregasi ke integrasi
Bab 7   dari segregasi ke integrasiBab 7   dari segregasi ke integrasi
Bab 7 dari segregasi ke integrasi
 
Modul siri 2
Modul siri 2Modul siri 2
Modul siri 2
 

Similar to Software System Engineering - Chapter 14

Ph.D. final defense
Ph.D. final defensePh.D. final defense
Ph.D. final defensemaxdeleoni
 
Lecture 13 requirements modeling - flow & behavior (2)
Lecture 13   requirements modeling - flow &  behavior (2)Lecture 13   requirements modeling - flow &  behavior (2)
Lecture 13 requirements modeling - flow & behavior (2)IIUI
 
STATE DIAGRAM.pptx
STATE DIAGRAM.pptxSTATE DIAGRAM.pptx
STATE DIAGRAM.pptxssuser2d043c
 
C:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop umlC:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop umlsatyaiswaroop
 
Unit three Advanced State Modelling
Unit three Advanced State ModellingUnit three Advanced State Modelling
Unit three Advanced State ModellingDr Chetan Shelke
 
Formal Verification of Distributed Checkpointing Using Event-B
Formal Verification of Distributed Checkpointing Using Event-BFormal Verification of Distributed Checkpointing Using Event-B
Formal Verification of Distributed Checkpointing Using Event-Bijcsit
 
5. state diagrams
5. state diagrams5. state diagrams
5. state diagramsAPU
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagramsAPU
 
Software engg. pressman_ch-8
Software engg. pressman_ch-8Software engg. pressman_ch-8
Software engg. pressman_ch-8Dhairya Joshi
 
UML Diagrams For Online Course Portal
UML Diagrams For Online Course PortalUML Diagrams For Online Course Portal
UML Diagrams For Online Course PortalHarieHaren GV
 
Unit 3(advanced state modeling & interaction meodelling)
Unit  3(advanced state modeling & interaction meodelling)Unit  3(advanced state modeling & interaction meodelling)
Unit 3(advanced state modeling & interaction meodelling)Manoj Reddy
 
Wcm overview
Wcm overviewWcm overview
Wcm overviewamit1858
 
J developer 11g components ppt
J developer 11g components pptJ developer 11g components ppt
J developer 11g components pptTUSHAR VARSHNEY
 

Similar to Software System Engineering - Chapter 14 (20)

Jar chapter 4, part 1
Jar chapter 4, part 1Jar chapter 4, part 1
Jar chapter 4, part 1
 
Ph.D. final defense
Ph.D. final defensePh.D. final defense
Ph.D. final defense
 
Lecture 13 requirements modeling - flow & behavior (2)
Lecture 13   requirements modeling - flow &  behavior (2)Lecture 13   requirements modeling - flow &  behavior (2)
Lecture 13 requirements modeling - flow & behavior (2)
 
STATE DIAGRAM.pptx
STATE DIAGRAM.pptxSTATE DIAGRAM.pptx
STATE DIAGRAM.pptx
 
C:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop umlC:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop uml
 
Unit three Advanced State Modelling
Unit three Advanced State ModellingUnit three Advanced State Modelling
Unit three Advanced State Modelling
 
Jar chapter 5_part_ii
Jar chapter 5_part_iiJar chapter 5_part_ii
Jar chapter 5_part_ii
 
Formal Verification of Distributed Checkpointing Using Event-B
Formal Verification of Distributed Checkpointing Using Event-BFormal Verification of Distributed Checkpointing Using Event-B
Formal Verification of Distributed Checkpointing Using Event-B
 
5. state diagrams
5. state diagrams5. state diagrams
5. state diagrams
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
 
Step types
Step typesStep types
Step types
 
Software engg. pressman_ch-8
Software engg. pressman_ch-8Software engg. pressman_ch-8
Software engg. pressman_ch-8
 
UML Diagrams For Online Course Portal
UML Diagrams For Online Course PortalUML Diagrams For Online Course Portal
UML Diagrams For Online Course Portal
 
Unit 3(advanced state modeling & interaction meodelling)
Unit  3(advanced state modeling & interaction meodelling)Unit  3(advanced state modeling & interaction meodelling)
Unit 3(advanced state modeling & interaction meodelling)
 
072 swe415stnotes08
072 swe415stnotes08072 swe415stnotes08
072 swe415stnotes08
 
Wcm overview
Wcm overviewWcm overview
Wcm overview
 
Seminar State Chart1
Seminar State Chart1Seminar State Chart1
Seminar State Chart1
 
J developer 11g components ppt
J developer 11g components pptJ developer 11g components ppt
J developer 11g components ppt
 
Activity diagrams
Activity diagramsActivity diagrams
Activity diagrams
 
09 workflow
09 workflow09 workflow
09 workflow
 

More from Fadhil Ismail

Software System Engineering - Chapter 11
Software System Engineering - Chapter 11Software System Engineering - Chapter 11
Software System Engineering - Chapter 11Fadhil 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 4
Software System Engineering - Chapter 4Software System Engineering - Chapter 4
Software System Engineering - Chapter 4Fadhil Ismail
 
Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Fadhil Ismail
 
Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh Fadhil 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
 

More from Fadhil Ismail (12)

Software System Engineering - Chapter 11
Software System Engineering - Chapter 11Software System Engineering - Chapter 11
Software System Engineering - Chapter 11
 
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 4
Software System Engineering - Chapter 4Software System Engineering - Chapter 4
Software System Engineering - Chapter 4
 
Software System Engineering - Chapter 1
Software System Engineering - Chapter 1Software System Engineering - Chapter 1
Software System Engineering - Chapter 1
 
Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh Pengenalan Masyarakat Sikh
Pengenalan Masyarakat Sikh
 
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
 

Recently uploaded

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxchumtiyababu
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 

Recently uploaded (20)

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 

Software System Engineering - Chapter 14

  • 1. 1 CHAPTER 14 Specifying Control Software System Engineering (260CT)
  • 2. In This Lecture You Will Learn:  How to identify requirements for control in an application  How to model object life cycles using statecharts  How to develop statechart diagrams from interaction diagrams  How to model concurrent behaviour in an object  How to ensure consistency with other UML models 2
  • 3. 3 State The current state of an object is determined by the current value of the object’s attributes and the links that it has with other objects For example the class StaffMember has an attribute startDate which determines whether a StaffMember object is in the probationary state
  • 4. State  ‘A state is a condition during the life of an object or an interaction during which it satisfies some condition, performs some action or waits for some event.... Conceptually, an object remains in a state for an interval of time. However, the semantics allow for modelling "flow-through" states which are instantaneous as well as transitions that are not instantaneous.’ 4 (OMG, 2001)
  • 5. 5 Statechart The current state of a GradeRate object can be determined by the two attributes rateStartDate and rateFinishDate An enumerated state variable may be used to hold the object state, possible values would be Pending, Active or Lapsed
  • 6. Statechart 6 Pending Active Lapsed Initial state Transition between states when [rateStartDate <= currentDate] when [rateFinishDate <= currentDate] after [1 year] Final state Change event GradeRate() Elapsed-time event Statechart for the class GradeRate. Movement from one state to another is dependent upon events that occur with the passage of time.
  • 7. Types of Event  A change event occurs when a condition becomes true  A call event occurs when an object receives a call to one of its operations either from another object or from itself  A signal event occurs when an object receives a signal (an asynchronous communication)  An elapsed-time event is caused by the passage of a designated period of time after a specified event (frequently the entry to the current state) 7
  • 8. This event must correspond to an operation in the Campaign class 8 Events Commissioned Active authorized(authorizationCode) [contract Signed] /setCampaignActive( )
  • 9. 9 Actions and Activities State Name entry / action expression exit/ action expression do / activity include / submachine Name compartment A state may include a sub-statechart Internal transition compartmen t Internal actions and activities for a state
  • 10. 10 Statechart for the class Campaign /assignManager(); assignStaff() Commissioned authorized(authorizationCode) [contract signed] /setCampaignActive() Active campaignCompleted() /prepareFinalStatement() Completed Paid paymentReceived(payment) [paymentDue - payment > zero] paymentReceived(payment) [paymentDue – payment <= zero] archiveCampaign() /unassignStaff(); unassignManager() Action-expression assigning manager and staff on object creation Guard condition ensuring complete payment before entering Paid Recursive transition models any payment event that does not reduce the amount due to zero or beyond
  • 11. campaignCompleted() /prepareFinalStatement() 11 A revised statechart for the class Campaign /assignManager(); assignStaff() Commissioned authorized(authorizationCode) [contract signed] /setCampaignActive() Active paymentReceived(payment) [paymentDue - payment < zero] Completed Paid paymentReceived(payment) [paymentDue – payment > zero] If the user /generateRefund() paymentReceived(payment) [paymentDue - payment = zero] archiveCampaign() /unassignStaff(); unassignManager() requirements were to change, so that an overpayment is now to result in the automatic generation of a refund, a new transition is added
  • 12. advertsApproved() /authorize() 12 The Active State with Concurrent Substates Active Advert Preparation extendCampaign() /modify Budget() Running Adverts confirmSchedule() Scheduling Survey surveyComplete() Evaluation runSurvey() Running Monitoring campaignCompleted() /prepareFinalStatement()
  • 13. 13 Concurrent States  A transition to a complex state is equivalent to a simultaneous transition to the initial states of each concurrent statechart  An initial state must be specified in both nested statecharts in order to avoid ambiguity about which substate should first be entered in each concurrent region  A transition to the Active state means that the Campaign object simultaneously enters the Advert Preparation and Survey states
  • 14. 14 Concurrent States Once the composite states is entered a transition may occur within either concurrent region without having any effect on the state in the other concurrent region A transition out of the Active state applies to all its substates (no matter how deeply nested)
  • 15. 15 Preparing Statecharts Two approaches may be used: • Behavioural approach • Life cycle approach Allen and Frost (1998)
  • 16. Behavioural Approach 1. Examine all interaction diagrams that involve each class that has heavy messaging. 2. Identify the incoming messages on each interaction diagram that may correspond to events. Also identify the possible resulting states. 3. Document these events and states on a 16 statechart. 4. Elaborate the statechart as necessary to cater for additional interactions as these become evident, and add any exceptions.
  • 17. Behavioural Approach 5. Develop any nested statecharts (unless this has already been done in an earlier step). 6. Review the statechart to ensure consistency with use cases. In particular, check that any constraints that are implied by the statechart are appropriate. 7. Iterate steps 4, 5 and 6 until the statechart captures the necessary level of detail. 8. Check the consistency of the statechart with the class diagram, with interaction diagrams and with any other statecharts and models. 17
  • 18. Sequence Diagram with Implicit States Sequence diagram for use case Set Campaign Completed 18 Campaign Manager startInterface() *getClient() listCampaigns() *getCampaignDetails() :CompleteCampaignUI :CompleteCampaign :Client :Campaign showClientCampaigns() selectClient() completeCampaign() completeCampaign() campaignCompleted() Active state Completed state
  • 19. extendCampaign() /modify Budget() Running Adverts confirmSchedule() Scheduling 19 Initial statechart for the Campaign class—a behavioural approach Commissioned authorized(authorizationCode) [contract signed] /setCampaignActive() /assignManager(); assignStaff() Advert Preparation campaignCompleted() /prepareFinalStatement() paymentReceived(payment) [paymentDue - payment < zero] /generateRefund() Completed Paid paymentReceived(payment) [paymentDue – payment > zero] paymentReceived(payment) [paymentDue - payment = zero] archiveCampaign() /unassignStaff(); unassignManager() advertsApproved() /authorize()
  • 20. Life Cycle Approach  Consider the life cycles for objects of each class  Events and states are identified directly from use cases and from any other requirements documentation that happens to be available  First, the main system events are listed  Each event is then examined in order to determine which objects are likely to have a state dependent response to it 20
  • 21. 21 Life Cycle Approach Steps 1. Identify major system events. 2. Identify each class that is likely to have a state dependent response to these events. 3. For each of these classes produce a first-cut statechart by considering the typical life cycle of an instance of the class. 4. Examine the statechart and elaborate to encompass more detailed event behaviour.
  • 22. Life Cycle Approach Steps 5. Enhance the statechart to include alternative 22 scenarios. 6. Review the statechart to ensure that is consistent with the use cases. In particular, check that the constraints that the statechart implies are appropriate. 7. Iterate through steps 4, 5 and 6 until the statechart captures the necessary level of detail. 8. Ensure consistency with class diagram and interaction diagrams and other statecharts.
  • 23. 23 Life Cycle Approach Less formal than the behavioural approach in its initial identification of events and relevant classes Often helpful to use a combination of the two, since each provides checks on the other
  • 24. 24 Consistency Checking  Every event should appear as an incoming message for the appropriate object on an interaction diagram  Every action should correspond to the execution of an operation on the appropriate class, and perhaps also to the despatch of a message to another object  Every event should correspond to an operation on the appropriate class (but note that not all operations correspond to events)  Every outgoing message sent from a statechart must correspond to an operation on another class
  • 25. 25 Consistency Checking Consistency checking is an important task in the preparation of a complete set of models Highlights omissions and errors, and encourages the clarification of any ambiguity or incompleteness in the requirements
  • 26. Summary In this lecture you have learned about:  How to identify requirements for control in an application  How to model object life cycles using state charts  How to develop statechart diagrams from interaction diagrams  How to model concurrent behaviour in an object  How to ensure consistency with other UML models 26

Editor's Notes

  1. . The current state of an object is a result of the events that have occurred to the object, and is determined by the current value of the object’s attributes and the links that it has with other objects. Some attributes and links of an object are significant for the determination of its state while others are not. For example, in the Agate case study staffName and staffNo attributes of a StaffMember object have no impact upon its state, whereas the date that a staff member started his or her employment at Agate determines when the probationary period of employment ends (after six months, say). The StaffMember object is in the Probationary state for the first six months of employment. While in this state, a staff member has different employment rights and is not eligible for redundancy pay in the event that they are dismissed by the company.
  2. h
  3. The recursive transition from the Completed state models any payment event that does not reduce the amount due to zero or beyond. Only one of the two transitions from the Completed state (one of which is recursive) can be triggered by the paymentReceived event since the guard conditions are mutually exclusive. It would be bad practice to construct a statechart where one event can trigger two different transitions from the same state. A life cycle is only unambiguous when all the transitions from each state are mutually exclusive.
  4. If the user requirements were to change, so that an overpayment is now to result in the automatic generation of a refund, the statechart can be changed as follows. Since the action that results from an overpayment is different from the action that results from a payment that reduces paymentDue to zero, a new transition is needed from the Completed state to the Paid state. The guard conditions from the Completed state must also be modified.
  5. Suppose that further investigation reveals that at Agate a campaign is surveyed and evaluated while it is also active. A campaign may occupy either the Survey substate or the Evaluation substate when it is in the Active state. Transitions between these two states are not affected by the campaign’s current state in relation to the preparing and running of adverts. We model this by splitting the Active state into two concurrent nested statecharts, Running and Monitoring, each in a separate sub-region of the Active statechart. This is shown by dividing the state icon with a dashed line.
  6. Note that getCampaignDetails() does not change the state as this message only queries aspects of the objects state. However, campaignCompleted() does cause a state change and changes the values of some attributes of the object.
  7. The need for consistency between different models was discussed in Chapter 9 in relation to interaction diagrams. Statecharts must also be consistent with other models.      Every event should appear as an incoming message for the appropriate object on an interaction diagram.      Every action should correspond to the execution of an operation on the appropriate class, and perhaps also to the despatch of a message to another object.      Every event should correspond to an operation on the appropriate class (but note that not all operations correspond to events).      Every outgoing message sent from a statechart must correspond to an operation on another class. Consistency checks are an important task in the preparation of a complete set of models. This process highlights omissions and errors, and encourages the clarification of any ambiguity or incompleteness in the requirements.