260 likes | 440 Views
Scenario-based Analysis of UML Design Class Models. Lijun Yu October 4th, 2010 Oslo, Norway. My background. Bachelor in Computer Science, Nanjing University, China, 1997 Master in Computer Science, Colorado State University, USA, 2006 After 2006: Ph.D. research in software engineering
E N D
Scenario-based Analysis of UML Design Class Models Lijun Yu October 4th, 2010 Oslo, Norway
My background • Bachelor in Computer Science, Nanjing University, China, 1997 • Master in Computer Science, Colorado State University, USA, 2006 • After 2006: • Ph.D. research in software engineering • Full-time software engineer 2
Outline Problem Statement Solution Overview Evaluation Method Related Work Research Plan 3
Background • The Unified Modeling Language is a de-facto standard OO modeling language • UML class models are often used to describe software designs • Software design is creative process and human beings introduce errors in the design model • Design errors should be uncovered and resolved as early as possible
State-of-the-art in UML class model analysis UML design class model describes Structure in terms of classes and relationships Functionality in terms of operation specifications (OCL) UML static analysis tools USE/OCLE can check whether a snapshot is consistent with structural constraints in UML design class models A snapshot is a UML instance model describing a system state They do not provide good support for analyzing functionality 5
Research questions How to analyze functional scenarios against UML design class models? How can we leverage USE/OCLE to support scenario-based analysis? What type of design errors can be uncovered in scenario-based analysis of UML design class models? How to systematically generate scenarios? 6
Outline Problem Statement Solution Overview A scenario-based analysis approach Scenario generation techniques Evaluation Method Related Work Research Plan 7
Scenario-based Analysis: A lightweight approach Step 1 Step 3 Step 2 8
Step 1: generate snapshot model • Create a structured class Snapshot that contains a part structure representing snapshots of the system • Create a Transition class that links to before and after snapshots • For each operation in the UML design • Create a subclass of Transition • Add operation parameters as attributes • “And” OCL pre and post conditions and transform to invariants of the Transition subclass • Add frame constraints: make sure other objects and relationships remain unchanged 9
Step 2: generate snapshot transitions • 1. Use UMLAnT to generate snapshot transitions • Verifier describes operation definitions using JAL (Java-like Action Language) • Snapshot transitions are generated by executing JAL using UMLAnT • 2. Use Alloy to generate snapshot transitions • To be discussed in scenario generation part 11
Step 3: consistency checking • Snapshot transitions are instance model of the Snapshot model • Consistency is checked using USE/OCLE • Inconsistencies imply errors in either the UML design or the operation definitions 12
Scenario generation • Scenario generation technique automates the creation of scenarios • Option 1: Generate scenarios from formal UML requirements model • Option 2: Generate scenarios from UML design • Compare two options 13
Scenario generation option 1 • Generate scenarios from formal UML requirements model • UML Requirements model • UML activity diagram describing use case sequences • Use case formally described as system operation with parameters and pre/post conditions • All allowed operation sequences are extracted from the UML activity diagram • Alloy is used to solve parameters of scenarios 14
Scenario generation option 2 • Generates scenarios from UML designs using Alloy • Verifier describes operation definitions in terms of OCL constraints • Transform snapshot class model and operation definitions to Alloy • Generate interesting scenarios and their snapshot sequences using Alloy trace 15
Outline Problem Statement Solution Overview Evaluation Method Related Work Research Plan 16
Evaluate scenario-based analysis technique Questions Can the technique find inconsistencies between UML class model and scenarios? What types of inconsistencies can the technique uncover? Method Different types of inconsistencies are seeded into UML design class models and scenario models Two groups of students: one uses scenario-based analysis tool, another does manual inspection Record and compare number of errors and type of errors found 17
Evaluate scenario generation method Question: Can the scenario generation method generate scenarios that uncover design errors? Method: Seed design errors in the UML design class model Generate scenarios using the scenario generation method and a random scenario generator Compare design errors uncovered by the scenario generation method and a random generator 18
Outline Problem Statement Solution Overview Evaluation Method Related Work Research Plan 19
Related Work Transforming UML to formal specification languages Developers need to be familiar with these notations and techniques Correctness of transformation can be difficult to prove Testing & Animating UML designs (UMLAnT) Testing one operation call vs Analyzing scenarios Executing the UML model vs Static analysis 20
Outline Problem Statement Solution Overview Evaluation Method Related Work Research Plan 21
Questions and discussions • ? 23