Project Galen Logo

Project Galen

  • Reduced size of application source file repositories by 40%.
  • Enabled application development build structures to be completely autonomous.
  • Reduced media errors and time to fix media bugs.
  • Improved behaviors regarding on-going file maintenance.

Introduction

Claudius Galen (131-201) was a Greek physician who went to Rome and revived the ideas of Hippocrates and other Greek doctors. Along with putting great emphasis on clinical observation, Galen was an early proponent of the practice of cleansing the body.

Due to the nature of the Android OS build process at Motorola (see Evolution of Media Delivery), media management in the build tree structure was handled strictly by developers as opposed to designers; therefore, cumulative changes resulted in a maintenance nightmare for media assets. Project Galen was an organization-wide effort led by me in 2011 to clean up the media.

Problem

An unmaintained file repository results in duplicate files, erroneous files, incorrect filenames, and a host of other quality issues. Since the only authorized personnel who were able to maintain the file repositories were developers, for the most part, media assets were ignored in any code cleanup efforts. This problem became acute in a few high profile applications ("Connected Music Player" and "Connected Gallery") that underwent massive design revisions to their many screen views.

This buildup of unused media led to increased change aversion by the developers. Being able to identify which media files are actually being referenced in code is crucial in resolving UI issues for a developer or a designer. Allowing the source tree to accumulate unreferenced or out-of-date media assets leads to sluggish repository performance and slower turnaround of design fixes.

Analysis

Existing code search tools in conjunction with a few additional scripts can be developed to scrub through the code and determine unused media files, missing files, and duplicates. These files would then be deleted. This will streamline build tree maintenance, reduce risk of errors, and make media bug fixes easier to resolve.

Solution

As a representative of the design team, I evangelized and demonstrated the benefits of Project Galen to a broad audience of software engineers. Along with setting up a shared website and forum, I shepherded the application teams through the tasks necessary to clean up our git repositories.

2 tools were developed internally by the design engineering team to aid in this effort:

  • Media Audit Tool: Java app that compares image data of files to identify duplicates as well as corrupted images (Fig. 1).
  • medialint: Python app that parses through code to determine unused media resources as well as unused references within XML resources.

Along with a grep-based code search tool integrated with the git repository forest, I used these tools to scrub through every one of our 40+ applications. I deleted hundreds of files directly from the those apps that I had authorized access to. Each one of them required a test build and thorough UI checking to push through the changes. For the apps I did not have access to, I submitted a bug for every one with the necessary data attached to each so that the developers could easily complete their cleanup task.

Media Audit Tool screenshot

Figure 1: Sample output of the Media Audit Tool identifying duplicate media files within an application.

After the 3 months of intense effort, the Project Galen was complete. We had reduced the size of our app repos by 40% and made it much easier to navigate through media fixes and updates. As a result of this effort, other files were cleaned up and it made it easier to move to a new software development model where the applications were built and managed independent of the rest of the system - the framework.

Soon after this project, Google's Android team announced their version of Lint (Fig. 2) which we used in another more thorough cleanup effort in early 2012 and is used on-going. Thanks to Project Galen, awareness of the benefits of clean file structures has made the adoption of the regular use of Lint a no-brainer.

Android Lint screenshot

Figure 2: Sample report from Android Lint displaying duplicate media assets.