An Analysis of Software Quality and Maintainability
Total Page:16
File Type:pdf, Size:1020Kb
AN ANALYSIS OF SOFTWARE QUALITY AND MAINTAINABILITY METRICS WITH AN APPLICATION TO A LONGITUDINAL STUDY OF THE LINUX KERNEL By Lawrence Gray Thomas Dissertation Submitted to the Faculty of the Graduate School of Vanderbilt University in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY In Computer Science August, 2008 Nashville, Tennessee Approved: Dr. Stephen R. Schach Dr. Larry Dowdy Dr. Julie Adams Dr. Richard Alan Peters II Dr. Ralph M. Butler (MTSU) Copyright © 2008 by Lawrence Gray Thomas All Rights Reserved To my beloved wife, Peggy and To the memory of my mother, Nina Irene Gray, Vanderbilt Class of 1947 iii ACKNOWLEDGEMENTS This work was funded in part by a grant from Microsoft Corporation. I am also grateful to Klocwork Inc., for generously providing their software tools used in this research. I am especially indebted to Dr. Stephen R. Schach, Associate Professor of Computer Science and Computer Engineering at Vanderbilt University, who has been invaluable in supporting my research, and who as worked actively to provide me with the protected academic time and other necessary resources to pursue my research. Nobody has been more important to me in the pursuit of this goal than my loving wife, Peggy. I am thankful for her unending encouragement, support, inspiration, and patience. iv TABLE OF CONTENTS Page DEDICATION .................................................................................................................. iii ACKNOWLEDGEMENTS .............................................................................................. iv LIST OF TABLES ............................................................................................................ ix LIST OF FIGURES .......................................................................................................... x Chapter I. INTRODUCTION......................................................................................................1 1.1 What is Quality?...........................................................................................1 1.2 Quality Factors, Quality Metrics, and Validation ........................................2 1.3 Coupling.......................................................................................................6 1.4 Previous Validation Studies .........................................................................8 1.5 Research Objectives.....................................................................................9 1.6 Problem Statement .....................................................................................11 1.7 Contributions of This Work .......................................................................12 1.8 Organization of the Remainder of the Dissertation....................................14 II. RELATED WORK ..................................................................................................16 2.1 Open-Source Software and the Origins of Linux.......................................16 2.2 Software Maintenance................................................................................19 2.3 Metrics Related to Quality and Maintainability.........................................22 2.3.1 Global Variables and Common Coupling........................................24 2.3.2 McCabe’s Cyclomatic Complexity Metrics.....................................30 2.3.3 Halstead Volume (Software Science) ..............................................45 2.3.4 Lines of Code...................................................................................50 2.3.5 Oman’s Maintainability Index (MI).................................................52 2.3.6 Klocwork’s Risk Metric...................................................................59 2.4 Categorization of Instances of Global Variables .......................................61 2.5 What Constitutes “The Kernel”?................................................................62 2.6 Software Evolution ....................................................................................64 III. LINUX: SOURCE CODE AND TOOLS ................................................................65 3.0 Introduction................................................................................................65 3.1 The Linux Source Code .............................................................................65 3.2 Building Linux Under Linux – the Debian Distribution............................66 3.3 CXREF.......................................................................................................68 3.4 Klocwork....................................................................................................68 v 3.5 VMWare Workstation................................................................................69 3.6 WinRAR.....................................................................................................69 3.7 MySQL.......................................................................................................69 IV. WHY REVISIT SCHACH ET AL.?........................................................................71 4.1 Introduction - Aspects of [Schach et al. 2002] to Reconsider....................71 4.2 The Code Base to Consider - What Constitutes the Linux Kernel?...........72 4.3 Kernel Versions Examined (Production vs. Development) .......................77 4.4 Intervals used to determine rate of growth.................................................83 V. SELECTING A CONFIGURATION FOR EMPIRICAL RESEARCH ON THE LINUX KERNEL..........................................................................................85 Contributions in this Chapter ............................................................................85 5.1 Chapter Introduction ..................................................................................85 5.2 Kernel Version Series Chosen for Inclusion in This Study .......................87 5.3 Selecting a Configuration for Empirical Research on the Linux Kernel ...90 5.4 The Configuration Script – make config ...........................................103 5.5 The One Major Exception to Our Method ...............................................107 5.6 Verifying Our Configuration as Selected.................................................107 VI. GLOBAL VARIABLES: A NEW CATEGORIZATION AND ITS CASE TOOL...................................................................................................................111 6.1 How “Global” is “Global”?......................................................................111 6.2 Classifying the GV Instances – Instance Kinds .......................................112 6.3 Performing the GV Instance Classification..............................................118 6.4 Analysis of the Instance Kinds.................................................................129 6.5 Analysis of the Instance Kinds and Common Coupling ..........................139 VII. SCHACH ET AL. 2002, REDUX..........................................................................142 Contribution of this Chapter ...........................................................................142 7.0 Introduction..............................................................................................142 7.1 Which Versions of the Linux Kernel Should We Consider? ...................142 7.2 Development vs. Stable Series and Their Life Cycles.............................145 7.3 Kernel Versions Examined by Schach et al. ............................................147 7.3.1 Schach et al. and the 2.00.x kernels...............................................147 7.3.2 Schach et al. and the 2.02.x kernels...............................................148 7.3.3 Schach et al. and the 2.04.x kernels...............................................149 7.4 Development/Stable Code Forking History.............................................149 7.5 Selecting a Cutoff Point ...........................................................................153 7.6 Confirming Our Cutoff Points by Examining Code Churn .....................154 7.7 Kernel Series 2.00.x, 2.02.x, and 2.04.x – One Longitudinal Study or Three? .....................................................................................................167 7.8 Measuring the Size of the Linux Kernel ..................................................171 vi 7.9 Rate of Growth of the Size of the Linux kernel.......................................177 7.9.1 Versions 2.00.x ..............................................................................177 7.9.2 Versions 2.02.x ..............................................................................182 7.9.3 Versions 2.04.x ..............................................................................185 7.9.4 All Versions ...................................................................................188 7.10 Rate of Growth of Common Coupling in the Linux Kernel ..................190 7.10.1 Common Coupling In the 2.00.x Kernels ....................................190 7.10.2 Common Coupling In the 2.02.x Kernels ....................................192 7.10.3 Common coupling in the 2.04.x Kernels .....................................195 7.10.4 All Versions .................................................................................203 7.11 Examining Schach et al.’s data with respect to release date..................204 7.12 Summary and Conclusions.....................................................................209