Tuesday, October 7, 2008

Collaborative Software Development

Previously, I added my own project to Google Code Project Hosting. As an exercise in collaborative software development, I shared my project with fellow classmate Daniel Arakaki, and he shared his project with me. The idea was to gain more hands-on practice with Google Code Project Hosting, Subversion, and working with other people's code on our local workspace.

What's Mine is Yours

Daniel checked out my project from the repository, made some improvements, and committed those changes back to the repository. I received an email alerting me that changes had been committed. It also detailed what code was removed and what code was added. Frankly, I found the email to be a little hard to read: it was full of plus (+), minus (-) and at (@) symbols, as well as line numbers. Thankfully, the commit logs on the Google Code project site are much more reader friendly.

I checked out the updated version of my project to my local workspace. Using the Ant verify target that is part of my project, I was quickly able to confirm that Daniel's edits didn't unintentionally cause any code-breaking changes.

What's Yours is Mine

I checked out Daniel's project from his repository, and I tried to run the Ant verify target to check that his project builds and works correctly. Unfortunately, the verify.build.xml file was missing from his project repository, and thus from my workspace as well. I copied the missing file over from the stack-6.0.911 project, and ran the Ant verify target. Everything checked out okay.

I wanted to import Daniel's project into Eclipse to take a look at it. However, the .classpath and .project files were also missing from his repository. These files contain settings for Eclipse, and without them the project could not be easily imported into Eclipse. As a workaround, in Eclipse I created a new Java project from an existing source, and I used the downloaded project as the existing source. Because the project uses JUnit, I also had to remember to include the JUnit 4 library with the project.

Daniel's project looked fine, so I ran the Ant verify target again just to be sure that everything still worked correctly, and then I committed the project with the additional files back to the repository.

Parting Thoughts

Ant helped a lot with the collaborative aspect of this exercise. Ant provides a consistent way to build and (more importantly in this case) test the project that you are working on, so you don't have to think about such things (as much). It helped me quickly see whether any of the changes Daniel or I made broke anything, and whether or not the project still passed all of the essential tests.

Overall, Subversion and Google Code project hosting are very cool. I found myself browsing through our project commit logs, looking at what changes were made and how the projects evolved over time. Even for such a simple project as a CodeRuler implementation, Aric and I found emailing source files back and forth, and merging changes together to be troublesome at best. Using a version control system would have helped, any it almost certainly should be required for any large or complex collaborative programming projects.

No comments: