A Legacy System Migration and Software Evolution
Total Page:16
File Type:pdf, Size:1020Kb
Die approbierte Originalversion dieser Diplom-/ Masterarbeit ist in der Hauptbibliothek der Tech- nischen Universität Wien aufgestellt und zugänglich. http://www.ub.tuwien.ac.at The approved original version of this diploma or master thesis is available at the main library of the Vienna University of Technology. http://www.ub.tuwien.ac.at/eng A Legacy System Migration and Software Evolution DIPLOMARBEIT zur Erlangung des akademischen Grades Diplom-Ingenieur im Rahmen des Studiums Software Engineering & Internet Computing eingereicht von Andreas Fürnweger Matrikelnummer 0626472 an der Fakultät für Informatik der Technischen Universität Wien Betreuung: Ao.Univ.Prof. DI Mag. Dr. Stefan Biffl Mitwirkung: Dr. DI Mag. MA Martin Auer Wien, 20.04.2017 (Unterschrift Verfasser) (Unterschrift Betreuung) Technische Universität Wien A-1040 Wien Karlsplatz 13 Tel. +43-1-58801-0 www.tuwien.ac.at Erklärung zur Verfassung der Arbeit Andreas Fürnweger Industriestraße 135/1/29, 1220 Wien Hiermit erkläre ich, dass ich diese Arbeit selbständig verfasst habe, dass ich die verwende- ten Quellen und Hilfsmittel vollständig angegeben habe und dass ich die Stellen der Arbeit - einschließlich Tabellen, Karten und Abbildungen -, die anderen Werken oder dem Internet im Wortlaut oder dem Sinn nach entnommen sind, auf jeden Fall unter Angabe der Quelle als Ent- lehnung kenntlich gemacht habe. (Ort, Datum) (Unterschrift Verfasser) i Abstract Software ages. Maintenance costs tend to increase, and modifications to an application make future adaptions more difficult. As the surrounding software components are updated and mod- ernized, static software becomes even more outdated relative to them. As soon as a system notably resists modification and evolution, it becomes legacy software and the stakeholders, such as architects and managers, have to decide whether to preserve or redesign the system. The main research questions are: • What software evolution approaches are feasible and how to evaluate their cost and risk criteria? • How do these criteria affect an actual migration based on a large, real-world software package? The chosen evaluation methods are: • Research software evolution and related topics to identify different evolution approaches, and create a list of software evolution criteria for them. • Apply those criteria to a real-world application to find an appropriate evolution approach; break it down to milestones; implement and evaluate the success of the implementation. The results are: • The evolution can be preservation or migration driven; many offsetting costs/benefits and risk/reward profiles must be considered. • As for real-world instances of migrations, there exist several tools to ease migrations and enable cross-platform application development. A code analysis is a useful way to quan- tify the success of the implementation. This work is the extended version of the paper Software Evolution of Legacy Systems: A Case Study of Soft-Migration [38]. iii Kurzfassung Software altert. Die Wartungskosten steigen tendenziell an und Änderungen an einer Anwen- dung machen zukünftige Anpassungen schwieriger. Wenn Softwarekomponenten im Umfeld aktualisiert und modernisiert werden, wirkt statische Software relativ dazu noch stärker veraltet. Sobald sich die Änderung und Weiterentwicklung eines Systems deutlich erschwert, be- zeichnet man es als Legacy System (Altsystem). Interessengruppen wie Architekten und Mana- ger müssen dann entscheiden, ob das System präserviert oder redesigned werden soll. Die wichtigsten Forschungsfragen sind: • Welche Ansätze zur Software Evolution sind machbar und wie kann man die Kosten- und Risikofaktoren beurteilen? • Wie beeinflussen diese Faktoren eine tatsächliche Migration basierend auf einem umfang- reichen, realen Softwarepaket? Die gewählten Bewertungsverfahren sind: • Software Evolution und verwandte Themengebiete recherchieren, um verschiedene Evo- lutionsansätze herauszuarbeiten; daraus eine Liste an möglichen Software Evolutions Kri- terien erstellen. • Diese Kriterien auf eine reale Softwareanwendung umlegen, um einen passenden Evolu- tionsansatz zu finden; auf Meilensteine herunterbrechen; implementieren und den Erfolg der Implementierung beurteilen. Die Ergebnisse sind: • Die Evolution kann in Richtung Präservierung oder Migration gehen; das Kosten/Nutzen und das Ertrags/Risiko Verhältnis diverser Ansätze muss beachtet werden. • Es gibt viele Werkzeuge, um die Migration von realen Softwareprojekten zu erleichtern und um plattformübergreifende Anwendungen zu entwickeln. Eine Codeanalyse ist ein praktischer Weg, um den Erfolg der Umsetzung zu messen. Diese Diplomarbeit ist die erweiterte Fassung des Papers Software Evolution of Legacy Sys- tems: A Case Study of Soft-Migration [38]. v Contents 1 Introduction 1 1.1 Motivation . 1 1.2 Research Questions . 2 1.3 Actual Migration . 2 1.4 Stakeholders . 3 1.5 Related Work . 4 1.6 Structure of the Work . 5 2 Software Evolution 7 2.1 Software Evolution as Scientific and Engineering Discipline . 7 2.2 Software Aging . 9 2.3 Legacy Systems . 9 2.4 Maintenance . 11 2.5 Software Evolution Approaches . 12 2.6 Software Evolution Criteria . 13 2.7 Soft Migration . 15 3 State of the Art 19 3.1 Portability . 19 3.2 Java . 21 3.3 Web Applications . 23 3.4 Google Web Toolkit (GWT) . 28 3.5 Unified Modeling Language (UML) . 29 3.6 UMLet . 30 3.7 Web Based UML Tools . 34 4 UMLet Evolution Approach 37 4.1 Decision Drivers . 37 4.2 Evaluation of Software Evolution Criteria . 38 4.3 Results of the Evaluation . 39 4.4 Current High-Level Architectural Model . 39 4.5 GridElement Architectural Model . 42 4.6 UMLetino (Web) High-Level Architectural Model . 49 vii 5 Project Modularization 51 5.1 Functions (Facets) as Central Concept . 51 5.2 New Properties Parser . 54 5.3 Platform Independent Drawing API (DrawHandler) . 59 5.4 Platform Independent Basic Classes . 61 5.5 Separate Eclipse Project for Shared Code . 62 5.6 Encapsulation of Element Behavior . 62 5.7 Results . 63 6 Web Version Implementation 67 6.1 Reuse Java Code with GWT . 67 6.2 UI Design Goals . 68 6.3 Application Menu . 68 6.4 Diagram Tab Bar . 71 6.5 Palette and Properties . 72 6.6 Saving and Opening Diagrams . 72 6.7 Importing and Exporting Diagrams . 73 6.8 Clipboard . 76 6.9 Keyboard Shortcuts . 76 6.10 Zoom . 78 6.11 Performance Improvements for HTML5 Canvas . 78 6.12 Major Development Version Snapshots . 79 7 Code Analysis 85 7.1 UMLet Eclipse Projects . 85 7.2 Findbugs Analysis . 86 7.3 Lines of Code . 87 7.4 Project and Package Dependencies . 90 8 Maven Build 99 8.1 Improving Build Structure and Management . 99 8.2 Migration to a Multi-Module Maven Project . 100 8.3 Build Artifacts . 102 8.4 Continuous Integration with Travis . 103 9 Discussion of Results 105 9.1 Research Questions . 105 9.2 Milestones . 107 9.3 Lessons Learned . 108 9.4 Benefits of the New Architecture . 110 9.5 Java Based Core Component . 111 9.6 Current Metrics of Code Reuse . 112 9.7 Conclusion . 113 viii 10 Future Work 115 10.1 General Improvements . 115 10.2 UMLet Standalone and Eclipse Plugin . 117 10.3 UMLetino (Web) Future . 118 A UMLet Terminology 125 Bibliography 127 ix CHAPTER 1 Introduction 1.1 Motivation Software development is still a fast-changing environment, driven by new and evolving hard- ware, operating systems, frameworks, programming languages, and user interfaces. While this seemingly constant drive for modernization offers many benefits, it also requires dealing with legacy software that—while working—slowly falls out of step with the surrounding components that are being updated—for example, if a certain version of an operating system is no longer sup- ported by its vendor. There are various ways to handle such “aging” software: one can try to keep it up and running; to carefully refactor it to various degrees to make it blend in better; to port its code; to rewrite it from scratch; etc. The main stakeholders in deciding on a course of action are managers, which must allocate resources to and consider the risks and maintenance cost profiles of the various options (e.g., will affordable developers with specific skills still be available?), as well as software developers, which should be aware of the long-term implications of their choices (e.g., will a certain programming language be around in five years’ time?). To provide some software evolution guidelines, this thesis gives an overview of the state of the art of software evolution, as well as maintenance, reengineering, and whether to preserve or redesign legacy systems. It looks into different aspects of software maintenance and shows that the classic meaning of maintenance as some final development phase after software delivery is outdated. Instead, it is best seen as an ongoing effort. Then costs and benefits of various evolution approaches are outlined. These approaches are either legacy-based, essentially trying to preserve as much as possible of the existing system, or migration-based, where the software is transferred, to various degrees, into a new setup. After that, so-called “soft” migration approaches are discussed. Those approaches aim to fa- cilitate traditional migration methods like porting or rewriting code via support tools and frame- works. 1 Special focus is given to the Java programming language and a specific variant of a soft- migration approach is presented, which is using a Java-based program core with several platform- specific branches. The approach is explained in detail, starting with its scope, the basic idea, a step by step execution, and a description of tools that can greatly facilitate the migration effort. Finally, a case study of an actual soft migration is described and the benefits and drawbacks of the suggested approach are discussed. The results are also published in the paper Software Evolution of Legacy Systems: A Case Study of Soft-Migration [38]. 1.2 Research Questions The two main research questions of this thesis are: • (R1) What software evolution approaches are feasible and how to evaluate their cost and risk criteria? R1 is addressed by a comprehensive literature study in the scientific fields of software evolu- tion and maintenance.