SlideShare uma empresa Scribd logo
1 de 36
A Multi-level Methodology for Developing UML Sequence Diagrams Il-Yeol Song  Ritu Khare  Yuan An Margaret Hilsbos (Unites States of America) ER CONFERENCE 2008  1
Order of the Presentation  SQD: Background Related Research SQD Semantics Detecting Errors Translating Use-case to SQD Others Notations of SQD Key Features Multi-level Correctness Consistency Assumptions Component Diagram Steps Object Framework Level Object Assembly Stage Object Rearrangement Stage Responsibility Assignment Level Action Message Mapping Stage Message Responsibility Stage Visual Pattern Level High Cohesion Check Low Coupling Check Fork or Stair Check Central Class Check  Conclusion  Future Work 2
1. Sequence Diargams: Background Help in Object Oriented Programming by presenting a visual logic flow.  Development Process is intricate.  As new objects and messages are identified, the diagram gets more packed and complicated.  At every step, multiple factors (which object to choose, which message to assign to what object) need to be taken care of simultaneously.  Developer ends up making mistakes.  ,[object Object],3
2. 1 Related Research: SQD Semantics 4 Xia and Kane (2003) present an excellent attribute grammar based approach on defining the semantics of UML SQD to make it easily convertible to code, and to make these formal methods more usable in the industry.  Aredo (2000) prepares a framework for defining the semantics of an SQD to create a shared understanding across a design team.  Research Gap:  The problem of designing an SQD  still remains unresolved especially for the novices who do not hail from computer science background. Hence novices continue to commit errors.
2.2. Related Research: Detecting Errors 5 Baker et al (2005) address the problem of automatically detecting and resolving the semantic errors that occur in SQD scenarios. The tool proposed in this paper is successful in detecting semantic inconsistencies in industrial case studies. Research Gap:  Our method takes a preventive action to deal with the semantic inconsistencies by basing itself on the commonly occurring valid patterns in SQD and avoiding the frequently committed mistakes by UML students.
2.3 Related Research: Translate Use-case to SQD 6 Li (2000) presents a semi-automated approach to translate a use case to a sequence diagram. The work is based on syntactic structure of the sentences of use-case description. It presents a parser that makes a tabular analysis distinguishing between the static information (classes, objects attributes and operations) and the dynamic information (message sends from use case description).  Research Gap:  This motivated us to separate the static and the dynamic elements of an SQD, and deal with them at different levels of the process. Although this paper provides useful rules for novices, e.g. converting a use case to “message sends”, it does not avoid the common mistakes made by novices.
2.4 Related Research: Others 7 Selonen et al (2001) present a method to generate implementation schemes (pseudo codes) using UML sequence diagrams.  Both Rountev and Connell (2005), and Merdes and Dorsch (2006), present reverse engineering techniques to extract an SQD from a program.  Another interesting work ‘REUSER’ by Robinson and Woo (2004) automatically retrieves reusable SQDs from UML artifacts.  Research Gap:  Research effort for developing an easy-to-use method for developing SQDs is still rare and far from satisfactory.
3. Notation of SQD 8 UML 2.0
4. Key Features  9 Extend 10-step heuristics (Song,2001) using use-case and class diagrams.  Purpose: To serve as a reference guide for novice SQD modelers Key features:  Multi-level Guidelines and Patterns Consistency checks
4.1 Key Features: Multi-level 10 ,[object Object],[object Object]
4.3 Key Features: Consistency Checks 12 ,[object Object],[object Object]
6. Component Diargam 14
7. Method Steps 15 1. Object Framework Level:Identify the building participants which constitute the basic framework of an SQD.   1.1 Object Assembly Stage: Identify the actor, primary BO, primary CO, secondary CO(s), secondary BO(s) for the SQD.  1.2 Object Rearrangement Stage: Rearrange the classes (and also the actor) in the following order: Actor, Primary BO, Primary CO, EOs (list in the order of access), and Secondary COs and Secondary BOs in the order of access.  2.Responsibility Assignment Level: Assign correct responsibilities to each object.  2.1 Action-Message Mapping Stage: Map every automated action in the use-case description to a message in the SQD. Each message would fall under one of the following categories: Instance creation and destruction, Association forming, Attribute modification, Attribute access, Input/Output/Interface, and Integrity-constraint checking.  2.2 Message Re-arrangement Stage: Perform arrangement checks such as: making sure that each message is traceable to the primary actor through activated objects, giving meaningful names to each message, checking consistency of SQD with class diagram, removing any unnecessary return messages, and checking for continuity of focus of control.  3.Visual Pattern Level: Apply final checks based on the visual patterns illustrated by the SQD.  3.1 High Cohesion Check: Make sure that the responsibilities assigned to a class are related, and there exists a high cohesion within a class.  3.2 Low Coupling Check: Re-arrange messages from one class to another class to reduce coupling.  3.3 Fork or Stair Check: Choose between the “fork” and the “stair” pattern depending on the relationship between classes, and taking into account the pros and cons of both patterns.  3.4 Central Class Check: It should be kept in mind that the class, which looks central in the class diagram, is likely to send most messages to other classes in the SQD.
7.1 Object Framework Level 16 In this level, we identify the building blocks which constitute the basic framework of an SQD.
7.1.1Object Assembly Stage Select the initiating actor and initiating event from the use case description. Identify the primary display screen needed for implementing the use case. Call it the primary boundary object.  Create a primary control object to handle communication between the primary boundary object and domain objects.  If the use case involves any included or extended use case, create one secondary CO for each of them.  Identify the number of major screens necessary to implement the use case.  From the class diagram, list all domainclasses participating in the use case by reviewing the use case description.  17
7.1.2 Object Rearrangement Stage 18 Use the classes just identified as participant names in the SQD.  In a logical sequence of actions, tasks begin with an actor interacting with an interface (BO). The BO then passes control to a CO that has resources to carry the required actions, which then passes control to relevant EOs, and so on.  Hence, list the actor and the classes in the following order: Actor, Primary BO, Primary CO, EOs (list in the order of access), Secondary BOs, and Secondary COs in the order of access.
7.2 Responsibility Assignment Level 19 Responsibility assignment refers to the determination of which class should implement a message (the target), and which class should send the message (the source). A segment of a SQD and the class in the design class diagram
7.2.1 Action-Message Mapping Stage 20 The messages are identified through the following procedure:   Identify verbs from the use-case description. Remove verbs that describe the problem. Select verbs that solve the problem and call them problem-solving verbs. From the problem-solving verbs (PSVs), select verbs that represent an automatic operation or a manual operation by the actor. We call these PSVs problem-solving operations (PSOs) and use them as messages in the SQD.   Larman (2004) uses three types of postconditions: Instance creation and destruction, Association forming, and Attribute modification.  In this paper, we treat them as PSO categories. Here, we add three more PSO categories: Attribute access, Input/Output/Interface, and Integrity-constraint checking.  We use these six PSO categories to identify messages from a use case description. These six types of PSOs can also be used in identifying messages that are necessary but not explicit in the use case descriptions.  
7.2.1 Action-Message Mapping StageA. Instance Creation and Desctruction B should have the responsibility to send the create() message to A:   B aggregates A objects B  contains A objects  B records instances of A objects B closely uses A objects  B has the initializing data that will be passed to A when it is created. 21 X 
7.2.1 Action-Message Mapping StageB. Association Forming If there is an association between two classes, then at least one of the SQDs must include a message that forms this association.   If a depicted association is never supposed to be used at all, then there must be an error either in the class diagram or the SQD (Ambler, 2008b).  Associations can be formed by creating the object with the appropriate parameters or by updating the appropriate parameter in the object.  Figure shows an example where the association is formed between :SomeEO and :AnotherEO by the parameter (AnotherEO_id) being passed to :SomeEO at creation.   This makes the getX() message possible. 22
7.2.1 Action-Message Mapping StageC. Attribute Modification (Set/ Compute/ Convert) For each postcondition that causes a state change, there should be a message.  The messages change the value of attributes such as deposit_amount(), calc_subscription_charge(), and convert_cm_to_inch().  Any message that sets a value, computes a value, or converts one unit to another belongs to this message type. Simple Calculation  Complex Calculation 23
7.2.1 Action-Message Mapping StageD. Attribute Access(Get/ Find/ Compare/ Sort) This type of message reads values of attributes.  Any message that gets a value, finds a value, compares values, and sorts values belongs to this message type. A frequent mistake of novice developers is to try to update an attribute of a read-only class in the use case.  24 X 
7.2.1 Action-Message Mapping StageE. Input/ Output/ Interface This type of messages is used to input data to display output, generate report  to save a data to a storage to interface with external objects or systems.  25 X 
7.2.1 Action-Message Mapping StageF. Integrity-constraint (IC) Checking 26 Another message type in an SQD is an IC checking operation.   Checking a complex integrity constraint usually requires passing of multiple messages among objects.  Examples include validating a user input or computing a discount amount based on the current order and customer credit rating.
7.2.2 Message Rearrangement Stage Make sure that each message is traceable to the primary Actor through activated objects. Name each message with meaningful names Check the SQD for consistency with the Class Diagram. 27 X 
7.2.2 Message Rearrangement Stage Check if return messages are implied or required.  Check for the correctness of focus of control.  28 X 
7.3 Visual Pattern Level 29 Using GRASP Patterns High Cohesion Check Low Coupling Check Fork or Stair Check Central Class Check
7.3.1 High Cohesion Check Responsibilities of a class are closely related  A class should not have diverse responsibilities. As in figure, logically  :PaidSubscriber should not be responsible to edit/create the subscription information.  Hence, a Controller is used to create a new subscription.  30 X 
7.3.2 Low Coupling Check 31 Ensure that every recipient of a message and every parameter in the message is either  part of the state of the object that is sending it;  passed as a parameter to the method sending the new message;  or returned from a previous message sent within the current method. (Law of Demeter; Rowlett, 2001) To send a message, use a source class that is already coupled to the target class.   Introduce a CO if many messages are being passed between two classes. In this way the CO can coordinate among multiple objects.  Make sure a parameter is not passed again and again in multiple messages.
7.3.3 Fork or Stair Check Application of the aforementioned guidelines result in a visual pattern to the SQD, which is descriptively called a “fork” or “stair” pattern (Jacobson, 1992). A “fork” structure is recommended  When messages could change the order  When there is a central object that controls many messages as in the case of enforcing an integrity constraint.  A “stair” structure is recommended When there is no central object in the SQD When messages have strong connections among objects based on relationships such as temporal relationships or an aggregation hierarchy.  Fork Pattern Stair Pattern  32
7.3.4 Central Class Check The “central class” concept of Chonoles and Schardt(2003) is helpful.  They suggest identifying a central class for a use case, and note that this class will probably do a large part of the work in the interaction. It can be seen that Obj2 is the central class – it has the shortest access route (least hops) to all the other classes in the interaction. It might be an indication that responsibilities are incorrectly assigned. (Obj5 has the most difficult access to the other classes).  33 X
8. Conclusion  34 We have presented a multi-level development methodology for developing SQDs in UML.  We have included guidelines and common visual patterns in SQDs while highlighting the frequently committed mistakes by novices.  The guidelines were tested and examples were collected for the past five years of teaching SQDs in a graduate class. The students found our guidelines usable and effective.
9. Future Work  35 Perform a more extensive study to measure the number and the nature of mistakes they make at each level of the proposed methodology. Handle loops and conditionals. Create and Delete participants.  Deal with Timing Inconsistency.  Enhance the resulting SQD to make it easily convertible to the source code.
Questions, Comments, Thoughts, Ideas??? Thank You!!! 36
A Multi-level Methodology for Developing UML Sequence Diagrams
A Multi-level Methodology for Developing UML Sequence Diagrams

Mais conteúdo relacionado

Mais procurados

A&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLA&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UML
vinay arora
 
Survey paper
Survey paperSurvey paper
Survey paper
IJASCSE
 

Mais procurados (20)

A&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UMLA&D - Object Oriented Analysis using UML
A&D - Object Oriented Analysis using UML
 
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUROOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
OOM MCQ Dev by Prof PL Pradhan TGPCET, NAGPUR
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
Object oriented and function oriented design
Object oriented and function oriented designObject oriented and function oriented design
Object oriented and function oriented design
 
OOM MCQ 2018
OOM  MCQ 2018OOM  MCQ 2018
OOM MCQ 2018
 
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
 
Paper 55 final
Paper 55 finalPaper 55 final
Paper 55 final
 
COMPSAC 2008 Presentation
COMPSAC 2008 PresentationCOMPSAC 2008 Presentation
COMPSAC 2008 Presentation
 
Cs 2352 object oriented analysis and design
Cs 2352 object oriented analysis and designCs 2352 object oriented analysis and design
Cs 2352 object oriented analysis and design
 
Survey paper
Survey paperSurvey paper
Survey paper
 
Oop
OopOop
Oop
 
OO Development 5 - Analysis
OO Development 5 - AnalysisOO Development 5 - Analysis
OO Development 5 - Analysis
 
Software Systems as Cities: a Controlled Experiment
Software Systems as Cities: a Controlled ExperimentSoftware Systems as Cities: a Controlled Experiment
Software Systems as Cities: a Controlled Experiment
 
De-virtualizing virtual Function Calls using various Type Analysis Technique...
De-virtualizing virtual Function Calls using various Type  Analysis Technique...De-virtualizing virtual Function Calls using various Type  Analysis Technique...
De-virtualizing virtual Function Calls using various Type Analysis Technique...
 
Ooad lab manual(original)
Ooad lab manual(original)Ooad lab manual(original)
Ooad lab manual(original)
 
IRJET - Cognitive based Emotion Analysis of a Child Reading a Book
IRJET -  	  Cognitive based Emotion Analysis of a Child Reading a BookIRJET -  	  Cognitive based Emotion Analysis of a Child Reading a Book
IRJET - Cognitive based Emotion Analysis of a Child Reading a Book
 
OO Development 6 - Software Design
OO Development 6 - Software DesignOO Development 6 - Software Design
OO Development 6 - Software Design
 
Unit 5
Unit 5Unit 5
Unit 5
 
Chapter1
Chapter1Chapter1
Chapter1
 
Type variability and completeness of interfaces in java applications
Type variability and completeness of interfaces in java applicationsType variability and completeness of interfaces in java applications
Type variability and completeness of interfaces in java applications
 

Semelhante a A Multi-level Methodology for Developing UML Sequence Diagrams

Evidential diagnosis of inconsistencies in object oriented designs
Evidential diagnosis of inconsistencies in object oriented designsEvidential diagnosis of inconsistencies in object oriented designs
Evidential diagnosis of inconsistencies in object oriented designs
Kyriakos Kasis
 
Lab # 06
Lab # 06Lab # 06
Lab # 06
Mr SMAK
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Mahesh Bhalerao
 
CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V
pkaviya
 
Object oriented software engineering
Object oriented software engineeringObject oriented software engineering
Object oriented software engineering
Varsha Ajith
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
SHIVAM691605
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
ijceronline
 

Semelhante a A Multi-level Methodology for Developing UML Sequence Diagrams (20)

Cs6502 ooad-cse-vst-au-unit-v dce
Cs6502 ooad-cse-vst-au-unit-v dceCs6502 ooad-cse-vst-au-unit-v dce
Cs6502 ooad-cse-vst-au-unit-v dce
 
PHASE II.pptx
PHASE II.pptxPHASE II.pptx
PHASE II.pptx
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Evidential diagnosis of inconsistencies in object oriented designs
Evidential diagnosis of inconsistencies in object oriented designsEvidential diagnosis of inconsistencies in object oriented designs
Evidential diagnosis of inconsistencies in object oriented designs
 
Ooad unit 1
Ooad unit 1Ooad unit 1
Ooad unit 1
 
Generation of Testcases from UML Sequence Diagram and Detecting Deadlocks usi...
Generation of Testcases from UML Sequence Diagram and Detecting Deadlocks usi...Generation of Testcases from UML Sequence Diagram and Detecting Deadlocks usi...
Generation of Testcases from UML Sequence Diagram and Detecting Deadlocks usi...
 
Mc0083 object oriented analysis & design using uml
Mc0083 object oriented analysis & design using umlMc0083 object oriented analysis & design using uml
Mc0083 object oriented analysis & design using uml
 
Lab # 06
Lab # 06Lab # 06
Lab # 06
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V
 
A Critique On Code Critics
A Critique On Code CriticsA Critique On Code Critics
A Critique On Code Critics
 
Object oriented software engineering
Object oriented software engineeringObject oriented software engineering
Object oriented software engineering
 
[0201699613]visual modeling with rational rose 2000 and uml
[0201699613]visual modeling with rational rose 2000 and uml[0201699613]visual modeling with rational rose 2000 and uml
[0201699613]visual modeling with rational rose 2000 and uml
 
MANAGING AND ANALYSING SOFTWARE PRODUCT LINE REQUIREMENTS
MANAGING AND ANALYSING SOFTWARE PRODUCT LINE REQUIREMENTSMANAGING AND ANALYSING SOFTWARE PRODUCT LINE REQUIREMENTS
MANAGING AND ANALYSING SOFTWARE PRODUCT LINE REQUIREMENTS
 
Ooad
OoadOoad
Ooad
 
Sample SRS format
Sample SRS formatSample SRS format
Sample SRS format
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
1Intro.PPT
1Intro.PPT1Intro.PPT
1Intro.PPT
 
CS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and AnswerCS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and Answer
 

Último

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 

A Multi-level Methodology for Developing UML Sequence Diagrams

  • 1. A Multi-level Methodology for Developing UML Sequence Diagrams Il-Yeol Song Ritu Khare Yuan An Margaret Hilsbos (Unites States of America) ER CONFERENCE 2008 1
  • 2. Order of the Presentation SQD: Background Related Research SQD Semantics Detecting Errors Translating Use-case to SQD Others Notations of SQD Key Features Multi-level Correctness Consistency Assumptions Component Diagram Steps Object Framework Level Object Assembly Stage Object Rearrangement Stage Responsibility Assignment Level Action Message Mapping Stage Message Responsibility Stage Visual Pattern Level High Cohesion Check Low Coupling Check Fork or Stair Check Central Class Check Conclusion Future Work 2
  • 3.
  • 4. 2. 1 Related Research: SQD Semantics 4 Xia and Kane (2003) present an excellent attribute grammar based approach on defining the semantics of UML SQD to make it easily convertible to code, and to make these formal methods more usable in the industry. Aredo (2000) prepares a framework for defining the semantics of an SQD to create a shared understanding across a design team. Research Gap: The problem of designing an SQD still remains unresolved especially for the novices who do not hail from computer science background. Hence novices continue to commit errors.
  • 5. 2.2. Related Research: Detecting Errors 5 Baker et al (2005) address the problem of automatically detecting and resolving the semantic errors that occur in SQD scenarios. The tool proposed in this paper is successful in detecting semantic inconsistencies in industrial case studies. Research Gap: Our method takes a preventive action to deal with the semantic inconsistencies by basing itself on the commonly occurring valid patterns in SQD and avoiding the frequently committed mistakes by UML students.
  • 6. 2.3 Related Research: Translate Use-case to SQD 6 Li (2000) presents a semi-automated approach to translate a use case to a sequence diagram. The work is based on syntactic structure of the sentences of use-case description. It presents a parser that makes a tabular analysis distinguishing between the static information (classes, objects attributes and operations) and the dynamic information (message sends from use case description). Research Gap: This motivated us to separate the static and the dynamic elements of an SQD, and deal with them at different levels of the process. Although this paper provides useful rules for novices, e.g. converting a use case to “message sends”, it does not avoid the common mistakes made by novices.
  • 7. 2.4 Related Research: Others 7 Selonen et al (2001) present a method to generate implementation schemes (pseudo codes) using UML sequence diagrams. Both Rountev and Connell (2005), and Merdes and Dorsch (2006), present reverse engineering techniques to extract an SQD from a program. Another interesting work ‘REUSER’ by Robinson and Woo (2004) automatically retrieves reusable SQDs from UML artifacts. Research Gap: Research effort for developing an easy-to-use method for developing SQDs is still rare and far from satisfactory.
  • 8. 3. Notation of SQD 8 UML 2.0
  • 9. 4. Key Features 9 Extend 10-step heuristics (Song,2001) using use-case and class diagrams. Purpose: To serve as a reference guide for novice SQD modelers Key features: Multi-level Guidelines and Patterns Consistency checks
  • 10.
  • 11.
  • 13. 7. Method Steps 15 1. Object Framework Level:Identify the building participants which constitute the basic framework of an SQD. 1.1 Object Assembly Stage: Identify the actor, primary BO, primary CO, secondary CO(s), secondary BO(s) for the SQD. 1.2 Object Rearrangement Stage: Rearrange the classes (and also the actor) in the following order: Actor, Primary BO, Primary CO, EOs (list in the order of access), and Secondary COs and Secondary BOs in the order of access. 2.Responsibility Assignment Level: Assign correct responsibilities to each object. 2.1 Action-Message Mapping Stage: Map every automated action in the use-case description to a message in the SQD. Each message would fall under one of the following categories: Instance creation and destruction, Association forming, Attribute modification, Attribute access, Input/Output/Interface, and Integrity-constraint checking. 2.2 Message Re-arrangement Stage: Perform arrangement checks such as: making sure that each message is traceable to the primary actor through activated objects, giving meaningful names to each message, checking consistency of SQD with class diagram, removing any unnecessary return messages, and checking for continuity of focus of control. 3.Visual Pattern Level: Apply final checks based on the visual patterns illustrated by the SQD. 3.1 High Cohesion Check: Make sure that the responsibilities assigned to a class are related, and there exists a high cohesion within a class. 3.2 Low Coupling Check: Re-arrange messages from one class to another class to reduce coupling. 3.3 Fork or Stair Check: Choose between the “fork” and the “stair” pattern depending on the relationship between classes, and taking into account the pros and cons of both patterns. 3.4 Central Class Check: It should be kept in mind that the class, which looks central in the class diagram, is likely to send most messages to other classes in the SQD.
  • 14. 7.1 Object Framework Level 16 In this level, we identify the building blocks which constitute the basic framework of an SQD.
  • 15. 7.1.1Object Assembly Stage Select the initiating actor and initiating event from the use case description. Identify the primary display screen needed for implementing the use case. Call it the primary boundary object. Create a primary control object to handle communication between the primary boundary object and domain objects. If the use case involves any included or extended use case, create one secondary CO for each of them. Identify the number of major screens necessary to implement the use case. From the class diagram, list all domainclasses participating in the use case by reviewing the use case description. 17
  • 16. 7.1.2 Object Rearrangement Stage 18 Use the classes just identified as participant names in the SQD. In a logical sequence of actions, tasks begin with an actor interacting with an interface (BO). The BO then passes control to a CO that has resources to carry the required actions, which then passes control to relevant EOs, and so on. Hence, list the actor and the classes in the following order: Actor, Primary BO, Primary CO, EOs (list in the order of access), Secondary BOs, and Secondary COs in the order of access.
  • 17. 7.2 Responsibility Assignment Level 19 Responsibility assignment refers to the determination of which class should implement a message (the target), and which class should send the message (the source). A segment of a SQD and the class in the design class diagram
  • 18. 7.2.1 Action-Message Mapping Stage 20 The messages are identified through the following procedure: Identify verbs from the use-case description. Remove verbs that describe the problem. Select verbs that solve the problem and call them problem-solving verbs. From the problem-solving verbs (PSVs), select verbs that represent an automatic operation or a manual operation by the actor. We call these PSVs problem-solving operations (PSOs) and use them as messages in the SQD.  Larman (2004) uses three types of postconditions: Instance creation and destruction, Association forming, and Attribute modification. In this paper, we treat them as PSO categories. Here, we add three more PSO categories: Attribute access, Input/Output/Interface, and Integrity-constraint checking. We use these six PSO categories to identify messages from a use case description. These six types of PSOs can also be used in identifying messages that are necessary but not explicit in the use case descriptions.  
  • 19. 7.2.1 Action-Message Mapping StageA. Instance Creation and Desctruction B should have the responsibility to send the create() message to A: B aggregates A objects B contains A objects B records instances of A objects B closely uses A objects B has the initializing data that will be passed to A when it is created. 21 X 
  • 20. 7.2.1 Action-Message Mapping StageB. Association Forming If there is an association between two classes, then at least one of the SQDs must include a message that forms this association. If a depicted association is never supposed to be used at all, then there must be an error either in the class diagram or the SQD (Ambler, 2008b). Associations can be formed by creating the object with the appropriate parameters or by updating the appropriate parameter in the object. Figure shows an example where the association is formed between :SomeEO and :AnotherEO by the parameter (AnotherEO_id) being passed to :SomeEO at creation. This makes the getX() message possible. 22
  • 21. 7.2.1 Action-Message Mapping StageC. Attribute Modification (Set/ Compute/ Convert) For each postcondition that causes a state change, there should be a message. The messages change the value of attributes such as deposit_amount(), calc_subscription_charge(), and convert_cm_to_inch(). Any message that sets a value, computes a value, or converts one unit to another belongs to this message type. Simple Calculation Complex Calculation 23
  • 22. 7.2.1 Action-Message Mapping StageD. Attribute Access(Get/ Find/ Compare/ Sort) This type of message reads values of attributes. Any message that gets a value, finds a value, compares values, and sorts values belongs to this message type. A frequent mistake of novice developers is to try to update an attribute of a read-only class in the use case. 24 X 
  • 23. 7.2.1 Action-Message Mapping StageE. Input/ Output/ Interface This type of messages is used to input data to display output, generate report to save a data to a storage to interface with external objects or systems. 25 X 
  • 24. 7.2.1 Action-Message Mapping StageF. Integrity-constraint (IC) Checking 26 Another message type in an SQD is an IC checking operation. Checking a complex integrity constraint usually requires passing of multiple messages among objects. Examples include validating a user input or computing a discount amount based on the current order and customer credit rating.
  • 25. 7.2.2 Message Rearrangement Stage Make sure that each message is traceable to the primary Actor through activated objects. Name each message with meaningful names Check the SQD for consistency with the Class Diagram. 27 X 
  • 26. 7.2.2 Message Rearrangement Stage Check if return messages are implied or required. Check for the correctness of focus of control. 28 X 
  • 27. 7.3 Visual Pattern Level 29 Using GRASP Patterns High Cohesion Check Low Coupling Check Fork or Stair Check Central Class Check
  • 28. 7.3.1 High Cohesion Check Responsibilities of a class are closely related A class should not have diverse responsibilities. As in figure, logically :PaidSubscriber should not be responsible to edit/create the subscription information. Hence, a Controller is used to create a new subscription. 30 X 
  • 29. 7.3.2 Low Coupling Check 31 Ensure that every recipient of a message and every parameter in the message is either part of the state of the object that is sending it; passed as a parameter to the method sending the new message; or returned from a previous message sent within the current method. (Law of Demeter; Rowlett, 2001) To send a message, use a source class that is already coupled to the target class. Introduce a CO if many messages are being passed between two classes. In this way the CO can coordinate among multiple objects. Make sure a parameter is not passed again and again in multiple messages.
  • 30. 7.3.3 Fork or Stair Check Application of the aforementioned guidelines result in a visual pattern to the SQD, which is descriptively called a “fork” or “stair” pattern (Jacobson, 1992). A “fork” structure is recommended When messages could change the order When there is a central object that controls many messages as in the case of enforcing an integrity constraint. A “stair” structure is recommended When there is no central object in the SQD When messages have strong connections among objects based on relationships such as temporal relationships or an aggregation hierarchy. Fork Pattern Stair Pattern 32
  • 31. 7.3.4 Central Class Check The “central class” concept of Chonoles and Schardt(2003) is helpful. They suggest identifying a central class for a use case, and note that this class will probably do a large part of the work in the interaction. It can be seen that Obj2 is the central class – it has the shortest access route (least hops) to all the other classes in the interaction. It might be an indication that responsibilities are incorrectly assigned. (Obj5 has the most difficult access to the other classes). 33 X
  • 32. 8. Conclusion 34 We have presented a multi-level development methodology for developing SQDs in UML. We have included guidelines and common visual patterns in SQDs while highlighting the frequently committed mistakes by novices. The guidelines were tested and examples were collected for the past five years of teaching SQDs in a graduate class. The students found our guidelines usable and effective.
  • 33. 9. Future Work 35 Perform a more extensive study to measure the number and the nature of mistakes they make at each level of the proposed methodology. Handle loops and conditionals. Create and Delete participants. Deal with Timing Inconsistency. Enhance the resulting SQD to make it easily convertible to the source code.
  • 34. Questions, Comments, Thoughts, Ideas??? Thank You!!! 36