Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automating Program Transformation with srcML and LINQ

Automating Program Transformation with srcML and LINQ

Presentation at FSE 2012 (http://www.sigsoft.org/fse20/).

Vinay Augustine

November 13, 2012
Tweet

More Decks by Vinay Augustine

Other Decks in Programming

Transcript

  1. Overview ƒ ABB Corporate Research ƒ The Problem ƒ The

    Solution ƒ What is srcML? ƒ What is LINQ? ƒ Demonstration ƒ Questions
  2. ABB Corporate Research Industrial Software Systems (ISS) • USA •

    Germany • Switzerland • Poland • Sweden • India • China 7 research centers worldwide Raleigh, NC
  3. Adaptive Maintenance Changes The Problem Month DD, Year | Slide

    5 © ABB Group The Scenario ƒ Long-lived legacy software ƒ Adapt source code for new ƒ Compilers ƒ Libraries ƒ Environments
  4. The Scenario ƒ Long-lived legacy software ƒ Adapt source code

    for new ƒ Compilers ƒ Libraries ƒ Environments Resulting Issues • Time-consuming • Error-prone • Repetitive Adaptive Maintenance Changes The Problem Month DD, Year | Slide 6 © ABB Group
  5. Adaptive Maintenance Changes An Example Month DD, Year | Slide

    7 © ABB Group Source: http://msdn.microsoft.com/en-US/library/vstudio/h4bcz65t(v=vs.80).aspx
  6. Our Solution ƒ Lightweight ƒ Multi-language ƒ Easy to test

    ƒ Fast ƒ Familiar to developers Month DD, Year | Slide 8 © ABB Group srcML (fast!) + LINQ (familiar!)
  7. ƒ What is it? ƒ XML annotation for source code

    ƒ Why do we like it? ƒ Adds structure to source code ƒ Multilanguage ƒ Fast! ƒ Remove it to get original source! What is srcML? (and why do we like it?) Month DD, Year | Slide 9 © ABB Group Source: http://www.sdml.info/projects/srcml/
  8. ƒ Provides SQL-like queries for C# ƒ Extensive IDE support

    in Visual Studio ƒ Natural for developers ƒ Can query XML LINQ Language INtegrated Query
  9. Automate an adaptive maintenance change on real software Wrap all

    uses of “new” with a try/catch block in Demonstration Month DD, Year | Slide 11 © ABB Group Source: http://notepad-plus-plus.org/news/notepad-6.2-release-udl2.html
  10. Demonstration 1. Learn about “new” in srcML 2. Where is

    “new” used? 3. Find all expressions that use “new” 4. Transform all “new” expressions 5. Execute the transform 6. Run the new notepad++.exe Steps Month DD, Year | Slide 12 © ABB Group
  11. Questions? Automated Program Transformation with srcML + LINQ ƒ Fast

    ƒ Multi-language ƒ Easy to test Go to our github page for • more information • the code • and this demonstration http://github.com/abb-iss/SrcML.NET Month DD, Year | Slide 13 © ABB Group