Abstract:
In this paper, I present a case study on the tool-mediated refactoring process and its effects, in terms of software metrics and performance, on an educational video game. The game is Museum Assistant: Design an Exhibit, which was released in May 2012 by an interdisciplinary team of undergraduate students. The game was developed for the Web in C# using Unity3D and MonoDevelop. The team set out to apply the principles of Clean Code throughout the development of the game. However, late in the development cycle, the team knowingly abandoned methodological constraints in the face of production stress. For this study, I began a six-week refactoring period comprising two phases: the first was mediated by the popular automated refactoring tool ReSharper, and the second involved manual identification of SRP violations. ReSharper's static analysis tools identified over 900 design problems, 95% of which were resolved in refactoring. In my analysis, I discuss how ReSharper simplified the detection and removal of superficial design defects such as naming convention violations, scope limitations, and idiomatic language syntax features, but it was not able to identify larger design flaws such as opportunities for design patterns. The details of one particular pattern-based refactoring are introduced in order to illustrate the relative merits of tool mediation and manual inspection: the introduction of a Chain of Responsibility. Code metrics, as computed by Visual Studio, were tracked throughout the refactoring process in order to estimate changes in readability and maintainability. I identify lines of code, readability index, class coupling, and cyclomatic complexity for extended discussion; all of these metrics improved through the refactoring process.