Finding Reusable UML Sequence Diagrams Automatically By William

Finding Reusable UML Sequence Diagrams Automatically By: William N. Robinson and Han G. Woo From: IEEE Software (September/October 2004) Presented by: Ruth Miller

Reusing Code n n art - Artifact a piece to reuse, the function must match µ - determines the best match m – Is your design in the library L : m = µ(art, L)

Artifact n Hard to find a function that matches correctly. n Use Cases are very hard n You need to compare the narratives

Two ways to Reuse A. Concept Matching B. Relationship Matching

Concept Matching n Facet-based classification system n Syntactic Similarity n Focus on Event flows n Semantics

Relationship Matching § Uses concepts and relationships Looks at the structure and calculates whole graph similarity a. Concepts – vertices b. Relationships – edges

Relationship Matching n Several reusing tools for UML already out there, but they require extra notes attached to the diagrams to work. n This isn’t the best for the user, it also limits your matches. n Authors propose that matching with a library of designs is best (Using Structural Relationships).

Reuse by Structural Relationships Select an artifact library 2) Reuser calculates scores for the library 3) It calculates the score on a partial structure and returns best matches 4) Adapt the artifact to your current program context (Can be used w/any UML tool that uses directed graphs. ) 1)

Example

Text Strings of Objects Prefixesa. INS – instance b. MSG – Messages c. CLS – Class d. ATR– attributes e. MTH – method f. ASC – Associations g. STR - Stereotypes

Example Fig a: shows a Use Case Diagram w/goals Fig b: shows a sequence Diagram for the Use Case Together forms an artifact fragment which Can be used to query the library

REUSER used Directed Graphs of UML Models n UML metamodel associations become edges (associations, links) n Other UML metamodel elements become vertices (classes, objects, messages, stereotypes)

Examples Vertices: a. ATR b. MTH c. ASC d. STR Edges (metamodel relationships): Support the vertices.

A. Sequence Diagram B. Reuser graph format

Subdue Algorithm

Automated Matching 1 node label must match (Can use a label synonym list you provide. ) n Should have structure-limiting constraints n Finds repetitive & interesting substructures n Replaces repeating structures w/pointers to make it quicker n

Summary n Analysis of Tool

QUESTIONS? ?
- Slides: 18