Analysis and Transformation of Configurable Systems

Total Page:16

File Type:pdf, Size:1020Kb

Analysis and Transformation of Configurable Systems Analysis and Transformation of Configurable Systems Jörg Liebig 2015-04-30 Eingereicht an der Fakultät für Informatik und Mathematik der Universität Passau als Dissertation zur Erlangung des Grades eines Doktors der Naturwissenschaften Submitted to the Department of Informatics and Mathematics of the University of Passau in Partial Fulfillment of Obtaining the Degree of a Doctor in the Domain of Science Betreuer / Advisors: Prof. Dr.-Ing. Sven Apel University of Passau, Germany Prof. Christian Lengauer, Ph.D. University of Passau, Germany Externer Gutachter / External Examiner: Prof. Dr. Paul Grünbacher University of Linz, Austria Abstract Static analysis tools and transformation engines for source code belong to the standard equip- ment of a software developer. Their use simplifies a developer’s everyday work of maintaining and evolving software systems significantly and, hence, accounts for much of a developer’s programming efficiency and programming productivity. This is also beneficial from a financial point of view, as programming errors are early detected and avoided in the the development process, thus the use of static analysis tools reduces the overall software-development costs considerably. In practice, software systems are often developed as configurable systems to account for different requirements of application scenarios and use cases. To implement configurable systems, developers often use compile-time implementation techniques, such as preprocessors, by using #ifdef directives. Configuration options control the inclusion and exclusion of #ifdef-annotated source code and their selection/deselection serve as an input for generating tailor-made system variants on demand. Existing configurable systems, such as the LINUX kernel, often provide thousands of configuration options, forming a huge configuration space with billions of system variants. Unfortunately, existing tool support cannot handle the myriads of system variants that can typically be derived from a configurable system. Analysis and transformation tools are not prepared for variability in source code, and, hence, they may process it incorrectly with the result of an incomplete and often broken tool support. We challenge the way configurable systems are analyzed and transformed by introducing variability-aware static analysis tools and a variability-aware transformation engine for config- urable systems’ development. The main idea of such tool support is to exploit commonalities between system variants, reducing the effort of analyzing and transforming a configurable system. In particular, we develop novel analysis approaches for analyzing the myriads of system variants and compare them to state-of-the-art analysis approaches (namely sampling). The comparison shows that variability-aware analysis is complete (with respect to covering the whole configuration space), efficient (it outperforms some of the sampling heuristics), and scales even to large software systems. We demonstrate that variability-aware analysis is even practical when using it with non-trivial case studies, such as the LINUX kernel. On top of variability-aware analysis, we develop a transformation engine for C, which respects variability induced by the preprocessor. The engine provides three common refac- torings (rename identifier, extract function, and inline function) and overcomes shortcomings (completeness, use of heuristics, and scalability issues) of existing engines, while still being semantics-preserving with respect to all variants and being fast, providing an instantaneous user experience. To validate semantics preservation, we extend a standard testing approach for i refactoring engines with variability and show in real-world case studies the effectiveness and scalability of our engine. In the end, our analysis and transformation techniques show that configurable systems can efficiently be analyzed and transformed (even for large-scale systems), providing the same guarantees for configurable systems as for standard systems in terms of detecting and avoiding programming errors. ii Acknowledgements Pursuing a Ph.D. in computer science is a long and difficult endeavor during which the Ph.D. student is faced with many challenging tasks. Luckily, I could rely on the support of many persons when solving them. First, I would like to thank Sven Apel. After having gotten my diploma from the University of Magdeburg, Sven invited me to Passau and encouraged me to start a Ph.D. Working with Sven was a great pleasure for me because his dedication and enthusiasm to scientific work is contagious and provides a great source of inspiration. During many discussions he helped me to understand the big picture of my work, fostered my way of scientific writing, and directed me towards interesting research questions. To me, Sven is a scientist’s best role model. Second, I’m grateful for the support of Christian Lengauer. Despite the fact that Christian’s research group focuses on a different aspect of programming, he has always given me the freedom to follow my own research direction and has supported me unconditionally in financial and organizational aspects. Coming to Passau and working at his group was a big step for me. But I soon realized that Passau was not only a place to work, but also a place to live and I have always felt welcome. In this context I would like to particularly thank Eva Reichhart. Furthermore, I would like to thank many colleagues and students for their collaboration, for discussions, and for their support regarding different aspects of this thesis: Jens Dörre, Florian Garbe, Armin Größlinger, Claus Hunsen, Andreas Janker, Christian Kästner, Sergiy Kolesnikov, Olaf Leßenich, Christopher Resch, Wolfgang Scholz, Sandro Schulze, Janet Siegmund, Norbert Siegmund, Andreas Simbürger, Reinhard Tartler, and Alexander von Rhein. In particular, I’m grateful to have met Christian Kästner. Christian has been a constant source of support and I highly value his feedback. By challenging my research work down to its foundations, Christian helped me to improve it in a way I could have never imagined. Last but not least, I have to thank Elke, my wife, and my family for their continuous support and love that helped through hard times of my thesis. iii Contents List of Figures vii List of Tables ix List of Acronyms xi 1 Introduction 1 1.1 Contributions . 3 1.2 Outline . 5 2 Background 7 2.1 Software Product Lines and Configurable Software Systems . 7 2.1.1 Configuration Knowledge . 9 2.1.2 Implementing Configurable Systems . 15 2.2 Static Analysis . 18 2.3 Refactoring . 21 3 Understanding Preprocessor Annotations 25 3.1 Methodology . 26 3.1.1 Goals . 26 3.1.2 Questions . 30 3.1.3 Metrics . 34 3.2 Analysis . 39 3.3 Interpretation and Discussion . 42 3.3.1 Answering the Research Questions . 42 3.3.2 Threats to Validity . 52 3.4 Related Work . 54 3.5 Summary . 58 4 Analyzing C Code with Preprocessor Annotations 61 4.1 Sampling-based Analysis and Variability-aware Analysis . 62 4.1.1 Sampling-based Analysis . 62 4.1.2 Variability-aware Analysis . 66 4.2 Analysis Time . 72 4.2.1 Empirical Study . 73 v Contents 4.3 Upfront Investment . 81 4.3.1 Experience with Sampling . 82 4.3.2 Patterns of Variability-aware Analyses . 85 4.3.3 Variability-aware Intra-procedural Data-flow Framework . 86 4.4 Error Detection . 89 4.4.1 Evaluation . 90 4.4.2 Experiment Setup . 94 4.4.3 Results and Discussion . 95 4.5 Perspectives . 96 4.6 Related Work . 97 4.7 Summary . 102 5 Refactoring C Code with #ifdefs 105 5.1 State of the Art . 106 5.2 Variability-aware Refactorings with Morpheus . 110 5.2.1 Specification of Refactorings . 110 5.3 Experiments . 116 5.3.1 Subject Systems . 116 5.3.2 Experiment Setup . 117 5.3.3 Performance Results . 118 5.3.4 Testing the Refactoring Engine . 118 5.3.5 Perspectives of Variability-aware Refactoring . 120 5.3.6 Threats to Validity . 121 5.4 Related Work . 122 5.5 Summary . 124 6 Conclusion and Future Work 125 Bibliography 129 vi List of Figures 2.1 Compile-time configuration in LINUX; adapted from Tartler [2013]. 11 2.2 Definition of HOTPLUG_CPU with KCONFIG in LINUX [Tartler, 2013]. 11 2.3 Examples of configuration-knowledge use in MAKEFILEs in BUSYBOX. 12 2.4 Excerpt of the operating-system configuration with CPP in SQLITE. 13 2.5 Propositional formulae for the configuration knowledge presented in Fig- ures 2.2, 2.3, and 2.4. 14 2.6 Example of configuration knowledge in GLIBC using non-boolean constraints. 15 2.7 A variable list implementation with CPP; taken from Liebig et al. [2010]. 16 2.8 Implementation of the configuration option DLINKED using aspect-oriented and feature-oriented programming. 18 2.9 Code example with its corresponding AST (excerpt) and its CFG representation. 19 2.10 Examples of type errors in C. 20 3.1 Goal Question Metric (GQM) model of our study on preprocessor usage. 27 3.2 Trade-off between expressiveness, comprehension, and replication [Schulze et al., 2013a]. 28 3.3 Excerpt of a CPP-extended ISO/IEC 9899 lexical C grammar; rules for pre- processor directives are highlighted (Line 7 and Line 10 to 14); cppexp is the condition; nl is a newline; cppthenfunc represents the #endif or alternative function definitions. 33 3.4 Examples of disciplined annotations in VIM................... 34 3.5 Examples of undisciplined annotations in VIM. 35 3.6 Example of undisciplined annotations in XTERM. 36 3.7 Example of coarse-grained and fine-grained extensions. 38 3.8 Variability plots: lines of code vs configuration options (LOC/CO), lines of code vs lines of variable code (LOC/LVC), and configuration options vs lines of variable code (CO/LVC). 42 3.9 Complexity plots: configuration options vs scattering degree (CO/SD), con- figuration options vs tangling degree (CO/TD), and configuration options vs nesting depth (CO/ND). 46 3.10 Undisciplined parameter annotation (a) and two disciplined variants of it (b and c).
Recommended publications
  • Veusz Documentation Release 3.0
    Veusz Documentation Release 3.0 Jeremy Sanders Jun 09, 2018 CONTENTS 1 Introduction 3 1.1 Veusz...................................................3 1.2 Installation................................................3 1.3 Getting started..............................................3 1.4 Terminology...............................................3 1.4.1 Widget.............................................3 1.4.2 Settings: properties and formatting...............................6 1.4.3 Datasets.............................................7 1.4.4 Text...............................................7 1.4.5 Measurements..........................................8 1.4.6 Color theme...........................................8 1.4.7 Axis numeric scales.......................................8 1.4.8 Three dimensional (3D) plots..................................9 1.5 The main window............................................ 10 1.6 My first plot............................................... 11 2 Reading data 13 2.1 Standard text import........................................... 13 2.1.1 Data types in text import.................................... 14 2.1.2 Descriptors........................................... 14 2.1.3 Descriptor examples...................................... 15 2.2 CSV files................................................. 15 2.3 HDF5 files................................................ 16 2.3.1 Error bars............................................ 16 2.3.2 Slices.............................................. 16 2.3.3 2D data ranges........................................
    [Show full text]
  • Resurrect Your Old PC
    Resurrect your old PCs Resurrect your old PC Nostalgic for your old beige boxes? Don’t let them gather dust! Proprietary OSes force users to upgrade hardware much sooner than necessary: Neil Bothwick highlights some great ways to make your pensioned-off PCs earn their keep. ardware performance is constantly improving, and it is only natural to want the best, so we upgrade our H system from time to time and leave the old ones behind, considering them obsolete. But you don’t usually need the latest and greatest, it was only a few years ago that people were running perfectly usable systems on 500MHz CPUs and drooling over the prospect that a 1GHz CPU might actually be available quite soon. I can imagine someone writing a similar article, ten years from now, about what to do with that slow, old 4GHz eight-core system that is now gathering dust. That’s what we aim to do here, show you how you can put that old hardware to good use instead of consigning it to the scrapheap. So what are we talking about when we say older computers? The sort of spec that was popular around the turn of the century. OK, while that may be true, it does make it seem like we are talking about really old hardware. A typical entry-level machine from six or seven years ago would have had something like an 800MHz processor, Pentium 3 or similar, 128MB of RAM and a 20- 30GB hard disk. The test rig used for testing most of the software we will discuss is actually slightly lower spec, it has a 700MHz Celeron processor, because that’s what I found in the pile of computer gear I never throw away in my loft, right next to my faithful old – but non-functioning – Amiga 4000.
    [Show full text]
  • Refactoring of Acceptance Tests in Visual Studio
    Refactoring of Acceptance Tests in Visual Studio Denis Elbert Diplomarbeit Studiengang Informatik (Technik) Fakultät für Informatik Hochschule Mannheim Autor: Denis Elbert Matrikelnummer: 510243 Zeitraum: 16.11.2009 – 16.03.2010 Erstgutachterin: Prof. Dr. Astrid Schmücker-Schend Zweitgutachterin Prof. Dr. Miriam Föller-Nord Praktischer Teil angefertigt bei: Prof. Dr. Frank Maurer Agile Software Engineering Group University of Calgary Department of Computer Science 2500 University Dr NW Calgary, Alberta T2N 1N4 Canada Refactoring of Acceptance Tests in Visual Studio STATUTORY DECLARATION (GERMAN) Ich versichere, dass ich die vorliegende Arbeit selbstständig und ohne Benutzung anderer als der angegebenen Hilfsmittel angefertigt habe. Alle Stellen, die wörtlich oder sinngemäß aus veröffentlichten und nicht veröffentlichten Schriften entnommen wurden, sind als solche kenntlich gemacht. Die Arbeit hat in dieser oder ähnlicher Form keiner anderen Prüfungsbehörde vorgelegen. Mannheim, 16.03.2010 ________________________ Unterschrift I Refactoring of Acceptance Tests in Visual Studio ABSTRACT Executable Acceptance Test Driven Development (EATDD) is an extension of Test Driven Development (TDD). TDD requires that unit tests are written before any code. EATDD pushes this TDD paradigm to the customer level by using Acceptance Tests to specify the requirements and features of a system. The Acceptance Tests are mapped to a Fixture that permits the automated execution of the tests. With ongoing development the requirements of the system can change. Thus, the Acceptance Tests must be adjusted in order to reflect the new requirements. Since the tests and the corresponding Fixtures must remain consistent, the manual modification of these tests is time consuming and error-prone. Hence comes the need for Acceptance Test refactoring.
    [Show full text]
  • Lightweight Distros on Test
    GROUP TEST LIGHTWEIGHT DISTROS LIGHTWEIGHT DISTROS GROUP TEST Mayank Sharma is on the lookout for distros tailor made to infuse life into his ageing computers. On Test Lightweight distros here has always been a some text editing, and watch some Linux Lite demand for lightweight videos. These users don’t need URL www.linuxliteos.com Talternatives both for the latest multi-core machines VERSION 2.0 individual apps and for complete loaded with several gigabytes of DESKTOP Xfce distributions. But the recent advent RAM or even a dedicated graphics Does the second version of the distro of feature-rich resource-hungry card. However, chances are their does enough to justify its title? software has reinvigorated efforts hardware isn’t supported by the to put those old, otherwise obsolete latest kernel, which keeps dropping WattOS machines to good use. support for older hardware that is URL www.planetwatt.com For a long time the primary no longer in vogue, such as dial-up VERSION R8 migrators to Linux were people modems. Back in 2012, support DESKTOP LXDE, Mate, Openbox who had fallen prey to the easily for the i386 chip was dropped from Has switching the base distro from exploitable nature of proprietary the kernel and some distros, like Ubuntu to Debian made any difference? operating systems. Of late though CentOS, have gone one step ahead we’re getting a whole new set of and dropped support for the 32-bit SparkyLinux users who come along with their architecture entirely. healthy and functional computers URL www.sparkylinux.org that just can’t power the newer VERSION 3.5 New life DESKTOP LXDE, Mate, Xfce and others release of Windows.
    [Show full text]
  • Installation Minimale De Debian Avec Serveur X Installation Minimale De Debian Avec Serveur X
    27/09/2021 06:52 1/6 Installation minimale de Debian avec serveur X Installation minimale de Debian avec serveur X Objet : Méthode d'installation minimale de Debian Niveau requis : débutant, avisé Commentaires : Il peut être intéressant d'installer les programmes séparément en partant d'un système minimal pour gagner en réactivité, pour avoir un système configuré selon ses besoins ou simplement pour en connaître un peu plus sur le fonctionnement de Debian. Débutant, à savoir : Utiliser GNU/Linux en ligne de commande, tout commence là !. Suivi : Création par smolski le 14/05/2010 Testé par paskal le 26-10-2013 Commentaires sur le forum : Lien vers le forum concernant ce tuto1) Pourquoi ? L'installation par défaut de Debian permet à l'utilisateur d'avoir un système complet et utilisable dès le premier démarrage : bureautique, Internet, jeux, multimédia, infographie… Néanmoins, il peut être intéressant d'installer les programmes séparément en partant d'un système minimal 1. pour gagner en réactivité, 2. pour avoir un système configuré selon ses besoins 3. ou simplement pour en connaître un peu plus sur le fonctionnement de Debian. Pré requis La procédure n'est pas compliquée. Je pars du principe que vous savez effectuer une installation par défaut de Debian de bout en bout et ne reviendrai que très peu sur cette partie. Je vous conseille également d'avoir un peu de bouteille sous Debian ou les systèmes GNU/Linux en général et d'être relativement à l'aise avec le terminal, une partie de l'installation ne se fera pas en mode graphique. Ceci étant dit, allons-y ! Installation du système Debian minimal Le début de la procédure est identique à l'installation par défaut, démarrez sur un CD ou USB netinstall et suivez les instructions.
    [Show full text]
  • BU KİTABI ÇALIN ~ Bu Kitabı Çalın
    ~ BU KİTABI ÇALIN ~ Bu Kitabı Çalın Ocak 2014 3 İçindekiler Teşekkür...............................................................................................4 Giriş......................................................................................................5 1. EXIF ve GPS.....................................................................................6 2. Sosyal Medyada Açık Hesaplar......................................................13 3. Ünlü Olmak....................................................................................17 4. Budala Son Kullanıcı......................................................................18 5. Twitter'ın Karanlık Yüzü.................................................................20 6. PGP Kullanın..................................................................................23 7. Google Hesabı Silmek....................................................................31 8. Big Brother = Usta.........................................................................36 9. Kimyasal Silah Kullanımı ve Amerika............................................39 10. Arka Kapı......................................................................................44 11. AKP, Baskı ve Polis Devleti...........................................................47 12. Online Kripto Araçları..................................................................50 13. CV Rekabetçiliği...........................................................................53 14. SteamOS'un Düşündürdükleri.....................................................56
    [Show full text]
  • Milax - Opensolaris Small Livecd Distro Alexander R
    USE IMPROVE EVANGELIZE MilaX - OpenSolaris small LiveCD distro Alexander R. Eremin MilaX Developer USE IMPROVE EVANGELIZE Can Solaris become as small as DSL? Solaris 2 USE IMPROVE EVANGELIZE DSS 0.1 Feb 2008 CDDL v.1 MilaX 0.1, 0.1.1 Feb 2008 MilaX 0.2 Mar 2008 Milax 0.3 May 2008 June 2008 MilaX 0.3.1 MilaX 0.3.1 server 3 USE IMPROVE EVANGELIZE Last version released June 10 2008 4 USE IMPROVE EVANGELIZE MilaX LiveCD, LiveUSB USE IMPROVE EVANGELIZE Virtualizing MilaX LiveCD,LiveUSB Qemu VirtualBox VMware USE IMPROVE EVANGELIZE MilaX advantages ● Small size ● Fast boot ● Loading live image from RAM ● Booting from various storage devices ● People can try small Solaris without installing on the harddisk. ● All Solaris features: dtrace,zfs, zones,e.t.c ● Latest drivers and bugfixes ● Two versions: desktop and server USE IMPROVE EVANGELIZE When MilaX is the best choice? ● Old PC's ● Not enough RAM ● Not enough free disk space ● Fast and small server (0.3.1 server) ● Fast developing (0.3.1 server) ● Virtual testing USE IMPROVE EVANGELIZE MilaX Filesystem Ramdisk 105mb, UFS Root FS /,/lib,/dev,/devices,/var Ramdisk Swap RAM /usr (RAM < 512mb) /usr, /alex, /root, /tmp Ram > 512MB HSFS Filesystem (/usr mount) LOFI Pseudo Device /.cdrom/usr.zlib HSFS Filesystem (/.cdrom mount) MilaX Live CD USE IMPROVE EVANGELIZE Milax 0.3.1 Apps Desktop version ● Gtk-Terminal, Beaver, Netsurf, Sylpheed, Midnight Commander, emelFM, XMMS, Xpdf, VNC viewer, Rdesktop, Nmap, gFTP, gPicview, Conky, XChat, Xpad. Server version ● Apache, PHP, Samba and NFS servers, GCC, GMake, Midnight Commander, Pine, Mutt, Elinks, Lynx.
    [Show full text]
  • Improving Tools for Javascript Programmers
    Improving Tools for JavaScript Programmers (Position Paper) Esben Andreasen Asger Feldthaus Simon Holm Jensen Aarhus University Aarhus University Aarhus University [email protected] [email protected] [email protected] Casper S. Jensen Peter A. Jonsson Magnus Madsen Aarhus University Aarhus University Aarhus University [email protected] [email protected] [email protected] Anders Møller Aarhus University [email protected] ABSTRACT 2. FINDING ERRORS WITH We present an overview of three research projects that all DATAFLOW ANALYSIS aim to provide better tools for JavaScript web application 1 The TAJS analysis tool infers an abstract state for each programmers : TAJS, which infers static type information program point in a given JavaScript web application. Such for JavaScript applications using dataflow analysis; JSRefac- an abstract state soundly models the possible states that tor, which enables sound code refactorings; and Artemis, may appear at runtime and can be used for detecting type- which provides high-coverage automated testing. related errors and dead code. These errors often arise from wrong function parameters, misunderstandings of the run- time type coercion rules, or simple typos that can be tedious to find using testing. 1. JAVASCRIPT PROGRAMMERS NEED We have approached the development of TAJS in stages. BETTER TOOLS First, our focus has been on the abstract domain and dataflow JavaScript contains many dynamic features that allegedly constraints that are required for a sound and reasonably ease the task of programming modern web applications. Most precise modeling of the basic operations of the JavaScript importantly, it has a flexible notion of objects: properties are language itself and the native objects that are specified in added dynamically, the names of the properties are dynam- the ECMAScript standard [3].
    [Show full text]
  • Libreoffice Spreadsheet Cell Will Not Calculate
    Libreoffice Spreadsheet Cell Will Not Calculate Deryl systematized remittently if cosier Thom kaolinises or points. Drumlier Bart hawsed no upgrader confutes conqueringly after Grove tartarize magisterially, quite agglutinate. Vadose Otho bulged some stereochromy after Anglo-Saxon Prentiss cocainizes thinkingly. Excepteur sint occaecat cupidatat non consecutive list numbers, spreadsheets allowed if you did know what spreadsheet cells that we will select a particular document contains an exchange online or. Calc makes a: once with text, little until you. Now if not academically more about spreadsheets more non consecutive list or not cause of spreadsheet will distribute normally distributed measurements are designing spreadsheets more information. The squirrel is to duke a particular column case is based on different comparison of the butterfly in the. Complete they have not run around with. Let us begin with not as needed! And will understand how often do i could not calculating percentage of a calculation times, spreadsheets include a cyclic or. Note that will not change formula then run at some of spreadsheet with. - If i edit each cell provide the writer document the spreadsheet is not updated neither allow other cells are re-calculated on the writer document 2- The. How had you smell in LibreOffice Calc? Terex sales value will not visible on rails software. Libreoffice calc define range Botas Rudel. Column so I discovered OpenOffice sum function not working- before is. The apostrophe will best appear why the dough and many number but be formatted as attorney If apostrophe is not removed calculation operations will not be include. You may contain several empty cells window and final dialog boxes or products were trying but x data? LibreOffice Calc Calculations and the Formula Bar Ahuka.
    [Show full text]
  • Spreadsheet-Based Complex Data Transformation
    Spreadsheet-based complex data transformation Hung Thanh Vu Dissertation submitted in fulfilment of the requirements for the degree of Doctor of Philosophy School of Computer Science and Engineering University of New South Wales Sydney, NSW 2052, Australia March 2011 Supervisor: Prof. Boualem Benatallah i Acknowledgements I am very grateful to Professor Boualem for his exceptional unconditional support and limitless patience. He was the first person who taught me how to do research; how to write and present a complex research problem. He has always been there for me when I have any difficulties in research. He is one of the best supervisors I have ever worked with. Without his support, this thesis would never be completed. My sincere thanks go to Dr Regis Saint-Paul for his fruitful collaborations and providing me invaluable research skills. I also wish to express my gratitude to the members of the SOC group, who spent a lot of time discussing with me on the research issues and giving me helpful advice. I would like to thank Dr Paolo Papotti for insightful discussions on data exchange as well as mapping tools Clio, Clip, and +Spicy; Assisstant Professor Christopher Scaffidi for answering my questions on Topes; Associate Professor Wang-Chiew Tan and Dr Bogdan Alexe for helping me understand STBenchmark; Dr Wei Wang for helpful discussions on similarity join and its related algorithms; and some members of XQuery WG and XSLT WG including Daniela Florescu, Jerome Simeon, and Michael Kay for giving me advice on the expressiveness and new updates of XSLT and XQuery. Last but not least, I am forever in debt to my parents.
    [Show full text]
  • GIT—A Stupid Content Tracker
    GIT—A Stupid Content Tracker Junio C. Hamano Twin Sun, Inc. [email protected] Abstract The paper gives an overview of how git evolved and discusses the strengths and weaknesses of its design. Git was hurriedly hacked together by Linus Torvalds, after the Linux kernel project lost its license to use BitKeeper as its source code management system (SCM). It has since 1 Low level design quickly grown to become capable of managing the Linux kernel project source code. Other projects have started to replace their existing Git is a “stupid content tracker.” It is designed SCMs with it. to record and compare the whole tree states ef- ficiently. Unlike traditional source code control Among interesting things that it does are: systems, its data structures are not geared to- ward recording changes between revisions, but for making it efficient to retrieve the state of in- 1. giving a quick whole-tree diff, dividual revisions. 2. quick, simple, stupid-but-safe merge, The unit in git storage is an object. It records: 3. facilitating e-mail based patch exchange workflow, and • blob – the contents of a file (either the 4. helping to pin-point the change that caused contents of a regular file, or the path a particular bug by a bisection search in pointed at by a symbolic link). the development history. • tree – the contents of a directory, by recording the mapping from names to ob- The core git functionality is implemented as a jects (either a blob object or a tree object set of programs to allow higher-layer systems that represents a subdirectory).
    [Show full text]
  • Pyref: a Refactoring Detection Tool for Python Projects
    Università Software della Institute Svizzera italiana PYREF:AREFACTORING DETECTION TOOL FOR PYTHON PROJECTS Hassan Atwi June 2021 Supervised by Prof. Dr. Michele Lanza Co-Supervised by Dr. Bin Lin SOFTWARE &DATA ENGINEERING MASTER THESIS iii Abstract Refactoring, the process of improving internal code structure of a software system without altering its external behav- iors, is widely applied during software development. Understanding how developers refactor source code can help us gain better understandings of the software development process and the relationship between various versions of software systems. Currently, many refactoring detection tools (e.g., REFACTORINGMINER and REF-FINDER) have been proposed and have received considerable attention. However, most of these tools focus on Java program, and are not able to detect refactorings applied throughout the history of a Python project, although the popularity of Python is rapidly magnifying. Developing a refactoring detection tool for Python projects would fill this gap and help extend the language boundary of the analysis in variant software engineering tasks. In this work, we present PYREF, a tool that automatically detect 11 different types of refactoring operations in Python projects. Our tool is inspired by REFACTORING MINER, the state-of-the-art refactoring detection tool for Java projects. With that said, while our core algorithms and heuristics largely inherit those of REFACTORING MINER, considerable changes are made due to the different language characteristics between Python and Java. PYREF is evaluated against oracles collected from various online resources. Meanwhile, we also examine the reliability of PYREF by manually inspecting the detected refactorings from real Python projects. Our results indi- cate that PYREF can achieve satisfactory precision.
    [Show full text]