Title: Legacy System Evolution through ModelDriven Program Transformation
1Legacy System Evolution through Model-Driven
Program Transformation
- Jing Zhang and Jeff Grayzhangj, gray _at_
cis.uab.edu - http//www.cis.uab.edu/zhangj
- http//www.cis.uab.edu/gray
2Contents
- Motivation Challenges
- Overview of Model-Driven Program Transformation
(MDPT) - Case Study and Demo
- Conclusions Future work
3Two-Dimensions of Transformation/Translation
- Horizontal transformation
- Transformation within the same level of
abstraction - E.g., Model transformation, code refactoring
- Vertical translation
- Translation, or synthesis, between layers of
abstraction - E.g., MIC interpreters, reverse engineering
Vertical transformation needed!!!
4The evolution of the legacy system in terms of
models and source code
5Code Transformation from Models
- Goal Maintain the fidelity between the mapping
of the model properties and the legacy source
code - Challenges Parsing and invasively transforming
legacy source code from higher-level models - Solution Model-Driven Program Transformation
(MDPT) - Based on the unification of a mature program
transformation system with a meta-modeling
environment
6Supporting TechnologiesThe DMS "Software
Reengineering Toolkit"
Symbol Table
AST (Graph)
Source Files (Domain Notation)
Revised Source Files
Lexer/Parser
Declarations
Unparser
AST (Graph)
Attribute Evaluator
Analyzers
Parser Definition
Debug Text
Transforms
Domain
Transformation
Viewer
Definition
Engine
Reader
Procedures
Sequencing Transforms
Language Descriptions
Unparser definitions
Analysis Transform Descriptions Tool
definition
Coded in PARLANSE
Slide borrowed with permission from Semantic
Designs (www.semdesigns.com)
7Supporting TechnologiesModel-Integrated
Computing (MIC)
- Generic Modeling Environment (GME)
- Embedded Systems Modeling Language (ESML)
8Legacy SystemBold Stroke Product Line
- Mission-control software for Boeing military
aircraft, e.g., F-18 E/F, Harrier, UCAV - CORBA event-based systems
- Thousands of components implemented in over a
million lines of C code
9Model-Driven Program Transformation (MDPT)
UpdatedESML models
Interpreter
DMS Transformation Rules
TransformedBoldStroke C Code
10Benefits
- Ensures causal connection between model changes
and the underlying source code of the legacy
system - Assists in legacy evolution from new properties
specified in models - Model interpreters generate transformation rules
to modify source
11Case Study a black box data recorder
default base domain CppVisualCpp6. pattern
LogStmt() statement "log.add(\"data1_\"
data1_) ". pattern LogOnMethodAspect(sstateme
nt_seq) statement_seq " \s \LogStmt\(\) ".
pattern Update(ididentifier) qualified_id
"\id Update". rule log_on_Update(retdecl_sp
ecifier_seq, ididentifier, pparameter_declaratio
n_clause, s statement_seq) function_definition
-gt function_definition "\ret
\Update\(\id\) (\p) \s " -gt "\ret
\Update\(\id\) (\p) \LogOnMethodAspect\(\s\) "
if modsListstatement_seq .s matches
"\statement_seq \LogOnMethodAspect\(\modsList\)"
. rule log_on_Update_cv(retdecl_specifier_seq,
ididentifier, pparameter_declaration_clause,
s statement_seq, cv cv_qualifier_seq)
function_definition -gt function_definition
"\ret \Update\(\id\) (\p) \cv \s " -gt "\ret
\Update\(\id\) (\p) \cv \LogOnMethodAspect\(\s\)
" if modsListstatement_seq .s matches
"\statement_seq \LogOnMethodAspect\(\modsList\)"
. pattern getData1_(ididentifier)
qualified_id "\id getData1_". rule
log_on_getData1_(retdecl_specifier_seq,
ididentifier, pparameter_declaration_clause, s
statement_seq) function_definition -gt
function_definition "\ret
\getData1_\(\id\) (\p) \s " -gt "\ret
\getData1_\(\id\) (\p) \LogOnMethodAspect\(\s\)
" if modsListstatement_seq .s matches
"\statement_seq \LogOnMethodAspect\(\modsList\)"
. rule log_on_getData1__cv(retdecl_specifier_s
eq, ididentifier, pparameter_declaration_clause,
s statement_seq, cv cv_qualifier_seq)
function_definition -gt function_definition
"\ret \getData1_\(\id\) (\p) \cv \s " -gt
"\ret \getData1_\(\id\) (\p) \cv
\LogOnMethodAspect\(\s\) " if
modsListstatement_seq .s matches
"\statement_seq \LogOnMethodAspect\(\modsList\)"
. public ruleset applyrules log_on_Update,
log_on_Update_cv, log_on_getData1_,
log_on_getData1__cv .
12Transformed code fragment
Addlog("data1_" data1_)
Addlog("data1_" data1_)
Addlog("data1_" data1_)
Addlog("data1_" data1_)
13Video DEMO
- Case study a black box data recorder
- Constraint-Specification Aspect Weaver (C-SAW) is
utilized to weave the "LogOnWrite" strategy
across multiple components
14Generalization of the control flow for the MDPT
process
15Conclusion
- The model-driven program transformation technique
is a novel approach for transforming large legacy
systems from domain-specific models. - It provides widespread adaptations across
multiple source files according to the evolving
model features.
http//www.gray-area.org/Research/C-SAW/
16Future Work
- Support other concerns (e.g. QoS) for
transforming Bold Stroke - Generalization of the process for supporting
legacy system evolution using MDPT - Experimental evaluation
- Productivity
- Correctness
17Thank you !!!
Questions?