Modularity Framework as a New Framework in Enhancing Modularity in Open Source Projects

Andi Wahju Rahardjo Emanuel 1, Khabib Mustofa 2 1Bachelor Informatics Program, Faculty of Information Technology, Maranatha Christian University, Jl. Prof.Drg. Suria Sumantri 65, Bandung, Indonesia 2Computer Science Postgraduate Program, Faculty of Mathematics and Natural Sciences, Gadjah Mada University, Jl. Sekip Utara, Sleman, Yogyakarta, Indonesia [email protected], [email protected]

Abstract—In this paper a new Open Source Software Despite of these success stories about Open Source Framework called Modularity Framework is proposed and , the fact that there are many failures of analyzed for the first time. Study by several researchers such developing software using this methodology is disturbing. as Dekoenigsberg and Gurbani have identified that For example, in sourceforge.net, one of the biggest portals modularity is one of the key success factors of Open Source for developing Open Source Softwares, is currently Projects, but how modularity should be achieved in these projects are not clearly understood. The primary having more than 180 thousands Open Source Projects, components of the proposed Software Framework, which but the number of projects that is downloaded with more are Patterns and Software Components, are that 25 thousand times are only about 5000 Projects or analyzed against some parameters currently attributed to less than 3%. Several studies have been conducted in software modularity such as module’s size, number of trying to identify the possible cause of these failures, and modules, complexity, cohesion, and coupling / dependency some important causes of these failures are the lack of (fan in, and fan out). The result of the analysis shows that formal process similar to its proprietary counterpart [3], the composition of these combined with poor architectural design [5], the lack of documentation Software Components (interfaces and abstract classes) in a that hinder new participants to contribute to the projects form of Software Framework called Modularity Framework is highly feasible. [6] and high entry barier for new participant to be able to contribute significantly to the project [15]. Index Terms—Modularity Framework, Open Source, Some studies are able to discover the key success Software Architecture, Software Framework factors of the Open Source Software Projects. The important finding is that one of the key success factors in developing high quality Open Source Software is the sound and modular architecture of the software [4] [9]. I. INTRODUCTION Eventhough modularity has been identified as the key Open Source currently become one major research success factor, how modularity in early phase of Open topic in by many researchers Source Projects should be achieved, in order to increase worldwide. This alternative its change of survival, is not yet clearly understood. Since methodology which is initiated in 1990s by Richard most of the Open Source Projects are developed in ad hoc Stallman in his paper "Why Software should be Free" [14] manner, more systematic and repeateable approaches in and Eric Raymond in his paper "The Cathedral and the the development of Open Source Projects using proper Bazaar" [13] now becomes the mainstream software Software Framework as the mini-architectural guidance engineering movement in Information Technology. The which focuses on modularity are needed. In this paper, a development methodology, which allow almost everyone new Software Framework called Modularity Framework to download, improve, and modify the source code, is is proposed and discussed for the first time. This creating groups of users and developers called Open framework focuses on achieving modularity and Source Communities which are constantly trying to addressing the poor architectural design of the Open improve the software in rapid and evolutionary manner. Source Software Project. Even though the members of the communities are never meet each other in person and only connected using electronic means such as email and forum, this distributed II. CURRENT RESEARCHES collaboration is eventually able to create some very high quality softwares which are comparable and even The software framework being proposed will consist competing to the proprietary softwares. Some noticeable of two main components which are collection of Software success stories about Open Source Software are Linux Components and composition of several Software Design (Debian, Ubuntu, FreeBSD, Red Hat, Patterns. The combination of these two main components etc.), Apache Web Server, Firefox / Mozilla Web will create a mini-architecture which can be used as a Browser, OpenOffice.org , and many more. guidance in starting the modular Open Source Software.

136 International Conference on Rural Information and Communication Technology 2009

Several researches have been conducted in Software  The development methods of the Open Source Frameworks, Architecture, and Software Design Patterns. projects are lacking of formal methodology found in commercially developed software applications. A. Software Framework and Architecture During the development of Open Source Softwares, the developers and communities depend on some tools. There are currently several studies about Software CVS (Concurrent Version System) is used as the Framework and Software Architecture in Open Source repository and version control of the source code. Bug Projects. Stewart studied the development model of Open software such as Bugzilla or TRAC is used to Source Projects which focused on complexity [15]. keep track of all the bugs during developement. All the Nakagawa in his study of software architecture in Open proposed functionalities and improvement suggestions are Source Software proposed architecture refactoring activity kept in a TODO List / Wish List. Documentation of the to repair software architecture [12]. Study in the software is kept using Wiki. The communication among composition of patterns for example in MVC (Model – developers and communities are done electronically via View – Controller) architecture is actually the websites, forum, mailing list etc. The distribution and composition of Composite, Strategy and Observer Design modification of the software is controlled by specific Patterns [2]. licensing scheme such as GPL, LGPL, etc [16]. Currently, many website portals have been developed B. as an incubator for Open Source software initiators and The study about Design Pattern in 1000 Open Source interested participants to develop and host their projects. Projects was conducted by Hahnsler in which he found These portals are equipped with many development tools that Singleton is mostly used Design Pattern and only and statistics to assist the project initiator or administrator very few Open Source Developers were actually using in improving their Open Source projects and other Design Pattern [10]. Empirical Study evolution of design interested contributors to join the projects. Some of the pattern of three Open Source Projects which are popular portals are sourceforge.net, freshmeat.net, JHotdraws, ArgoUML, and Eclipse JDT found that launchpad.net, and Google Code (code.google.com). patterns used are changed more frequently, and different kind of changes impact differently on co-changed classes, B. Software Design Pattern different capabilities of making the system resilient to Design Pattern is defined as micro architecture, and it changes [1]. captures essence of good solution in particular context. In summary, it can be seen from above researches that The characteristics of software design patterns: the study about Software Frameworks, Architecture and  Descriptions of communicating objects and classes Design Patterns are mainly focuses on detecting the that are customized to solve a general design problem existing Framework, Architecture and Design Patterns in in a particular context . the Open Source Projects and all of the consequences  Design pattern is not as data structures nor complex relating to them. There is no effort have been conducted domain specific designs. in trying to enforce the Open Source development process There are several benefit of Design Pattern, such as it to have sound and modular architecture characteristics. enables large-scale reuse of software architectures, helps The Modularity Framework proposed in this paper is document systems, captures expert knowledges and trying to fill the gap. design tradeoffs, improves developer communication, forms a common vocabulary among developers and many more. The descriptions of design pattern are usually consist of [7]: Pattern name, Problem, Intent, Context, III. THEORETICAL BACKGROUND When to apply, Solution, UML-like structure, Abstract The theoretical background for this paper will describe code, Consequences, Results, Tradeoffs. Design Patterns Open Source Software Projects and Software Framework are categorized into three types [7]:  and all that related to them such as Software Component, Creational: Singleton, Abstract Factory, Factory Design Pattern, Software Framework and Software Method, Prototype, Builder. Architecture.  Structural: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy. A. Open Source Software Projects  Behavioural: Chain of Responsibility, Command, , Mediator, Momento, Observer, State, Open Source is a software development methodology Strategy, Template Method, Visitor, Iterator. based on several distinct characteristics: Design Pattern is first proposed by Christopher  The source code of the application is freely available Alexander 1970s, and then the first systematic for everybody to download, improve and modify identification and analysis of Software Design Patterns [13]. are conducted by Gang of Four (Erich Gamma, Richard  People who contribute to the development of the Helm, Ralph Johnson, and John Vlisside) which identified Open Source projects is usually forming a group 23 Design Patterns. Currently, other Design Patterns are called Open Source Communities which is now being proposed by many researches for specific completely voluntary. purposes.

137 C. Software Components Table 1. Intended Characteristics of Modular Open Source Software Software Components are defined as package piece of Characteristics Description functionality and usually used as black box (internal of Modularity structure of the program is not need to be known) so they Small size in each Size of each individual module, may be stated are to be used as is and is provided to be reused. Software module as LOC (Line of Code) or FP (Function Point). Components consist of collections of abstract classes, and The smaller the size of the module, the higher interfaces. This abstract classes and interfaces are created the tendency of the source code to become modular. to enable inheritance and implementation of these components by other modules / classes of the software High number of Number of modules in the system, may be projects. These connections to the abstract classes and modules stated as the number of objects, headers, etc. The larger the number of modules, it indicates interfaces are called hot spots and hooks. the increase in granularity of the system (more There are two types of Software Components to be modular). used based on the advanced properties of Object Oriented Low complexity The internal structure of the module, such as programming principles: the decision structure, number of operators,  Interfaces: a special class that all of its methods are etc. The more complex the application usually abstract. A class may implements one or more reflects the lower modularity of the source code. interfaces.  Abstract classes: template of a class that should be Coupling / Interdependence of one module to another dependency (high modules which measures the strength of all inherited and cannot be instantiated in which fan in and low fan relationships between modules. There are two consisting one or more abstract method. out) parameters relating to coupling / dependency: - Fan in: The class or object is being used D. Software Framework and Architecture by many classes or objects, which is the number of modules that call a given Software Framework is a mini architecture of software module. The higher the fan in of modules, the higher the modularity. which is intended to be re-used via "hot spots" and - Fan out: The ability of a class or object "hooks" [11]. Software Framework provide core to be reused, which is the number of infrastructure in creating a software project as required by modules that called by a given module. the programmer. Software Framework is larger, more The lower the fan out of modules, the higher the modularity. concrete, and more specific than Software Design Pattern, but it is smaller than Software Architecture. Some High cohesion Internal – interdependency inside module, examples of Software Frameworks are J2EE (Java 2 which measures the semantic strength of relationships between components within a Enterprise Edition) for developing enterprise level functional unit, and a module is usually stated application in Java, jHotDraws for developing graphical as high cohesion or low cohesion. The more application using Java (Consisting Template Method, cohesion inside each module, the higher the Strategy, Observer, Decorator, and Prototype Design modularity Patterns), and Prado to build a rapid web application based on PHP scripting language. Whereas Software To conform to the these intended characteristics into Architecture is high level design of large software the proposed software framework, each of the systems, and it reflects top level design decision. Some characteristics will be analyzed against each primary examples of software architecture are Pipes and Filters, components of the framework, which are Software Data Abstraction / Object Oriented, Layered, Repositories Components and Software Design Patterns. / Data Centered, Blackboard, Event-based, implicit invocation, Client-Server, and many more [8]. A. Achieving Modularity at Software Component Since Software Framework consists of Software Components and Design Patterns, achieving modularity at IV. PROPOSED OPEN SOURCE MODULARITY Software Component level should be analyzed against FRAMEWORK each of the intended characteristics shown in Table 1. According to Dekoenigsberg and Gurbani, the Table 2 shows the intended properties of the Software modularity of an Open Source Software is determined by Components so that modularity in an Open Source some parameters, which are size (size of each module and Software can be achieved and their justifications. the number of modules), complexity, coupling / dependency (fan in and fan out), and cohesion [4] [9].

Table 1 shows the description of each parameters and short description regarding the preferred characteristics of each parameter to create modular Open Source Software.

138 International Conference on Rural Information and Communication Technology 2009

Table 2. Achieving Modularity at Software Component Level  Composite: a structural design pattern, structure for building recursive aggregations Characteristics Description to Achieve  Façade: a structural design pattern, simplifies the interface for a subsystem Small size in - Limiting the number of classes in each  Proxy: a structural design pattern, one object each module module to ensure that each module is created only to perform simple function. approximates another - Limiting the number of methods in each class to ensure that one class is created only for specific purposes. Table 3. Achieving Modularity using Software Design Patterns - Using principles that each method in a class comprising the method is created to Characteristics Description do only for a single-simple task. to Achieve

High number of Module / sub-system that perform more Small size in Using Decorator and Composite Design modules complex task should be created by calling each module Patterns in making complex function as lower level modules in a controlled interface. collections of simple functions. Those simple functions will ensure there will be small size in Low complexity - Limiting the number of operators in each each module module or class or method. - Regulating the the flow of control in each High number of Creation of new classes or modules by users in method in the class / module. modules controlled manner by using Software Design Patterns such as Abstract Factory, Factory Coupling / - Common interfaces shall be created to Method, or Prototype. dependency handle interconnection of similar modules (high fan in and / classes to limit the number of Low complexity Reducing the complexity by applying Strategy, low fan out) interconnection among modules. Composite and Decorator Design Pattern, so - Hirarchy of calls shall be created in which that complex functionality is aggregated from a module / sub-system is only allowed to collections of simple functionalities of lower call lower level module / sub-system and it level modules / classes. is not allowed to call each other in similar level without creating higher level module Coupling / - Separation of implementation and data by / sub-system. dependency using Observer Design Pattern will reduce (high fan in and tight coupling among modules. High cohesion Using proper coding practices, such as limiting low fan out) - Reduction of interface in module the use of global variables, use private and interconnection by using Façade or Proxy protected attributes in a class (proper Design Pattern. information hiding). High cohesion Not applicable since high cohesion related to the internal structure of each module and not to B. Achieving Modularity in Software Design the higher level. Pattern Modularity in Open Source Software also should be C. Achieving Modularity using Software Framework achieved in the composition of Design Patterns as the The composition of these Software Components and second component of the Software Framework. Table 3. Software Design Patterns will create a Software shows the intended properties of the Software Design Framework which acts as a mini-architecture style Patterns that will be composed along with Software platform that enables Open Source Software Developers Components as Software Framework. to create a new modular Open Source Software. Description of each Design Pattern stated in Table 3, Combining all the findings about how to achieve as the subject of further research about Modularity modularity in either Software Components and Software Framework [7]: Design Patterns, the general requirement for Modularity  Abstract Factory: a creational design pattern, factory Framework are stated in this 8 basic requirements: for building related objects.  REQ01 : The Software Framework shall consist of  Factory Method: a creational design pattern, method collection of two primary components, which are the in derived class creates associates Software Components and Software Design Patterns.  Prototype: a creational design pattern, factory for  REQ02 : The Software Components shall consist of cloning new instances of objects from prototype, modules where in each module shall consist of Create a new object by copying this prototype Interfaces and Abstract Classes to be implemented /  Strategy: a behavioral design pattern, abstraction for inherited by user created modules. selecting one of many algorithms, Reduce  REQ03 : There shall be limitation in the number of complexity, Increase flexibility classes of each module and the number of method of  Decorator: a structural design pattern, decorator each class / interface, for either the method / class in extends an object transparently, add additional Software Components or the user created classes. responsibilities to an object dynamically, alternative  REQ04 : Each user created class shall be created in to subclassing for extending functionality controlled fashion using Abstract Factory, Factory  Observer: a behavioral design pattern, dependents Method, or Prototype Design Pattern. update automatically when subject changes, reduce  REQ05 : Complex task should be achieved by calling tight coupling many modules in higher level of module through the

139 provided Software Components using Strategy, find the underlying Software Framework of those projects Decorator, Composite or Observer Design Patterns. that may be implemented in the proposed Software  REQ06 : Proxy Design Pattern shall be used to reduce Framework. Development of Sofware Components and calling to other modules / classes. The interface is composition of Design Patterns that makes up the controlled using Proxy Design patterns. framework need to be created and tested to several group  REQ07 : Predefined building blok of user created of programmers. Integration of this framework to modules shall be created by using Façade Design Integrated Development Environment which is popular to Pattern. Open Source communities such as in Eclipse or Anjuta is  REQ08 : Proper coding practices shall be enforced, also future possibility. such as limiting the use of global variables, use private and protected attributes in a class (proper information hiding) REFERENCES These requirements should be used as the base for the construction of the proposed Modularity Framework and [1] L. Aversano, L. Cerulo, M.D. Penta, “Relating the Evolution of they may evolve further. As the Software Framework is Design Patterns and Crosscutting Concerns”, Seventh IEEE International Working Conference on Source Code Analysis and intended to be developed in Open Source, the Manipulation, 2007, pp 180 – 189. requirements of the framework will eventually added and [2] I. Bayley, H. Zhu, “On the Composition of Design Patterns”, evolve. The 8 requirements stated above should provide IEEE The Eight International Conference on Quality Software, 2008, pp 27 – 36. as initial start to develop the framework. The application [3] S. Christley, G. Madey, “Analysis of Activity in the Open Source of this framework by Open Source initiators will enforce Software Development Community”, Proceeding of the 40 th IEEE the good design principle by applying modularity Annual Hawaii International Conference on System Sciences, principle from the beginning of the project. 2007, pp 166b. [4] G. DeKoenigsberg, “How Successful Open Source Projects Work, and How and Why to Introduce Students to the Open Source World”, 21st IEEE Conference on Software Engineering Education and Training, 2008, pp 274 – 276. V. CONCLUSION [5] T. Dinh-Trong, J.M. Bieman, “Open Source Software Development: A Case Study of FreeBSD”, Proceedings of the Open Source Software Projects are becoming the 10th IEEE International Symposium on Software Metrics, 2004, mainstream software development that attracting many pp 96 - 105. researchers who are trying to find its success factors. [6] H.J.C. Ellis, R.A. Morelli, T.R. Lanerolle, J. Damon, J. Raye, Despite many of failures currently observed in Open “Can Humanitarian Open-Source Software Development Draw New Students to CS?”, Proceeding of the 38 th SIGCSE Technical Source Projects, many studies have found that the key Symposium on Education 2007, pp 551 – 555. success factor is modularity. The desired parameters [7] E. Gamma, R. Helm, R. Johnson, J. Vlissides, “Design Patterns: currently attributed to modularity have been identified Elements of Reusable Object-Oriented Software”, Addison th which are small size in each module, high number of Wesley Longman Inc., ISBN: 0-201-63361-2, 36 Edition, 2007. [8] D. Garlan, M.Shaw, “An Introduction to Software Architecture”, modules, low complexity, coupling / dependency (high CMU (Carnegie Mellon University) Software Engineering fan in and low fan out), and high cohesion. Even though Institute Technical Report (CMU/SEI-94-TR-21), 1994. many studies has been dedicated to Design Pattern, [9] V.K. Gurbani, A. Garvert, J.D. Herbsleb, “A Case Study of Open Software Framework, and Software Architecture, the Source Tools and Practices in Commercial Setting”, Proceeding of the fifth Workshop on Open Source Software Engineering proper methodology to achieve modularity in Open 2005, pp 1 - 6. Source Projects is never studied. [10] M. Hahnsler, “A Quantitative Study of the Adoption of Design In this paper a new Open Source Software Framework Patterns by Open Source Software Developers”, Chapter V of called Modularity Framework is proposed and analyzed Free / Open Source Software Development by Stefan Koch, Idea Group Publishing, ISBN 1-59140-371-5, 2005, pp 103 – 123. for the first time. The intended characteristics related to [11] R.E. Johnson, “Framework = (Components + Patterns)”, the desired parameters attributed to modularity in the Proceeding of 1997 Symposium on Software Reusability, 1997. components of Software Framework (Software [12] E.Y. Nakagawa, E.P.M. de Sousa, K. de Britto Murata, “Software Components and Design Patterns) are analyzed. The study Architecture Relevance in Open Source Software Evolution: A Case Study”, Annual IEEE International Computer Software and shows that the construction of Modularity Framework that Application Conference, 2008, pp 1234 – 1239. enhance the modularity in Open Source Projects is highly [13] E.S. Raymond, “The Cathedral and the Bazaar”, version 3, feasible by identifying eight basic requirements of the Thyrsus Enterprises (http://www.tuxedo.org/~esr/), 2000. framework. [14] R. Stallman, “Why Software Should be Free”, GNU Websites, 24 April 1992, Available: http://www.gnu.org/philosophy/ shouldbefree.html [15] K. J. Stewart, D.P. Darcy, S.L. Daniel, “Observations on Patterns of Development in Open Source Software Projects”, Proceeding VI. FUTURE WORK on the fifth Workshop on Open Source Software Engineering 2005, pp 1 – 5. Since this is only in the early stage of development of [16] Y. Yamauchi, M. Yokozawa, T. Shinohara, T. Ishida, the Open Source Software Framework called Modularity “Collaboration with Lean Media: How Open-Source Software Framework, further research in this area is needed. Study Succeeds”,Proceeding of the 2000 ACM Conference on Computer Supported Cooperative Work, pp 329 – 338. about many kinds of software architecture in several successfull Open Source Projects is required in order to

140