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

001012 - Presentation Goals at OTI

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Yann-Gaël Guéhéneuc Yann-Gaël Guéhéneuc
September 25, 2023
15

001012 - Presentation Goals at OTI

Avatar for Yann-Gaël Guéhéneuc

Yann-Gaël Guéhéneuc

September 25, 2023
Tweet

Transcript

  1. A global view on the problem I Our goal is

    to build an assistant for automatic code transformation I Transform program to improve: – architecture – memory usage – speed – readability
  2. Three+ ways to transform I From code to code I

    From a HLA to another HLA I From code to code through HLA* Code Code’ Code Code’ HLA HLA’ Language Model Code Code’ HLA HLA’ Language Model * Higher level abstracion
  3. From code to code I Refactoring: “ a change made

    to the internal structure of software to make ot easier to understand and cheaper to modify without changing its observable behavior ” [MF99] I This includes: – Use of pre-/post-conditions [WFO92] – Definition of high level refactorings [MÓC00]
  4. From code to code: examples I Low-level refactorings: refactoring[code] Å

    code’ – renameSuperclass – deleteMethod I High-level refactorings: – hierarchyLinearization – convertHierarchyToAggregation
  5. From HLA to HLA I Project UMLAUT [UMLAUT]: “ UMLAUT

    is a framework that facilitates the transformation of UML model. Once the model has been linearized, map, filter and reduce functions can be composed and applied on it. But some problems of semantic remain. ”
  6. From code to code through HLA I Project FAMOOS and

    their FAMIX Model [FAMOOS]: “ the FAMIX model provides for a language-independent representation of object-oriented sources and contains the required information of the reengineering tasks performed [by our present tools]. ”
  7. A narrow view on the problem I So far research

    focuses on refactorings: – What refactorings are interesting? [MF99] – How to prove they don’t change the behaviour of the program? [WFO92, DBR99] – How to compose them? [MÓC00] – How to support them [DR97, JREFACTORY, IJRENAMER, XREFACTORY] I BUT...
  8. A global view on our problem I BUT little has

    been done on detecting the spots where to apply the refactoring I This involves formalizing: – The refactorings – The “bad smells” [BFWFO94, WJB98] – The “refactoring patterns” I AND...
  9. A narrow view on our problem I AND how to

    automatize refactoring? – How to automatically detect spots that should be refactored? [IRM96, MMF99] – What refactorings should be applied? – How to prove the applied refactorings do not change the behavior of the program? – What improvements are expected?
  10. An example I Imagine a tool that: – Takes a

    set of code as input (code or bytecode alike) – Analyzes it – Notices a spot that is badly designed – Applies some refactorings to improve it
  11. Needs I How to do that? – Formalize the input

    at a higher level: HLA – Formalize the refactoring patterns using the same HLA – Match a refactoring pattern with the HLA – Formalize the set of refactorings to apply – Appply the refactorings – Prove they do not change the behaviour of the program
  12. Related works I Design patterns formalization and detection [KB97,OPD99, GARFLC98]

    I Design defect formalization and detection [SGWAEQQY98, WJB98, MMF99] I Static and dynamic analysis [JVRNHJSU92, JH90] I Constraints/Logic programing [JESS]
  13. Some open questions I Questions: – Do refactorings need to

    preserve behaviour or just behaviour within a specified domain? – What HLA should be used [HAAYGG00], AOL [GARFLC98], UML, FAMIX? – How to detect “bad smells” in this HLA?
  14. And some more I Questions: – How to obtain dynamic

    information from the system? – How to formalize creational and behavioural design patterns?
  15. Our interest (in a nutshell) I Our interest: I Three

    directions: – How to detect? – What HLA is needed? – What refactorings, high-leve refactorings and refactoring patterns? Code Code’ HLA HLA’ Language Model
  16. An answer (in a nutshell) Code Meta-model HLA Patterns Refactorings

    Code’ Constraints Static/dynamic analysis Constraints ?
  17. Where are we going so far? I Definition of a

    meta-model for structural patterns with a hint of behaviour [HAAYGG00] I Difference between association, aggregation and composition [YGG00] (plus delegation [GARFLC98]) I Mix refactoring and tests I Use of explicative constraints?
  18. Did you say constraints? I Two possibilities: Code Code’ HLA

    HLA’ Language Model Constraints to detect Constraints or logic programming to express, check transformations...
  19. How come? Some examples... I Constraints to detect: – Express

    a design pattern with constraints – Represent the code as a domain – Apply the constraints on the domain I Constraints to express and to check – Express the transformation with constraints – Express the pre-/post-conditions