Clean Legacy Code

5 downloads 2041 Views 24MB Size Report
Clean Legacy Code. Lars Martin, Ringvorlesung , 04.11.2013 ... Clean Legacy Code. Horseshoe-Model. PIM. PSM. PSM'. PIM'. Code'. Code. Fo re w ard. E n g.
Clean Legacy Code Lars Martin, Ringvorlesung , 04.11.2013

Clean Legacy Code

Who am I?

§  Developer, Architect, Consultant §  Java Enterprise, Eclipse, Continuous … §  Entrepreneur, Company founded in 1998

Clean Legacy Code

Agenda + introduction into model based software modernization approaches + introduction of Eclipse based tooling − full migration of legacy systems “Make sure you know what the code does before you attempt any modifications, don't just jump in.”

Clean Legacy Code

Motivation

§  legacy system §  heavy database access §  ORM è java.sql.* §  new team ©  Katharina  Bregulla  /  pixelio.de  

Clean Legacy Code

Motivation

§  Raising Questions Ø  which tables will be accessed? Ø  will other tables (modules) be accessed? Ø  if yes, migrated already?

Ø  automation possible? ©  Katharina  Bregulla  /  pixelio.de  

Clean Legacy Code

Software Aging

Clean Legacy Code

Software Aging

Legacy: •  outdated, not necessarily old •  obsolete methods and technologies •  used in critical area of operations after 5 years Software becomes legacy

Clean Legay Code

Software Evolution

Clean Legacy Code

Software Evolution (2)

Clean Legacy Code

Horseshoe-Model Re-Engineering PIM Architecture Transformation

PSM’

Code’

PSM

Code

Foreward Engineering (MDA)

Reverse Engineering (ADM)

PIM’

Reverse engineering: ”… is the process of analyzing a software system to create representations of the system at a higher level of abstraction.” Re-Engineering: “... is the analysis and modification of a software system to change its form and implement it in its new form.” (Forward) Engineering: “… is the way of designing systems, starting from abstract logical and implementation independent specification to gradually lead to the implementation of a physical system. ©  unknown  

Towards Clean Legacy Code

Tools •  Grep, AWK, Shell Scripts, … •  Debugger, … •  Decompiler, … •  CASE Tools, … •  JaMoPP, Snoop, Moose, MoDisco, …

Towards Clean Legacy Code

MoDisco - Concepts Documentation Impact Analysis

Source Code

Models Viewpoints

Databases

Restruct. Code Migrated Code

Configuration Files

MoDisco ..other

Eclipse Modeling

Metrics Norm checking

Towards Clean Legacy Code

MoDisco - Modernization Phases

Existing Artifacts

Software Artifacts •  Source Code •  Configuration •  Tests •  Database •  …

Discover

Models

Understand

Transform

Viewpoints

New Artifacts

Towards Clean Legacy Code

Practical Session (1/2)

Towards Clean Legacy Code

Practical Session

JUnit4 é JUnit3

©  Katharina  Wieland  Mülle  /  pixelio.de  

Towards Clean Legacy Code java.ecore customizes

conforms to

extends

Java EMF Model JUnit3 Facet

JUnit3 Customization

uses

JUnit3 Queries

uses

Towards Clean Legacy Code

Practical Session (2/2)

Towards Clean Legacy Code

Practical Session

Abstract Factory, Adapter, Bridge, Builder, …, Singleton, …, Visitor ©  kiramain  /  pixelio.de  

Towards Clean Legacy Code

Conclusion ü  Customizability o  Metamodels o  M2M, M2T ü  Extensive o  Discoverer o  Queries ü  Workflow ü  DSL (Xtext, …)

ü  (Focus on Java) ü  Entry barriers ü  Toolset

©  Gerd  Altmann  /  pixelio.de  

Towards Clean Legacy Code

Outlook ü  Metrics on software maintainability o  bugs / commits per time unit o  committer per time unit o  … ü  Identification of variants within branches o  modularization o  … ü  Sync domain model DB ©  Mario  De  Ma>a  /  pixelio.de  

©  Gerd  Altmann  /  pixelio.de  

Master Thesis / Abschlussarbeit – Software Engineering Aufgabengebiet: •  Entwicklung von Methoden zur Informationsgewinnung •  Implementierung der Methoden mittels Eclipse basierter Technologien Studienbereiche: •  Informatik und -Informatik

©  Willi  Heidelbach  /  pixelio.de  

Dipl.-Inf. Lars Martin +49-(0)173-64 24 461 [email protected]

SMB GmbH – Plauenscher Ring 21 – D-01187 Dresden