A Model Driven Reverse Engineering framework for extracting business rules out of a Java application
Upcoming SlideShare
Loading in...5
×
 

A Model Driven Reverse Engineering framework for extracting business rules out of a Java application

on

  • 528 views

This work has been presented in RuleML Symposium held in conjunction with ECAI 2012, the 20th biennial European Conference on Artificial Intelligence , in Montpellier; ...

This work has been presented in RuleML Symposium held in conjunction with ECAI 2012, the 20th biennial European Conference on Artificial Intelligence , in Montpellier;
The goal of this work is to identify and extract the business logic (expressed as a set of business rules) within a Java application.
We use as running example a small application representing the predator-prey problem. The application simulates the behaviour of animals (foxes, rabbits, birds) and humans (hunters) in a meadow,
where each actor animal or human can act and move according to its nature.
Two di fferent functionalities are implemented in this application: one represents the business logic and describes how predator-prey interactions a ffect population sizes. The second one is used to store statistical information about the actors
participating in the simulation.
The business rule extraction process is based on MDE and it's composed by four activities:
Model Discovery -> to pass from the source code to a model representation), it uses the discovery component of Modisco (http://www.eclipse.org/MoDisco/)
Variable Classification -> to identify the domain variables and the container classes
Business Rule Identification -> to isolate the part of code related to the variables identified in the previous step
Business Rule Representation -> to present the extracted BRs using graphs or textual representations.

Statistics

Views

Total Views
528
Slideshare-icon Views on SlideShare
382
Embed Views
146

Actions

Likes
0
Downloads
17
Comments
0

2 Embeds 146

http://modeling-languages.com 145
http://www.google.de 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    A Model Driven Reverse Engineering framework for extracting business rules out of a Java application A Model Driven Reverse Engineering framework for extracting business rules out of a Java application Presentation Transcript

    • Valerio Cosentino - IBM, AtlanMod, INRIA & EMN, Nantes - valerio.cosentino@fr.ibm.comJordi Cabot - AtlanMod, INRIA & EMN, Nantes - jordi.cabot@mines-nantes.frPatrick Albert – IBM - albertpa@fr.ibm.comPhilippe Bauquel – IBM - bauquel.p@fr.ibm.comJacques Perronnet – IBM - jacques_perronnet@fr.ibm.com A Model Driven Reverse Engineering framework for extracting business rules out of a Java application 1 RuleML 2012, Montpellier, France – 29 August © 2009 IBM Corporation
    • Outline Introduction – Context & problem – Example – Business rule extraction process Framework overview – Model discovery – Variable classification – Business rule identification – Business rule representation Conclusion & Future work2 © 2009 IBM Corporation
    • Introduction - context & problem Context: every organization needs to periodically reevaluate and evolve its company policies enforced in its Information System (IS) by means of a set of business rules3 © 2009 IBM Corporation
    • Introduction - context & problem Context: every organization needs to periodically reevaluate and evolve its company policies enforced in its Information System (IS) by means of a set of business rules Business rule: – « Relevant action aiming at constraining some precise aspect of a business » – Key component for ISs4 © 2009 IBM Corporation
    • Introduction - context & problem Context: every organization needs to periodically reevaluate and evolve its company policies enforced in its Information System (IS) by means of a set of business rules Business rule: – « Relevant action aiming at constraining some precise aspect of a business » – Key component for ISs Problem: policies and rules must be aligned at all time, but in most of ISs business rules are scattered among the source code.5 © 2009 IBM Corporation
    • Introduction - context & problem Context: every organization needs to periodically reevaluate and evolve its company policies enforced in its Information System (IS) by means of a set of business rules Business rule: – « Relevant action aiming at constraining some precise aspect of a business » – Key component for ISs Problem: policies and rules must be aligned at all time, but in most of ISs business rules are scattered among the source code.Hard to find the business rules within the IS even for small application6 © 2009 IBM Corporation
    • Introduction - context & problem Context: every organization needs to periodically reevaluate and evolve its company policies enforced in its Information System (IS) by means of a set of business rules Business rule: – « Relevant action aiming at constraining some precise aspect of a business » – Key component for ISs Problem: policies and rules must be aligned at all time, but in most of ISs business rules are scattered among the source code.Hard to find the business rules within the IS even for small application Hard to evolve (quickly and safely) company policies7 © 2009 IBM Corporation
    • We use as running example a small application representing the predator- prey problem. The application simulates the behaviour of animals (foxes, rabbits, birds) and humans (hunters) in a meadow. Each actor animal or human can act and move according to its nature. Two different functionalities are implemented in this application: oneIntroduction - example represents the business logic and describes how predator-prey interactions affect the population size. The second one is used to store statistical information about the actors participating in the simulation8 © 2009 IBM Corporation
    • Introduction - example9 © 2009 IBM Corporation
    • Introduction - example Rules modeling the application: – Hunters:  Never die  Hunt animals – Rabbits & Birds:  Can die by being eaten by foxes, hunted by hunters, of starvation, old age or overcrowding  Can breed when they reach their breeding age  Eat grass – Foxes:  Can die by being eaten by hunters, of starvation, old age or overcrowding  Can breed when they reach their breeding age  Eat rabbits and birds10 © 2009 IBM Corporation
    • Introduction - example Rules modeling the application: – Hunters:  Never die  Hunt animals – Rabbits & Birds:  Can die by being eaten by foxes, hunted by hunters, of starvation, old age or overcrowding  Can breed when they reach their breeding age  Eat grass – Foxes:  Can die by being eaten by hunters, of starvation, old age or overcrowding  Can breed when they reach their breeding age  Eat rabbits and birds11 © 2009 IBM Corporation
    • Introduction – example rules are scattered in the source code old age starvation12 © 2009 IBM Corporation
    • Introduction - example rabbit killed by a fox13 © 2009 IBM Corporation
    • Introduction - example rabbit killed by a hunter14 © 2009 IBM Corporation
    • Introduction - example overcrowding15 © 2009 IBM Corporation
    • Introduction - business rule extraction process Business rule extraction (BREX) process: – Allows extracting business rules out of an IS, isolating the code segments which are directly related to business – Three major activities:  Variable Classification → finds variables related to domain/business concepts and hintining at BRs  Business rule identification → collects chunks of code related to the variables identified in the previous step  Business rule representation → presents the extracted BRs by means of artifacts (graphs, textual representations, …)16 © 2009 IBM Corporation
    • Introduction - business rule extraction process Business rule extraction (BREX) process: – Allows extracting business rules out of an IS, isolating the code segments which are directly related to business – Three major activities:  Variable Classification → finds variables related to domain/business concepts and hintining at BRs  Business rule identification → collects chunks of code related to the variables identified in the previous step  Business rule representation → presents the extracted BRs by means of artifacts (graphs, textual representations, …) Model Driven Engineering techniques: – Abstract & homogeneous representation – Modular solving process – Non-intrusive solution17 © 2009 IBM Corporation
    • Framework overview - model discovery Modisco discovery component (http://www.eclipse.org/MoDisco/) A new operation (Model Discovery) is added to the BRE process to move the problem from a grammarware technological space to the modelware one. – Input: source code – Output: platform specific model (PSM)18 © 2009 IBM Corporation
    • Framework overview - variable classification Variables Classification identifies the domain variables together with their containing classes – Input: PSM – Output: model containing all domains classes and their inner variables19 © 2009 IBM Corporation
    • Framework overview - variable classification each link represents a type dependency. ex.: the link connecting Simulator and AnimatedView means that the class Simulator uses the type AnimatedView20 © 2009 IBM Corporation
    • Framework overview - variable classification the algorithm starts from the classes containing a graphical import (awt, swing, ..)21 © 2009 IBM Corporation
    • Framework overview - variable classification for each of those classes, a set of connected classes is calculated (recursively)22 © 2009 IBM Corporation
    • Framework overview - variable classification23 © 2009 IBM Corporation
    • Framework overview - variable classification the green set (business domain) contains the classes representing the logic modelling how the actors act/interact each other24 © 2009 IBM Corporation
    • Framework overview - variable classification for the same application we may find several business domains (in blue the classes related to the stats of the simulation)25 © 2009 IBM Corporation
    • Framework overview - variable classification - metamodel For each class in a group, its variables are classified in: – Single-access: class attributes occurring at most once on the left side of an assignment – Multi-access: class attributes occurring more than once on the left side of an assignment – Potentials: variables declarated in methods and occurring on the left side of an assignment26 © 2009 IBM Corporation
    • Framework overview - variable classification - metamodel For each class in a group, its variables are classified in: – Single-access: class attributes occurring at most once on the left side of an assignment – Multi-access: class attributes occurring more than once on the left side of an assignment – Potentials: variables declarated in methods and occurring on the left side of an assignment – Traceability: relates the classified variables to the source code27 © 2009 IBM Corporation
    • Framework overview - business rule identification28 © 2009 IBM Corporation
    • Framework overview - business rule identification Domain model extraction: – Input: PSM, the domain variables model – Output:  Model conforming to the Business Object Model/Vocabulary [BOM/VOC] metamodel of IBM WebSphere ILOG Jrules – Extracts method signatures and class attributes from the classes containing the domain variables identified in the variables classification step – Provides a default vocabulary for these entities to be reused in the description of the business rules – The user can tune the process and define its verbalization29 © 2009 IBM Corporation
    • Framework overview - business rule identification Domain model extraction:30 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i31 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i (ex: alive)32 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i A statement is marked as « Rule » if it modifies the value of the variable i Alive is the name of the variable we are slicing Id to identify each business rule The granularity index is the distance of a statement from the statement that modifies the value of the variable i33 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i A method is marked as «Related» if it contains a rule statement34 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i35 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i A statement containing a method invocation that allows reaching the statement that modifies the value of the variable i is annoted as «Rule»36 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i37 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i38 © 2009 IBM Corporation
    • Framework overview - business rule identification Slicing operation: – Input: PSM, a variable i contained in the domain variables model – Output:  PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i39 © 2009 IBM Corporation
    • Framework overview - business rule identification40 © 2009 IBM Corporation
    • Framework overview - business rule identification41 © 2009 IBM Corporation
    • Framework overview - business rule identification A variable declaration is marked as «RELATED-VARIABLE» if it is used inside a «Related» or «Rule» statement.42 © 2009 IBM Corporation
    • Framework overview - business rule Aidentification if one of its invocations occurs method is annotated as «Reachable» in a «Related» statement or in another «Reachable» method.43 © 2009 IBM Corporation
    • Framework overview - business rule identification44 © 2009 IBM Corporation
    • Framework overview - business rule identification This attribute defines the distance from the method containing the «Rule» statement45 © 2009 IBM Corporation
    • Framework overview - business rule identification46 © 2009 IBM Corporation
    • Framework overview - business rule identification47 © 2009 IBM Corporation
    • Framework overview - business rule identification48 © 2009 IBM Corporation
    • Framework overview - business rule identification49 © 2009 IBM Corporation
    • Framework overview - business rule identification50 © 2009 IBM Corporation
    • Framework overview - business rule identification51 © 2009 IBM Corporation
    • Framework overview - business rule identification the slicing generates annotations even for the classes outside the business domain52 © 2009 IBM Corporation
    • Framework overview - business rule identification Business rules model extraction: once the slicing operation is over, two options are proposed: 1 - regenerating the application putting as comments the slicing annotations 2 – executing the business rules model extraction, reducing the slicing information just for the classes inside the business domain (green or blue set)53 © 2009 IBM Corporation
    • Framework overview - business rule identification Business rules model extraction: – Input: Domain model and PSM enriched with annotations (PSMA) on all the statements, variable declarations and methods relevant for i – Output:  Business rule model for the variable i – PSMA contains information of classes outside the business domain. The domain model is used to exclude them54 © 2009 IBM Corporation
    • Framework overview - business rule identification Classes related to the variable alive:55 © 2009 IBM Corporation
    • Framework overview - business rule identification Classes outside the domain:56 © 2009 IBM Corporation
    • Framework overview - business rule identification Classes inside the domain:57 © 2009 IBM Corporation
    • Framework overview - business rule identification Intersection with the domain classes:58 © 2009 IBM Corporation
    • Framework overview - business rule identification - metamodel ReachableMethod represents methods annotated as « Reachable » Action represents the statements annotated as « Rule » Structure represents the statements annotated as « Related » following and follower represent the granularity value RelatedVariable represents Variable Declaration annotated as « RELATED- VARIABLE »59 © 2009 IBM Corporation
    • Framework overview - business rule identification - metamodel all the elements of this metamodel are Traces, that means that for each of them we know exactly the relative Java source code element. In this way we implement the traceability of the extracted business rules60 © 2009 IBM Corporation
    • Framework overview 2 kind of representation are provided (text or graph) and for each of them the domain model vocabulary can be used Business rules representation: Business rules representation provides human-understandable artifacts (text and graph) for the extracted BRs. – Input: domain model (optional), business rule model-i – Output: text or graph61 © 2009 IBM Corporation
    • Framework overview text representation without model domain vocabulary information Text:62 © 2009 IBM Corporation
    • Framework overview graph representation with model domain vocabulary information Graph:63 © 2009 IBM Corporation
    • Conclusion & Future work MDE benefits: – Non-intrusive approach – Modular framework – Internal/external representation of BRs – Traceability Test on a real use case: – IBM Rational Programming Patterns :  > 5000 classes, 476 system variables  Variable classification step improved with new heuristics  Optimization of the slicing operation Future works: – Extend the framework to other languages – Identify BRs in the other layers composing an application64 © 2009 IBM Corporation
    • Questions65 © 2009 IBM Corporation