Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Quality Assurance of Software Models within Eclipse using Java and OCL
Dr. Thorsten Arendt
Modellgetriebene Softwareentwicklung mobiler Anwendungen Wintersemester 2014/15 17. Dezember 2014
Outline
• Why model quality assurance?
• A structured model quality assurance process
• Tailoring the process for a given modeling project
– Specification process
– Application process
• Tool support: EMF Refactor
2 MDDMA WS 2014/2015
Why model quality assurance?
Problems
Risks
Model Refactorings
Model Smells
Model Metrics
3 MDDMA WS 2014/2015
Why model quality assurance?
Problems
Risks
Model Refactorings
Model Smells
Model Metrics
Model Quality Assurance Process
MDDMA WS 2014/2015 4
Software quality ≠ software model quality
[ISO/IEC 9126]
MDDMA WS 2014/2015 5
Software quality ≠ software model quality
[ISO/IEC 9126]
MDDMA WS 2014/2015
Software quality
[Mohagheghi]
6C model quality goals
– Correctness – Completeness – Changeability – Comprehensibility – Confinement – Consistency
6
Model smells
• Adopted from the concept of code smell
• Smells are parts of the model that – … contain symptoms of poor model quality – … are worthy of an inspection – … are potential candidates for improvements by refactoring
• Smells are not synonyms for problems – ‘… smells don't always indicate a problem. ... You have to look
deeper to see if there is an underlying problem there - smells aren't inherently bad on their own - they are often an indicator of a problem rather than the problem themselves.’
MDDMA WS 2014/2015
[Fowler]
7
A structured model quality assurance process (1)
MDDMA WS 2014/2015
Specification process
Application process Manager Designer
8
Discussing important quality aspects
MDDMA WS 2014/2015
– Correctness – Completeness – Changeability
Specification process
– Comprehensibility – Confinement – Consistency
Changeability Comprehensibility
9
Specifying relevant model smells (1)
MDDMA WS 2014/2015
• Question: Are there equally named classes in different packages?
Specification process
Changeability Comprehensibility
− Smell: Multiple definitions of classes with equal names
10
Specifying relevant model refactorings (1)
MDDMA WS 2014/2015
Specification process
• Smell: Multiple definitions of classes with equal names – Refactorings: Merge Classes,
Rename Class
11
Specifying relevant model smells (2)
• Question: Are there abstract classes without any concrete subclasses?
Specification process
Completeness Confinement
− Smell: No concrete Subclass
12 MDDMA WS 2014/2015
Specifying relevant model refactorings (2)
Specification process
– Refactoring: Insert Concrete Subclass • Smell: No concrete subclass
13 MDDMA WS 2014/2015
UML specific refactorings
MDDMA WS 2014/2015
Refactoring: Change Attribute to Association End
Refactoring: Change Association End to Attribute
14
UML class attribute specification
MDDMA WS 2014/2015
Refactoring: Change Attribute to Association End
15
[OMG: UML]
A structured model quality assurance process (2)
MDDMA WS 2014/2015
Specification process
Application process
Modeler Reviewer
16
Manager Designer
Tool environment for model quality assurance
MDDMA WS 2014/2015
Problems
Risks
Model Refactorings
Model Smells
Model Metrics
Model Quality Assurance Process
17
Quality Assurance and Textual Modeling in Eclipse
MDDMA WS 2014/2015 18
Scenario: Vehicle Rental Company
• Project – Development of a web
application for renting vehicles using MDD
• Semantic domain – Company with vehicles,
customers, services, .. • Technical domain
– Web application • Modeling purpose
– Modeling of the semantic domain as well as the information mandatory for code generation using a (textual) DSML
• Credo – The better the model, the better the code
MDDMA WS 2014/2015 19
Xtext Grammar for SWM
MDDMA WS 2014/2015 20
Scenario: Xtext Model Vehicle Rental Company
Is the model complete?
Is the model comprehensible,
correct, …?
MDDMA WS 2014/2015 21
Metrics calculation Is the model complete?
MDDMA WS 2014/2015 22
Reporting and interpreting
variously interpretable
Is the model complete?
MDDMA WS 2014/2015 23
Smell detection Is the model complete?
MDDMA WS 2014/2015 24
Locating and interpreting
refactoring as quick-fix
Is the model complete?
MDDMA WS 2014/2015 25
Refactoring application
Model partially completed
Is the model complete?
MDDMA WS 2014/2015 26
EMF Refactor: Architecture
Specification Language
Generation module
metrics, smells, refactorings
Eclipse Modeling Framework (EMF)
extension points
Generation module
MDDMA WS 2014/2015 27
Application module
Configuration of relevant quality assurance techniques
MDDMA WS 2014/2015 28
Smell-Refactoring relations
MDDMA WS 2014/2015 29
EMF Refactor: Architecture
Specification Language
Generation module
metrics, smells, refactorings
Eclipse Modeling Framework (EMF)
extension points
Specification Language
Generation module
MDDMA WS 2014/2015 30
Application module
Specification languages
Generation module
Application module
metrics, smells, refactorings
Eclipse Modeling Framework (EMF)
Metrics
Refactorings
+
MDDMA WS 2014/2015 31
Integration of EMF Refactor tools
• Specific tools use each other – Metric-based model smells – Refactoring invocation from within model smell results view – Model smell analysis during refactoring application
• Each tool can be used directly on the model within a certain EMF-based modeling environment
– EMF instance editor – Unified Modeling Language (UML)
• Eclipse Plugin Papyrus • IBM Rational Software Architect
– Textual Xtext editors
32 MDDMA WS 2014/2015
Flexible specification mechanisms in EMF Refactor
• Usage of existing quality assurance techniques – Combination of existing model metrics – Metric-based model smells – Composite model refactorings
• Usage of concrete specification languages – Java – OCL – EMF model transformation language Henshin – … further languages can be integrated by new adapters
33 MDDMA WS 2014/2015
Conclusion
• Quality assurance for software models is an important project management task
• Software quality ≠ software model quality
• A structured model quality assurance process can be adapted to project and domain specific purposes
– The application sub-process is performed during the modeling task, e.g., in a model review
– The specification sub-process should be performed before (as far as possible)
• Tool support in Eclipse is given by EMF Refactor
34 MDDMA WS 2014/2015
References
• ISO/IEC 9126-1:2001 – Software engineering – Product quality – Part 1: Quality model, 2001.
• P. Mohagheghi, V. Dehlen, T. Neple: Definitions and approaches to model quality in model-based software development - A review of literature. Information & Software Technology, 2009.
• Martin Fowler: Code Smell. http://martinfowler.com/bliki/CodeSmell.html
• Object Management Group (OMG): Unified Modeling Language (UML), http://www.omg.org/spec/UML/
• Thorsten Arendt and Gabriele Taentzer: A tool environment for quality assurance based on the Eclipse Modeling Framework. Journal Automated Software Engineering, 2013.
• Thorsten Arendt: Quality Assurance of Software Models - A Structured Quality Assurance Process Supported by a Flexible Tool Environment in the Eclipse Modeling Project, Dissertation, 2014.
• Eclipse: EMF Refactor, http://www.eclipse.org/emf-refactor
35 MDDMA WS 2014/2015