Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Legacy System Evolution through Model-Driven Program Transformation Funded by the DARPA Information Exploitation Office (DARPA/IXO), under the Program.

Similar presentations


Presentation on theme: "1 Legacy System Evolution through Model-Driven Program Transformation Funded by the DARPA Information Exploitation Office (DARPA/IXO), under the Program."— Presentation transcript:

1 1 Legacy System Evolution through Model-Driven Program Transformation Funded by the DARPA Information Exploitation Office (DARPA/IXO), under the Program Composition for Embedded Systems (PCES) program Jing Zhang and Jeff Gray {zhangj, gray} @ cis.uab.edu http://www.cis.uab.edu/zhangj http://www.cis.uab.edu/gray

2 2 Contents Motivation & Challenges Overview of Model-Driven Program Transformation (MDPT) Case Study and Demo Conclusions & Future work

3 3 Two-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 ComputePosition C++ ComputePosition with Locking C++ NavDisplay C++ Vertical transformation needed!!!

4 4 Legacy Source Legacy Models Legacy Models’ Meta-model Defines Legacy Source’ Defines Describe ∆M∆M ∆S∆S The evolution of the legacy system in terms of models and source code ∆ M : The changes made to the legacy models ∆ S : The changes reflected in the legacy source

5 5 Code 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

6 Supporting Technologies: The DMS "Software Reengineering Toolkit" Lexer/ Parser Domain Definition Transformation Engine Transforms Analyzers Procedures Unparser definitions Parser Definition Source Files (Domain Notation) AST (Graph) Language Descriptions Viewer Unparser Revised Source Files Debug Text Attribute Evaluator Sequencing; Transforms Symbol Table Declarations Reader AST (Graph) Analysis + Transform Descriptions = Tool definition Coded in PARLANSE Slide borrowed with permission from Semantic Designs (www.semdesigns.com)

7 7 Supporting Technologies: Model-Integrated Computing (MIC) Generic Modeling Environment (GME) Embedded Systems Modeling Language (ESML) Model Interpretatio n Model Interpreters Models Modeling Environment Application Domain App 1 App 2 App 3 Application Evolution Environment Evolution Meta-Level Translation Metaprogramming Interface Formal Specifications Model Builder

8 8 Legacy System: Bold 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

9 9 Model-Driven Program Transformation (MDPT) DMS Transformation Rules Interpreter Updated ESML models Common/Project Library of BoldStroke C++ Source Code void BM__PushPullComponentImpl::Update (const UUEventSet& events) { BM__ComponentInstrumentation::EventConsumer(GetId(), "Update", events); unsigned int tempData1 = GetId().GetGroupId(); unsigned int tempData2 = GetId().GetItemId(); std::vector ::iterator devIter = devices_.begin(); std::vector ::iterator endIter = devices_.end(); for (; devIter != endIter; ++devIter) { BM__ClosedComponent* component = *devIter; const UUIdentifier& id = component->GetId(); if (idInEventSet(id, events)) { const BM__ClosedFunctionalFacet& facet = component->ProvideClosedFunctionalFacet(); BM__ComponentInstrumentation::SendDirectCall(GetId(), "Update", component->GetId(), "GetData1"); tempData1 += facet.GetData1(); BM__ComponentInstrumentation::SendDirectCall(GetId(), "Update", component->GetId(), "GetData2"); tempData2 += facet.GetData2(); } } data1_ = tempData1; data2_ = tempData2; } Transformed BoldStroke C++ Code void BM__PushPullComponentImpl::Update (const UUEventSet& events) { UM__GUARD_EXTERNAL_REGION(GetExternalPushLock()); BM__ComponentInstrumentation::EventConsumer(GetId(), "Update", events); unsigned int tempData1 = GetId().GetGroupId(); unsigned int tempData2 = GetId().GetItemId(); std::vector ::iterator devIter = devices_.begin(); std::vector ::iterator endIter = devices_.end(); for (; devIter != endIter; ++devIter) { BM__ClosedComponent* component = *devIter; const UUIdentifier& id = component->GetId(); if (idInEventSet(id, events)) { const BM__ClosedFunctionalFacet& facet = component->ProvideClosedFunctionalFacet(); BM__ComponentInstrumentation::SendDirectCall(GetId(), "Update", component->GetId(), "GetData1"); tempData1 += facet.GetData1(); BM__ComponentInstrumentation::SendDirectCall(GetId(), "Update", component->GetId(), "GetData2"); tempData2 += facet.GetData2(); } } UM__GUARD_INTERNAL_REGION; log.add(“data1_=”+data1_); data1_ = tempData1; data2_ = tempData2; log.add(“data2_=”+data2_); }

10 10 Benefits 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

11 11 Case Study : a black box data recorder default base domain Cpp~VisualCpp6. pattern LogStmt() : statement = "log.add(\"data1_=\" + data1_); ". pattern LogOnMethodAspect(s:statement_seq): statement_seq = " { \s } \LogStmt\(\) ". pattern Update(id:identifier): qualified_id = "\id :: Update". rule log_on_Update(ret:decl_specifier_seq, id:identifier, p:parameter_declaration_clause, s: statement_seq): function_definition -> function_definition = "\ret \Update\(\id\) (\p) { \s } " -> "\ret \Update\(\id\) (\p) { \LogOnMethodAspect\(\s\) }" if ~[modsList:statement_seq.s matches "\:statement_seq \LogOnMethodAspect\(\modsList\)"]. rule log_on_Update_cv(ret:decl_specifier_seq, id:identifier, p:parameter_declaration_clause, s: statement_seq, cv: cv_qualifier_seq): function_definition - > function_definition = "\ret \Update\(\id\) (\p) \cv { \s } " -> "\ret \Update\(\id\) (\p) \cv { \LogOnMethodAspect\(\s\) }" if ~[modsList:statement_seq.s matches "\:statement_seq \LogOnMethodAspect\(\modsList\)"]. pattern getData1_(id:identifier): qualified_id = "\id :: getData1_". rule log_on_getData1_(ret:decl_specifier_seq, id:identifier, p:parameter_declaration_clause, s: statement_seq): function_definition -> function_definition = "\ret \getData1_\(\id\) (\p) { \s } " -> "\ret \getData1_\(\id\) (\p) { \LogOnMethodAspect\(\s\) }" if ~[modsList:statement_seq.s matches "\:statement_seq \LogOnMethodAspect\(\modsList\)"]. rule log_on_getData1__cv(ret:decl_specifier_seq, id:identifier, p:parameter_declaration_clause, s: statement_seq, cv: cv_qualifier_seq): function_definition - > function_definition = "\ret \getData1_\(\id\) (\p) \cv { \s } " -> "\ret \getData1_\(\id\) (\p) \cv { \LogOnMethodAspect\(\s\) }" if ~[modsList:statement_seq.s matches "\:statement_seq \LogOnMethodAspect\(\modsList\)"]. public ruleset applyrules = { log_on_Update, log_on_Update_cv, log_on_getData1_, log_on_getData1__cv }.

12 12 Transformed code fragment 1 unsigned int BM__ClosedEDComponentImpl::getData1_ () const 2 { 3 4 5 UM__GUARD_INTERNAL_REGION; 6 BM__ComponentInstrumentation::ReceiveDirectCall(GetId(), "GetData1"); 7 8 9 return data1_; 10 } 11 12 void BM__ClosedEDComponentImpl::Update (const UUEventSet& events) 13 { 14 15 16 UM__GUARD_EXTERNAL_REGION(GetExternalPushLock()); 17 BM__ComponentInstrumentation::EventConsumer(GetId(), "Update", events); 18 unsigned int tempData1 = GetId().GetGroupId(); 19 unsigned int tempData2 = GetId().GetItemId(); 20 21 //*** REMOVED: code for implementing Real-time Event Channel 22 23 24 data1_ = tempData1; //*** REMOVED: actual variable names (proprietary) 25 data2_ = tempData2; 26 } Addlog("data1_=" + data1_); Log on getData1_() method entry Log on reading data1_ Log on Update() method entry Log on writing data1_

13 13 Video DEMO Case study: a black box data recorder Constraint-Specification Aspect Weaver (C-SAW) is utilized to weave the "LogOnWrite" strategy across multiple components

14 14 Generalization of the control flow for the MDPT process

15 15 Conclusion 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/

16 16 Future 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

17 17


Download ppt "1 Legacy System Evolution through Model-Driven Program Transformation Funded by the DARPA Information Exploitation Office (DARPA/IXO), under the Program."

Similar presentations


Ads by Google