Taking a small step back from actual the actual creation of code and unit test assets, I'm going to talk about version control and the importance of it in a development environment. When working as the sole developer on a project you can argue that there's no need for version control. I'll look at why, even in this situation, these this subject is important.
Version control is the act of tracking changes of a software system over periods of time. As the sole developer on a codebase you may ask why you even need it as surely you know what you've changed and when you changed it, right? Consider the situation in which you are adding a new feature to the system. What happens if you have to change some of your existing classes or interfaces which ends up breaking one or more features of systems. Without a backup, you're left to either manually rollback or try and fix it to make it work. Maybe you're wanting to try an experimental update to some existing code that you may or may not wish to commit to depending on the outcome of the update, a similar situation occurs. Imagine you've made a release or two to the world and you wish to work on a new version whilst keeping the original source around for bugfixes and minor updates that your users are asking for; how would you manage that? The typical approach would seem to be keeping a full copy of the source code folder, probably with names such as "Source-old", "Source-new", "Source-new2", etc. For the sake of argument, you fix a bug in "Source-old" which you realise is present also in "Source-new" - how would you go about applying the bugfix, bearing in mind that you may have also modified code around the situation in "Source-new". What happens if another developer wishes to contribute updates to your code? Hopefully you're now seeing some real problems in the old "backup your folders" methodologies many of us may be using. How do we look at addressing this? Enter version control software (VCS). Version Control Software provides a solution by storing your code assets in a database and maintaining every change you make from one commit to the next. It will provide the ability to revert changes to files, show differences and merge changes between two versions. Many, if not all, version control systems will provide the ability for multiple people to make changes to different files, allowing you to keep a single definitive version of the current codebase and all points in time leading up to it. A snapshot of the codebase can be taken or retrieved at any point in time to allow multiple 'branches' to be maintained, solving the need for keeping full filesystem copies of the codebase stored under different names. Typically, updates to one or more branches can be merged up and around into curent versions, allowing the bugfixes to merged into the cutting edge codebase in a much simpler way. I won't go into the ins and outs of how version control systems work, but if you're interested, please have a look at the wikipedia article on the subject and Eric Sink's excellent introductory article.
There are many version control providers out there, each of which offering new and different features. Deciding on which one to use depends on the specific requirements of your team and project. For this particular project, I will need the following features:
-
Typical branch/merge functionality. I want to be able to keep the "Development", "Main" and "Release" structures I'm used to.
-
Intelligent compare/merge tools. I need to see the differences between versions easily and merge them automatically without having to hack around files.
-
Labelling. I want to be able to apply meaningful point in time labels to files or entire folders/branches.
-
Mutli-user system. I want to be open to allowing others to access the code at some point, so multiple users are a must.
-
Easily backed up database. I need to take regular backups of the database to ensure that in the event of failure, little or no code is lost.
-
Cost-efficient. I want a free or cheap system.
-
Well-documented. The system needs to have good documentation for setup and usage
-
Visual studio integration. The ability to checkin/checkout files via the visual studio UI would be very attractive.
-
Ideal system will have work and bug tracking features built in
Over the course of the next few days I'll look at evaluating the following products for the purpose of this project. Of course, there are many more available, but I can't look at all of them.
It's worth noting that Visual SourceSafe and Team Foundation Server (TFS) are likely to be discounted on cost alone, although my professional experience with TFS has highlighted how good it actually is.