MODEL-DRIVEN ENGINEERING (MDE) in Practice

15
MODEL-DRIVEN ENGINEERING in Practice

Transcript of MODEL-DRIVEN ENGINEERING (MDE) in Practice

Page 1: MODEL-DRIVEN ENGINEERING (MDE) in Practice

MODEL-DRIVEN ENGINEERING in Practice

Page 2: MODEL-DRIVEN ENGINEERING (MDE) in Practice

The $800-Million Bombshell (Motivation)

• The following was the code for controlling long-distance phone traffic routing in USA:

• …switch (caseIndex) {case‘A’: route = routeA;

…break;

…case‘M’: route = routeM;

…case‘N’: route = routeN;

…break;

…}

Missing “break” statement!

When this code ran (in 1990), the entire US Northeast lost long-distance phone service

Page 3: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Engineering ModelA reduced representation of some system that highlights the properties of interest from a given viewpoint

Functional ModelModeled system

We don’t see everything at once We use a representation (notation) that is easily understood for

the purpose on hand

Page 4: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Models vs. Systems

Differences due to:• Unique properties of actual

construction materials• Construction methods• Scaling-up effects• Skill sets/technologies• Misunderstandings

Can lead to serious errors and discrepancies in the realization

Page 5: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Characteristics of Useful Models• Abstract

• Emphasize important aspects while removing irrelevant ones

• Understandable• Expressed in a form that is readily understood by

observers• Accurate

• Faithfully represents the modeled system• Predictive

• Can be used to answer questions about the modeled system

• Inexpensive• Much cheaper to construct and study than the

modeled systemTo be useful, engineering models must satisfy all of these characteristics!

Page 6: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Model Transformations• Computation-

independent Model• Uses natural language• Ex: state-chart

diagram

CIM

• Platform-independent Model

• Does not specify any technology

PIM

• Platform-specific Model• Built for a specific

technology• When technology evolves, a

new PSM can be generated rather than rewriting it

PSM

Business Analyst

Architect / Designer

Developer / Tester

Page 7: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Machine Code

Impossible?

The Abstraction Gap• Middleware makes MDA a potential

reality

Level of Abstraction

Generators

1

0..*

security

mortgages

1

0..*

borrower

mortgages

10..*

ownerhouses

House

-value:Money

Person

-ssn:Integer-salary:Money

+getMortgage(sum:Money,security:House):Mortgage

Mortgage

-principal:Money-monthlyPayment:Money-start:Date-end:Date

Machine Code with Operating System

Impractical?Use Operating System facilities

Unlikely?Use Middleware

Practical(ly)Middleware with Framework

Today!

A b

s t r

a c

t i o

n G

a p

Page 8: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Model Execution

X = cos (h + p/2)+ x*5

X = cos (h + p/2)+ x*5

? By formal analysis mathematical methods reliable (theoretically) software is very difficult to

model mathematically!?

X = cos (h + p/2)+ x*5

X = cos (h + p/2)+ x*5

By experimentation (execution) more reliable than inspection direct experience/insight

X = cos (h + p/2)+ x*5

X = cos (h + p/2)+ x*5

? By inspection mental execution unreliable

Page 9: MODEL-DRIVEN ENGINEERING (MDE) in Practice

MDE Prospects• The problem:

• We cannot keep implementing our applications using the programming technologies of the late Fifties’

• The demands on functionality, reliability, dependability, availability, security, and performance demanded of modern software.

• We need to, can do, and have already done better!

• MDE:• Increased levels of abstraction• Open unified standards• Increased levels of automation

Page 10: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Primary Forms of Automation for MDE

• Computer-based validation • Formal methods (qualitative and quantitative)

• Computer-based testing• Automated test generation, setup, and execution

• Computer-based model execution• Particularly execution of abstract and incomplete

models-- when most of the important decisions are made

• Model transformations• Code generation, between PSMs, …

Page 11: MODEL-DRIVEN ENGINEERING (MDE) in Practice

MDE - Case StudyProject Description• A simple web-based J2EE e-commerce system

(Pet Store)• Users can sign into a system and manage their

accounts.• Users can browse a catalogue of pets on the

web site (such as birds, fish or reptiles).• Shopping cart functionality: Users can add

pets to their shopping cart and manage their shopping carts.

• Order functionality: Users can place an order for the contents of their shopping carts.

• Web services. Users can query orders via a web service.

Page 12: MODEL-DRIVEN ENGINEERING (MDE) in Practice

MDE - Case StudyTeams Description• 2 development teams

• Traditional development lifecycle• Model-driven Development style

• 1 senior J2EE architect + 2 experienced J2EE programmers per team

• Each team uses the same HTML, images and database schema.

• MDA team was required to use an MDA tool• Traditional team was required to use leading J2EE IDE• Both teams must use EJB in their code bases• No further constraints

Page 13: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Savings Achieved0% 36% 46% 28% No data

available

Total average savings achieved: 26%

Page 14: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Quantitative Resultsdevelopment hours spent by each team:

Team Original Estimated Hours

Actual Number of Hours

Traditional team 499 507,5

MDA team 422 330

this corresponds to a 35% increase in productivity when using MDA

Page 15: MODEL-DRIVEN ENGINEERING (MDE) in Practice

Thank you!Hussein Alshkhir