Categorization of Common Coupling in Kernel Based Software Liguo Yu Assistant Professor Tennessee Tech University, Box 5101 Cookeville, TN 38505 (001) 931-372-6484 yul@csc.tntech.edu Srini Ramaswamy Associate Professor Tennessee Tech University, Box 5101 Cookeville, TN 38505 (001) 931-372-3691 srini@csc.tntech.edu ABSTRACT Common coupling is an important factor that needs to be considered in software design. It affects software dependency via the definition-use relationship of global variables. Common coupling can arise in all types of software; here we focus on issues specific to kernel-based software. In a previous paper, we described a categorization of common coupling and used it to study the maintainability of the Linux operating system. In this paper, we present a detailed description of this categorization, prove its completeness, and suggest further applications. We hope that, by this approach, we can make it easier for others to use our categorization to measure the maintainability of other kernel- based software. Categories and Subject Descriptors D.2.2.d [Modules and interfaces], D.2.7.g [Maintainability], D.2.8 [Metrics/ Measurement], D.2.10.h [Quality analysis and evaluations]. General Terms Design. Keywords Modularity, dependencies, common coupling, definition-use analysis, kernel-based software. 1. INTRODUCTION Two modules are called common coupled if they access the same global variable. In a previous study [1], we presented a categorization of common coupling based on definitions and uses of shared variables in kernel and nonkernel modules. An instance of a variable is either a definition (a change to the value of the variable) or a use (a utilization of the value of the variable). Changes to a definition during maintenance will affect uses, whereas changes to a use cannot affect other uses. In that previous work, we split common coupling into five categories, as described in Section 5.2. Category-4 and category-5 are more undesirable than category-1, category-2, and category-3 from the viewpoint of maintainability. Using this categorization, we studied common coupling in the Linux kernel and showed that Linux has an excess of instances of undesirable category-4 and category-5 of global variables, which will make it extremely difficult to maintain Linux in the future. In this paper, we describe our categorization in more detail and prove its completeness. In section 2, we review software dependency. Section 3 describes the definition-use relationship of variables. Section 4 reviews kernel based-software. Section 5 describes in more detail the definitions of our new categorization of common coupling. Section 6 proves the completeness of our categorization. Our conclusions appear in Section 7. 2. SOFTWARE DEPENDENCY Coupling measures the dependency between the modules [2]. Coupling is necessary for software design. A good software system should have high cohesion within each module and low coupling between modules. Coupling between modules strengthens the dependencies of one module on others and increases the possibility that changes in one module may affect other modules. This relation has two effects on software faults. First, one fault in a module may transfer to another module via coupling. Second, an inappropriate change in one module may cause a fault in other modules. Coupling is related to maintenance in two ways. First, coupling is the degree of dependency between modules, so a high level of coupling means a high degree of dependency. Strong dependency is an indication of high complexity. It is generally accepted that a high degree of complexity means a high level of maintenance difficulty. As redefined by Offutt et al. [3], modules A and B are common coupled if A and B share references to the same global variable. Common coupling has always been considered as a strong coupling and been used with caution. Common coupling possesses an unfortunate property that the number of instances of common coupling between a module M and the other modules can change drastically, even if module M itself never changes [4]. In kernel-based software this makes the kernel more difficult to maintain. For example, the value of a global variable that is used Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. 43 rd ACM Southeast Conference, March 18-20, 2005, Kennesaw, GA, USA. Copyright 2004 ACM 1-58113-000-0/00/0004…$5.00.