A Metric Evaluation of Game Application Software
Total Page:16
File Type:pdf, Size:1020Kb
A Metric Evaluation of Game Application Software Alan C. Jamieson, Nicholas A. Kraft, Jason O. Hallstrom and Brian A. Malloy Computer Science Department Clemson University Clemson, SC 29634, USA {ajamies,nkraft,jasonoh,malloy}@cs.clemson.edu Abstract art, music, and voice. To manage large teams of program- mers, most current game developers use the C++ language In this paper we evaluate the exploitation of object tech- and attempt to exploit the benefits of object technology. nology as it is used in a test suite of game application soft- In this paper we evaluate the exploitation of object tech- ware. We use several well-known metrics and apply them nology as it is used in a test suite of game application soft- to both the game application software and a test suite of ware. We use several well-known metrics and apply them language processing tools to form a basis of comparing the to both the game application software and a test suite of two groups. We have developed a metric computation sys- language processing tools to form a basis of comparing the tem that uses the g4re infrastructure to analyze the C++ two groups. We have developed a metric computation sys- programs. We present some results for the two groups of tem that uses the g4re infrastructure to analyze the C++ pro- applications and draw some conclusions about the modu- grams [10, 11]. We present some results for the two groups larity, use of inheritance, and the complexity of methods in of programs and draw some conclusions about the modu- these applications. larity, use of inheritance and the complexity of methods in the applications. The literature on object-oriented software metrics is ex- 1. Introduction tensive; see, for example, the detailed surveys presented in [3] and [5]. By contrast, there has been relatively little As software developers shift their priorities to the con- work focused on applying metrics to assess the relative de- struction of complex large scale systems that are easy to sign characteristics of systems in different application do- extend, modify, and maintain, the inadequacy of tradi- mains. A unique contribution of our work is the application tional approaches and methodologies becomes apparent. of object-oriented software metrics to the consideration of The object-oriented approach to software development ad- gaming applications. dresses some of these inadequacies and makes it possible to In the next section we provide background about the model systems that are close to their real world analogues. terminology that we use, about game APIs, and about the 4 The goal of object-oriented design is to accurately identify g re system. In Section 3 we describe the construction of the principle roles in a process, assign responsibilities to our metric computation system and define the metrics that these roles and encapsulate them in an object. The benefits we use to evaluate the exploitation of object orientation in of object technology are extensibility, ease of modification game application software. In Section 4 we provide results and ease of reuse. from our evaluation of the test suite of game software and The development of game application software has fol- language processing tools. In Section 5 we describe the lowed this pattern of migration from traditional approaches limited research that is similar to our work. Finally, in Sec- to the exploitation of object technology for its acknowl- tion 6 we draw conclusions and describe our future work. edged benefits. In fact, the object-oriented paradigm seems to have a natural application to the domain of graphics, 2. Background Graphical User Interfaces (GUIs) and game application programming. Early games such as Quake and Doom were In this section we provide background about the termi- implemented in C because of its small learning curve and nology and tools that we use in this paper. In Section 2.1 its fast compilation and execution speed. However, cur- we review some of the Application Programmer Interfaces rent game development requires large teams of program- (APIs) used in game development. In Section 2.2 we re- mers and analysts as well as other kinds of talent such as view the g4re system that analyzes the applications in our Submitted to The Future Play Conference October 13–15, 2005, Michigan State University MI test suite [10, 11]. Finally, in Section 2.3 we review the use port application development [4, 23, 25]. The lack of tool of metrics in the software life cycle. support for applications using the C++ language is espe- cially noteworthy. 2.1. Game APIs One explanation for the lack of software tools for C++ is the difficulty in constructing a front-end for the language, In early game development, DOS-based games were as described in references [2, 9, 12, 20, 21, 22]. This diffi- generally implemented with commands issued directly to culty results, in part, from the complexity and scale of the the computer’s hardware. These early DOS games used language. However, a more important problem is the ambi- calls to device drivers for input devices such as a mouse or guity inherent in many C++ language constructs[9, 12, 19, joystick and calls to specific sound cards such as Creative 22]. Many C++ constructs cannot be recognized through Labs’ Sound Blaster. Video programming was the most syntactic considerations alone. For example, the difficulty difficult aspect of game development where the generation in distinguishing a declaration from an expression can only of fast and smooth graphics required significant program- be resolved by performing name lookup[1, 9]. ming skill. Graphics code frequently exploited the speed of 4 assembly language programming and depended on certain The g re tool chain exploits the gcc Abstract Semantic hardware-level features of the VGA graphics adapter. Graph (ASG), GENERIC, to provide an Application Pro- grammers Interface (API) to facilitate easy access to infor- Currently, few game developers write register-level mation about declarations, including classes, functions, and video code, instead relying on prewritten Application Pro- variables, as well as information about scopes, types, and grammer Interfaces (APIs) that form a layer of software be- control statements. The advantages of the g4re tool chain is tween the game and the hardware. The most popular API that it can analyze any program that can be compiled by the in current usage is DirectX using the C++ language vehi- gcc C++ compiler. We use the g4re tool chain to construct cle [15, 16]. The DirectX API provides low-level access our metric computation system and we describe this system to multimedia hardware in a device-independent manner. in Section 3. New versions of DirectX are released to permit game de- velopers to take advantage of hardware advances as they occur, even after games have shipped. However, the Di- 2.3. Object-Oriented Metrics rectX API is specific to the Microsoft Windows platform. With the popularity of the Linux operating system game Software metrics are quantitative measures that enable developers became interested in platform-independent software developers, testers, and maintainers to evaluate game programming and several APIs have been introduced, the static properties of a software system [5]. Software including SVGALib, ClanLib and SDL. The most popular metrics are computed and the resultant data are collected, of the platform-independent game APIs is the Simple Di- analyzed, and compared throughout the lifetime of a soft- rectmedia Layer (SDL) [18]. SDL is a cross-platform mul- ware system to evaluate improvement or deterioration of timedia library that has already been used to port a number the software system. Software metrics are also useful for of Windows-based games to Linux. identifying problem modules of a software system. The SDL API supports virtually all of the major op- Object-oriented metrics were introduced to measure erating systems including Linux, Windows, Solaris and software properties specific to object-oriented software BSD variants including FreeBSD and MacOS. In addi- systems, including properties pertaining to classes and their tion to fast graphics support, SDL provides interfaces for object instances [3, 5]. The primary focus of object- playing sound, accessing CD-ROM drives and achieving oriented metrics is measuring properties of classes and their portable multi-threaded applications. SDL is released un- instances. Properties of interest include scope of properties, der the GNU LGPL and has accumulated a collection of object complexity, coupling, and cohesion. user-contributed libraries that provide additional function- ality for game developers. 3. Methodology 2.2. The g4re Tool Chain In this section we present an overview of our metrics Software tools are fundamental to the comprehen- computation system that enables us to evaluate the ex- sion, analysis, testing and debugging of application sys- ploitation of object technology in game application soft- tems. Tools can automate repetitive tasks and, with large ware. In Section 3.1 we describe details of the system and scale systems, can enable computation that would be pro- its use of the g4re tool chain [10, 11]. In Section 3.2 we hibitively time consuming if performed manually. The Java describe the metrics that we compute to facilitate our eval- language is well supported with libraries and tools to sup- uation of the game software. 2 Figure 1. System overview. This figure illustrates the important components in our metrics computation system that we constructed to compute the metrics defined in Section 3.2 and to perform the case study presented in Section 4. The metrics computation system consists of the g4re tool chain, including the CppInfo API, and a Metrics Tool that interacts with the API to extract information about a C++ program. 3.1. Overview of the Metrics Computation System classes and functions needed to compute the metrics de- fined in Section 3.2.