Towards refactoring meta-models into multi-level models ıas 1 Esther Guerra 2 Juan de Lara 2 Fernando Mac´ fernandomacias.es Campina Grande, November 21, 2017 1 Western Norway University of Applied Sciences 2 Universidad Aut´ onoma de Madrid 1 / 16
This work: What, how and why Multi-level refactoring process Two-level limitations Evaluation and experiments Juan de Lara, Esther Guerra, and Jes´ us S´ anchez Cuadrado. “When and How to Use Multilevel Modelling”. In: ACM Trans. Softw. Eng. Methodol. 24.2 (Dec. 2014), 12:1–12:46. issn : 1049-331X. doi : 10.1145/2685615 2 / 16
What is MDSE? Model-Driven Software Engineering. Representing information in a structured way. Uses: Code generation Simulation Documentation ... 3 / 16
Example: Security Policies Tejeddine Mouelhi, Franck Fleurey, and Benoit Baudry. “A Generic Metamodel For Security Policies Mutation”. In: Proc. ICST . IEEE Computer Society, 2008, pp. 278–286 4 / 16
Limitations of traditional approaches Complexity tends to grow pretty fast. Difficult to read Complex maintenance Low reusability 5 / 16
Multi-level modelling (MLM) The good: Unbounded levels of abstraction Richer semantics Cleaner structures The bad: Lack of consensus on foundations Technology lock-in Tool isolation 6 / 16
Security Policies with MLM ( a ) “flat” meta-model type PolicyType name: String ruleTypes 1..* 1..* elementTypes parameters RuleType ElementType 1..* name: String name: String hierarchy: bool type type children parameters Rule Parameter 1..* * name: String name: String rules * * elements Policy name: String 7 / 16
Security Policies with MLM ( a ) “flat” meta-model type PolicyType name: String ruleTypes 1..* 1..* elementTypes parameters RuleType ElementType 1..* name: String name: String hierarchy: bool type type children parameters Rule Parameter 1..* * name: String name: String rules * * elements Policy name: String ( c ) “flat” model :type rbac:PolicyType :type role:ElementType name = “RBAC” name = “Role” :parameters :ruleTypes hierarchy= true userRole:RuleType name = “ UserRole ” user:ElementType :type name = “ User ” hierarchy= false :type :parameters p1:Parameter rule:Rule name = “ Romain ” name = “R1” p2:Parameter :rules name = “ Student ” policy:Policy name = “ LibraryRBAC ” 7 / 16
Security Policies with MLM ( a ) “flat” meta -model ( b ) multi-level specification type PolicyType PolicyType name: String ruleTypes name: String 1..* elementTypes 1..* parameters ruleTypes 1..* 1..* elementTypes children@(2) RuleType ElementType parameters RuleType ElementType 1..* name: String name: String 1..* name: String name: String hierarchy@1: bool hierarchy: bool type type children parameters Rule Parameter 1..* * name: String name: String rules * * elements Policy name: String ( c ) “flat” model :type rbac:PolicyType :type role:ElementType name = “RBAC” name = “Role” :parameters :ruleTypes hierarchy= true userRole:RuleType name = “ UserRole ” user:ElementType :type name = “ User ” hierarchy= false :type :parameters p1:Parameter rule:Rule name = “ Romain ” name = “R1” p2:Parameter :rules name = “ Student ” policy:Policy name = “ LibraryRBAC ” 7 / 16
Security Policies with MLM ( a ) “flat” meta -model ( b ) multi-level specification type PolicyType PolicyType name: String ruleTypes name: String 1..* elementTypes 1..* parameters ruleTypes 1..* 1..* elementTypes children@(2) RuleType ElementType parameters RuleType ElementType 1..* name: String name: String 1..* name: String name: String hierarchy@1: bool hierarchy: bool type type children parameters Rule Parameter 1..* * name: String name: String rules * * elements Policy name: String ( c ) “flat” model ( d ) multi-level model :type rbac:PolicyType rbac:PolicyType :type role:ElementType role:ElementType rparam: name = “RBAC” name = “RBAC” parameters name = “Role” name = “Role” :parameters :ruleTypes hierarchy= true hierarchy= true roles:ruleTypes 1..1 * userRole:RuleType 1..1 userRole:RuleType user:ElementType name = “ UserRole ” user:ElementType uparam: name = “ UserRole ” parameters name = “ User ” :type name = “ User ” hierarchy= false hierarchy= false :type :parameters p1:Parameter rule:Rule name = “ Romain ” name = “R1” p2:Parameter :rules name = “ Student ” policy:Policy name = “ LibraryRBAC ” 7 / 16
Security Policies with MLM ( a ) “flat” meta -model ( b ) multi-level specification type PolicyType PolicyType name: String ruleTypes name: String 1..* elementTypes 1..* parameters ruleTypes 1..* 1..* elementTypes children@(2) RuleType ElementType parameters RuleType ElementType 1..* name: String name: String 1..* name: String name: String hierarchy@1: bool hierarchy: bool type type children parameters Rule Parameter 1..* * name: String name: String rules * * elements Policy name: String ( c ) “flat” model ( d ) multi-level model :type rbac:PolicyType rbac:PolicyType :type role:ElementType role:ElementType rparam: name = “RBAC” name = “RBAC” parameters name = “Role” name = “Role” :parameters :ruleTypes hierarchy= true hierarchy= true roles:ruleTypes 1..1 * userRole:RuleType 1..1 userRole:RuleType user:ElementType name = “ UserRole ” user:ElementType uparam: name = “ UserRole ” parameters name = “ User ” :type name = “ User ” hierarchy= false hierarchy= false :type :parameters :uparam p1:Parameter p1:user rule:userRole rule:Rule name = “ Romain ” name = “R1” name = “ Romain ” name = “R1” p2:Parameter :roles :rules p2:role :rparam name = “ Student ” policy:rbac policy:Policy name = “ Student ” name = “ LibraryRBAC ” name = “ LibraryRBAC ” 7 / 16
Refactoring into MLM Goals: Empirical data about MLM improvement Automatic refactoring tool Convergence of MLM frameworks 8 / 16
Step 1: Detecting smells Heuristic-based annotation Based on structure and name similarity Adjustable confidence threshold Open to human intervention (i.e. semi-automatic) 9 / 16
Step 1: Detecting smells 9 / 16
Step 2: Refactoring Transformation applied to each annotated pattern Based on annotations from previous step Single-model output (for now) Automatic 10 / 16
Step 2: Refactoring 10 / 16
Step 3: Recommendation Based on framework support for MLM features Three degrees of support: supported , emulated , unsupported Scores and ranking output Automatic 11 / 16
Step 3: Recommendation 11 / 16
Step 3: Recommendation 11 / 16
Step 3: Recommendation 11 / 16
Step 4: Deployment 12 / 16
Step 4: Deployment 12 / 16
Step 4: Deployment 12 / 16
Evaluation: Gain 13 / 16
Evaluation: F-score optimization 14 / 16
Conclusions Empirical evaluation of MLM with third-party data Prototype tool support Tool-independent representation of MLM hierarchies 15 / 16
Future work Support more scenarios Large-scale evaluation (Github) Crystallize tool-independent metamodel as exchange format 16 / 16
References Fernando Mac´ ıas, Esther Guerra, and Juan de Lara. “Towards rearchitecting meta-models into multi-level models”. In: International Conference on Conceptual Modeling . Springer. 2017, pp. 59–68 Juan de Lara, Esther Guerra, and Jes´ us S´ anchez Cuadrado. “When and How to Use Multilevel Modelling”. In: ACM Trans. Softw. Eng. Methodol. 24.2 (Dec. 2014), 12:1–12:46. issn : 1049-331X. doi : 10.1145/2685615 Juan de Lara and Esther Guerra. “Deep meta-modelling with MetaDepth”. In: Objects, Models, Components, Patterns . Vol. 6141. LNCS. Springer, July 2010, pp. 1–20. doi : 10.1007/978-3-642-13953-6\_1 Colin Atkinson, Ralph Gerbig, and Mathias Fritzsche. “A multi-level approach to modeling language extension in the enterprise systems domain”. In: Information Systems 54 (2015), pp. 289–307 Fernando Mac´ ıas, Adrian Rutle, and Volker Stolz. “MultEcore: Combining The Best of Fixed-Level and Multilevel Metamodelling”. In: 3rd International Workshop on Multi-Level Modelling (MULTI2016) . Vol. 1722. CEUR Workshop Proceedings. 2016
Recommend
More recommend