Wednesday, December 16, 2009

Code Management on a budget

Code management on a budget in a team development environment



If you've done any development in a team environment, I'm sure your aware of the pains associated with such development.

You spend a whole day debugging and fixing conflicts only to come in the next day and find your code broken again. You decide enough is enough and walk over to your teammate and ask him for an explanation. He shows you that his version compiles and runs just fine. You walk back to your terminal scratching your head thoroughly frustrated and spend the next six hours locating an environment configuration variable that has been breaking your code.

A code base can grow exponentially in a team environment, getting bloated with buggy code, conflicts, configuration issues, environment issues etc. A huge amount of time is wasted in debugging and resolving environment and configuration issues, increasing your projects time and reducing productive coding.

So what's the solution? While it is a complex problem with a number of parameters that could go wrong and no perfect solution. Implementing an efficient code management process that suits your team's development needs and environment may not be perfect but could still make things a little less frustrating and improve your overall efficiency.

Based on how your team operates you'll need to find the right balance between a technical or managerial solution. So below is a rough guide on what is available out there and by no means exhaustive.

Tools

Like they say the right tools get the job done. Here are a few tools that can aid in managing your code.

  1. Firstly you need some kind of a code repository(I prefer SVN). There are a host of other commercial and open source products to choose from. Visual studio, Telelogic Synergy, CVS etc
  2. You need a good diff and merge tool that can be used with the code repository (DiffMerge seems like a nice tool to do this, again a whole lot of them available.
  3. If your projects use a database then you should also get some database diff tools. I use SQLDiff.
  4. Re-factoring tools will help keep your code in good shape a nice add on to Visual studio is ReSharper 
  5. Logging is a really helpful feature to have in any project. Trying to debug a projects for every error that occurs in a team environment can make it extremely frustrating and wasteful activity. Logging can gives you the ease of locating the errors at a glance. Log4Net is an open source library that you can use. It allows you to set and change the severity level in your project and allows you to choose a logging medium like a flat file, event logs or a database.
  6. A continuous build machine can greatly help in team development, users have access to different builds. Each build can be configured to show the diff between a baseline(stable project) making it easy to compare broken versions of the build.
Process

All the tools in the world cannot help without some degree of good process management. Like any other  management practice it requires planning, organizing, training and controlling to improve productivity.

  1. Come up with a plan on how to structure/organize, share and store your code base. Review this plan periodically and update it to suite your changing needs.
  2. Things to consider in your plan naming conventions, integration schedules/policies, consideration for environment differences, deployment practices,  release management.
  3. Documentation is key, convert your plan into policies,rules, guides for the team.  This will also ensure that information on your process is readily available to the team. 
  4. Train the team, everyone needs to be on the same wave length in order to be effective, so train everyone on the team.

Ive only outlined a few possibilities to better code management in a .Net team environment.  Get creative, use your imagination and get everyone involved to come up with the right tools and techniques for your team.

No comments: