1 / 12

Challenges of Model-Driven Evolution of Legacy Software

Previous support by DARPA/IXO PCES. Current funding from NSF CAREER. Challenges of Model-Driven Evolution of Legacy Software. Jeff Gray UAB – CIS Department. Dagstuhl MECS August 2008. With slide contributions from Suman Roychoudhury, Ritu Arora, Purushotham Bangalore. Metamodel 0.

loman
Download Presentation

Challenges of Model-Driven Evolution of Legacy Software

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Previous support by DARPA/IXO PCES. Current funding from NSF CAREER. Challenges of Model-Driven Evolution of Legacy Software Jeff Gray UAB – CIS Department Dagstuhl MECS August 2008 With slide contributions from Suman Roychoudhury, Ritu Arora, Purushotham Bangalore

  2. Metamodel0 Metamodel1 Metamodeln …… Based on Define Define Define ∆M 1 ∆I n ∆MM n ∆M n ∆I 2 ∆M 2 ∆I 1 ∆MM 2 ∆MM 1 …… Modeln Model1 Model0 Interpret Interpret Interpret Legacy Source0 Legacy Source1 Legacy Sourcen …… Evolution of legacy models and code ∆MM: The changes made to the meta-models ∆M: The changes reflected in the domain models ∆I: The changes reflected in the legacy source What about other artifacts of the modeling process during metamodel evolution? Interpreters, constraints, model transformations…

  3. 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<BM__ClosedComponent*>::iterator devIter = devices_.begin(); std::vector<BM__ClosedComponent*>::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(); } } PushPullComponentImpl::Update (const UUEventSet& events) { BM__ComponentInstrumentation::EventConsumer(GetId(), "Update", events); unsigned int tempData1 = GetId().GetGroupId(); unsigned int tempData2 = GetId().GetItemId(); std::vector<BM__ClosedComponent*>::iterator devIter = devices_.begin(); std::vector<BM__ClosedComponent*>::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; data1_ = tempData1; data2_ = tempData2; } The Parser Construction Problem • Problem: Constructing a complete parser and integrating it into an MDE solution is a strong challenge • Proposed Solution: Model-Driven Program Transformation ∆ ∆ ∆ ∆

  4. 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<BM__ClosedComponent*>::iterator devIter = devices_.begin(); std::vector<BM__ClosedComponent*>::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_); } 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<BM__ClosedComponent*>::iterator devIter = devices_.begin(); std::vector<BM__ClosedComponent*>::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; } Model-Driven Program Transformation • Model weaving to explore design alternatives more rapidly • Design decisions crosscut model hierarchy • Difficult to change models to new configuration • Design decisions captured as higher level policy strategies and weaved into models • Model driven program transformation • Ensures causal connection between model changes and represented source code of legacy system • Assists in legacy evolution from new properties specified in models • Model interpreters generate transformation rules to modify source • Experimentation:Boeing’s Bold Stroke Application • Apply original Bold Stroke C++ source code and generated transformation rules to DMS; result is a transformed version of Bold Stroke that is consistent with the model specification 1 //show("Data fields exist. Add two concurrency atoms."); //add the first concurrency atom concurrencyAtom1 := addAtom("Concurrency", "InternalLock"); concurrencyAtom1.setAttribute("Enable", "1");// "1" is true, "0" is false concurrencyAtom1.setAttribute("LockType", "Thread Mutex"); concurrencyAtom1.setAttribute("LockStrategy", "Internal Locking"); //add the second concurrency atom concurrencyAtom2 := addAtom("Concurrency", "ExternalLock"); concurrencyAtom2.setAttribute("Enable", "1");// "1" is true, "0" is false concurrencyAtom2.setAttribute("LockType", "Thread Mutex"); concurrencyAtom2.setAttribute("LockStrategy", "External Locking"); Model Transformation GME Model 2 Weaved Model DMS Xform Rules 3 Transformed C++ Code Base C++ Source Code

  5. Case Study:Bold Stroke Product Line • Background Context • Mission-control software for Boeing military aircraft under development since 1995 (F-15/F-18) • CORBA event-based systems • Thousands of components implemented in over 4 million lines of C++ code • Key Challenges • Difficult to evolve the underlying source representation to address new requirements; impossible to determine, a priori, all of the future adaptation requests • Difficult to migrate the source representation to newer component models

  6. Example: C-SAW Assertion Strategy void BM__ClosedEDComponent:: Update(const UUEventSet& events) { assert(data1_>200); // <- Precondition BM_CompInstrumentation:: EventConsumer(GetId(), "Update", events); unsigned int tempData1 = GetId().GetGroupId(); unsigned int tempData2 = GetId().GetItemId(); //* REMOVED code for Real-time Event Channel //* REMOVED actual variable names (proprietary) data1_ = tempData1; data2_ = tempData2; assert(data1_<500); // <- Postcondition } default base domain Cpp~VisualCpp6. pattern assertStmt() : statement = "assert(data1_>200);". pattern aspect(s:statement_seq): statement_seq = " \assertStmt\(\){ \s }". pattern joinpoint(id:identifier): qualified_id = "\id :: Update". rule precondition(ret:decl_specifier_seq, id:identifier, p:parameter_declaration_clause, s:statement_seq): function_definition -> function_definition = "\ret \joinpoint \(\id\)(\p){\s}" -> "\ret \joinpoint \(\id\)(\p){\aspect\(\s\)}" if ~[modsList:statement_seq .s matches "\:statement_seq \apect\(\modsList\)"]. public ruleset applyrules = { precondition }.

  7. Video Demonstration:C-SAW and Model-Driven Program Transformation Evolving a black-box data recorder… http://www.cis.uab.edu/gray/Research/C-SAW/video-demo.htm

  8. Challenges using PT Engines • The rewrite rules used to modify base programs are difficult to compose, which makes it accessible to only language researchers (accidental complexities) • The transformation rules are generally hard to comprehend by average software developers (need to know about the grammar and semantics of the underlying PTE) • The transformation rules are tied to the grammar of the base language Moreover…. • The entire evolution process is rendered unusable if the base transformation engine is replaced with another one (interoperability problem)

  9. Raising the Level of Abstraction of Parallel Programming Backend DSL Code (Computations) DSL Code (Architecture- Specification) AMMA Toolkit Repository of Design Templates And Code Constructs End User Domain-Specific Model Parallel Application Wizard-Driven DSL Specifications ATL Transformation Application- Specific Code Constructs Rule-Specification Language Model Generative Programming RSL Rules Program Transformation Engine Existing Sequential Application Backend From Ritu Arora and Puri Bangalore

  10. Evolution Megamodel Model-Driven Engineering (MDE) Technical Space (TS) Grammarware TS Grammarware TS M3 EBNF EBNF KM3 Aspect.gGrammar Aspect Metamodel RSL Metamodel RSL.g Grammar M2 Myaspect.ap AspectPascal Myaspect Model MyRsl Model MyRsl.rsl RSL program M1 Extraction Injection Aspect2RSL Transformation M1 = model level; M2 = metamodel level; M3 = meta-metamodel level From Suman Roychoudhury

  11. GenAWeave in Action Input Source Program C4 C1 Generic Aspect Metamodel Parser definitions Lexer/ Parser C2 Symbol Table C3 C4 C3 AST Graph C2 Generic Model Transform Library Aspect Source Metamodel RSL Metamodel Domain Reader Analyzer C1 Unparser definitions Transformed Target Program Pretty Printer Aspect Source Model RSL Model Aspect Source Program Concrete RSL Transform C3 C3 DMS Program Transformation Engine ATL Model Transformation Engine C2 C1 Program Transformation Back-End Model-Driven Front-End From Suman Roychoudhury

  12. SoftCom Research Lab http://www.cis.uab.edu/softcom Questions? Related Web Pages C-SAW http://www.cis.uab.edu/Research/C-SAW/Contains papers, downloads, video demos

More Related